From 45d9a5e9748e22f8c1b641a5c377017a3afd0f18 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Thu, 22 May 2025 08:13:42 +0000 Subject: [PATCH 1/3] Update --- .gitattributes | 25 + examples/slog/go.mod | 26 +- examples/slog/go.sum | 13 + experimental/mocks/mock_workspace_client.go | 10 + .../mock_database_instances_interface.go | 389 + .../mock_quality_monitors_v2_interface.go | 479 + service/apps/impl.go | 420 +- service/apps/internal.go | 1338 ++ service/apps/model.go | 1414 +- service/billing/impl.go | 478 +- service/billing/internal.go | 1835 +++ service/billing/model.go | 1867 ++- service/catalog/api.go | 35 + service/catalog/impl.go | 3703 ++++- service/catalog/interface.go | 15 + service/catalog/internal.go | 12299 ++++++++++++++++ service/catalog/model.go | 11283 +++++++++++--- service/cleanrooms/impl.go | 344 +- service/cleanrooms/internal.go | 1450 ++ service/cleanrooms/model.go | 1415 +- service/compute/impl.go | 1623 +- service/compute/internal.go | 8163 ++++++++++ service/compute/model.go | 7520 ++++++++-- service/dashboards/impl.go | 972 +- service/dashboards/internal.go | 2854 ++++ service/dashboards/model.go | 2713 +++- service/files/impl.go | 458 +- service/files/internal.go | 1129 ++ service/files/model.go | 1143 +- service/iam/impl.go | 1531 +- service/iam/internal.go | 2978 ++++ service/iam/model.go | 2876 +++- service/jobs/impl.go | 616 +- service/jobs/internal.go | 7217 +++++++++ service/jobs/model.go | 6443 ++++++-- service/marketplace/impl.go | 1395 +- service/marketplace/internal.go | 4486 ++++++ service/marketplace/model.go | 4353 +++++- service/ml/impl.go | 2096 ++- service/ml/internal.go | 7551 ++++++++++ service/ml/model.go | 7112 +++++++-- service/oauth2/impl.go | 680 +- service/oauth2/internal.go | 1799 +++ service/oauth2/model.go | 1605 +- service/pipelines/impl.go | 398 +- service/pipelines/internal.go | 3212 ++++ service/pipelines/model.go | 2856 +++- service/pkg.go | 8 +- service/provisioning/impl.go | 811 +- service/provisioning/internal.go | 2191 +++ service/provisioning/model.go | 2117 ++- service/qualitymonitor/api.go | 91 + service/qualitymonitor/impl.go | 211 + service/qualitymonitor/interface.go | 38 + service/qualitymonitor/internal.go | 311 + service/qualitymonitor/model.go | 443 + service/serving/impl.go | 603 +- service/serving/internal.go | 3835 +++++ service/serving/model.go | 3614 ++++- service/settings/impl.go | 2667 +++- service/settings/internal.go | 6911 +++++++++ service/settings/model.go | 6773 +++++++-- service/sharing/impl.go | 802 +- service/sharing/internal.go | 3159 ++++ service/sharing/model.go | 2846 +++- service/sql/impl.go | 1788 ++- service/sql/internal.go | 8120 ++++++++++ service/sql/model.go | 7411 ++++++++-- service/vectorsearch/impl.go | 454 +- service/vectorsearch/internal.go | 1891 +++ service/vectorsearch/model.go | 1772 ++- service/workspace/impl.go | 920 +- service/workspace/internal.go | 2695 ++++ service/workspace/model.go | 2685 +++- workspace_client.go | 5 + 75 files changed, 174869 insertions(+), 14920 deletions(-) create mode 100644 experimental/mocks/service/qualitymonitor/mock_quality_monitors_v2_interface.go create mode 100755 service/apps/internal.go create mode 100755 service/billing/internal.go create mode 100755 service/catalog/internal.go create mode 100755 service/cleanrooms/internal.go create mode 100755 service/compute/internal.go create mode 100755 service/dashboards/internal.go create mode 100755 service/files/internal.go create mode 100755 service/iam/internal.go create mode 100755 service/jobs/internal.go create mode 100755 service/marketplace/internal.go create mode 100755 service/ml/internal.go create mode 100755 service/oauth2/internal.go create mode 100755 service/pipelines/internal.go create mode 100755 service/provisioning/internal.go create mode 100755 service/qualitymonitor/api.go create mode 100755 service/qualitymonitor/impl.go create mode 100755 service/qualitymonitor/interface.go create mode 100755 service/qualitymonitor/internal.go create mode 100755 service/qualitymonitor/model.go create mode 100755 service/serving/internal.go create mode 100755 service/settings/internal.go create mode 100755 service/sharing/internal.go create mode 100755 service/sql/internal.go create mode 100755 service/vectorsearch/internal.go create mode 100755 service/workspace/internal.go diff --git a/.gitattributes b/.gitattributes index 84d55704b..2aa42223b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -160,82 +160,107 @@ experimental/mocks/service/workspace/mock_workspace_interface.go linguist-genera service/apps/api.go linguist-generated=true service/apps/impl.go linguist-generated=true service/apps/interface.go linguist-generated=true +service/apps/internal.go linguist-generated=true service/apps/model.go linguist-generated=true service/billing/api.go linguist-generated=true service/billing/impl.go linguist-generated=true service/billing/interface.go linguist-generated=true +service/billing/internal.go linguist-generated=true service/billing/model.go linguist-generated=true service/catalog/api.go linguist-generated=true service/catalog/impl.go linguist-generated=true service/catalog/interface.go linguist-generated=true +service/catalog/internal.go linguist-generated=true service/catalog/model.go linguist-generated=true service/cleanrooms/api.go linguist-generated=true service/cleanrooms/impl.go linguist-generated=true service/cleanrooms/interface.go linguist-generated=true +service/cleanrooms/internal.go linguist-generated=true service/cleanrooms/model.go linguist-generated=true service/compute/api.go linguist-generated=true service/compute/impl.go linguist-generated=true service/compute/interface.go linguist-generated=true +service/compute/internal.go linguist-generated=true service/compute/model.go linguist-generated=true service/dashboards/api.go linguist-generated=true service/dashboards/impl.go linguist-generated=true service/dashboards/interface.go linguist-generated=true +service/dashboards/internal.go linguist-generated=true service/dashboards/model.go linguist-generated=true service/files/api.go linguist-generated=true service/files/impl.go linguist-generated=true service/files/interface.go linguist-generated=true +service/files/internal.go linguist-generated=true service/files/model.go linguist-generated=true service/iam/api.go linguist-generated=true service/iam/impl.go linguist-generated=true service/iam/interface.go linguist-generated=true +service/iam/internal.go linguist-generated=true service/iam/model.go linguist-generated=true service/jobs/api.go linguist-generated=true service/jobs/impl.go linguist-generated=true service/jobs/interface.go linguist-generated=true +service/jobs/internal.go linguist-generated=true service/jobs/model.go linguist-generated=true service/marketplace/api.go linguist-generated=true service/marketplace/impl.go linguist-generated=true service/marketplace/interface.go linguist-generated=true +service/marketplace/internal.go linguist-generated=true service/marketplace/model.go linguist-generated=true service/ml/api.go linguist-generated=true service/ml/impl.go linguist-generated=true service/ml/interface.go linguist-generated=true +service/ml/internal.go linguist-generated=true service/ml/model.go linguist-generated=true service/oauth2/api.go linguist-generated=true service/oauth2/impl.go linguist-generated=true service/oauth2/interface.go linguist-generated=true +service/oauth2/internal.go linguist-generated=true service/oauth2/model.go linguist-generated=true service/pipelines/api.go linguist-generated=true service/pipelines/impl.go linguist-generated=true service/pipelines/interface.go linguist-generated=true +service/pipelines/internal.go linguist-generated=true service/pipelines/model.go linguist-generated=true service/pkg.go linguist-generated=true service/provisioning/api.go linguist-generated=true service/provisioning/impl.go linguist-generated=true service/provisioning/interface.go linguist-generated=true +service/provisioning/internal.go linguist-generated=true service/provisioning/model.go linguist-generated=true +service/qualitymonitor/api.go linguist-generated=true +service/qualitymonitor/impl.go linguist-generated=true +service/qualitymonitor/interface.go linguist-generated=true +service/qualitymonitor/internal.go linguist-generated=true +service/qualitymonitor/model.go linguist-generated=true service/serving/api.go linguist-generated=true service/serving/impl.go linguist-generated=true service/serving/interface.go linguist-generated=true +service/serving/internal.go linguist-generated=true service/serving/model.go linguist-generated=true service/settings/api.go linguist-generated=true service/settings/impl.go linguist-generated=true service/settings/interface.go linguist-generated=true +service/settings/internal.go linguist-generated=true service/settings/model.go linguist-generated=true service/sharing/api.go linguist-generated=true service/sharing/impl.go linguist-generated=true service/sharing/interface.go linguist-generated=true +service/sharing/internal.go linguist-generated=true service/sharing/model.go linguist-generated=true service/sql/api.go linguist-generated=true service/sql/impl.go linguist-generated=true service/sql/interface.go linguist-generated=true +service/sql/internal.go linguist-generated=true service/sql/model.go linguist-generated=true service/vectorsearch/api.go linguist-generated=true service/vectorsearch/impl.go linguist-generated=true service/vectorsearch/interface.go linguist-generated=true +service/vectorsearch/internal.go linguist-generated=true service/vectorsearch/model.go linguist-generated=true service/workspace/api.go linguist-generated=true service/workspace/impl.go linguist-generated=true service/workspace/interface.go linguist-generated=true +service/workspace/internal.go linguist-generated=true service/workspace/model.go linguist-generated=true workspace_client.go linguist-generated=true diff --git a/examples/slog/go.mod b/examples/slog/go.mod index b110735e3..737ff5a30 100644 --- a/examples/slog/go.mod +++ b/examples/slog/go.mod @@ -10,13 +10,13 @@ require ( ) 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 v1.25.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // 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/go-querystring v1.1.0 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -25,17 +25,17 @@ 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.21.0 // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.169.0 // indirect + google.golang.org/api v0.182.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 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/grpc v1.64.1 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/examples/slog/go.sum b/examples/slog/go.sum index 32f5c50a0..b6bbd99d5 100644 --- a/examples/slog/go.sum +++ b/examples/slog/go.sum @@ -1,8 +1,10 @@ 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 v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= 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/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= @@ -39,6 +41,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4/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= @@ -84,6 +87,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= 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= @@ -93,6 +97,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl 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/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= @@ -104,9 +109,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= 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/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= @@ -122,6 +129,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.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= @@ -130,6 +138,7 @@ 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/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= 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= @@ -143,6 +152,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/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/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -152,6 +162,7 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 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/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= @@ -159,6 +170,7 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 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.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= 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= @@ -172,6 +184,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 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/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 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= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index a4ba1626b..9999fb8fa 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -19,6 +19,7 @@ import ( "github.com/databricks/databricks-sdk-go/experimental/mocks/service/marketplace" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/ml" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/pipelines" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/qualitymonitor" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/serving" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/settings" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/sharing" @@ -106,6 +107,7 @@ func NewMockWorkspaceClient(t interface { ProviderProviders: marketplace.NewMockProviderProvidersInterface(t), Providers: sharing.NewMockProvidersInterface(t), QualityMonitors: catalog.NewMockQualityMonitorsInterface(t), + QualityMonitorsV2: qualitymonitor.NewMockQualityMonitorsV2Interface(t), Queries: sql.NewMockQueriesInterface(t), QueriesLegacy: sql.NewMockQueriesLegacyInterface(t), QueryExecution: dashboards.NewMockQueryExecutionInterface(t), @@ -814,6 +816,14 @@ func (m *MockWorkspaceClient) GetMockQualityMonitorsAPI() *catalog.MockQualityMo return api } +func (m *MockWorkspaceClient) GetMockQualityMonitorsV2API() *qualitymonitor.MockQualityMonitorsV2Interface { + api, ok := m.WorkspaceClient.QualityMonitorsV2.(*qualitymonitor.MockQualityMonitorsV2Interface) + if !ok { + panic(fmt.Sprintf("expected QualityMonitorsV2 to be *qualitymonitor.MockQualityMonitorsV2Interface, actual was %T", m.WorkspaceClient.QualityMonitorsV2)) + } + return api +} + func (m *MockWorkspaceClient) GetMockQueriesAPI() *sql.MockQueriesInterface { api, ok := m.WorkspaceClient.Queries.(*sql.MockQueriesInterface) if !ok { diff --git a/experimental/mocks/service/catalog/mock_database_instances_interface.go b/experimental/mocks/service/catalog/mock_database_instances_interface.go index be4400d53..a2135301d 100644 --- a/experimental/mocks/service/catalog/mock_database_instances_interface.go +++ b/experimental/mocks/service/catalog/mock_database_instances_interface.go @@ -143,6 +143,65 @@ func (_c *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call) RunAndRetu return _c } +// CreateDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) CreateDatabaseTable(ctx context.Context, request catalog.CreateDatabaseTableRequest) (*catalog.DatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDatabaseTable") + } + + var r0 *catalog.DatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseTableRequest) (*catalog.DatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseTableRequest) *catalog.DatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_CreateDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDatabaseTable' +type MockDatabaseInstancesInterface_CreateDatabaseTable_Call struct { + *mock.Call +} + +// CreateDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) CreateDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_CreateDatabaseTable_Call { + return &MockDatabaseInstancesInterface_CreateDatabaseTable_Call{Call: _e.mock.On("CreateDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.CreateDatabaseTableRequest)) *MockDatabaseInstancesInterface_CreateDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseTable_Call) Return(_a0 *catalog.DatabaseTable, _a1 error) *MockDatabaseInstancesInterface_CreateDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.CreateDatabaseTableRequest) (*catalog.DatabaseTable, error)) *MockDatabaseInstancesInterface_CreateDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + // CreateSyncedDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInstancesInterface) CreateSyncedDatabaseTable(ctx context.Context, request catalog.CreateSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error) { ret := _m.Called(ctx, request) @@ -390,6 +449,100 @@ func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call) RunA return _c } +// DeleteDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseTable(ctx context.Context, request catalog.DeleteDatabaseTableRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseTable") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteDatabaseTableRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseTable' +type MockDatabaseInstancesInterface_DeleteDatabaseTable_Call struct { + *mock.Call +} + +// DeleteDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseTable_Call{Call: _e.mock.On("DeleteDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.DeleteDatabaseTableRequest)) *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.DeleteDatabaseTableRequest) error) *MockDatabaseInstancesInterface_DeleteDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseTableByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseTableByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseTableByName") + } + + 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 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseTableByName' +type MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call struct { + *mock.Call +} + +// DeleteDatabaseTableByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseTableByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call{Call: _e.mock.On("DeleteDatabaseTableByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call) RunAndReturn(run func(context.Context, string) error) *MockDatabaseInstancesInterface_DeleteDatabaseTableByName_Call { + _c.Call.Return(run) + return _c +} + // DeleteSyncedDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInstancesInterface) DeleteSyncedDatabaseTable(ctx context.Context, request catalog.DeleteSyncedDatabaseTableRequest) error { ret := _m.Called(ctx, request) @@ -484,6 +637,65 @@ func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call) R return _c } +// FailoverDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) FailoverDatabaseInstance(ctx context.Context, request catalog.FailoverDatabaseInstanceRequest) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for FailoverDatabaseInstance") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.FailoverDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.FailoverDatabaseInstanceRequest) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.FailoverDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FailoverDatabaseInstance' +type MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call struct { + *mock.Call +} + +// FailoverDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.FailoverDatabaseInstanceRequest +func (_e *MockDatabaseInstancesInterface_Expecter) FailoverDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call { + return &MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call{Call: _e.mock.On("FailoverDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call) Run(run func(ctx context.Context, request catalog.FailoverDatabaseInstanceRequest)) *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.FailoverDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call) RunAndReturn(run func(context.Context, catalog.FailoverDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + // FindDatabaseInstanceByUid provides a mock function with given fields: ctx, request func (_m *MockDatabaseInstancesInterface) FindDatabaseInstanceByUid(ctx context.Context, request catalog.FindDatabaseInstanceByUidRequest) (*catalog.DatabaseInstance, error) { ret := _m.Called(ctx, request) @@ -543,6 +755,65 @@ func (_c *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call) RunAndR return _c } +// GenerateDatabaseCredential provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) GenerateDatabaseCredential(ctx context.Context, request catalog.GenerateDatabaseCredentialRequest) (*catalog.DatabaseCredential, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GenerateDatabaseCredential") + } + + var r0 *catalog.DatabaseCredential + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GenerateDatabaseCredentialRequest) (*catalog.DatabaseCredential, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GenerateDatabaseCredentialRequest) *catalog.DatabaseCredential); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseCredential) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GenerateDatabaseCredentialRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateDatabaseCredential' +type MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call struct { + *mock.Call +} + +// GenerateDatabaseCredential is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GenerateDatabaseCredentialRequest +func (_e *MockDatabaseInstancesInterface_Expecter) GenerateDatabaseCredential(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call { + return &MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call{Call: _e.mock.On("GenerateDatabaseCredential", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call) Run(run func(ctx context.Context, request catalog.GenerateDatabaseCredentialRequest)) *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GenerateDatabaseCredentialRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call) Return(_a0 *catalog.DatabaseCredential, _a1 error) *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call) RunAndReturn(run func(context.Context, catalog.GenerateDatabaseCredentialRequest) (*catalog.DatabaseCredential, error)) *MockDatabaseInstancesInterface_GenerateDatabaseCredential_Call { + _c.Call.Return(run) + return _c +} + // GetDatabaseCatalog provides a mock function with given fields: ctx, request func (_m *MockDatabaseInstancesInterface) GetDatabaseCatalog(ctx context.Context, request catalog.GetDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error) { ret := _m.Called(ctx, request) @@ -779,6 +1050,124 @@ func (_c *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call) RunAndR return _c } +// GetDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) GetDatabaseTable(ctx context.Context, request catalog.GetDatabaseTableRequest) (*catalog.DatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseTable") + } + + var r0 *catalog.DatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseTableRequest) (*catalog.DatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseTableRequest) *catalog.DatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseTable' +type MockDatabaseInstancesInterface_GetDatabaseTable_Call struct { + *mock.Call +} + +// GetDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_GetDatabaseTable_Call { + return &MockDatabaseInstancesInterface_GetDatabaseTable_Call{Call: _e.mock.On("GetDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.GetDatabaseTableRequest)) *MockDatabaseInstancesInterface_GetDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTable_Call) Return(_a0 *catalog.DatabaseTable, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.GetDatabaseTableRequest) (*catalog.DatabaseTable, error)) *MockDatabaseInstancesInterface_GetDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseTableByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) GetDatabaseTableByName(ctx context.Context, name string) (*catalog.DatabaseTable, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseTableByName") + } + + var r0 *catalog.DatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.DatabaseTable, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.DatabaseTable); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseTableByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseTableByName' +type MockDatabaseInstancesInterface_GetDatabaseTableByName_Call struct { + *mock.Call +} + +// GetDatabaseTableByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseTableByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call { + return &MockDatabaseInstancesInterface_GetDatabaseTableByName_Call{Call: _e.mock.On("GetDatabaseTableByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call) Return(_a0 *catalog.DatabaseTable, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.DatabaseTable, error)) *MockDatabaseInstancesInterface_GetDatabaseTableByName_Call { + _c.Call.Return(run) + return _c +} + // GetSyncedDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInstancesInterface) GetSyncedDatabaseTable(ctx context.Context, request catalog.GetSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/qualitymonitor/mock_quality_monitors_v2_interface.go b/experimental/mocks/service/qualitymonitor/mock_quality_monitors_v2_interface.go new file mode 100644 index 000000000..781285009 --- /dev/null +++ b/experimental/mocks/service/qualitymonitor/mock_quality_monitors_v2_interface.go @@ -0,0 +1,479 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package qualitymonitor + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + mock "github.com/stretchr/testify/mock" + + qualitymonitor "github.com/databricks/databricks-sdk-go/service/qualitymonitor" +) + +// MockQualityMonitorsV2Interface is an autogenerated mock type for the QualityMonitorsV2Interface type +type MockQualityMonitorsV2Interface struct { + mock.Mock +} + +type MockQualityMonitorsV2Interface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQualityMonitorsV2Interface) EXPECT() *MockQualityMonitorsV2Interface_Expecter { + return &MockQualityMonitorsV2Interface_Expecter{mock: &_m.Mock} +} + +// CreateQualityMonitor provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) CreateQualityMonitor(ctx context.Context, request qualitymonitor.CreateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateQualityMonitor") + } + + var r0 *qualitymonitor.QualityMonitor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.CreateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.CreateQualityMonitorRequest) *qualitymonitor.QualityMonitor); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*qualitymonitor.QualityMonitor) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, qualitymonitor.CreateQualityMonitorRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQualityMonitorsV2Interface_CreateQualityMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateQualityMonitor' +type MockQualityMonitorsV2Interface_CreateQualityMonitor_Call struct { + *mock.Call +} + +// CreateQualityMonitor is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.CreateQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) CreateQualityMonitor(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call { + return &MockQualityMonitorsV2Interface_CreateQualityMonitor_Call{Call: _e.mock.On("CreateQualityMonitor", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call) Run(run func(ctx context.Context, request qualitymonitor.CreateQualityMonitorRequest)) *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.CreateQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call) Return(_a0 *qualitymonitor.QualityMonitor, _a1 error) *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call) RunAndReturn(run func(context.Context, qualitymonitor.CreateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)) *MockQualityMonitorsV2Interface_CreateQualityMonitor_Call { + _c.Call.Return(run) + return _c +} + +// DeleteQualityMonitor provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) DeleteQualityMonitor(ctx context.Context, request qualitymonitor.DeleteQualityMonitorRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteQualityMonitor") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.DeleteQualityMonitorRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteQualityMonitor' +type MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call struct { + *mock.Call +} + +// DeleteQualityMonitor is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.DeleteQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) DeleteQualityMonitor(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call { + return &MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call{Call: _e.mock.On("DeleteQualityMonitor", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call) Run(run func(ctx context.Context, request qualitymonitor.DeleteQualityMonitorRequest)) *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.DeleteQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call) Return(_a0 error) *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call) RunAndReturn(run func(context.Context, qualitymonitor.DeleteQualityMonitorRequest) error) *MockQualityMonitorsV2Interface_DeleteQualityMonitor_Call { + _c.Call.Return(run) + return _c +} + +// DeleteQualityMonitorByObjectTypeAndObjectId provides a mock function with given fields: ctx, objectType, objectId +func (_m *MockQualityMonitorsV2Interface) DeleteQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) error { + ret := _m.Called(ctx, objectType, objectId) + + if len(ret) == 0 { + panic("no return value specified for DeleteQualityMonitorByObjectTypeAndObjectId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, objectType, objectId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteQualityMonitorByObjectTypeAndObjectId' +type MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call struct { + *mock.Call +} + +// DeleteQualityMonitorByObjectTypeAndObjectId is a helper method to define mock.On call +// - ctx context.Context +// - objectType string +// - objectId string +func (_e *MockQualityMonitorsV2Interface_Expecter) DeleteQualityMonitorByObjectTypeAndObjectId(ctx interface{}, objectType interface{}, objectId interface{}) *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call { + return &MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call{Call: _e.mock.On("DeleteQualityMonitorByObjectTypeAndObjectId", ctx, objectType, objectId)} +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call) Run(run func(ctx context.Context, objectType string, objectId string)) *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call) Return(_a0 error) *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call) RunAndReturn(run func(context.Context, string, string) error) *MockQualityMonitorsV2Interface_DeleteQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Return(run) + return _c +} + +// GetQualityMonitor provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) GetQualityMonitor(ctx context.Context, request qualitymonitor.GetQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetQualityMonitor") + } + + var r0 *qualitymonitor.QualityMonitor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.GetQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.GetQualityMonitorRequest) *qualitymonitor.QualityMonitor); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*qualitymonitor.QualityMonitor) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, qualitymonitor.GetQualityMonitorRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQualityMonitorsV2Interface_GetQualityMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetQualityMonitor' +type MockQualityMonitorsV2Interface_GetQualityMonitor_Call struct { + *mock.Call +} + +// GetQualityMonitor is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.GetQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) GetQualityMonitor(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_GetQualityMonitor_Call { + return &MockQualityMonitorsV2Interface_GetQualityMonitor_Call{Call: _e.mock.On("GetQualityMonitor", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitor_Call) Run(run func(ctx context.Context, request qualitymonitor.GetQualityMonitorRequest)) *MockQualityMonitorsV2Interface_GetQualityMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.GetQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitor_Call) Return(_a0 *qualitymonitor.QualityMonitor, _a1 error) *MockQualityMonitorsV2Interface_GetQualityMonitor_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitor_Call) RunAndReturn(run func(context.Context, qualitymonitor.GetQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)) *MockQualityMonitorsV2Interface_GetQualityMonitor_Call { + _c.Call.Return(run) + return _c +} + +// GetQualityMonitorByObjectTypeAndObjectId provides a mock function with given fields: ctx, objectType, objectId +func (_m *MockQualityMonitorsV2Interface) GetQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) (*qualitymonitor.QualityMonitor, error) { + ret := _m.Called(ctx, objectType, objectId) + + if len(ret) == 0 { + panic("no return value specified for GetQualityMonitorByObjectTypeAndObjectId") + } + + var r0 *qualitymonitor.QualityMonitor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*qualitymonitor.QualityMonitor, error)); ok { + return rf(ctx, objectType, objectId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *qualitymonitor.QualityMonitor); ok { + r0 = rf(ctx, objectType, objectId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*qualitymonitor.QualityMonitor) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, objectType, objectId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetQualityMonitorByObjectTypeAndObjectId' +type MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call struct { + *mock.Call +} + +// GetQualityMonitorByObjectTypeAndObjectId is a helper method to define mock.On call +// - ctx context.Context +// - objectType string +// - objectId string +func (_e *MockQualityMonitorsV2Interface_Expecter) GetQualityMonitorByObjectTypeAndObjectId(ctx interface{}, objectType interface{}, objectId interface{}) *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call { + return &MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call{Call: _e.mock.On("GetQualityMonitorByObjectTypeAndObjectId", ctx, objectType, objectId)} +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call) Run(run func(ctx context.Context, objectType string, objectId string)) *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call) Return(_a0 *qualitymonitor.QualityMonitor, _a1 error) *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call) RunAndReturn(run func(context.Context, string, string) (*qualitymonitor.QualityMonitor, error)) *MockQualityMonitorsV2Interface_GetQualityMonitorByObjectTypeAndObjectId_Call { + _c.Call.Return(run) + return _c +} + +// ListQualityMonitor provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) ListQualityMonitor(ctx context.Context, request qualitymonitor.ListQualityMonitorRequest) listing.Iterator[qualitymonitor.QualityMonitor] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListQualityMonitor") + } + + var r0 listing.Iterator[qualitymonitor.QualityMonitor] + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.ListQualityMonitorRequest) listing.Iterator[qualitymonitor.QualityMonitor]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[qualitymonitor.QualityMonitor]) + } + } + + return r0 +} + +// MockQualityMonitorsV2Interface_ListQualityMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListQualityMonitor' +type MockQualityMonitorsV2Interface_ListQualityMonitor_Call struct { + *mock.Call +} + +// ListQualityMonitor is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.ListQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) ListQualityMonitor(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_ListQualityMonitor_Call { + return &MockQualityMonitorsV2Interface_ListQualityMonitor_Call{Call: _e.mock.On("ListQualityMonitor", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitor_Call) Run(run func(ctx context.Context, request qualitymonitor.ListQualityMonitorRequest)) *MockQualityMonitorsV2Interface_ListQualityMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.ListQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitor_Call) Return(_a0 listing.Iterator[qualitymonitor.QualityMonitor]) *MockQualityMonitorsV2Interface_ListQualityMonitor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitor_Call) RunAndReturn(run func(context.Context, qualitymonitor.ListQualityMonitorRequest) listing.Iterator[qualitymonitor.QualityMonitor]) *MockQualityMonitorsV2Interface_ListQualityMonitor_Call { + _c.Call.Return(run) + return _c +} + +// ListQualityMonitorAll provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) ListQualityMonitorAll(ctx context.Context, request qualitymonitor.ListQualityMonitorRequest) ([]qualitymonitor.QualityMonitor, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListQualityMonitorAll") + } + + var r0 []qualitymonitor.QualityMonitor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.ListQualityMonitorRequest) ([]qualitymonitor.QualityMonitor, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.ListQualityMonitorRequest) []qualitymonitor.QualityMonitor); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]qualitymonitor.QualityMonitor) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, qualitymonitor.ListQualityMonitorRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListQualityMonitorAll' +type MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call struct { + *mock.Call +} + +// ListQualityMonitorAll is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.ListQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) ListQualityMonitorAll(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call { + return &MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call{Call: _e.mock.On("ListQualityMonitorAll", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call) Run(run func(ctx context.Context, request qualitymonitor.ListQualityMonitorRequest)) *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.ListQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call) Return(_a0 []qualitymonitor.QualityMonitor, _a1 error) *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call) RunAndReturn(run func(context.Context, qualitymonitor.ListQualityMonitorRequest) ([]qualitymonitor.QualityMonitor, error)) *MockQualityMonitorsV2Interface_ListQualityMonitorAll_Call { + _c.Call.Return(run) + return _c +} + +// UpdateQualityMonitor provides a mock function with given fields: ctx, request +func (_m *MockQualityMonitorsV2Interface) UpdateQualityMonitor(ctx context.Context, request qualitymonitor.UpdateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateQualityMonitor") + } + + var r0 *qualitymonitor.QualityMonitor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.UpdateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, qualitymonitor.UpdateQualityMonitorRequest) *qualitymonitor.QualityMonitor); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*qualitymonitor.QualityMonitor) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, qualitymonitor.UpdateQualityMonitorRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateQualityMonitor' +type MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call struct { + *mock.Call +} + +// UpdateQualityMonitor is a helper method to define mock.On call +// - ctx context.Context +// - request qualitymonitor.UpdateQualityMonitorRequest +func (_e *MockQualityMonitorsV2Interface_Expecter) UpdateQualityMonitor(ctx interface{}, request interface{}) *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call { + return &MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call{Call: _e.mock.On("UpdateQualityMonitor", ctx, request)} +} + +func (_c *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call) Run(run func(ctx context.Context, request qualitymonitor.UpdateQualityMonitorRequest)) *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(qualitymonitor.UpdateQualityMonitorRequest)) + }) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call) Return(_a0 *qualitymonitor.QualityMonitor, _a1 error) *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call) RunAndReturn(run func(context.Context, qualitymonitor.UpdateQualityMonitorRequest) (*qualitymonitor.QualityMonitor, error)) *MockQualityMonitorsV2Interface_UpdateQualityMonitor_Call { + _c.Call.Return(run) + return _c +} + +// NewMockQualityMonitorsV2Interface creates a new instance of MockQualityMonitorsV2Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockQualityMonitorsV2Interface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQualityMonitorsV2Interface { + mock := &MockQualityMonitorsV2Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/service/apps/impl.go b/service/apps/impl.go index ee0eaf22b..865d97be7 100755 --- a/service/apps/impl.go +++ b/service/apps/impl.go @@ -19,78 +19,232 @@ type appsImpl struct { } func (a *appsImpl) Create(ctx context.Context, request CreateAppRequest) (*App, error) { - var app App + + requestPb, pbErr := createAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb path := "/api/2.0/apps" queryParams := make(map[string]any) - if request.NoCompute != false || slices.Contains(request.ForceSendFields, "NoCompute") { - queryParams["no_compute"] = request.NoCompute + if requestPb.NoCompute != false || slices.Contains(requestPb.ForceSendFields, "NoCompute") { + queryParams["no_compute"] = requestPb.NoCompute } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.App, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).App, + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Delete(ctx context.Context, request DeleteAppRequest) (*App, error) { - var app App - path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + + requestPb, pbErr := deleteAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb + path := fmt.Sprintf("/api/2.0/apps/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Deploy(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) { - var appDeployment AppDeployment - path := fmt.Sprintf("/api/2.0/apps/%v/deployments", request.AppName) + + requestPb, pbErr := createAppDeploymentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appDeploymentPb appDeploymentPb + path := fmt.Sprintf("/api/2.0/apps/%v/deployments", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.AppDeployment, &appDeployment) - return &appDeployment, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).AppDeployment, + &appDeploymentPb, + ) + if err != nil { + return nil, err + } + resp, err := appDeploymentFromPb(&appDeploymentPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Get(ctx context.Context, request GetAppRequest) (*App, error) { - var app App - path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + + requestPb, pbErr := getAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb + path := fmt.Sprintf("/api/2.0/apps/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error) { - var appDeployment AppDeployment - path := fmt.Sprintf("/api/2.0/apps/%v/deployments/%v", request.AppName, request.DeploymentId) + + requestPb, pbErr := getAppDeploymentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appDeploymentPb appDeploymentPb + path := fmt.Sprintf("/api/2.0/apps/%v/deployments/%v", requestPb.AppName, requestPb.DeploymentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &appDeployment) - return &appDeployment, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &appDeploymentPb, + ) + if err != nil { + return nil, err + } + resp, err := appDeploymentFromPb(&appDeploymentPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) GetPermissionLevels(ctx context.Context, request GetAppPermissionLevelsRequest) (*GetAppPermissionLevelsResponse, error) { - var getAppPermissionLevelsResponse GetAppPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/apps/%v/permissionLevels", request.AppName) + + requestPb, pbErr := getAppPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getAppPermissionLevelsResponsePb getAppPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/apps/%v/permissionLevels", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAppPermissionLevelsResponse) - return &getAppPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getAppPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getAppPermissionLevelsResponseFromPb(&getAppPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) GetPermissions(ctx context.Context, request GetAppPermissionsRequest) (*AppPermissions, error) { - var appPermissions AppPermissions - path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + + requestPb, pbErr := getAppPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPermissionsPb appPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/apps/%v", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &appPermissions) - return &appPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &appPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := appPermissionsFromPb(&appPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List apps. @@ -129,13 +283,35 @@ func (a *appsImpl) ListAll(ctx context.Context, request ListAppsRequest) ([]App, } func (a *appsImpl) internalList(ctx context.Context, request ListAppsRequest) (*ListAppsResponse, error) { - var listAppsResponse ListAppsResponse + + requestPb, pbErr := listAppsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAppsResponsePb listAppsResponsePb path := "/api/2.0/apps" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAppsResponse) - return &listAppsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAppsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAppsResponseFromPb(&listAppsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List app deployments. @@ -174,66 +350,198 @@ func (a *appsImpl) ListDeploymentsAll(ctx context.Context, request ListAppDeploy } func (a *appsImpl) internalListDeployments(ctx context.Context, request ListAppDeploymentsRequest) (*ListAppDeploymentsResponse, error) { - var listAppDeploymentsResponse ListAppDeploymentsResponse - path := fmt.Sprintf("/api/2.0/apps/%v/deployments", request.AppName) + + requestPb, pbErr := listAppDeploymentsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAppDeploymentsResponsePb listAppDeploymentsResponsePb + path := fmt.Sprintf("/api/2.0/apps/%v/deployments", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAppDeploymentsResponse) - return &listAppDeploymentsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAppDeploymentsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAppDeploymentsResponseFromPb(&listAppDeploymentsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) SetPermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error) { - var appPermissions AppPermissions - path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + + requestPb, pbErr := appPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPermissionsPb appPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/apps/%v", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &appPermissions) - return &appPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &appPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := appPermissionsFromPb(&appPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Start(ctx context.Context, request StartAppRequest) (*App, error) { - var app App - path := fmt.Sprintf("/api/2.0/apps/%v/start", request.Name) + + requestPb, pbErr := startAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb + path := fmt.Sprintf("/api/2.0/apps/%v/start", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Stop(ctx context.Context, request StopAppRequest) (*App, error) { - var app App - path := fmt.Sprintf("/api/2.0/apps/%v/stop", request.Name) + + requestPb, pbErr := stopAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb + path := fmt.Sprintf("/api/2.0/apps/%v/stop", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) Update(ctx context.Context, request UpdateAppRequest) (*App, error) { - var app App - path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + + requestPb, pbErr := updateAppRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPb appPb + path := fmt.Sprintf("/api/2.0/apps/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.App, &app) - return &app, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).App, + &appPb, + ) + if err != nil { + return nil, err + } + resp, err := appFromPb(&appPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *appsImpl) UpdatePermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error) { - var appPermissions AppPermissions - path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + + requestPb, pbErr := appPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var appPermissionsPb appPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/apps/%v", requestPb.AppName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &appPermissions) - return &appPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &appPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := appPermissionsFromPb(&appPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/apps/internal.go b/service/apps/internal.go new file mode 100755 index 000000000..232dfa780 --- /dev/null +++ b/service/apps/internal.go @@ -0,0 +1,1338 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package apps + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func appToPb(st *App) (*appPb, error) { + if st == nil { + return nil, nil + } + pb := &appPb{} + pb.ActiveDeployment = st.ActiveDeployment + + pb.AppStatus = st.AppStatus + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.ComputeStatus = st.ComputeStatus + + pb.CreateTime = st.CreateTime + + pb.Creator = st.Creator + + pb.DefaultSourceCodePath = st.DefaultSourceCodePath + + pb.Description = st.Description + + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.EffectiveUserApiScopes = st.EffectiveUserApiScopes + + pb.Id = st.Id + + pb.Name = st.Name + + pb.Oauth2AppClientId = st.Oauth2AppClientId + + pb.Oauth2AppIntegrationId = st.Oauth2AppIntegrationId + + pb.PendingDeployment = st.PendingDeployment + + pb.Resources = st.Resources + + pb.ServicePrincipalClientId = st.ServicePrincipalClientId + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UpdateTime = st.UpdateTime + + pb.Updater = st.Updater + + pb.Url = st.Url + + pb.UserApiScopes = st.UserApiScopes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appPb struct { + ActiveDeployment *AppDeployment `json:"active_deployment,omitempty"` + + AppStatus *ApplicationStatus `json:"app_status,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + ComputeStatus *ComputeStatus `json:"compute_status,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + Creator string `json:"creator,omitempty"` + + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + + Description string `json:"description,omitempty"` + + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + EffectiveUserApiScopes []string `json:"effective_user_api_scopes,omitempty"` + + Id string `json:"id,omitempty"` + + Name string `json:"name"` + + Oauth2AppClientId string `json:"oauth2_app_client_id,omitempty"` + + Oauth2AppIntegrationId string `json:"oauth2_app_integration_id,omitempty"` + + PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` + + Resources []AppResource `json:"resources,omitempty"` + + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + + ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + Updater string `json:"updater,omitempty"` + + Url string `json:"url,omitempty"` + + UserApiScopes []string `json:"user_api_scopes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appFromPb(pb *appPb) (*App, error) { + if pb == nil { + return nil, nil + } + st := &App{} + st.ActiveDeployment = pb.ActiveDeployment + st.AppStatus = pb.AppStatus + st.BudgetPolicyId = pb.BudgetPolicyId + st.ComputeStatus = pb.ComputeStatus + st.CreateTime = pb.CreateTime + st.Creator = pb.Creator + st.DefaultSourceCodePath = pb.DefaultSourceCodePath + st.Description = pb.Description + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + st.EffectiveUserApiScopes = pb.EffectiveUserApiScopes + st.Id = pb.Id + st.Name = pb.Name + st.Oauth2AppClientId = pb.Oauth2AppClientId + st.Oauth2AppIntegrationId = pb.Oauth2AppIntegrationId + st.PendingDeployment = pb.PendingDeployment + st.Resources = pb.Resources + st.ServicePrincipalClientId = pb.ServicePrincipalClientId + st.ServicePrincipalId = pb.ServicePrincipalId + st.ServicePrincipalName = pb.ServicePrincipalName + st.UpdateTime = pb.UpdateTime + st.Updater = pb.Updater + st.Url = pb.Url + st.UserApiScopes = pb.UserApiScopes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appAccessControlRequestToPb(st *AppAccessControlRequest) (*appAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &appAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appAccessControlRequestFromPb(pb *appAccessControlRequestPb) (*AppAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &AppAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appAccessControlResponseToPb(st *AppAccessControlResponse) (*appAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &appAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appAccessControlResponsePb struct { + AllPermissions []AppPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appAccessControlResponseFromPb(pb *appAccessControlResponsePb) (*AppAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &AppAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appDeploymentToPb(st *AppDeployment) (*appDeploymentPb, error) { + if st == nil { + return nil, nil + } + pb := &appDeploymentPb{} + pb.CreateTime = st.CreateTime + + pb.Creator = st.Creator + + pb.DeploymentArtifacts = st.DeploymentArtifacts + + pb.DeploymentId = st.DeploymentId + + pb.Mode = st.Mode + + pb.SourceCodePath = st.SourceCodePath + + pb.Status = st.Status + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appDeploymentPb struct { + CreateTime string `json:"create_time,omitempty"` + + Creator string `json:"creator,omitempty"` + + DeploymentArtifacts *AppDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + + DeploymentId string `json:"deployment_id,omitempty"` + + Mode AppDeploymentMode `json:"mode,omitempty"` + + SourceCodePath string `json:"source_code_path,omitempty"` + + Status *AppDeploymentStatus `json:"status,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appDeploymentFromPb(pb *appDeploymentPb) (*AppDeployment, error) { + if pb == nil { + return nil, nil + } + st := &AppDeployment{} + st.CreateTime = pb.CreateTime + st.Creator = pb.Creator + st.DeploymentArtifacts = pb.DeploymentArtifacts + st.DeploymentId = pb.DeploymentId + st.Mode = pb.Mode + st.SourceCodePath = pb.SourceCodePath + st.Status = pb.Status + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appDeploymentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appDeploymentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appDeploymentArtifactsToPb(st *AppDeploymentArtifacts) (*appDeploymentArtifactsPb, error) { + if st == nil { + return nil, nil + } + pb := &appDeploymentArtifactsPb{} + pb.SourceCodePath = st.SourceCodePath + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appDeploymentArtifactsPb struct { + SourceCodePath string `json:"source_code_path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appDeploymentArtifactsFromPb(pb *appDeploymentArtifactsPb) (*AppDeploymentArtifacts, error) { + if pb == nil { + return nil, nil + } + st := &AppDeploymentArtifacts{} + st.SourceCodePath = pb.SourceCodePath + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appDeploymentArtifactsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appDeploymentArtifactsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appDeploymentStatusToPb(st *AppDeploymentStatus) (*appDeploymentStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &appDeploymentStatusPb{} + pb.Message = st.Message + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appDeploymentStatusPb struct { + Message string `json:"message,omitempty"` + + State AppDeploymentState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appDeploymentStatusFromPb(pb *appDeploymentStatusPb) (*AppDeploymentStatus, error) { + if pb == nil { + return nil, nil + } + st := &AppDeploymentStatus{} + st.Message = pb.Message + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appDeploymentStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appDeploymentStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appPermissionToPb(st *AppPermission) (*appPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &appPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appPermissionFromPb(pb *appPermissionPb) (*AppPermission, error) { + if pb == nil { + return nil, nil + } + st := &AppPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appPermissionsToPb(st *AppPermissions) (*appPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &appPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appPermissionsPb struct { + AccessControlList []AppAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appPermissionsFromPb(pb *appPermissionsPb) (*AppPermissions, error) { + if pb == nil { + return nil, nil + } + st := &AppPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appPermissionsDescriptionToPb(st *AppPermissionsDescription) (*appPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &appPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appPermissionsDescriptionFromPb(pb *appPermissionsDescriptionPb) (*AppPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &AppPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appPermissionsRequestToPb(st *AppPermissionsRequest) (*appPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &appPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.AppName = st.AppName + + return pb, nil +} + +type appPermissionsRequestPb struct { + AccessControlList []AppAccessControlRequest `json:"access_control_list,omitempty"` + + AppName string `json:"-" url:"-"` +} + +func appPermissionsRequestFromPb(pb *appPermissionsRequestPb) (*AppPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &AppPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.AppName = pb.AppName + + return st, nil +} + +func appResourceToPb(st *AppResource) (*appResourcePb, error) { + if st == nil { + return nil, nil + } + pb := &appResourcePb{} + pb.Description = st.Description + + pb.Job = st.Job + + pb.Name = st.Name + + pb.Secret = st.Secret + + pb.ServingEndpoint = st.ServingEndpoint + + pb.SqlWarehouse = st.SqlWarehouse + + pb.UcSecurable = st.UcSecurable + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type appResourcePb struct { + Description string `json:"description,omitempty"` + + Job *AppResourceJob `json:"job,omitempty"` + + Name string `json:"name"` + + Secret *AppResourceSecret `json:"secret,omitempty"` + + ServingEndpoint *AppResourceServingEndpoint `json:"serving_endpoint,omitempty"` + + SqlWarehouse *AppResourceSqlWarehouse `json:"sql_warehouse,omitempty"` + + UcSecurable *AppResourceUcSecurable `json:"uc_securable,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func appResourceFromPb(pb *appResourcePb) (*AppResource, error) { + if pb == nil { + return nil, nil + } + st := &AppResource{} + st.Description = pb.Description + st.Job = pb.Job + st.Name = pb.Name + st.Secret = pb.Secret + st.ServingEndpoint = pb.ServingEndpoint + st.SqlWarehouse = pb.SqlWarehouse + st.UcSecurable = pb.UcSecurable + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *appResourcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st appResourcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func appResourceJobToPb(st *AppResourceJob) (*appResourceJobPb, error) { + if st == nil { + return nil, nil + } + pb := &appResourceJobPb{} + pb.Id = st.Id + + pb.Permission = st.Permission + + return pb, nil +} + +type appResourceJobPb struct { + Id string `json:"id"` + + Permission AppResourceJobJobPermission `json:"permission"` +} + +func appResourceJobFromPb(pb *appResourceJobPb) (*AppResourceJob, error) { + if pb == nil { + return nil, nil + } + st := &AppResourceJob{} + st.Id = pb.Id + st.Permission = pb.Permission + + return st, nil +} + +func appResourceSecretToPb(st *AppResourceSecret) (*appResourceSecretPb, error) { + if st == nil { + return nil, nil + } + pb := &appResourceSecretPb{} + pb.Key = st.Key + + pb.Permission = st.Permission + + pb.Scope = st.Scope + + return pb, nil +} + +type appResourceSecretPb struct { + Key string `json:"key"` + + Permission AppResourceSecretSecretPermission `json:"permission"` + + Scope string `json:"scope"` +} + +func appResourceSecretFromPb(pb *appResourceSecretPb) (*AppResourceSecret, error) { + if pb == nil { + return nil, nil + } + st := &AppResourceSecret{} + st.Key = pb.Key + st.Permission = pb.Permission + st.Scope = pb.Scope + + return st, nil +} + +func appResourceServingEndpointToPb(st *AppResourceServingEndpoint) (*appResourceServingEndpointPb, error) { + if st == nil { + return nil, nil + } + pb := &appResourceServingEndpointPb{} + pb.Name = st.Name + + pb.Permission = st.Permission + + return pb, nil +} + +type appResourceServingEndpointPb struct { + Name string `json:"name"` + + Permission AppResourceServingEndpointServingEndpointPermission `json:"permission"` +} + +func appResourceServingEndpointFromPb(pb *appResourceServingEndpointPb) (*AppResourceServingEndpoint, error) { + if pb == nil { + return nil, nil + } + st := &AppResourceServingEndpoint{} + st.Name = pb.Name + st.Permission = pb.Permission + + return st, nil +} + +func appResourceSqlWarehouseToPb(st *AppResourceSqlWarehouse) (*appResourceSqlWarehousePb, error) { + if st == nil { + return nil, nil + } + pb := &appResourceSqlWarehousePb{} + pb.Id = st.Id + + pb.Permission = st.Permission + + return pb, nil +} + +type appResourceSqlWarehousePb struct { + Id string `json:"id"` + + Permission AppResourceSqlWarehouseSqlWarehousePermission `json:"permission"` +} + +func appResourceSqlWarehouseFromPb(pb *appResourceSqlWarehousePb) (*AppResourceSqlWarehouse, error) { + if pb == nil { + return nil, nil + } + st := &AppResourceSqlWarehouse{} + st.Id = pb.Id + st.Permission = pb.Permission + + return st, nil +} + +func appResourceUcSecurableToPb(st *AppResourceUcSecurable) (*appResourceUcSecurablePb, error) { + if st == nil { + return nil, nil + } + pb := &appResourceUcSecurablePb{} + pb.Permission = st.Permission + + pb.SecurableFullName = st.SecurableFullName + + pb.SecurableType = st.SecurableType + + return pb, nil +} + +type appResourceUcSecurablePb struct { + Permission AppResourceUcSecurableUcSecurablePermission `json:"permission"` + + SecurableFullName string `json:"securable_full_name"` + + SecurableType AppResourceUcSecurableUcSecurableType `json:"securable_type"` +} + +func appResourceUcSecurableFromPb(pb *appResourceUcSecurablePb) (*AppResourceUcSecurable, error) { + if pb == nil { + return nil, nil + } + st := &AppResourceUcSecurable{} + st.Permission = pb.Permission + st.SecurableFullName = pb.SecurableFullName + st.SecurableType = pb.SecurableType + + return st, nil +} + +func applicationStatusToPb(st *ApplicationStatus) (*applicationStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &applicationStatusPb{} + pb.Message = st.Message + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type applicationStatusPb struct { + Message string `json:"message,omitempty"` + + State ApplicationState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func applicationStatusFromPb(pb *applicationStatusPb) (*ApplicationStatus, error) { + if pb == nil { + return nil, nil + } + st := &ApplicationStatus{} + st.Message = pb.Message + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *applicationStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st applicationStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func computeStatusToPb(st *ComputeStatus) (*computeStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &computeStatusPb{} + pb.Message = st.Message + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type computeStatusPb struct { + Message string `json:"message,omitempty"` + + State ComputeState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func computeStatusFromPb(pb *computeStatusPb) (*ComputeStatus, error) { + if pb == nil { + return nil, nil + } + st := &ComputeStatus{} + st.Message = pb.Message + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *computeStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st computeStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createAppDeploymentRequestToPb(st *CreateAppDeploymentRequest) (*createAppDeploymentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createAppDeploymentRequestPb{} + pb.AppDeployment = st.AppDeployment + + pb.AppName = st.AppName + + return pb, nil +} + +type createAppDeploymentRequestPb struct { + AppDeployment AppDeployment `json:"app_deployment"` + + AppName string `json:"-" url:"-"` +} + +func createAppDeploymentRequestFromPb(pb *createAppDeploymentRequestPb) (*CreateAppDeploymentRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateAppDeploymentRequest{} + st.AppDeployment = pb.AppDeployment + st.AppName = pb.AppName + + return st, nil +} + +func createAppRequestToPb(st *CreateAppRequest) (*createAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createAppRequestPb{} + pb.App = st.App + + pb.NoCompute = st.NoCompute + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAppRequestPb struct { + App App `json:"app"` + + NoCompute bool `json:"-" url:"no_compute,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAppRequestFromPb(pb *createAppRequestPb) (*CreateAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateAppRequest{} + st.App = pb.App + st.NoCompute = pb.NoCompute + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAppRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAppRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAppRequestToPb(st *DeleteAppRequest) (*deleteAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAppRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteAppRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteAppRequestFromPb(pb *deleteAppRequestPb) (*DeleteAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAppRequest{} + st.Name = pb.Name + + return st, nil +} + +func getAppDeploymentRequestToPb(st *GetAppDeploymentRequest) (*getAppDeploymentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAppDeploymentRequestPb{} + pb.AppName = st.AppName + + pb.DeploymentId = st.DeploymentId + + return pb, nil +} + +type getAppDeploymentRequestPb struct { + AppName string `json:"-" url:"-"` + + DeploymentId string `json:"-" url:"-"` +} + +func getAppDeploymentRequestFromPb(pb *getAppDeploymentRequestPb) (*GetAppDeploymentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAppDeploymentRequest{} + st.AppName = pb.AppName + st.DeploymentId = pb.DeploymentId + + return st, nil +} + +func getAppPermissionLevelsRequestToPb(st *GetAppPermissionLevelsRequest) (*getAppPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAppPermissionLevelsRequestPb{} + pb.AppName = st.AppName + + return pb, nil +} + +type getAppPermissionLevelsRequestPb struct { + AppName string `json:"-" url:"-"` +} + +func getAppPermissionLevelsRequestFromPb(pb *getAppPermissionLevelsRequestPb) (*GetAppPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAppPermissionLevelsRequest{} + st.AppName = pb.AppName + + return st, nil +} + +func getAppPermissionLevelsResponseToPb(st *GetAppPermissionLevelsResponse) (*getAppPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getAppPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getAppPermissionLevelsResponsePb struct { + PermissionLevels []AppPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getAppPermissionLevelsResponseFromPb(pb *getAppPermissionLevelsResponsePb) (*GetAppPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetAppPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getAppPermissionsRequestToPb(st *GetAppPermissionsRequest) (*getAppPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAppPermissionsRequestPb{} + pb.AppName = st.AppName + + return pb, nil +} + +type getAppPermissionsRequestPb struct { + AppName string `json:"-" url:"-"` +} + +func getAppPermissionsRequestFromPb(pb *getAppPermissionsRequestPb) (*GetAppPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAppPermissionsRequest{} + st.AppName = pb.AppName + + return st, nil +} + +func getAppRequestToPb(st *GetAppRequest) (*getAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAppRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getAppRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getAppRequestFromPb(pb *getAppRequestPb) (*GetAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAppRequest{} + st.Name = pb.Name + + return st, nil +} + +func listAppDeploymentsRequestToPb(st *ListAppDeploymentsRequest) (*listAppDeploymentsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAppDeploymentsRequestPb{} + pb.AppName = st.AppName + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAppDeploymentsRequestPb struct { + AppName string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAppDeploymentsRequestFromPb(pb *listAppDeploymentsRequestPb) (*ListAppDeploymentsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAppDeploymentsRequest{} + st.AppName = pb.AppName + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAppDeploymentsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAppDeploymentsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAppDeploymentsResponseToPb(st *ListAppDeploymentsResponse) (*listAppDeploymentsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAppDeploymentsResponsePb{} + pb.AppDeployments = st.AppDeployments + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAppDeploymentsResponsePb struct { + AppDeployments []AppDeployment `json:"app_deployments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAppDeploymentsResponseFromPb(pb *listAppDeploymentsResponsePb) (*ListAppDeploymentsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAppDeploymentsResponse{} + st.AppDeployments = pb.AppDeployments + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAppDeploymentsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAppDeploymentsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAppsRequestToPb(st *ListAppsRequest) (*listAppsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAppsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAppsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAppsRequestFromPb(pb *listAppsRequestPb) (*ListAppsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAppsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAppsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAppsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAppsResponseToPb(st *ListAppsResponse) (*listAppsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAppsResponsePb{} + pb.Apps = st.Apps + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAppsResponsePb struct { + Apps []App `json:"apps,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAppsResponseFromPb(pb *listAppsResponsePb) (*ListAppsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAppsResponse{} + st.Apps = pb.Apps + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAppsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAppsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func startAppRequestToPb(st *StartAppRequest) (*startAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &startAppRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type startAppRequestPb struct { + Name string `json:"-" url:"-"` +} + +func startAppRequestFromPb(pb *startAppRequestPb) (*StartAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &StartAppRequest{} + st.Name = pb.Name + + return st, nil +} + +func stopAppRequestToPb(st *StopAppRequest) (*stopAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &stopAppRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type stopAppRequestPb struct { + Name string `json:"-" url:"-"` +} + +func stopAppRequestFromPb(pb *stopAppRequestPb) (*StopAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &StopAppRequest{} + st.Name = pb.Name + + return st, nil +} + +func updateAppRequestToPb(st *UpdateAppRequest) (*updateAppRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAppRequestPb{} + pb.App = st.App + + pb.Name = st.Name + + return pb, nil +} + +type updateAppRequestPb struct { + App App `json:"app"` + + Name string `json:"-" url:"-"` +} + +func updateAppRequestFromPb(pb *updateAppRequestPb) (*UpdateAppRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAppRequest{} + st.App = pb.App + st.Name = pb.Name + + return st, nil +} diff --git a/service/apps/model.go b/service/apps/model.go index a6a9bfe27..0a571d8c5 100755 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -3,130 +3,219 @@ package apps import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type App struct { // The active deployment of the app. A deployment is considered active when // it has been deployed to the app compute. - ActiveDeployment *AppDeployment `json:"active_deployment,omitempty"` + // Wire name: 'active_deployment' + ActiveDeployment *AppDeployment - AppStatus *ApplicationStatus `json:"app_status,omitempty"` + // Wire name: 'app_status' + AppStatus *ApplicationStatus - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string - ComputeStatus *ComputeStatus `json:"compute_status,omitempty"` + // Wire name: 'compute_status' + ComputeStatus *ComputeStatus // The creation time of the app. Formatted timestamp in ISO 6801. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // The email of the user that created the app. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // The default workspace file system path of the source code from which app // deployment are created. This field tracks the workspace source code path // of the last active deployment. - DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + // Wire name: 'default_source_code_path' + DefaultSourceCodePath string // The description of the app. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string // The effective api scopes granted to the user access token. - EffectiveUserApiScopes []string `json:"effective_user_api_scopes,omitempty"` + // Wire name: 'effective_user_api_scopes' + EffectiveUserApiScopes []string // The unique identifier of the app. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. - Name string `json:"name"` + // Wire name: 'name' + Name string - Oauth2AppClientId string `json:"oauth2_app_client_id,omitempty"` + // Wire name: 'oauth2_app_client_id' + Oauth2AppClientId string - Oauth2AppIntegrationId string `json:"oauth2_app_integration_id,omitempty"` + // Wire name: 'oauth2_app_integration_id' + Oauth2AppIntegrationId string // The pending deployment of the app. A deployment is considered pending // when it is being prepared for deployment to the app compute. - PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` + // Wire name: 'pending_deployment' + PendingDeployment *AppDeployment // Resources for the app. - Resources []AppResource `json:"resources,omitempty"` + // Wire name: 'resources' + Resources []AppResource - ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + // Wire name: 'service_principal_client_id' + ServicePrincipalClientId string - ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // The update time of the app. Formatted timestamp in ISO 6801. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // The email of the user that last updated the app. - Updater string `json:"updater,omitempty"` + // Wire name: 'updater' + Updater string // The URL of the app once it is deployed. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - UserApiScopes []string `json:"user_api_scopes,omitempty"` + // Wire name: 'user_api_scopes' + UserApiScopes []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *App) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *App) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s App) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st App) MarshalJSON() ([]byte, error) { + pb, err := appToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel AppPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := appAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppAccessControlResponse struct { // All permissions. - AllPermissions []AppPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []AppPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := appAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppDeployment struct { // The creation time of the deployment. Formatted timestamp in ISO 6801. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // The email of the user creates the deployment. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // The deployment artifacts for an app. - DeploymentArtifacts *AppDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + // Wire name: 'deployment_artifacts' + DeploymentArtifacts *AppDeploymentArtifacts // The unique id of the deployment. - DeploymentId string `json:"deployment_id,omitempty"` + // Wire name: 'deployment_id' + DeploymentId string // The mode of which the deployment will manage the source code. - Mode AppDeploymentMode `json:"mode,omitempty"` + // Wire name: 'mode' + Mode AppDeploymentMode // 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 @@ -134,40 +223,79 @@ type AppDeployment struct { // 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,omitempty"` + // Wire name: 'source_code_path' + SourceCodePath string // Status and status message of the deployment - Status *AppDeploymentStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *AppDeploymentStatus // The update time of the deployment. Formatted timestamp in ISO 6801. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppDeployment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppDeployment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appDeploymentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appDeploymentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppDeployment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppDeployment) MarshalJSON() ([]byte, error) { + pb, err := appDeploymentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppDeploymentArtifacts struct { // The snapshotted workspace file system path of the source code loaded by // the deployed app. - SourceCodePath string `json:"source_code_path,omitempty"` + // Wire name: 'source_code_path' + SourceCodePath string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppDeploymentArtifacts) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppDeploymentArtifacts) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appDeploymentArtifactsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appDeploymentArtifactsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppDeploymentArtifacts) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppDeploymentArtifacts) MarshalJSON() ([]byte, error) { + pb, err := appDeploymentArtifactsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppDeploymentMode string +type appDeploymentModePb string const AppDeploymentModeAutoSync AppDeploymentMode = `AUTO_SYNC` @@ -194,7 +322,24 @@ func (f *AppDeploymentMode) Type() string { return "AppDeploymentMode" } +func appDeploymentModeToPb(st *AppDeploymentMode) (*appDeploymentModePb, error) { + if st == nil { + return nil, nil + } + pb := appDeploymentModePb(*st) + return &pb, nil +} + +func appDeploymentModeFromPb(pb *appDeploymentModePb) (*AppDeploymentMode, error) { + if pb == nil { + return nil, nil + } + st := AppDeploymentMode(*pb) + return &st, nil +} + type AppDeploymentState string +type appDeploymentStatePb string const AppDeploymentStateCancelled AppDeploymentState = `CANCELLED` @@ -225,43 +370,100 @@ func (f *AppDeploymentState) Type() string { return "AppDeploymentState" } +func appDeploymentStateToPb(st *AppDeploymentState) (*appDeploymentStatePb, error) { + if st == nil { + return nil, nil + } + pb := appDeploymentStatePb(*st) + return &pb, nil +} + +func appDeploymentStateFromPb(pb *appDeploymentStatePb) (*AppDeploymentState, error) { + if pb == nil { + return nil, nil + } + st := AppDeploymentState(*pb) + return &st, nil +} + type AppDeploymentStatus struct { // Message corresponding with the deployment state. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // State of the deployment. - State AppDeploymentState `json:"state,omitempty"` + // Wire name: 'state' + State AppDeploymentState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppDeploymentStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppDeploymentStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appDeploymentStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appDeploymentStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppDeploymentStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppDeploymentStatus) MarshalJSON() ([]byte, error) { + pb, err := appDeploymentStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel AppPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppPermission) MarshalJSON() ([]byte, error) { + pb, err := appPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type AppPermissionLevel string +type appPermissionLevelPb string const AppPermissionLevelCanManage AppPermissionLevel = `CAN_MANAGE` @@ -288,82 +490,219 @@ func (f *AppPermissionLevel) Type() string { return "AppPermissionLevel" } +func appPermissionLevelToPb(st *AppPermissionLevel) (*appPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := appPermissionLevelPb(*st) + return &pb, nil +} + +func appPermissionLevelFromPb(pb *appPermissionLevelPb) (*AppPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := AppPermissionLevel(*pb) + return &st, nil +} + type AppPermissions struct { - AccessControlList []AppAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []AppAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppPermissions) MarshalJSON() ([]byte, error) { + pb, err := appPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel AppPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := appPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppPermissionsRequest struct { - AccessControlList []AppAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AppAccessControlRequest // The app for which to get or manage permissions. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` +} + +func (st *AppPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := appPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResource struct { // Description of the App Resource. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string - Job *AppResourceJob `json:"job,omitempty"` + // Wire name: 'job' + Job *AppResourceJob // Name of the App Resource. - Name string `json:"name"` + // Wire name: 'name' + Name string - Secret *AppResourceSecret `json:"secret,omitempty"` + // Wire name: 'secret' + Secret *AppResourceSecret - ServingEndpoint *AppResourceServingEndpoint `json:"serving_endpoint,omitempty"` + // Wire name: 'serving_endpoint' + ServingEndpoint *AppResourceServingEndpoint - SqlWarehouse *AppResourceSqlWarehouse `json:"sql_warehouse,omitempty"` + // Wire name: 'sql_warehouse' + SqlWarehouse *AppResourceSqlWarehouse - UcSecurable *AppResourceUcSecurable `json:"uc_securable,omitempty"` + // Wire name: 'uc_securable' + UcSecurable *AppResourceUcSecurable - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AppResource) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AppResource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AppResource) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AppResource) MarshalJSON() ([]byte, error) { + pb, err := appResourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResourceJob struct { // Id of the job to grant permission on. - Id string `json:"id"` + // Wire name: 'id' + Id string // Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", // "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". - Permission AppResourceJobJobPermission `json:"permission"` + // Wire name: 'permission' + Permission AppResourceJobJobPermission +} + +func (st *AppResourceJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourceJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppResourceJob) MarshalJSON() ([]byte, error) { + pb, err := appResourceJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResourceJobJobPermission string +type appResourceJobJobPermissionPb string const AppResourceJobJobPermissionCanManage AppResourceJobJobPermission = `CAN_MANAGE` @@ -394,19 +733,64 @@ func (f *AppResourceJobJobPermission) Type() string { return "AppResourceJobJobPermission" } +func appResourceJobJobPermissionToPb(st *AppResourceJobJobPermission) (*appResourceJobJobPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := appResourceJobJobPermissionPb(*st) + return &pb, nil +} + +func appResourceJobJobPermissionFromPb(pb *appResourceJobJobPermissionPb) (*AppResourceJobJobPermission, error) { + if pb == nil { + return nil, nil + } + st := AppResourceJobJobPermission(*pb) + return &st, nil +} + type AppResourceSecret struct { // Key of the secret to grant permission on. - Key string `json:"key"` + // Wire name: 'key' + Key string // Permission to grant on the secret scope. For secrets, only one permission // is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". - Permission AppResourceSecretSecretPermission `json:"permission"` + // Wire name: 'permission' + Permission AppResourceSecretSecretPermission // Scope of the secret to grant permission on. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string +} + +func (st *AppResourceSecret) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourceSecretPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceSecretFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppResourceSecret) MarshalJSON() ([]byte, error) { + pb, err := appResourceSecretToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission to grant on the secret scope. Supported permissions are: "READ", // "WRITE", "MANAGE". type AppResourceSecretSecretPermission string +type appResourceSecretSecretPermissionPb string const AppResourceSecretSecretPermissionManage AppResourceSecretSecretPermission = `MANAGE` @@ -435,15 +819,59 @@ func (f *AppResourceSecretSecretPermission) Type() string { return "AppResourceSecretSecretPermission" } +func appResourceSecretSecretPermissionToPb(st *AppResourceSecretSecretPermission) (*appResourceSecretSecretPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := appResourceSecretSecretPermissionPb(*st) + return &pb, nil +} + +func appResourceSecretSecretPermissionFromPb(pb *appResourceSecretSecretPermissionPb) (*AppResourceSecretSecretPermission, error) { + if pb == nil { + return nil, nil + } + st := AppResourceSecretSecretPermission(*pb) + return &st, nil +} + type AppResourceServingEndpoint struct { // Name of the serving endpoint to grant permission on. - Name string `json:"name"` + // Wire name: 'name' + Name string // Permission to grant on the serving endpoint. Supported permissions are: // "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". - Permission AppResourceServingEndpointServingEndpointPermission `json:"permission"` + // Wire name: 'permission' + Permission AppResourceServingEndpointServingEndpointPermission +} + +func (st *AppResourceServingEndpoint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourceServingEndpointPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceServingEndpointFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppResourceServingEndpoint) MarshalJSON() ([]byte, error) { + pb, err := appResourceServingEndpointToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResourceServingEndpointServingEndpointPermission string +type appResourceServingEndpointServingEndpointPermissionPb string const AppResourceServingEndpointServingEndpointPermissionCanManage AppResourceServingEndpointServingEndpointPermission = `CAN_MANAGE` @@ -472,15 +900,59 @@ func (f *AppResourceServingEndpointServingEndpointPermission) Type() string { return "AppResourceServingEndpointServingEndpointPermission" } +func appResourceServingEndpointServingEndpointPermissionToPb(st *AppResourceServingEndpointServingEndpointPermission) (*appResourceServingEndpointServingEndpointPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := appResourceServingEndpointServingEndpointPermissionPb(*st) + return &pb, nil +} + +func appResourceServingEndpointServingEndpointPermissionFromPb(pb *appResourceServingEndpointServingEndpointPermissionPb) (*AppResourceServingEndpointServingEndpointPermission, error) { + if pb == nil { + return nil, nil + } + st := AppResourceServingEndpointServingEndpointPermission(*pb) + return &st, nil +} + type AppResourceSqlWarehouse struct { // Id of the SQL warehouse to grant permission on. - Id string `json:"id"` + // Wire name: 'id' + Id string // Permission to grant on the SQL warehouse. Supported permissions are: // "CAN_MANAGE", "CAN_USE", "IS_OWNER". - Permission AppResourceSqlWarehouseSqlWarehousePermission `json:"permission"` + // Wire name: 'permission' + Permission AppResourceSqlWarehouseSqlWarehousePermission +} + +func (st *AppResourceSqlWarehouse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourceSqlWarehousePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceSqlWarehouseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppResourceSqlWarehouse) MarshalJSON() ([]byte, error) { + pb, err := appResourceSqlWarehouseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResourceSqlWarehouseSqlWarehousePermission string +type appResourceSqlWarehouseSqlWarehousePermissionPb string const AppResourceSqlWarehouseSqlWarehousePermissionCanManage AppResourceSqlWarehouseSqlWarehousePermission = `CAN_MANAGE` @@ -509,15 +981,61 @@ func (f *AppResourceSqlWarehouseSqlWarehousePermission) Type() string { return "AppResourceSqlWarehouseSqlWarehousePermission" } +func appResourceSqlWarehouseSqlWarehousePermissionToPb(st *AppResourceSqlWarehouseSqlWarehousePermission) (*appResourceSqlWarehouseSqlWarehousePermissionPb, error) { + if st == nil { + return nil, nil + } + pb := appResourceSqlWarehouseSqlWarehousePermissionPb(*st) + return &pb, nil +} + +func appResourceSqlWarehouseSqlWarehousePermissionFromPb(pb *appResourceSqlWarehouseSqlWarehousePermissionPb) (*AppResourceSqlWarehouseSqlWarehousePermission, error) { + if pb == nil { + return nil, nil + } + st := AppResourceSqlWarehouseSqlWarehousePermission(*pb) + return &st, nil +} + type AppResourceUcSecurable struct { - Permission AppResourceUcSecurableUcSecurablePermission `json:"permission"` - SecurableFullName string `json:"securable_full_name"` + // Wire name: 'permission' + Permission AppResourceUcSecurableUcSecurablePermission + + // Wire name: 'securable_full_name' + SecurableFullName string - SecurableType AppResourceUcSecurableUcSecurableType `json:"securable_type"` + // Wire name: 'securable_type' + SecurableType AppResourceUcSecurableUcSecurableType +} + +func (st *AppResourceUcSecurable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &appResourceUcSecurablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := appResourceUcSecurableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AppResourceUcSecurable) MarshalJSON() ([]byte, error) { + pb, err := appResourceUcSecurableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AppResourceUcSecurableUcSecurablePermission string +type appResourceUcSecurableUcSecurablePermissionPb string const AppResourceUcSecurableUcSecurablePermissionReadVolume AppResourceUcSecurableUcSecurablePermission = `READ_VOLUME` @@ -544,7 +1062,24 @@ func (f *AppResourceUcSecurableUcSecurablePermission) Type() string { return "AppResourceUcSecurableUcSecurablePermission" } +func appResourceUcSecurableUcSecurablePermissionToPb(st *AppResourceUcSecurableUcSecurablePermission) (*appResourceUcSecurableUcSecurablePermissionPb, error) { + if st == nil { + return nil, nil + } + pb := appResourceUcSecurableUcSecurablePermissionPb(*st) + return &pb, nil +} + +func appResourceUcSecurableUcSecurablePermissionFromPb(pb *appResourceUcSecurableUcSecurablePermissionPb) (*AppResourceUcSecurableUcSecurablePermission, error) { + if pb == nil { + return nil, nil + } + st := AppResourceUcSecurableUcSecurablePermission(*pb) + return &st, nil +} + type AppResourceUcSecurableUcSecurableType string +type appResourceUcSecurableUcSecurableTypePb string const AppResourceUcSecurableUcSecurableTypeVolume AppResourceUcSecurableUcSecurableType = `VOLUME` @@ -569,7 +1104,24 @@ func (f *AppResourceUcSecurableUcSecurableType) Type() string { return "AppResourceUcSecurableUcSecurableType" } +func appResourceUcSecurableUcSecurableTypeToPb(st *AppResourceUcSecurableUcSecurableType) (*appResourceUcSecurableUcSecurableTypePb, error) { + if st == nil { + return nil, nil + } + pb := appResourceUcSecurableUcSecurableTypePb(*st) + return &pb, nil +} + +func appResourceUcSecurableUcSecurableTypeFromPb(pb *appResourceUcSecurableUcSecurableTypePb) (*AppResourceUcSecurableUcSecurableType, error) { + if pb == nil { + return nil, nil + } + st := AppResourceUcSecurableUcSecurableType(*pb) + return &st, nil +} + type ApplicationState string +type applicationStatePb string const ApplicationStateCrashed ApplicationState = `CRASHED` @@ -600,24 +1152,60 @@ func (f *ApplicationState) Type() string { return "ApplicationState" } +func applicationStateToPb(st *ApplicationState) (*applicationStatePb, error) { + if st == nil { + return nil, nil + } + pb := applicationStatePb(*st) + return &pb, nil +} + +func applicationStateFromPb(pb *applicationStatePb) (*ApplicationState, error) { + if pb == nil { + return nil, nil + } + st := ApplicationState(*pb) + return &st, nil +} + type ApplicationStatus struct { // Application status message - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // State of the application. - State ApplicationState `json:"state,omitempty"` + // Wire name: 'state' + State ApplicationState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ApplicationStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ApplicationStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &applicationStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := applicationStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ApplicationStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ApplicationStatus) MarshalJSON() ([]byte, error) { + pb, err := applicationStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ComputeState string +type computeStatePb string const ComputeStateActive ComputeState = `ACTIVE` @@ -654,171 +1242,623 @@ func (f *ComputeState) Type() string { return "ComputeState" } +func computeStateToPb(st *ComputeState) (*computeStatePb, error) { + if st == nil { + return nil, nil + } + pb := computeStatePb(*st) + return &pb, nil +} + +func computeStateFromPb(pb *computeStatePb) (*ComputeState, error) { + if pb == nil { + return nil, nil + } + st := ComputeState(*pb) + return &st, nil +} + type ComputeStatus struct { // Compute status message - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // State of the app compute. - State ComputeState `json:"state,omitempty"` + // Wire name: 'state' + State ComputeState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComputeStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComputeStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &computeStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := computeStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComputeStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComputeStatus) MarshalJSON() ([]byte, error) { + pb, err := computeStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an app deployment type CreateAppDeploymentRequest struct { - AppDeployment AppDeployment `json:"app_deployment"` + + // Wire name: 'app_deployment' + AppDeployment AppDeployment // The name of the app. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` +} + +func (st *CreateAppDeploymentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAppDeploymentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAppDeploymentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateAppDeploymentRequest) MarshalJSON() ([]byte, error) { + pb, err := createAppDeploymentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an app type CreateAppRequest struct { - App App `json:"app"` + + // Wire name: 'app' + App App // If true, the app will not be started after creation. - NoCompute bool `json:"-" url:"no_compute,omitempty"` + // Wire name: 'no_compute' + NoCompute bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAppRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAppRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAppRequest) MarshalJSON() ([]byte, error) { + pb, err := createAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an app type DeleteAppRequest struct { // The name of the app. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAppRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an app deployment type GetAppDeploymentRequest struct { // The name of the app. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` // The unique id of the deployment. - DeploymentId string `json:"-" url:"-"` + // Wire name: 'deployment_id' + DeploymentId string `tf:"-"` +} + +func (st *GetAppDeploymentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAppDeploymentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAppDeploymentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAppDeploymentRequest) MarshalJSON() ([]byte, error) { + pb, err := getAppDeploymentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get app permission levels type GetAppPermissionLevelsRequest struct { // The app for which to get or manage permissions. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` +} + +func (st *GetAppPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAppPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAppPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAppPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getAppPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetAppPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []AppPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []AppPermissionsDescription +} + +func (st *GetAppPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAppPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAppPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAppPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getAppPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get app permissions type GetAppPermissionsRequest struct { // The app for which to get or manage permissions. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` +} + +func (st *GetAppPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAppPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAppPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAppPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getAppPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an app type GetAppRequest struct { // The name of the app. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAppRequest) MarshalJSON() ([]byte, error) { + pb, err := getAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List app deployments type ListAppDeploymentsRequest struct { // The name of the app. - AppName string `json:"-" url:"-"` + // Wire name: 'app_name' + AppName string `tf:"-"` // Upper bound for items returned. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Pagination token to go to the next page of apps. Requests first page if // absent. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAppDeploymentsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAppDeploymentsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAppDeploymentsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAppDeploymentsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAppDeploymentsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAppDeploymentsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAppDeploymentsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAppDeploymentsResponse struct { // Deployment history of the app. - AppDeployments []AppDeployment `json:"app_deployments,omitempty"` + // Wire name: 'app_deployments' + AppDeployments []AppDeployment // Pagination token to request the next page of apps. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAppDeploymentsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAppDeploymentsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAppDeploymentsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAppDeploymentsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAppDeploymentsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAppDeploymentsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAppDeploymentsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List apps type ListAppsRequest struct { // Upper bound for items returned. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Pagination token to go to the next page of apps. Requests first page if // absent. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAppsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAppsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAppsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAppsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAppsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAppsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAppsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAppsResponse struct { - Apps []App `json:"apps,omitempty"` + + // Wire name: 'apps' + Apps []App // Pagination token to request the next page of apps. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAppsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAppsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAppsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAppsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAppsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAppsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAppsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StartAppRequest struct { // The name of the app. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *StartAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StartAppRequest) MarshalJSON() ([]byte, error) { + pb, err := startAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StopAppRequest struct { // The name of the app. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *StopAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stopAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stopAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StopAppRequest) MarshalJSON() ([]byte, error) { + pb, err := stopAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update an app type UpdateAppRequest struct { - App App `json:"app"` + + // Wire name: 'app' + App App // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *UpdateAppRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAppRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAppRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateAppRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAppRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/billing/impl.go b/service/billing/impl.go index 0ea95a456..b90f1d805 100755 --- a/service/billing/impl.go +++ b/service/billing/impl.go @@ -18,13 +18,35 @@ type billableUsageImpl struct { } func (a *billableUsageImpl) Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) { - var downloadResponse DownloadResponse + + requestPb, pbErr := downloadRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var downloadResponsePb downloadResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/usage/download", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &downloadResponse) - return &downloadResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &downloadResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := downloadResponseFromPb(&downloadResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just BudgetPolicy API methods @@ -33,34 +55,96 @@ type budgetPolicyImpl struct { } func (a *budgetPolicyImpl) Create(ctx context.Context, request CreateBudgetPolicyRequest) (*BudgetPolicy, error) { - var budgetPolicy BudgetPolicy + + requestPb, pbErr := createBudgetPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var budgetPolicyPb budgetPolicyPb path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &budgetPolicy) - return &budgetPolicy, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &budgetPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := budgetPolicyFromPb(&budgetPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *budgetPolicyImpl) Delete(ctx context.Context, request DeleteBudgetPolicyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := deleteBudgetPolicyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *budgetPolicyImpl) Get(ctx context.Context, request GetBudgetPolicyRequest) (*BudgetPolicy, error) { - var budgetPolicy BudgetPolicy - path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := getBudgetPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var budgetPolicyPb budgetPolicyPb + path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &budgetPolicy) - return &budgetPolicy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &budgetPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := budgetPolicyFromPb(&budgetPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // List policies. @@ -101,27 +185,71 @@ func (a *budgetPolicyImpl) ListAll(ctx context.Context, request ListBudgetPolici } func (a *budgetPolicyImpl) internalList(ctx context.Context, request ListBudgetPoliciesRequest) (*ListBudgetPoliciesResponse, error) { - var listBudgetPoliciesResponse ListBudgetPoliciesResponse + + requestPb, pbErr := listBudgetPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listBudgetPoliciesResponsePb listBudgetPoliciesResponsePb path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listBudgetPoliciesResponse) - return &listBudgetPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listBudgetPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listBudgetPoliciesResponseFromPb(&listBudgetPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *budgetPolicyImpl) Update(ctx context.Context, request UpdateBudgetPolicyRequest) (*BudgetPolicy, error) { - var budgetPolicy BudgetPolicy - path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := updateBudgetPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var budgetPolicyPb budgetPolicyPb + path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) - if request.LimitConfig != nil { - queryParams["limit_config"] = request.LimitConfig + if requestPb.LimitConfig != nil { + queryParams["limit_config"] = requestPb.LimitConfig } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &budgetPolicy) - return &budgetPolicy, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Policy, + &budgetPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := budgetPolicyFromPb(&budgetPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just budgets API methods @@ -130,34 +258,96 @@ type budgetsImpl struct { } func (a *budgetsImpl) Create(ctx context.Context, request CreateBudgetConfigurationRequest) (*CreateBudgetConfigurationResponse, error) { - var createBudgetConfigurationResponse CreateBudgetConfigurationResponse + + requestPb, pbErr := createBudgetConfigurationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createBudgetConfigurationResponsePb createBudgetConfigurationResponsePb path := fmt.Sprintf("/api/2.1/accounts/%v/budgets", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createBudgetConfigurationResponse) - return &createBudgetConfigurationResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createBudgetConfigurationResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createBudgetConfigurationResponseFromPb(&createBudgetConfigurationResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *budgetsImpl) Delete(ctx context.Context, request DeleteBudgetConfigurationRequest) error { - var deleteBudgetConfigurationResponse DeleteBudgetConfigurationResponse - path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + + requestPb, pbErr := deleteBudgetConfigurationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteBudgetConfigurationResponsePb deleteBudgetConfigurationResponsePb + path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), requestPb.BudgetId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteBudgetConfigurationResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteBudgetConfigurationResponsePb, + ) + if err != nil { + return err + } + return err } func (a *budgetsImpl) Get(ctx context.Context, request GetBudgetConfigurationRequest) (*GetBudgetConfigurationResponse, error) { - var getBudgetConfigurationResponse GetBudgetConfigurationResponse - path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + + requestPb, pbErr := getBudgetConfigurationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getBudgetConfigurationResponsePb getBudgetConfigurationResponsePb + path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), requestPb.BudgetId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getBudgetConfigurationResponse) - return &getBudgetConfigurationResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getBudgetConfigurationResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getBudgetConfigurationResponseFromPb(&getBudgetConfigurationResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get all budgets. @@ -196,24 +386,68 @@ func (a *budgetsImpl) ListAll(ctx context.Context, request ListBudgetConfigurati } func (a *budgetsImpl) internalList(ctx context.Context, request ListBudgetConfigurationsRequest) (*ListBudgetConfigurationsResponse, error) { - var listBudgetConfigurationsResponse ListBudgetConfigurationsResponse + + requestPb, pbErr := listBudgetConfigurationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listBudgetConfigurationsResponsePb listBudgetConfigurationsResponsePb path := fmt.Sprintf("/api/2.1/accounts/%v/budgets", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listBudgetConfigurationsResponse) - return &listBudgetConfigurationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listBudgetConfigurationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listBudgetConfigurationsResponseFromPb(&listBudgetConfigurationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *budgetsImpl) Update(ctx context.Context, request UpdateBudgetConfigurationRequest) (*UpdateBudgetConfigurationResponse, error) { - var updateBudgetConfigurationResponse UpdateBudgetConfigurationResponse - path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + + requestPb, pbErr := updateBudgetConfigurationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateBudgetConfigurationResponsePb updateBudgetConfigurationResponsePb + path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), requestPb.BudgetId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateBudgetConfigurationResponse) - return &updateBudgetConfigurationResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateBudgetConfigurationResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateBudgetConfigurationResponseFromPb(&updateBudgetConfigurationResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just LogDelivery API methods @@ -222,24 +456,68 @@ type logDeliveryImpl struct { } func (a *logDeliveryImpl) Create(ctx context.Context, request WrappedCreateLogDeliveryConfiguration) (*WrappedLogDeliveryConfiguration, error) { - var wrappedLogDeliveryConfiguration WrappedLogDeliveryConfiguration + + requestPb, pbErr := wrappedCreateLogDeliveryConfigurationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var wrappedLogDeliveryConfigurationPb wrappedLogDeliveryConfigurationPb path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &wrappedLogDeliveryConfiguration) - return &wrappedLogDeliveryConfiguration, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &wrappedLogDeliveryConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := wrappedLogDeliveryConfigurationFromPb(&wrappedLogDeliveryConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *logDeliveryImpl) Get(ctx context.Context, request GetLogDeliveryRequest) (*WrappedLogDeliveryConfiguration, error) { - var wrappedLogDeliveryConfiguration WrappedLogDeliveryConfiguration - path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), request.LogDeliveryConfigurationId) + + requestPb, pbErr := getLogDeliveryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var wrappedLogDeliveryConfigurationPb wrappedLogDeliveryConfigurationPb + path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), requestPb.LogDeliveryConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &wrappedLogDeliveryConfiguration) - return &wrappedLogDeliveryConfiguration, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &wrappedLogDeliveryConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := wrappedLogDeliveryConfigurationFromPb(&wrappedLogDeliveryConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } // Get all log delivery configurations. @@ -274,23 +552,63 @@ func (a *logDeliveryImpl) ListAll(ctx context.Context, request ListLogDeliveryRe } func (a *logDeliveryImpl) internalList(ctx context.Context, request ListLogDeliveryRequest) (*WrappedLogDeliveryConfigurations, error) { - var wrappedLogDeliveryConfigurations WrappedLogDeliveryConfigurations + + requestPb, pbErr := listLogDeliveryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var wrappedLogDeliveryConfigurationsPb wrappedLogDeliveryConfigurationsPb path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &wrappedLogDeliveryConfigurations) - return &wrappedLogDeliveryConfigurations, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &wrappedLogDeliveryConfigurationsPb, + ) + if err != nil { + return nil, err + } + resp, err := wrappedLogDeliveryConfigurationsFromPb(&wrappedLogDeliveryConfigurationsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *logDeliveryImpl) PatchStatus(ctx context.Context, request UpdateLogDeliveryConfigurationStatusRequest) error { - var patchStatusResponse PatchStatusResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), request.LogDeliveryConfigurationId) + + requestPb, pbErr := updateLogDeliveryConfigurationStatusRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchStatusResponsePb patchStatusResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), requestPb.LogDeliveryConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchStatusResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchStatusResponsePb, + ) + if err != nil { + return err + } + return err } @@ -300,22 +618,66 @@ type usageDashboardsImpl struct { } func (a *usageDashboardsImpl) Create(ctx context.Context, request CreateBillingUsageDashboardRequest) (*CreateBillingUsageDashboardResponse, error) { - var createBillingUsageDashboardResponse CreateBillingUsageDashboardResponse + + requestPb, pbErr := createBillingUsageDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createBillingUsageDashboardResponsePb createBillingUsageDashboardResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/dashboard", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createBillingUsageDashboardResponse) - return &createBillingUsageDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createBillingUsageDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createBillingUsageDashboardResponseFromPb(&createBillingUsageDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usageDashboardsImpl) Get(ctx context.Context, request GetBillingUsageDashboardRequest) (*GetBillingUsageDashboardResponse, error) { - var getBillingUsageDashboardResponse GetBillingUsageDashboardResponse + + requestPb, pbErr := getBillingUsageDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getBillingUsageDashboardResponsePb getBillingUsageDashboardResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/dashboard", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getBillingUsageDashboardResponse) - return &getBillingUsageDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getBillingUsageDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getBillingUsageDashboardResponseFromPb(&getBillingUsageDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/billing/internal.go b/service/billing/internal.go new file mode 100755 index 000000000..17e9bc8fe --- /dev/null +++ b/service/billing/internal.go @@ -0,0 +1,1835 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package billing + +import ( + "io" + + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/compute" +) + +func actionConfigurationToPb(st *ActionConfiguration) (*actionConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &actionConfigurationPb{} + pb.ActionConfigurationId = st.ActionConfigurationId + + pb.ActionType = st.ActionType + + pb.Target = st.Target + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type actionConfigurationPb struct { + ActionConfigurationId string `json:"action_configuration_id,omitempty"` + + ActionType ActionConfigurationType `json:"action_type,omitempty"` + + Target string `json:"target,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func actionConfigurationFromPb(pb *actionConfigurationPb) (*ActionConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &ActionConfiguration{} + st.ActionConfigurationId = pb.ActionConfigurationId + st.ActionType = pb.ActionType + st.Target = pb.Target + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *actionConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st actionConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertConfigurationToPb(st *AlertConfiguration) (*alertConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &alertConfigurationPb{} + pb.ActionConfigurations = st.ActionConfigurations + + pb.AlertConfigurationId = st.AlertConfigurationId + + pb.QuantityThreshold = st.QuantityThreshold + + pb.QuantityType = st.QuantityType + + pb.TimePeriod = st.TimePeriod + + pb.TriggerType = st.TriggerType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertConfigurationPb struct { + ActionConfigurations []ActionConfiguration `json:"action_configurations,omitempty"` + + AlertConfigurationId string `json:"alert_configuration_id,omitempty"` + + QuantityThreshold string `json:"quantity_threshold,omitempty"` + + QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + + TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + + TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertConfigurationFromPb(pb *alertConfigurationPb) (*AlertConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &AlertConfiguration{} + st.ActionConfigurations = pb.ActionConfigurations + st.AlertConfigurationId = pb.AlertConfigurationId + st.QuantityThreshold = pb.QuantityThreshold + st.QuantityType = pb.QuantityType + st.TimePeriod = pb.TimePeriod + st.TriggerType = pb.TriggerType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func budgetConfigurationToPb(st *BudgetConfiguration) (*budgetConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &budgetConfigurationPb{} + pb.AccountId = st.AccountId + + pb.AlertConfigurations = st.AlertConfigurations + + pb.BudgetConfigurationId = st.BudgetConfigurationId + + pb.CreateTime = st.CreateTime + + pb.DisplayName = st.DisplayName + + pb.Filter = st.Filter + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type budgetConfigurationPb struct { + AccountId string `json:"account_id,omitempty"` + + AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + + BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + + CreateTime int64 `json:"create_time,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + + UpdateTime int64 `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func budgetConfigurationFromPb(pb *budgetConfigurationPb) (*BudgetConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &BudgetConfiguration{} + st.AccountId = pb.AccountId + st.AlertConfigurations = pb.AlertConfigurations + st.BudgetConfigurationId = pb.BudgetConfigurationId + st.CreateTime = pb.CreateTime + st.DisplayName = pb.DisplayName + st.Filter = pb.Filter + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *budgetConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st budgetConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func budgetConfigurationFilterToPb(st *BudgetConfigurationFilter) (*budgetConfigurationFilterPb, error) { + if st == nil { + return nil, nil + } + pb := &budgetConfigurationFilterPb{} + pb.Tags = st.Tags + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type budgetConfigurationFilterPb struct { + Tags []BudgetConfigurationFilterTagClause `json:"tags,omitempty"` + + WorkspaceId *BudgetConfigurationFilterWorkspaceIdClause `json:"workspace_id,omitempty"` +} + +func budgetConfigurationFilterFromPb(pb *budgetConfigurationFilterPb) (*BudgetConfigurationFilter, error) { + if pb == nil { + return nil, nil + } + st := &BudgetConfigurationFilter{} + st.Tags = pb.Tags + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func budgetConfigurationFilterClauseToPb(st *BudgetConfigurationFilterClause) (*budgetConfigurationFilterClausePb, error) { + if st == nil { + return nil, nil + } + pb := &budgetConfigurationFilterClausePb{} + pb.Operator = st.Operator + + pb.Values = st.Values + + return pb, nil +} + +type budgetConfigurationFilterClausePb struct { + Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` + + Values []string `json:"values,omitempty"` +} + +func budgetConfigurationFilterClauseFromPb(pb *budgetConfigurationFilterClausePb) (*BudgetConfigurationFilterClause, error) { + if pb == nil { + return nil, nil + } + st := &BudgetConfigurationFilterClause{} + st.Operator = pb.Operator + st.Values = pb.Values + + return st, nil +} + +func budgetConfigurationFilterTagClauseToPb(st *BudgetConfigurationFilterTagClause) (*budgetConfigurationFilterTagClausePb, error) { + if st == nil { + return nil, nil + } + pb := &budgetConfigurationFilterTagClausePb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type budgetConfigurationFilterTagClausePb struct { + Key string `json:"key,omitempty"` + + Value *BudgetConfigurationFilterClause `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func budgetConfigurationFilterTagClauseFromPb(pb *budgetConfigurationFilterTagClausePb) (*BudgetConfigurationFilterTagClause, error) { + if pb == nil { + return nil, nil + } + st := &BudgetConfigurationFilterTagClause{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *budgetConfigurationFilterTagClausePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st budgetConfigurationFilterTagClausePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func budgetConfigurationFilterWorkspaceIdClauseToPb(st *BudgetConfigurationFilterWorkspaceIdClause) (*budgetConfigurationFilterWorkspaceIdClausePb, error) { + if st == nil { + return nil, nil + } + pb := &budgetConfigurationFilterWorkspaceIdClausePb{} + pb.Operator = st.Operator + + pb.Values = st.Values + + return pb, nil +} + +type budgetConfigurationFilterWorkspaceIdClausePb struct { + Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` + + Values []int64 `json:"values,omitempty"` +} + +func budgetConfigurationFilterWorkspaceIdClauseFromPb(pb *budgetConfigurationFilterWorkspaceIdClausePb) (*BudgetConfigurationFilterWorkspaceIdClause, error) { + if pb == nil { + return nil, nil + } + st := &BudgetConfigurationFilterWorkspaceIdClause{} + st.Operator = pb.Operator + st.Values = pb.Values + + return st, nil +} + +func budgetPolicyToPb(st *BudgetPolicy) (*budgetPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &budgetPolicyPb{} + pb.BindingWorkspaceIds = st.BindingWorkspaceIds + + pb.CustomTags = st.CustomTags + + pb.PolicyId = st.PolicyId + + pb.PolicyName = st.PolicyName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type budgetPolicyPb struct { + BindingWorkspaceIds []int64 `json:"binding_workspace_ids,omitempty"` + + CustomTags []compute.CustomPolicyTag `json:"custom_tags,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + PolicyName string `json:"policy_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func budgetPolicyFromPb(pb *budgetPolicyPb) (*BudgetPolicy, error) { + if pb == nil { + return nil, nil + } + st := &BudgetPolicy{} + st.BindingWorkspaceIds = pb.BindingWorkspaceIds + st.CustomTags = pb.CustomTags + st.PolicyId = pb.PolicyId + st.PolicyName = pb.PolicyName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *budgetPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st budgetPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBillingUsageDashboardRequestToPb(st *CreateBillingUsageDashboardRequest) (*createBillingUsageDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createBillingUsageDashboardRequestPb{} + pb.DashboardType = st.DashboardType + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBillingUsageDashboardRequestPb struct { + DashboardType UsageDashboardType `json:"dashboard_type,omitempty"` + + WorkspaceId int64 `json:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBillingUsageDashboardRequestFromPb(pb *createBillingUsageDashboardRequestPb) (*CreateBillingUsageDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateBillingUsageDashboardRequest{} + st.DashboardType = pb.DashboardType + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBillingUsageDashboardRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBillingUsageDashboardRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBillingUsageDashboardResponseToPb(st *CreateBillingUsageDashboardResponse) (*createBillingUsageDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createBillingUsageDashboardResponsePb{} + pb.DashboardId = st.DashboardId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBillingUsageDashboardResponsePb struct { + DashboardId string `json:"dashboard_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBillingUsageDashboardResponseFromPb(pb *createBillingUsageDashboardResponsePb) (*CreateBillingUsageDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateBillingUsageDashboardResponse{} + st.DashboardId = pb.DashboardId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBillingUsageDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBillingUsageDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBudgetConfigurationBudgetToPb(st *CreateBudgetConfigurationBudget) (*createBudgetConfigurationBudgetPb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetConfigurationBudgetPb{} + pb.AccountId = st.AccountId + + pb.AlertConfigurations = st.AlertConfigurations + + pb.DisplayName = st.DisplayName + + pb.Filter = st.Filter + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBudgetConfigurationBudgetPb struct { + AccountId string `json:"account_id,omitempty"` + + AlertConfigurations []CreateBudgetConfigurationBudgetAlertConfigurations `json:"alert_configurations,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBudgetConfigurationBudgetFromPb(pb *createBudgetConfigurationBudgetPb) (*CreateBudgetConfigurationBudget, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetConfigurationBudget{} + st.AccountId = pb.AccountId + st.AlertConfigurations = pb.AlertConfigurations + st.DisplayName = pb.DisplayName + st.Filter = pb.Filter + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBudgetConfigurationBudgetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBudgetConfigurationBudgetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBudgetConfigurationBudgetActionConfigurationsToPb(st *CreateBudgetConfigurationBudgetActionConfigurations) (*createBudgetConfigurationBudgetActionConfigurationsPb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetConfigurationBudgetActionConfigurationsPb{} + pb.ActionType = st.ActionType + + pb.Target = st.Target + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBudgetConfigurationBudgetActionConfigurationsPb struct { + ActionType ActionConfigurationType `json:"action_type,omitempty"` + + Target string `json:"target,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBudgetConfigurationBudgetActionConfigurationsFromPb(pb *createBudgetConfigurationBudgetActionConfigurationsPb) (*CreateBudgetConfigurationBudgetActionConfigurations, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetConfigurationBudgetActionConfigurations{} + st.ActionType = pb.ActionType + st.Target = pb.Target + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBudgetConfigurationBudgetActionConfigurationsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBudgetConfigurationBudgetActionConfigurationsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBudgetConfigurationBudgetAlertConfigurationsToPb(st *CreateBudgetConfigurationBudgetAlertConfigurations) (*createBudgetConfigurationBudgetAlertConfigurationsPb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetConfigurationBudgetAlertConfigurationsPb{} + pb.ActionConfigurations = st.ActionConfigurations + + pb.QuantityThreshold = st.QuantityThreshold + + pb.QuantityType = st.QuantityType + + pb.TimePeriod = st.TimePeriod + + pb.TriggerType = st.TriggerType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBudgetConfigurationBudgetAlertConfigurationsPb struct { + ActionConfigurations []CreateBudgetConfigurationBudgetActionConfigurations `json:"action_configurations,omitempty"` + + QuantityThreshold string `json:"quantity_threshold,omitempty"` + + QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + + TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + + TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBudgetConfigurationBudgetAlertConfigurationsFromPb(pb *createBudgetConfigurationBudgetAlertConfigurationsPb) (*CreateBudgetConfigurationBudgetAlertConfigurations, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetConfigurationBudgetAlertConfigurations{} + st.ActionConfigurations = pb.ActionConfigurations + st.QuantityThreshold = pb.QuantityThreshold + st.QuantityType = pb.QuantityType + st.TimePeriod = pb.TimePeriod + st.TriggerType = pb.TriggerType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBudgetConfigurationBudgetAlertConfigurationsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBudgetConfigurationBudgetAlertConfigurationsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createBudgetConfigurationRequestToPb(st *CreateBudgetConfigurationRequest) (*createBudgetConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetConfigurationRequestPb{} + pb.Budget = st.Budget + + return pb, nil +} + +type createBudgetConfigurationRequestPb struct { + Budget CreateBudgetConfigurationBudget `json:"budget"` +} + +func createBudgetConfigurationRequestFromPb(pb *createBudgetConfigurationRequestPb) (*CreateBudgetConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetConfigurationRequest{} + st.Budget = pb.Budget + + return st, nil +} + +func createBudgetConfigurationResponseToPb(st *CreateBudgetConfigurationResponse) (*createBudgetConfigurationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetConfigurationResponsePb{} + pb.Budget = st.Budget + + return pb, nil +} + +type createBudgetConfigurationResponsePb struct { + Budget *BudgetConfiguration `json:"budget,omitempty"` +} + +func createBudgetConfigurationResponseFromPb(pb *createBudgetConfigurationResponsePb) (*CreateBudgetConfigurationResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetConfigurationResponse{} + st.Budget = pb.Budget + + return st, nil +} + +func createBudgetPolicyRequestToPb(st *CreateBudgetPolicyRequest) (*createBudgetPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createBudgetPolicyRequestPb{} + pb.Policy = st.Policy + + pb.RequestId = st.RequestId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createBudgetPolicyRequestPb struct { + Policy *BudgetPolicy `json:"policy,omitempty"` + + RequestId string `json:"request_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createBudgetPolicyRequestFromPb(pb *createBudgetPolicyRequestPb) (*CreateBudgetPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateBudgetPolicyRequest{} + st.Policy = pb.Policy + st.RequestId = pb.RequestId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createBudgetPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createBudgetPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createLogDeliveryConfigurationParamsToPb(st *CreateLogDeliveryConfigurationParams) (*createLogDeliveryConfigurationParamsPb, error) { + if st == nil { + return nil, nil + } + pb := &createLogDeliveryConfigurationParamsPb{} + pb.ConfigName = st.ConfigName + + pb.CredentialsId = st.CredentialsId + + pb.DeliveryPathPrefix = st.DeliveryPathPrefix + + pb.DeliveryStartTime = st.DeliveryStartTime + + pb.LogType = st.LogType + + pb.OutputFormat = st.OutputFormat + + pb.Status = st.Status + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.WorkspaceIdsFilter = st.WorkspaceIdsFilter + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createLogDeliveryConfigurationParamsPb struct { + ConfigName string `json:"config_name,omitempty"` + + CredentialsId string `json:"credentials_id"` + + DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + + DeliveryStartTime string `json:"delivery_start_time,omitempty"` + + LogType LogType `json:"log_type"` + + OutputFormat OutputFormat `json:"output_format"` + + Status LogDeliveryConfigStatus `json:"status,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id"` + + WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createLogDeliveryConfigurationParamsFromPb(pb *createLogDeliveryConfigurationParamsPb) (*CreateLogDeliveryConfigurationParams, error) { + if pb == nil { + return nil, nil + } + st := &CreateLogDeliveryConfigurationParams{} + st.ConfigName = pb.ConfigName + st.CredentialsId = pb.CredentialsId + st.DeliveryPathPrefix = pb.DeliveryPathPrefix + st.DeliveryStartTime = pb.DeliveryStartTime + st.LogType = pb.LogType + st.OutputFormat = pb.OutputFormat + st.Status = pb.Status + st.StorageConfigurationId = pb.StorageConfigurationId + st.WorkspaceIdsFilter = pb.WorkspaceIdsFilter + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createLogDeliveryConfigurationParamsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createLogDeliveryConfigurationParamsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteBudgetConfigurationRequestToPb(st *DeleteBudgetConfigurationRequest) (*deleteBudgetConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteBudgetConfigurationRequestPb{} + pb.BudgetId = st.BudgetId + + return pb, nil +} + +type deleteBudgetConfigurationRequestPb struct { + BudgetId string `json:"-" url:"-"` +} + +func deleteBudgetConfigurationRequestFromPb(pb *deleteBudgetConfigurationRequestPb) (*DeleteBudgetConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteBudgetConfigurationRequest{} + st.BudgetId = pb.BudgetId + + return st, nil +} + +func deleteBudgetConfigurationResponseToPb(st *DeleteBudgetConfigurationResponse) (*deleteBudgetConfigurationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteBudgetConfigurationResponsePb{} + + return pb, nil +} + +type deleteBudgetConfigurationResponsePb struct { +} + +func deleteBudgetConfigurationResponseFromPb(pb *deleteBudgetConfigurationResponsePb) (*DeleteBudgetConfigurationResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteBudgetConfigurationResponse{} + + return st, nil +} + +func deleteBudgetPolicyRequestToPb(st *DeleteBudgetPolicyRequest) (*deleteBudgetPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteBudgetPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type deleteBudgetPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` +} + +func deleteBudgetPolicyRequestFromPb(pb *deleteBudgetPolicyRequestPb) (*DeleteBudgetPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteBudgetPolicyRequest{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func downloadRequestToPb(st *DownloadRequest) (*downloadRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &downloadRequestPb{} + pb.EndMonth = st.EndMonth + + pb.PersonalData = st.PersonalData + + pb.StartMonth = st.StartMonth + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type downloadRequestPb struct { + EndMonth string `json:"-" url:"end_month"` + + PersonalData bool `json:"-" url:"personal_data,omitempty"` + + StartMonth string `json:"-" url:"start_month"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func downloadRequestFromPb(pb *downloadRequestPb) (*DownloadRequest, error) { + if pb == nil { + return nil, nil + } + st := &DownloadRequest{} + st.EndMonth = pb.EndMonth + st.PersonalData = pb.PersonalData + st.StartMonth = pb.StartMonth + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *downloadRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st downloadRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func downloadResponseToPb(st *DownloadResponse) (*downloadResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &downloadResponsePb{} + pb.Contents = st.Contents + + return pb, nil +} + +type downloadResponsePb struct { + Contents io.ReadCloser `json:"-"` +} + +func downloadResponseFromPb(pb *downloadResponsePb) (*DownloadResponse, error) { + if pb == nil { + return nil, nil + } + st := &DownloadResponse{} + st.Contents = pb.Contents + + return st, nil +} + +func filterToPb(st *Filter) (*filterPb, error) { + if st == nil { + return nil, nil + } + pb := &filterPb{} + pb.CreatorUserId = st.CreatorUserId + + pb.CreatorUserName = st.CreatorUserName + + pb.PolicyName = st.PolicyName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type filterPb struct { + CreatorUserId int64 `json:"creator_user_id,omitempty" url:"creator_user_id,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty" url:"creator_user_name,omitempty"` + + PolicyName string `json:"policy_name,omitempty" url:"policy_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func filterFromPb(pb *filterPb) (*Filter, error) { + if pb == nil { + return nil, nil + } + st := &Filter{} + st.CreatorUserId = pb.CreatorUserId + st.CreatorUserName = pb.CreatorUserName + st.PolicyName = pb.PolicyName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *filterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st filterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getBillingUsageDashboardRequestToPb(st *GetBillingUsageDashboardRequest) (*getBillingUsageDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getBillingUsageDashboardRequestPb{} + pb.DashboardType = st.DashboardType + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getBillingUsageDashboardRequestPb struct { + DashboardType UsageDashboardType `json:"-" url:"dashboard_type,omitempty"` + + WorkspaceId int64 `json:"-" url:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getBillingUsageDashboardRequestFromPb(pb *getBillingUsageDashboardRequestPb) (*GetBillingUsageDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetBillingUsageDashboardRequest{} + st.DashboardType = pb.DashboardType + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getBillingUsageDashboardRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getBillingUsageDashboardRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getBillingUsageDashboardResponseToPb(st *GetBillingUsageDashboardResponse) (*getBillingUsageDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getBillingUsageDashboardResponsePb{} + pb.DashboardId = st.DashboardId + + pb.DashboardUrl = st.DashboardUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getBillingUsageDashboardResponsePb struct { + DashboardId string `json:"dashboard_id,omitempty"` + + DashboardUrl string `json:"dashboard_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getBillingUsageDashboardResponseFromPb(pb *getBillingUsageDashboardResponsePb) (*GetBillingUsageDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetBillingUsageDashboardResponse{} + st.DashboardId = pb.DashboardId + st.DashboardUrl = pb.DashboardUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getBillingUsageDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getBillingUsageDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getBudgetConfigurationRequestToPb(st *GetBudgetConfigurationRequest) (*getBudgetConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getBudgetConfigurationRequestPb{} + pb.BudgetId = st.BudgetId + + return pb, nil +} + +type getBudgetConfigurationRequestPb struct { + BudgetId string `json:"-" url:"-"` +} + +func getBudgetConfigurationRequestFromPb(pb *getBudgetConfigurationRequestPb) (*GetBudgetConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetBudgetConfigurationRequest{} + st.BudgetId = pb.BudgetId + + return st, nil +} + +func getBudgetConfigurationResponseToPb(st *GetBudgetConfigurationResponse) (*getBudgetConfigurationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getBudgetConfigurationResponsePb{} + pb.Budget = st.Budget + + return pb, nil +} + +type getBudgetConfigurationResponsePb struct { + Budget *BudgetConfiguration `json:"budget,omitempty"` +} + +func getBudgetConfigurationResponseFromPb(pb *getBudgetConfigurationResponsePb) (*GetBudgetConfigurationResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetBudgetConfigurationResponse{} + st.Budget = pb.Budget + + return st, nil +} + +func getBudgetPolicyRequestToPb(st *GetBudgetPolicyRequest) (*getBudgetPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getBudgetPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type getBudgetPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` +} + +func getBudgetPolicyRequestFromPb(pb *getBudgetPolicyRequestPb) (*GetBudgetPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetBudgetPolicyRequest{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func getLogDeliveryRequestToPb(st *GetLogDeliveryRequest) (*getLogDeliveryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLogDeliveryRequestPb{} + pb.LogDeliveryConfigurationId = st.LogDeliveryConfigurationId + + return pb, nil +} + +type getLogDeliveryRequestPb struct { + LogDeliveryConfigurationId string `json:"-" url:"-"` +} + +func getLogDeliveryRequestFromPb(pb *getLogDeliveryRequestPb) (*GetLogDeliveryRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLogDeliveryRequest{} + st.LogDeliveryConfigurationId = pb.LogDeliveryConfigurationId + + return st, nil +} + +func limitConfigToPb(st *LimitConfig) (*limitConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &limitConfigPb{} + + return pb, nil +} + +type limitConfigPb struct { +} + +func limitConfigFromPb(pb *limitConfigPb) (*LimitConfig, error) { + if pb == nil { + return nil, nil + } + st := &LimitConfig{} + + return st, nil +} + +func listBudgetConfigurationsRequestToPb(st *ListBudgetConfigurationsRequest) (*listBudgetConfigurationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listBudgetConfigurationsRequestPb{} + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listBudgetConfigurationsRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listBudgetConfigurationsRequestFromPb(pb *listBudgetConfigurationsRequestPb) (*ListBudgetConfigurationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListBudgetConfigurationsRequest{} + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listBudgetConfigurationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listBudgetConfigurationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listBudgetConfigurationsResponseToPb(st *ListBudgetConfigurationsResponse) (*listBudgetConfigurationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listBudgetConfigurationsResponsePb{} + pb.Budgets = st.Budgets + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listBudgetConfigurationsResponsePb struct { + Budgets []BudgetConfiguration `json:"budgets,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listBudgetConfigurationsResponseFromPb(pb *listBudgetConfigurationsResponsePb) (*ListBudgetConfigurationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListBudgetConfigurationsResponse{} + st.Budgets = pb.Budgets + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listBudgetConfigurationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listBudgetConfigurationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listBudgetPoliciesRequestToPb(st *ListBudgetPoliciesRequest) (*listBudgetPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listBudgetPoliciesRequestPb{} + pb.FilterBy = st.FilterBy + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.SortSpec = st.SortSpec + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listBudgetPoliciesRequestPb struct { + FilterBy *Filter `json:"-" url:"filter_by,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SortSpec *SortSpec `json:"-" url:"sort_spec,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listBudgetPoliciesRequestFromPb(pb *listBudgetPoliciesRequestPb) (*ListBudgetPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListBudgetPoliciesRequest{} + st.FilterBy = pb.FilterBy + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.SortSpec = pb.SortSpec + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listBudgetPoliciesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listBudgetPoliciesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listBudgetPoliciesResponseToPb(st *ListBudgetPoliciesResponse) (*listBudgetPoliciesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listBudgetPoliciesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Policies = st.Policies + + pb.PreviousPageToken = st.PreviousPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listBudgetPoliciesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Policies []BudgetPolicy `json:"policies,omitempty"` + + PreviousPageToken string `json:"previous_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listBudgetPoliciesResponseFromPb(pb *listBudgetPoliciesResponsePb) (*ListBudgetPoliciesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListBudgetPoliciesResponse{} + st.NextPageToken = pb.NextPageToken + st.Policies = pb.Policies + st.PreviousPageToken = pb.PreviousPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listBudgetPoliciesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listBudgetPoliciesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listLogDeliveryRequestToPb(st *ListLogDeliveryRequest) (*listLogDeliveryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listLogDeliveryRequestPb{} + pb.CredentialsId = st.CredentialsId + + pb.Status = st.Status + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listLogDeliveryRequestPb struct { + CredentialsId string `json:"-" url:"credentials_id,omitempty"` + + Status LogDeliveryConfigStatus `json:"-" url:"status,omitempty"` + + StorageConfigurationId string `json:"-" url:"storage_configuration_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listLogDeliveryRequestFromPb(pb *listLogDeliveryRequestPb) (*ListLogDeliveryRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListLogDeliveryRequest{} + st.CredentialsId = pb.CredentialsId + st.Status = pb.Status + st.StorageConfigurationId = pb.StorageConfigurationId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listLogDeliveryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listLogDeliveryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logDeliveryConfigurationToPb(st *LogDeliveryConfiguration) (*logDeliveryConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &logDeliveryConfigurationPb{} + pb.AccountId = st.AccountId + + pb.ConfigId = st.ConfigId + + pb.ConfigName = st.ConfigName + + pb.CreationTime = st.CreationTime + + pb.CredentialsId = st.CredentialsId + + pb.DeliveryPathPrefix = st.DeliveryPathPrefix + + pb.DeliveryStartTime = st.DeliveryStartTime + + pb.LogDeliveryStatus = st.LogDeliveryStatus + + pb.LogType = st.LogType + + pb.OutputFormat = st.OutputFormat + + pb.Status = st.Status + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.UpdateTime = st.UpdateTime + + pb.WorkspaceIdsFilter = st.WorkspaceIdsFilter + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logDeliveryConfigurationPb struct { + AccountId string `json:"account_id,omitempty"` + + ConfigId string `json:"config_id,omitempty"` + + ConfigName string `json:"config_name,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + CredentialsId string `json:"credentials_id,omitempty"` + + DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + + DeliveryStartTime string `json:"delivery_start_time,omitempty"` + + LogDeliveryStatus *LogDeliveryStatus `json:"log_delivery_status,omitempty"` + + LogType LogType `json:"log_type,omitempty"` + + OutputFormat OutputFormat `json:"output_format,omitempty"` + + Status LogDeliveryConfigStatus `json:"status,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + + UpdateTime int64 `json:"update_time,omitempty"` + + WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logDeliveryConfigurationFromPb(pb *logDeliveryConfigurationPb) (*LogDeliveryConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &LogDeliveryConfiguration{} + st.AccountId = pb.AccountId + st.ConfigId = pb.ConfigId + st.ConfigName = pb.ConfigName + st.CreationTime = pb.CreationTime + st.CredentialsId = pb.CredentialsId + st.DeliveryPathPrefix = pb.DeliveryPathPrefix + st.DeliveryStartTime = pb.DeliveryStartTime + st.LogDeliveryStatus = pb.LogDeliveryStatus + st.LogType = pb.LogType + st.OutputFormat = pb.OutputFormat + st.Status = pb.Status + st.StorageConfigurationId = pb.StorageConfigurationId + st.UpdateTime = pb.UpdateTime + st.WorkspaceIdsFilter = pb.WorkspaceIdsFilter + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logDeliveryConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logDeliveryConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logDeliveryStatusToPb(st *LogDeliveryStatus) (*logDeliveryStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &logDeliveryStatusPb{} + pb.LastAttemptTime = st.LastAttemptTime + + pb.LastSuccessfulAttemptTime = st.LastSuccessfulAttemptTime + + pb.Message = st.Message + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logDeliveryStatusPb struct { + LastAttemptTime string `json:"last_attempt_time,omitempty"` + + LastSuccessfulAttemptTime string `json:"last_successful_attempt_time,omitempty"` + + Message string `json:"message,omitempty"` + + Status DeliveryStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logDeliveryStatusFromPb(pb *logDeliveryStatusPb) (*LogDeliveryStatus, error) { + if pb == nil { + return nil, nil + } + st := &LogDeliveryStatus{} + st.LastAttemptTime = pb.LastAttemptTime + st.LastSuccessfulAttemptTime = pb.LastSuccessfulAttemptTime + st.Message = pb.Message + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logDeliveryStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logDeliveryStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func patchStatusResponseToPb(st *PatchStatusResponse) (*patchStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &patchStatusResponsePb{} + + return pb, nil +} + +type patchStatusResponsePb struct { +} + +func patchStatusResponseFromPb(pb *patchStatusResponsePb) (*PatchStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &PatchStatusResponse{} + + return st, nil +} + +func sortSpecToPb(st *SortSpec) (*sortSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &sortSpecPb{} + pb.Descending = st.Descending + + pb.Field = st.Field + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sortSpecPb struct { + Descending bool `json:"descending,omitempty" url:"descending,omitempty"` + + Field SortSpecField `json:"field,omitempty" url:"field,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sortSpecFromPb(pb *sortSpecPb) (*SortSpec, error) { + if pb == nil { + return nil, nil + } + st := &SortSpec{} + st.Descending = pb.Descending + st.Field = pb.Field + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sortSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sortSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateBudgetConfigurationBudgetToPb(st *UpdateBudgetConfigurationBudget) (*updateBudgetConfigurationBudgetPb, error) { + if st == nil { + return nil, nil + } + pb := &updateBudgetConfigurationBudgetPb{} + pb.AccountId = st.AccountId + + pb.AlertConfigurations = st.AlertConfigurations + + pb.BudgetConfigurationId = st.BudgetConfigurationId + + pb.DisplayName = st.DisplayName + + pb.Filter = st.Filter + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateBudgetConfigurationBudgetPb struct { + AccountId string `json:"account_id,omitempty"` + + AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + + BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateBudgetConfigurationBudgetFromPb(pb *updateBudgetConfigurationBudgetPb) (*UpdateBudgetConfigurationBudget, error) { + if pb == nil { + return nil, nil + } + st := &UpdateBudgetConfigurationBudget{} + st.AccountId = pb.AccountId + st.AlertConfigurations = pb.AlertConfigurations + st.BudgetConfigurationId = pb.BudgetConfigurationId + st.DisplayName = pb.DisplayName + st.Filter = pb.Filter + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateBudgetConfigurationBudgetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateBudgetConfigurationBudgetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateBudgetConfigurationRequestToPb(st *UpdateBudgetConfigurationRequest) (*updateBudgetConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateBudgetConfigurationRequestPb{} + pb.Budget = st.Budget + + pb.BudgetId = st.BudgetId + + return pb, nil +} + +type updateBudgetConfigurationRequestPb struct { + Budget UpdateBudgetConfigurationBudget `json:"budget"` + + BudgetId string `json:"-" url:"-"` +} + +func updateBudgetConfigurationRequestFromPb(pb *updateBudgetConfigurationRequestPb) (*UpdateBudgetConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateBudgetConfigurationRequest{} + st.Budget = pb.Budget + st.BudgetId = pb.BudgetId + + return st, nil +} + +func updateBudgetConfigurationResponseToPb(st *UpdateBudgetConfigurationResponse) (*updateBudgetConfigurationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateBudgetConfigurationResponsePb{} + pb.Budget = st.Budget + + return pb, nil +} + +type updateBudgetConfigurationResponsePb struct { + Budget *BudgetConfiguration `json:"budget,omitempty"` +} + +func updateBudgetConfigurationResponseFromPb(pb *updateBudgetConfigurationResponsePb) (*UpdateBudgetConfigurationResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateBudgetConfigurationResponse{} + st.Budget = pb.Budget + + return st, nil +} + +func updateBudgetPolicyRequestToPb(st *UpdateBudgetPolicyRequest) (*updateBudgetPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateBudgetPolicyRequestPb{} + pb.LimitConfig = st.LimitConfig + + pb.Policy = st.Policy + + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type updateBudgetPolicyRequestPb struct { + LimitConfig *LimitConfig `json:"-" url:"limit_config,omitempty"` + + Policy BudgetPolicy `json:"policy"` + + PolicyId string `json:"-" url:"-"` +} + +func updateBudgetPolicyRequestFromPb(pb *updateBudgetPolicyRequestPb) (*UpdateBudgetPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateBudgetPolicyRequest{} + st.LimitConfig = pb.LimitConfig + st.Policy = pb.Policy + st.PolicyId = pb.PolicyId + + return st, nil +} + +func updateLogDeliveryConfigurationStatusRequestToPb(st *UpdateLogDeliveryConfigurationStatusRequest) (*updateLogDeliveryConfigurationStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateLogDeliveryConfigurationStatusRequestPb{} + pb.LogDeliveryConfigurationId = st.LogDeliveryConfigurationId + + pb.Status = st.Status + + return pb, nil +} + +type updateLogDeliveryConfigurationStatusRequestPb struct { + LogDeliveryConfigurationId string `json:"-" url:"-"` + + Status LogDeliveryConfigStatus `json:"status"` +} + +func updateLogDeliveryConfigurationStatusRequestFromPb(pb *updateLogDeliveryConfigurationStatusRequestPb) (*UpdateLogDeliveryConfigurationStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateLogDeliveryConfigurationStatusRequest{} + st.LogDeliveryConfigurationId = pb.LogDeliveryConfigurationId + st.Status = pb.Status + + return st, nil +} + +func wrappedCreateLogDeliveryConfigurationToPb(st *WrappedCreateLogDeliveryConfiguration) (*wrappedCreateLogDeliveryConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &wrappedCreateLogDeliveryConfigurationPb{} + pb.LogDeliveryConfiguration = st.LogDeliveryConfiguration + + return pb, nil +} + +type wrappedCreateLogDeliveryConfigurationPb struct { + LogDeliveryConfiguration *CreateLogDeliveryConfigurationParams `json:"log_delivery_configuration,omitempty"` +} + +func wrappedCreateLogDeliveryConfigurationFromPb(pb *wrappedCreateLogDeliveryConfigurationPb) (*WrappedCreateLogDeliveryConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &WrappedCreateLogDeliveryConfiguration{} + st.LogDeliveryConfiguration = pb.LogDeliveryConfiguration + + return st, nil +} + +func wrappedLogDeliveryConfigurationToPb(st *WrappedLogDeliveryConfiguration) (*wrappedLogDeliveryConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &wrappedLogDeliveryConfigurationPb{} + pb.LogDeliveryConfiguration = st.LogDeliveryConfiguration + + return pb, nil +} + +type wrappedLogDeliveryConfigurationPb struct { + LogDeliveryConfiguration *LogDeliveryConfiguration `json:"log_delivery_configuration,omitempty"` +} + +func wrappedLogDeliveryConfigurationFromPb(pb *wrappedLogDeliveryConfigurationPb) (*WrappedLogDeliveryConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &WrappedLogDeliveryConfiguration{} + st.LogDeliveryConfiguration = pb.LogDeliveryConfiguration + + return st, nil +} + +func wrappedLogDeliveryConfigurationsToPb(st *WrappedLogDeliveryConfigurations) (*wrappedLogDeliveryConfigurationsPb, error) { + if st == nil { + return nil, nil + } + pb := &wrappedLogDeliveryConfigurationsPb{} + pb.LogDeliveryConfigurations = st.LogDeliveryConfigurations + + return pb, nil +} + +type wrappedLogDeliveryConfigurationsPb struct { + LogDeliveryConfigurations []LogDeliveryConfiguration `json:"log_delivery_configurations,omitempty"` +} + +func wrappedLogDeliveryConfigurationsFromPb(pb *wrappedLogDeliveryConfigurationsPb) (*WrappedLogDeliveryConfigurations, error) { + if pb == nil { + return nil, nil + } + st := &WrappedLogDeliveryConfigurations{} + st.LogDeliveryConfigurations = pb.LogDeliveryConfigurations + + return st, nil +} diff --git a/service/billing/model.go b/service/billing/model.go index 4f2106982..64fda77f6 100644 --- a/service/billing/model.go +++ b/service/billing/model.go @@ -3,33 +3,56 @@ package billing import ( + "encoding/json" "fmt" "io" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" ) type ActionConfiguration struct { // Databricks action configuration ID. - ActionConfigurationId string `json:"action_configuration_id,omitempty"` + // Wire name: 'action_configuration_id' + ActionConfigurationId string // The type of the action. - ActionType ActionConfigurationType `json:"action_type,omitempty"` + // Wire name: 'action_type' + ActionType ActionConfigurationType // Target for the action. For example, an email address. - Target string `json:"target,omitempty"` + // Wire name: 'target' + Target string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ActionConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ActionConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &actionConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := actionConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ActionConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ActionConfiguration) MarshalJSON() ([]byte, error) { + pb, err := actionConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ActionConfigurationType string +type actionConfigurationTypePb string const ActionConfigurationTypeEmailNotification ActionConfigurationType = `EMAIL_NOTIFICATION` @@ -54,36 +77,76 @@ func (f *ActionConfigurationType) Type() string { return "ActionConfigurationType" } +func actionConfigurationTypeToPb(st *ActionConfigurationType) (*actionConfigurationTypePb, error) { + if st == nil { + return nil, nil + } + pb := actionConfigurationTypePb(*st) + return &pb, nil +} + +func actionConfigurationTypeFromPb(pb *actionConfigurationTypePb) (*ActionConfigurationType, error) { + if pb == nil { + return nil, nil + } + st := ActionConfigurationType(*pb) + return &st, nil +} + type AlertConfiguration struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations []ActionConfiguration `json:"action_configurations,omitempty"` + // Wire name: 'action_configurations' + ActionConfigurations []ActionConfiguration // Databricks alert configuration ID. - AlertConfigurationId string `json:"alert_configuration_id,omitempty"` + // Wire name: 'alert_configuration_id' + AlertConfigurationId string // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold string `json:"quantity_threshold,omitempty"` + // Wire name: 'quantity_threshold' + QuantityThreshold string // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + // Wire name: 'quantity_type' + QuantityType AlertConfigurationQuantityType // The time window of usage data for the budget. - TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + // Wire name: 'time_period' + TimePeriod AlertConfigurationTimePeriod // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + // Wire name: 'trigger_type' + TriggerType AlertConfigurationTriggerType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertConfiguration) MarshalJSON() ([]byte, error) { + pb, err := alertConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertConfigurationQuantityType string +type alertConfigurationQuantityTypePb string const AlertConfigurationQuantityTypeListPriceDollarsUsd AlertConfigurationQuantityType = `LIST_PRICE_DOLLARS_USD` @@ -108,7 +171,24 @@ func (f *AlertConfigurationQuantityType) Type() string { return "AlertConfigurationQuantityType" } +func alertConfigurationQuantityTypeToPb(st *AlertConfigurationQuantityType) (*alertConfigurationQuantityTypePb, error) { + if st == nil { + return nil, nil + } + pb := alertConfigurationQuantityTypePb(*st) + return &pb, nil +} + +func alertConfigurationQuantityTypeFromPb(pb *alertConfigurationQuantityTypePb) (*AlertConfigurationQuantityType, error) { + if pb == nil { + return nil, nil + } + st := AlertConfigurationQuantityType(*pb) + return &st, nil +} + type AlertConfigurationTimePeriod string +type alertConfigurationTimePeriodPb string const AlertConfigurationTimePeriodMonth AlertConfigurationTimePeriod = `MONTH` @@ -133,7 +213,24 @@ func (f *AlertConfigurationTimePeriod) Type() string { return "AlertConfigurationTimePeriod" } +func alertConfigurationTimePeriodToPb(st *AlertConfigurationTimePeriod) (*alertConfigurationTimePeriodPb, error) { + if st == nil { + return nil, nil + } + pb := alertConfigurationTimePeriodPb(*st) + return &pb, nil +} + +func alertConfigurationTimePeriodFromPb(pb *alertConfigurationTimePeriodPb) (*AlertConfigurationTimePeriod, error) { + if pb == nil { + return nil, nil + } + st := AlertConfigurationTimePeriod(*pb) + return &st, nil +} + type AlertConfigurationTriggerType string +type alertConfigurationTriggerTypePb string const AlertConfigurationTriggerTypeCumulativeSpendingExceeded AlertConfigurationTriggerType = `CUMULATIVE_SPENDING_EXCEEDED` @@ -158,53 +255,149 @@ func (f *AlertConfigurationTriggerType) Type() string { return "AlertConfigurationTriggerType" } +func alertConfigurationTriggerTypeToPb(st *AlertConfigurationTriggerType) (*alertConfigurationTriggerTypePb, error) { + if st == nil { + return nil, nil + } + pb := alertConfigurationTriggerTypePb(*st) + return &pb, nil +} + +func alertConfigurationTriggerTypeFromPb(pb *alertConfigurationTriggerTypePb) (*AlertConfigurationTriggerType, error) { + if pb == nil { + return nil, nil + } + st := AlertConfigurationTriggerType(*pb) + return &st, nil +} + type BudgetConfiguration struct { // Databricks account ID. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + // Wire name: 'alert_configurations' + AlertConfigurations []AlertConfiguration // Databricks budget configuration ID. - BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + // Wire name: 'budget_configuration_id' + BudgetConfigurationId string // Creation time of this budget configuration. - CreateTime int64 `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime int64 // Human-readable name of budget configuration. Max Length: 128 - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + // Wire name: 'filter' + Filter *BudgetConfigurationFilter // Update time of this budget configuration. - UpdateTime int64 `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BudgetConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BudgetConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BudgetConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BudgetConfiguration) MarshalJSON() ([]byte, error) { + pb, err := budgetConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BudgetConfigurationFilter struct { // A list of tag keys and values that will limit the budget to usage that // includes those specific custom tags. Tags are case-sensitive and should // be entered exactly as they appear in your usage data. - Tags []BudgetConfigurationFilterTagClause `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []BudgetConfigurationFilterTagClause // If provided, usage must match with the provided Databricks workspace IDs. - WorkspaceId *BudgetConfigurationFilterWorkspaceIdClause `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId *BudgetConfigurationFilterWorkspaceIdClause +} + +func (st *BudgetConfigurationFilter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetConfigurationFilterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetConfigurationFilterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BudgetConfigurationFilter) MarshalJSON() ([]byte, error) { + pb, err := budgetConfigurationFilterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BudgetConfigurationFilterClause struct { - Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` - Values []string `json:"values,omitempty"` + // Wire name: 'operator' + Operator BudgetConfigurationFilterOperator + + // Wire name: 'values' + Values []string +} + +func (st *BudgetConfigurationFilterClause) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetConfigurationFilterClausePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetConfigurationFilterClauseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BudgetConfigurationFilterClause) MarshalJSON() ([]byte, error) { + pb, err := budgetConfigurationFilterClauseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BudgetConfigurationFilterOperator string +type budgetConfigurationFilterOperatorPb string const BudgetConfigurationFilterOperatorIn BudgetConfigurationFilterOperator = `IN` @@ -229,26 +422,90 @@ func (f *BudgetConfigurationFilterOperator) Type() string { return "BudgetConfigurationFilterOperator" } +func budgetConfigurationFilterOperatorToPb(st *BudgetConfigurationFilterOperator) (*budgetConfigurationFilterOperatorPb, error) { + if st == nil { + return nil, nil + } + pb := budgetConfigurationFilterOperatorPb(*st) + return &pb, nil +} + +func budgetConfigurationFilterOperatorFromPb(pb *budgetConfigurationFilterOperatorPb) (*BudgetConfigurationFilterOperator, error) { + if pb == nil { + return nil, nil + } + st := BudgetConfigurationFilterOperator(*pb) + return &st, nil +} + type BudgetConfigurationFilterTagClause struct { - Key string `json:"key,omitempty"` - Value *BudgetConfigurationFilterClause `json:"value,omitempty"` + // Wire name: 'key' + Key string + + // Wire name: 'value' + Value *BudgetConfigurationFilterClause - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BudgetConfigurationFilterTagClause) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BudgetConfigurationFilterTagClause) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetConfigurationFilterTagClausePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetConfigurationFilterTagClauseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BudgetConfigurationFilterTagClause) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BudgetConfigurationFilterTagClause) MarshalJSON() ([]byte, error) { + pb, err := budgetConfigurationFilterTagClauseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BudgetConfigurationFilterWorkspaceIdClause struct { - Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` - Values []int64 `json:"values,omitempty"` + // Wire name: 'operator' + Operator BudgetConfigurationFilterOperator + + // Wire name: 'values' + Values []int64 +} + +func (st *BudgetConfigurationFilterWorkspaceIdClause) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetConfigurationFilterWorkspaceIdClausePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetConfigurationFilterWorkspaceIdClauseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BudgetConfigurationFilterWorkspaceIdClause) MarshalJSON() ([]byte, error) { + pb, err := budgetConfigurationFilterWorkspaceIdClauseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Contains the BudgetPolicy details. @@ -256,141 +513,313 @@ type BudgetPolicy struct { // List of workspaces that this budget policy will be exclusively bound to. // An empty binding implies that this budget policy is open to any workspace // in the account. - BindingWorkspaceIds []int64 `json:"binding_workspace_ids,omitempty"` + // Wire name: 'binding_workspace_ids' + BindingWorkspaceIds []int64 // A list of tags defined by the customer. At most 20 entries are allowed // per policy. - CustomTags []compute.CustomPolicyTag `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags []compute.CustomPolicyTag // The Id of the policy. This field is generated by Databricks and globally // unique. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // The name of the policy. - Must be unique among active policies. - Can // contain only characters from the ISO 8859-1 (latin1) set. - Can't start // with reserved keywords such as `databricks:default-policy`. - PolicyName string `json:"policy_name,omitempty"` + // Wire name: 'policy_name' + PolicyName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BudgetPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BudgetPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &budgetPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := budgetPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BudgetPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BudgetPolicy) MarshalJSON() ([]byte, error) { + pb, err := budgetPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBillingUsageDashboardRequest struct { // Workspace level usage dashboard shows usage data for the specified // workspace ID. Global level usage dashboard shows usage data for all // workspaces in the account. - DashboardType UsageDashboardType `json:"dashboard_type,omitempty"` + // Wire name: 'dashboard_type' + DashboardType UsageDashboardType // The workspace ID of the workspace in which the usage dashboard is // created. - WorkspaceId int64 `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBillingUsageDashboardRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBillingUsageDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBillingUsageDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBillingUsageDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := createBillingUsageDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBillingUsageDashboardResponse struct { // The unique id of the usage dashboard. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBillingUsageDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBillingUsageDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBillingUsageDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBillingUsageDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := createBillingUsageDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBudgetConfigurationBudget struct { // Databricks account ID. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations []CreateBudgetConfigurationBudgetAlertConfigurations `json:"alert_configurations,omitempty"` + // Wire name: 'alert_configurations' + AlertConfigurations []CreateBudgetConfigurationBudgetAlertConfigurations // Human-readable name of budget configuration. Max Length: 128 - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + // Wire name: 'filter' + Filter *BudgetConfigurationFilter - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBudgetConfigurationBudget) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBudgetConfigurationBudget) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetConfigurationBudgetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetConfigurationBudgetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { + pb, err := createBudgetConfigurationBudgetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBudgetConfigurationBudgetActionConfigurations struct { // The type of the action. - ActionType ActionConfigurationType `json:"action_type,omitempty"` + // Wire name: 'action_type' + ActionType ActionConfigurationType // Target for the action. For example, an email address. - Target string `json:"target,omitempty"` + // Wire name: 'target' + Target string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBudgetConfigurationBudgetActionConfigurations) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBudgetConfigurationBudgetActionConfigurations) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetConfigurationBudgetActionConfigurationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetConfigurationBudgetActionConfigurationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBudgetConfigurationBudgetActionConfigurations) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBudgetConfigurationBudgetActionConfigurations) MarshalJSON() ([]byte, error) { + pb, err := createBudgetConfigurationBudgetActionConfigurationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBudgetConfigurationBudgetAlertConfigurations struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations []CreateBudgetConfigurationBudgetActionConfigurations `json:"action_configurations,omitempty"` + // Wire name: 'action_configurations' + ActionConfigurations []CreateBudgetConfigurationBudgetActionConfigurations // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold string `json:"quantity_threshold,omitempty"` + // Wire name: 'quantity_threshold' + QuantityThreshold string // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + // Wire name: 'quantity_type' + QuantityType AlertConfigurationQuantityType // The time window of usage data for the budget. - TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + // Wire name: 'time_period' + TimePeriod AlertConfigurationTimePeriod // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + // Wire name: 'trigger_type' + TriggerType AlertConfigurationTriggerType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBudgetConfigurationBudgetAlertConfigurations) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBudgetConfigurationBudgetAlertConfigurations) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetConfigurationBudgetAlertConfigurationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetConfigurationBudgetAlertConfigurationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBudgetConfigurationBudgetAlertConfigurations) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBudgetConfigurationBudgetAlertConfigurations) MarshalJSON() ([]byte, error) { + pb, err := createBudgetConfigurationBudgetAlertConfigurationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBudgetConfigurationRequest struct { // Properties of the new budget configuration. - Budget CreateBudgetConfigurationBudget `json:"budget"` + // Wire name: 'budget' + Budget CreateBudgetConfigurationBudget +} + +func (st *CreateBudgetConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := createBudgetConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateBudgetConfigurationResponse struct { // The created budget configuration. - Budget *BudgetConfiguration `json:"budget,omitempty"` + // Wire name: 'budget' + Budget *BudgetConfiguration +} + +func (st *CreateBudgetConfigurationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetConfigurationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetConfigurationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + pb, err := createBudgetConfigurationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A request to create a BudgetPolicy. @@ -398,43 +827,66 @@ type CreateBudgetPolicyRequest struct { // The policy to create. `policy_id` needs to be empty as it will be // generated `policy_name` must be provided, custom_tags may need to be // provided depending on the cloud provider. All other fields are optional. - Policy *BudgetPolicy `json:"policy,omitempty"` + // Wire name: 'policy' + Policy *BudgetPolicy // A unique identifier for this request. Restricted to 36 ASCII characters. // A random UUID is recommended. This request is only idempotent if a // `request_id` is provided. - RequestId string `json:"request_id,omitempty"` + // Wire name: 'request_id' + RequestId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateBudgetPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateBudgetPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createBudgetPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createBudgetPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateBudgetPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := createBudgetPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateLogDeliveryConfigurationParams struct { // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName string `json:"config_name,omitempty"` + // Wire name: 'config_name' + ConfigName string // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId string `json:"credentials_id"` + // Wire name: 'credentials_id' + CredentialsId string // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + // Wire name: 'delivery_path_prefix' + DeliveryPathPrefix string // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime string `json:"delivery_start_time,omitempty"` + // Wire name: 'delivery_start_time' + DeliveryStartTime string // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -447,7 +899,8 @@ type CreateLogDeliveryConfigurationParams struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType LogType `json:"log_type"` + // Wire name: 'log_type' + LogType LogType // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -458,19 +911,22 @@ type CreateLogDeliveryConfigurationParams struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat OutputFormat `json:"output_format"` + // Wire name: 'output_format' + OutputFormat OutputFormat // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status LogDeliveryConfigStatus `json:"status,omitempty"` + // Wire name: 'status' + Status LogDeliveryConfigStatus // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId string `json:"storage_configuration_id"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -484,37 +940,157 @@ type CreateLogDeliveryConfigurationParams struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + // Wire name: 'workspace_ids_filter' + WorkspaceIdsFilter []int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateLogDeliveryConfigurationParams) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateLogDeliveryConfigurationParams) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createLogDeliveryConfigurationParamsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createLogDeliveryConfigurationParamsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateLogDeliveryConfigurationParams) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateLogDeliveryConfigurationParams) MarshalJSON() ([]byte, error) { + pb, err := createLogDeliveryConfigurationParamsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete budget type DeleteBudgetConfigurationRequest struct { // The Databricks budget configuration ID. - BudgetId string `json:"-" url:"-"` + // Wire name: 'budget_id' + BudgetId string `tf:"-"` +} + +func (st *DeleteBudgetConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteBudgetConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteBudgetConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteBudgetConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteBudgetConfigurationResponse struct { } +func (st *DeleteBudgetConfigurationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteBudgetConfigurationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteBudgetConfigurationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteBudgetConfigurationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a budget policy type DeleteBudgetPolicyRequest struct { // The Id of the policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *DeleteBudgetPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteBudgetPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteBudgetPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteBudgetPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The status string for log delivery. Possible values are: * `CREATED`: There // were no log delivery attempts since the config was created. * `SUCCEEDED`: // The latest attempt of log delivery has succeeded completely. * @@ -525,6 +1101,7 @@ type DeleteResponse struct { // `NOT_FOUND`: The log delivery status as the configuration has been disabled // since the release of this feature or there are no workspaces in the account. type DeliveryStatus string +type deliveryStatusPb string // There were no log delivery attempts since the config was created. const DeliveryStatusCreated DeliveryStatus = `CREATED` @@ -565,32 +1142,95 @@ func (f *DeliveryStatus) Type() string { return "DeliveryStatus" } +func deliveryStatusToPb(st *DeliveryStatus) (*deliveryStatusPb, error) { + if st == nil { + return nil, nil + } + pb := deliveryStatusPb(*st) + return &pb, nil +} + +func deliveryStatusFromPb(pb *deliveryStatusPb) (*DeliveryStatus, error) { + if pb == nil { + return nil, nil + } + st := DeliveryStatus(*pb) + return &st, nil +} + // Return billable usage logs type DownloadRequest struct { // Format: `YYYY-MM`. Last month to return billable usage logs for. This // field is required. - EndMonth string `json:"-" url:"end_month"` + // Wire name: 'end_month' + EndMonth string `tf:"-"` // Specify whether to include personally identifiable information in the // billable usage logs, for example the email addresses of cluster creators. // Handle this information with care. Defaults to false. - PersonalData bool `json:"-" url:"personal_data,omitempty"` + // Wire name: 'personal_data' + PersonalData bool `tf:"-"` // Format: `YYYY-MM`. First month to return billable usage logs for. This // field is required. - StartMonth string `json:"-" url:"start_month"` + // Wire name: 'start_month' + StartMonth string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DownloadRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DownloadRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &downloadRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := downloadRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DownloadRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DownloadRequest) MarshalJSON() ([]byte, error) { + pb, err := downloadRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DownloadResponse struct { - Contents io.ReadCloser `json:"-"` + + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` +} + +func (st *DownloadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &downloadResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := downloadResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DownloadResponse) MarshalJSON() ([]byte, error) { + pb, err := downloadResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Structured representation of a filter to be applied to a list of policies. @@ -598,23 +1238,43 @@ type DownloadResponse struct { type Filter struct { // The policy creator user id to be filtered on. If unspecified, all // policies will be returned. - CreatorUserId int64 `json:"creator_user_id,omitempty" url:"creator_user_id,omitempty"` + // Wire name: 'creator_user_id' + CreatorUserId int64 // The policy creator user name to be filtered on. If unspecified, all // policies will be returned. - CreatorUserName string `json:"creator_user_name,omitempty" url:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // The partial name of policies to be filtered on. If unspecified, all // policies will be returned. - PolicyName string `json:"policy_name,omitempty" url:"policy_name,omitempty"` + // Wire name: 'policy_name' + PolicyName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Filter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Filter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &filterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := filterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Filter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Filter) MarshalJSON() ([]byte, error) { + pb, err := filterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get usage dashboard @@ -622,59 +1282,202 @@ type GetBillingUsageDashboardRequest struct { // Workspace level usage dashboard shows usage data for the specified // workspace ID. Global level usage dashboard shows usage data for all // workspaces in the account. - DashboardType UsageDashboardType `json:"-" url:"dashboard_type,omitempty"` + // Wire name: 'dashboard_type' + DashboardType UsageDashboardType `tf:"-"` // The workspace ID of the workspace in which the usage dashboard is // created. - WorkspaceId int64 `json:"-" url:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetBillingUsageDashboardRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetBillingUsageDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBillingUsageDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBillingUsageDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := getBillingUsageDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetBillingUsageDashboardResponse struct { // The unique id of the usage dashboard. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The URL of the usage dashboard. - DashboardUrl string `json:"dashboard_url,omitempty"` + // Wire name: 'dashboard_url' + DashboardUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetBillingUsageDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetBillingUsageDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBillingUsageDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBillingUsageDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := getBillingUsageDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get budget type GetBudgetConfigurationRequest struct { // The budget configuration ID - BudgetId string `json:"-" url:"-"` + // Wire name: 'budget_id' + BudgetId string `tf:"-"` +} + +func (st *GetBudgetConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBudgetConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBudgetConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := getBudgetConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetBudgetConfigurationResponse struct { - Budget *BudgetConfiguration `json:"budget,omitempty"` + + // Wire name: 'budget' + Budget *BudgetConfiguration +} + +func (st *GetBudgetConfigurationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBudgetConfigurationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBudgetConfigurationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + pb, err := getBudgetConfigurationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a budget policy type GetBudgetPolicyRequest struct { // The Id of the policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *GetBudgetPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBudgetPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBudgetPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getBudgetPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get log delivery configuration type GetLogDeliveryRequest struct { // Databricks log delivery configuration ID - LogDeliveryConfigurationId string `json:"-" url:"-"` + // Wire name: 'log_delivery_configuration_id' + LogDeliveryConfigurationId string `tf:"-"` +} + +func (st *GetLogDeliveryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLogDeliveryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLogDeliveryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetLogDeliveryRequest) MarshalJSON() ([]byte, error) { + pb, err := getLogDeliveryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The limit configuration of the policy. Limit configuration provide a budget @@ -682,49 +1485,114 @@ type GetLogDeliveryRequest struct { type LimitConfig struct { } +func (st *LimitConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &limitConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := limitConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LimitConfig) MarshalJSON() ([]byte, error) { + pb, err := limitConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get all budgets type ListBudgetConfigurationsRequest struct { // A page token received from a previous get all budget configurations call. // This token can be used to retrieve the subsequent page. Requests first // page if absent. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListBudgetConfigurationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListBudgetConfigurationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listBudgetConfigurationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listBudgetConfigurationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListBudgetConfigurationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListBudgetConfigurationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listBudgetConfigurationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListBudgetConfigurationsResponse struct { - Budgets []BudgetConfiguration `json:"budgets,omitempty"` + + // Wire name: 'budgets' + Budgets []BudgetConfiguration // Token which can be sent as `page_token` to retrieve the next page of // results. If this field is omitted, there are no subsequent budgets. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListBudgetConfigurationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListBudgetConfigurationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listBudgetConfigurationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listBudgetConfigurationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListBudgetConfigurationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListBudgetConfigurationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listBudgetConfigurationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List policies type ListBudgetPoliciesRequest struct { // A filter to apply to the list of policies. - FilterBy *Filter `json:"-" url:"filter_by,omitempty"` + // Wire name: 'filter_by' + FilterBy *Filter `tf:"-"` // The maximum number of budget policies to return. If unspecified, at most // 100 budget policies will be returned. The maximum value is 1000; values // above 1000 will be coerced to 1000. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token, received from a previous `ListServerlessPolicies` call. // Provide this to retrieve the subsequent page. If unspecified, the first // page will be returned. @@ -732,61 +1600,120 @@ type ListBudgetPoliciesRequest struct { // When paginating, all other parameters provided to // `ListServerlessPoliciesRequest` must match the call that provided the // page token. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The sort specification. - SortSpec *SortSpec `json:"-" url:"sort_spec,omitempty"` + // Wire name: 'sort_spec' + SortSpec *SortSpec `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListBudgetPoliciesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListBudgetPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listBudgetPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listBudgetPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListBudgetPoliciesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListBudgetPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listBudgetPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A list of policies. type ListBudgetPoliciesResponse struct { // A token that can be sent as `page_token` to retrieve the next page. If // this field is omitted, there are no subsequent pages. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - Policies []BudgetPolicy `json:"policies,omitempty"` + // Wire name: 'policies' + Policies []BudgetPolicy // A token that can be sent as `page_token` to retrieve the previous page. // In this field is omitted, there are no previous pages. - PreviousPageToken string `json:"previous_page_token,omitempty"` + // Wire name: 'previous_page_token' + PreviousPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListBudgetPoliciesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListBudgetPoliciesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listBudgetPoliciesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listBudgetPoliciesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListBudgetPoliciesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListBudgetPoliciesResponse) MarshalJSON() ([]byte, error) { + pb, err := listBudgetPoliciesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get all log delivery configurations type ListLogDeliveryRequest struct { // Filter by credential configuration ID. - CredentialsId string `json:"-" url:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string `tf:"-"` // Filter by status `ENABLED` or `DISABLED`. - Status LogDeliveryConfigStatus `json:"-" url:"status,omitempty"` + // Wire name: 'status' + Status LogDeliveryConfigStatus `tf:"-"` // Filter by storage configuration ID. - StorageConfigurationId string `json:"-" url:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListLogDeliveryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListLogDeliveryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listLogDeliveryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listLogDeliveryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListLogDeliveryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListLogDeliveryRequest) MarshalJSON() ([]byte, error) { + pb, err := listLogDeliveryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Status of log delivery configuration. Set to `ENABLED` (enabled) or @@ -795,6 +1722,7 @@ func (s ListLogDeliveryRequest) MarshalJSON() ([]byte, error) { // of a configuration is not supported, so disable a log delivery configuration // that is no longer needed. type LogDeliveryConfigStatus string +type logDeliveryConfigStatusPb string const LogDeliveryConfigStatusDisabled LogDeliveryConfigStatus = `DISABLED` @@ -821,35 +1749,59 @@ func (f *LogDeliveryConfigStatus) Type() string { return "LogDeliveryConfigStatus" } +func logDeliveryConfigStatusToPb(st *LogDeliveryConfigStatus) (*logDeliveryConfigStatusPb, error) { + if st == nil { + return nil, nil + } + pb := logDeliveryConfigStatusPb(*st) + return &pb, nil +} + +func logDeliveryConfigStatusFromPb(pb *logDeliveryConfigStatusPb) (*LogDeliveryConfigStatus, error) { + if pb == nil { + return nil, nil + } + st := LogDeliveryConfigStatus(*pb) + return &st, nil +} + type LogDeliveryConfiguration struct { // The Databricks account ID that hosts the log delivery configuration. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Databricks log delivery configuration ID. - ConfigId string `json:"config_id,omitempty"` + // Wire name: 'config_id' + ConfigId string // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName string `json:"config_name,omitempty"` + // Wire name: 'config_name' + ConfigName string // Time in epoch milliseconds when the log delivery configuration was // created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId string `json:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + // Wire name: 'delivery_path_prefix' + DeliveryPathPrefix string // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime string `json:"delivery_start_time,omitempty"` + // Wire name: 'delivery_start_time' + DeliveryStartTime string // Databricks log delivery status. - LogDeliveryStatus *LogDeliveryStatus `json:"log_delivery_status,omitempty"` + // Wire name: 'log_delivery_status' + LogDeliveryStatus *LogDeliveryStatus // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -862,7 +1814,8 @@ type LogDeliveryConfiguration struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType LogType `json:"log_type,omitempty"` + // Wire name: 'log_type' + LogType LogType // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -873,22 +1826,26 @@ type LogDeliveryConfiguration struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat OutputFormat `json:"output_format,omitempty"` + // Wire name: 'output_format' + OutputFormat OutputFormat // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status LogDeliveryConfigStatus `json:"status,omitempty"` + // Wire name: 'status' + Status LogDeliveryConfigStatus // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // Time in epoch milliseconds when the log delivery configuration was // updated. - UpdateTime int64 `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime int64 // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -902,29 +1859,50 @@ type LogDeliveryConfiguration struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + // Wire name: 'workspace_ids_filter' + WorkspaceIdsFilter []int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogDeliveryConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogDeliveryConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logDeliveryConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logDeliveryConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogDeliveryConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogDeliveryConfiguration) MarshalJSON() ([]byte, error) { + pb, err := logDeliveryConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Databricks log delivery status. type LogDeliveryStatus struct { // The UTC time for the latest log delivery attempt. - LastAttemptTime string `json:"last_attempt_time,omitempty"` + // Wire name: 'last_attempt_time' + LastAttemptTime string // The UTC time for the latest successful log delivery. - LastSuccessfulAttemptTime string `json:"last_successful_attempt_time,omitempty"` + // Wire name: 'last_successful_attempt_time' + LastSuccessfulAttemptTime string // Informative message about the latest log delivery attempt. If the log // delivery fails with USER_FAILURE, error details will be provided for // fixing misconfigurations in cloud permissions. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // The status string for log delivery. Possible values are: * `CREATED`: // There were no log delivery attempts since the config was created. * // `SUCCEEDED`: The latest attempt of log delivery has succeeded completely. @@ -935,17 +1913,35 @@ type LogDeliveryStatus struct { // `NOT_FOUND`: The log delivery status as the configuration has been // disabled since the release of this feature or there are no workspaces in // the account. - Status DeliveryStatus `json:"status,omitempty"` + // Wire name: 'status' + Status DeliveryStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogDeliveryStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogDeliveryStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logDeliveryStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logDeliveryStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogDeliveryStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogDeliveryStatus) MarshalJSON() ([]byte, error) { + pb, err := logDeliveryStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Log delivery type. Supported values are: @@ -961,6 +1957,7 @@ func (s LogDeliveryStatus) MarshalJSON() ([]byte, error) { // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html type LogType string +type logTypePb string const LogTypeAuditLogs LogType = `AUDIT_LOGS` @@ -987,6 +1984,22 @@ func (f *LogType) Type() string { return "LogType" } +func logTypeToPb(st *LogType) (*logTypePb, error) { + if st == nil { + return nil, nil + } + pb := logTypePb(*st) + return &pb, nil +} + +func logTypeFromPb(pb *logTypePb) (*LogType, error) { + if pb == nil { + return nil, nil + } + st := LogType(*pb) + return &st, nil +} + // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV @@ -998,6 +2011,7 @@ func (f *LogType) Type() string { // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html type OutputFormat string +type outputFormatPb string const OutputFormatCsv OutputFormat = `CSV` @@ -1024,27 +2038,88 @@ func (f *OutputFormat) Type() string { return "OutputFormat" } +func outputFormatToPb(st *OutputFormat) (*outputFormatPb, error) { + if st == nil { + return nil, nil + } + pb := outputFormatPb(*st) + return &pb, nil +} + +func outputFormatFromPb(pb *outputFormatPb) (*OutputFormat, error) { + if pb == nil { + return nil, nil + } + st := OutputFormat(*pb) + return &st, nil +} + type PatchStatusResponse struct { } +func (st *PatchStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PatchStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := patchStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SortSpec struct { // Whether to sort in descending order. - Descending bool `json:"descending,omitempty" url:"descending,omitempty"` + // Wire name: 'descending' + Descending bool // The filed to sort by - Field SortSpecField `json:"field,omitempty" url:"field,omitempty"` + // Wire name: 'field' + Field SortSpecField - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SortSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SortSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sortSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sortSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SortSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SortSpec) MarshalJSON() ([]byte, error) { + pb, err := sortSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SortSpecField string +type sortSpecFieldPb string const SortSpecFieldPolicyName SortSpecField = `POLICY_NAME` @@ -1069,70 +2144,217 @@ func (f *SortSpecField) Type() string { return "SortSpecField" } +func sortSpecFieldToPb(st *SortSpecField) (*sortSpecFieldPb, error) { + if st == nil { + return nil, nil + } + pb := sortSpecFieldPb(*st) + return &pb, nil +} + +func sortSpecFieldFromPb(pb *sortSpecFieldPb) (*SortSpecField, error) { + if pb == nil { + return nil, nil + } + st := SortSpecField(*pb) + return &st, nil +} + type UpdateBudgetConfigurationBudget struct { // Databricks account ID. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + // Wire name: 'alert_configurations' + AlertConfigurations []AlertConfiguration // Databricks budget configuration ID. - BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + // Wire name: 'budget_configuration_id' + BudgetConfigurationId string // Human-readable name of budget configuration. Max Length: 128 - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + // Wire name: 'filter' + Filter *BudgetConfigurationFilter - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateBudgetConfigurationBudget) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateBudgetConfigurationBudget) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateBudgetConfigurationBudgetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateBudgetConfigurationBudgetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { + pb, err := updateBudgetConfigurationBudgetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateBudgetConfigurationRequest struct { // The updated budget. This will overwrite the budget specified by the // budget ID. - Budget UpdateBudgetConfigurationBudget `json:"budget"` + // Wire name: 'budget' + Budget UpdateBudgetConfigurationBudget // The Databricks budget configuration ID. - BudgetId string `json:"-" url:"-"` + // Wire name: 'budget_id' + BudgetId string `tf:"-"` +} + +func (st *UpdateBudgetConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateBudgetConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateBudgetConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := updateBudgetConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateBudgetConfigurationResponse struct { // The updated budget. - Budget *BudgetConfiguration `json:"budget,omitempty"` + // Wire name: 'budget' + Budget *BudgetConfiguration +} + +func (st *UpdateBudgetConfigurationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateBudgetConfigurationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateBudgetConfigurationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + pb, err := updateBudgetConfigurationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update a budget policy type UpdateBudgetPolicyRequest struct { // DEPRECATED. This is redundant field as LimitConfig is part of the // BudgetPolicy - LimitConfig *LimitConfig `json:"-" url:"limit_config,omitempty"` + // Wire name: 'limit_config' + LimitConfig *LimitConfig `tf:"-"` // Contains the BudgetPolicy details. - Policy BudgetPolicy `json:"policy"` + // Wire name: 'policy' + Policy BudgetPolicy // The Id of the policy. This field is generated by Databricks and globally // unique. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *UpdateBudgetPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateBudgetPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateBudgetPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := updateBudgetPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateLogDeliveryConfigurationStatusRequest struct { // Databricks log delivery configuration ID - LogDeliveryConfigurationId string `json:"-" url:"-"` + // Wire name: 'log_delivery_configuration_id' + LogDeliveryConfigurationId string `tf:"-"` // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status LogDeliveryConfigStatus `json:"status"` + // Wire name: 'status' + Status LogDeliveryConfigStatus +} + +func (st *UpdateLogDeliveryConfigurationStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateLogDeliveryConfigurationStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateLogDeliveryConfigurationStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateLogDeliveryConfigurationStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := updateLogDeliveryConfigurationStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UsageDashboardType string +type usageDashboardTypePb string const UsageDashboardTypeUsageDashboardTypeGlobal UsageDashboardType = `USAGE_DASHBOARD_TYPE_GLOBAL` @@ -1159,14 +2381,165 @@ func (f *UsageDashboardType) Type() string { return "UsageDashboardType" } +func usageDashboardTypeToPb(st *UsageDashboardType) (*usageDashboardTypePb, error) { + if st == nil { + return nil, nil + } + pb := usageDashboardTypePb(*st) + return &pb, nil +} + +func usageDashboardTypeFromPb(pb *usageDashboardTypePb) (*UsageDashboardType, error) { + if pb == nil { + return nil, nil + } + st := UsageDashboardType(*pb) + return &st, nil +} + type WrappedCreateLogDeliveryConfiguration struct { - LogDeliveryConfiguration *CreateLogDeliveryConfigurationParams `json:"log_delivery_configuration,omitempty"` + + // Wire name: 'log_delivery_configuration' + LogDeliveryConfiguration *CreateLogDeliveryConfigurationParams +} + +func (st *WrappedCreateLogDeliveryConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &wrappedCreateLogDeliveryConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := wrappedCreateLogDeliveryConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WrappedCreateLogDeliveryConfiguration) MarshalJSON() ([]byte, error) { + pb, err := wrappedCreateLogDeliveryConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WrappedLogDeliveryConfiguration struct { - LogDeliveryConfiguration *LogDeliveryConfiguration `json:"log_delivery_configuration,omitempty"` + + // Wire name: 'log_delivery_configuration' + LogDeliveryConfiguration *LogDeliveryConfiguration +} + +func (st *WrappedLogDeliveryConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &wrappedLogDeliveryConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := wrappedLogDeliveryConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WrappedLogDeliveryConfiguration) MarshalJSON() ([]byte, error) { + pb, err := wrappedLogDeliveryConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WrappedLogDeliveryConfigurations struct { - LogDeliveryConfigurations []LogDeliveryConfiguration `json:"log_delivery_configurations,omitempty"` + + // Wire name: 'log_delivery_configurations' + LogDeliveryConfigurations []LogDeliveryConfiguration +} + +func (st *WrappedLogDeliveryConfigurations) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &wrappedLogDeliveryConfigurationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := wrappedLogDeliveryConfigurationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WrappedLogDeliveryConfigurations) MarshalJSON() ([]byte, error) { + pb, err := wrappedLogDeliveryConfigurationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/catalog/api.go b/service/catalog/api.go index 14781b987..8f28d3626 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -744,6 +744,9 @@ type DatabaseInstancesInterface interface { // Create a Database Instance. CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) + // Create a Database Table. + CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) + // Create a Synced Database Table. CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) @@ -759,15 +762,27 @@ type DatabaseInstancesInterface interface { // Delete a Database Instance. DeleteDatabaseInstanceByName(ctx context.Context, name string) error + // Delete a Database Table. + DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error + + // Delete a Database Table. + DeleteDatabaseTableByName(ctx context.Context, name string) error + // Delete a Synced Database Table. DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error // Delete a Synced Database Table. DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) + // Generates a credential that can be used to access database instances. + GenerateDatabaseCredential(ctx context.Context, request GenerateDatabaseCredentialRequest) (*DatabaseCredential, error) + // Get a Database Catalog. GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) @@ -780,6 +795,12 @@ type DatabaseInstancesInterface interface { // Get a Database Instance. GetDatabaseInstanceByName(ctx context.Context, name string) (*DatabaseInstance, error) + // Get a Database Table. + GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) + + // Get a Database Table. + GetDatabaseTableByName(ctx context.Context, name string) (*DatabaseTable, error) + // Get a Synced Database Table. GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) @@ -827,6 +848,13 @@ func (a *DatabaseInstancesAPI) DeleteDatabaseInstanceByName(ctx context.Context, }) } +// Delete a Database Table. +func (a *DatabaseInstancesAPI) DeleteDatabaseTableByName(ctx context.Context, name string) error { + return a.databaseInstancesImpl.DeleteDatabaseTable(ctx, DeleteDatabaseTableRequest{ + Name: name, + }) +} + // Delete a Synced Database Table. func (a *DatabaseInstancesAPI) DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error { return a.databaseInstancesImpl.DeleteSyncedDatabaseTable(ctx, DeleteSyncedDatabaseTableRequest{ @@ -848,6 +876,13 @@ func (a *DatabaseInstancesAPI) GetDatabaseInstanceByName(ctx context.Context, na }) } +// Get a Database Table. +func (a *DatabaseInstancesAPI) GetDatabaseTableByName(ctx context.Context, name string) (*DatabaseTable, error) { + return a.databaseInstancesImpl.GetDatabaseTable(ctx, GetDatabaseTableRequest{ + Name: name, + }) +} + // Get a Synced Database Table. func (a *DatabaseInstancesAPI) GetSyncedDatabaseTableByName(ctx context.Context, name string) (*SyncedDatabaseTable, error) { return a.databaseInstancesImpl.GetSyncedDatabaseTable(ctx, GetSyncedDatabaseTableRequest{ diff --git a/service/catalog/impl.go b/service/catalog/impl.go index 45e0ccb51..3d10df2b9 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -18,34 +18,92 @@ type accountMetastoreAssignmentsImpl struct { } func (a *accountMetastoreAssignmentsImpl) Create(ctx context.Context, request AccountsCreateMetastoreAssignment) error { - var createResponse CreateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + + requestPb, pbErr := accountsCreateMetastoreAssignmentToPb(&request) + if pbErr != nil { + return pbErr + } + + var createResponsePb createResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId, requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountMetastoreAssignmentsImpl) Delete(ctx context.Context, request DeleteAccountMetastoreAssignmentRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + + requestPb, pbErr := deleteAccountMetastoreAssignmentRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId, requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountMetastoreAssignmentsImpl) Get(ctx context.Context, request GetAccountMetastoreAssignmentRequest) (*AccountsMetastoreAssignment, error) { - var accountsMetastoreAssignment AccountsMetastoreAssignment - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastore", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := getAccountMetastoreAssignmentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsMetastoreAssignmentPb accountsMetastoreAssignmentPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastore", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsMetastoreAssignment) - return &accountsMetastoreAssignment, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &accountsMetastoreAssignmentPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsMetastoreAssignmentFromPb(&accountsMetastoreAssignmentPb) + if err != nil { + return nil, err + } + + return resp, err } // Get all workspaces assigned to a metastore. @@ -80,23 +138,63 @@ func (a *accountMetastoreAssignmentsImpl) ListAll(ctx context.Context, request L } func (a *accountMetastoreAssignmentsImpl) internalList(ctx context.Context, request ListAccountMetastoreAssignmentsRequest) (*ListAccountMetastoreAssignmentsResponse, error) { - var listAccountMetastoreAssignmentsResponse ListAccountMetastoreAssignmentsResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/workspaces", a.client.ConfiguredAccountID(), request.MetastoreId) + + requestPb, pbErr := listAccountMetastoreAssignmentsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAccountMetastoreAssignmentsResponsePb listAccountMetastoreAssignmentsResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/workspaces", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAccountMetastoreAssignmentsResponse) - return &listAccountMetastoreAssignmentsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAccountMetastoreAssignmentsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAccountMetastoreAssignmentsResponseFromPb(&listAccountMetastoreAssignmentsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountMetastoreAssignmentsImpl) Update(ctx context.Context, request AccountsUpdateMetastoreAssignment) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + + requestPb, pbErr := accountsUpdateMetastoreAssignmentToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId, requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -106,34 +204,96 @@ type accountMetastoresImpl struct { } func (a *accountMetastoresImpl) Create(ctx context.Context, request AccountsCreateMetastore) (*AccountsMetastoreInfo, error) { - var accountsMetastoreInfo AccountsMetastoreInfo + + requestPb, pbErr := accountsCreateMetastoreToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsMetastoreInfoPb accountsMetastoreInfoPb path := fmt.Sprintf("/api/2.0/accounts/%v/metastores", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &accountsMetastoreInfo) - return &accountsMetastoreInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &accountsMetastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsMetastoreInfoFromPb(&accountsMetastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountMetastoresImpl) Delete(ctx context.Context, request DeleteAccountMetastoreRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + + requestPb, pbErr := deleteAccountMetastoreRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountMetastoresImpl) Get(ctx context.Context, request GetAccountMetastoreRequest) (*AccountsMetastoreInfo, error) { - var accountsMetastoreInfo AccountsMetastoreInfo - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + + requestPb, pbErr := getAccountMetastoreRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsMetastoreInfoPb accountsMetastoreInfoPb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsMetastoreInfo) - return &accountsMetastoreInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &accountsMetastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsMetastoreInfoFromPb(&accountsMetastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // Get all metastores associated with an account. @@ -167,24 +327,63 @@ func (a *accountMetastoresImpl) ListAll(ctx context.Context) ([]MetastoreInfo, e } func (a *accountMetastoresImpl) internalList(ctx context.Context) (*ListMetastoresResponse, error) { - var listMetastoresResponse ListMetastoresResponse + + var listMetastoresResponsePb listMetastoresResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/metastores", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listMetastoresResponse) - return &listMetastoresResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listMetastoresResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listMetastoresResponseFromPb(&listMetastoresResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountMetastoresImpl) Update(ctx context.Context, request AccountsUpdateMetastore) (*AccountsMetastoreInfo, error) { - var accountsMetastoreInfo AccountsMetastoreInfo - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + + requestPb, pbErr := accountsUpdateMetastoreToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsMetastoreInfoPb accountsMetastoreInfoPb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &accountsMetastoreInfo) - return &accountsMetastoreInfo, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &accountsMetastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsMetastoreInfoFromPb(&accountsMetastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AccountStorageCredentials API methods @@ -193,34 +392,96 @@ type accountStorageCredentialsImpl struct { } func (a *accountStorageCredentialsImpl) Create(ctx context.Context, request AccountsCreateStorageCredential) (*AccountsStorageCredentialInfo, error) { - var accountsStorageCredentialInfo AccountsStorageCredentialInfo - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), request.MetastoreId) + + requestPb, pbErr := accountsCreateStorageCredentialToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsStorageCredentialInfoPb accountsStorageCredentialInfoPb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &accountsStorageCredentialInfo) - return &accountsStorageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &accountsStorageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsStorageCredentialInfoFromPb(&accountsStorageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountStorageCredentialsImpl) Delete(ctx context.Context, request DeleteAccountStorageCredentialRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + + requestPb, pbErr := deleteAccountStorageCredentialRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId, requestPb.StorageCredentialName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountStorageCredentialsImpl) Get(ctx context.Context, request GetAccountStorageCredentialRequest) (*AccountsStorageCredentialInfo, error) { - var accountsStorageCredentialInfo AccountsStorageCredentialInfo - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + + requestPb, pbErr := getAccountStorageCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsStorageCredentialInfoPb accountsStorageCredentialInfoPb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId, requestPb.StorageCredentialName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsStorageCredentialInfo) - return &accountsStorageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &accountsStorageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsStorageCredentialInfoFromPb(&accountsStorageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // Get all storage credentials assigned to a metastore. @@ -255,24 +516,68 @@ func (a *accountStorageCredentialsImpl) ListAll(ctx context.Context, request Lis } func (a *accountStorageCredentialsImpl) internalList(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) + + requestPb, pbErr := listAccountStorageCredentialsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAccountStorageCredentialsResponsePb listAccountStorageCredentialsResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAccountStorageCredentialsResponse) - return &listAccountStorageCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAccountStorageCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAccountStorageCredentialsResponseFromPb(&listAccountStorageCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountStorageCredentialsImpl) Update(ctx context.Context, request AccountsUpdateStorageCredential) (*AccountsStorageCredentialInfo, error) { - var accountsStorageCredentialInfo AccountsStorageCredentialInfo - path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + + requestPb, pbErr := accountsUpdateStorageCredentialToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountsStorageCredentialInfoPb accountsStorageCredentialInfoPb + path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), requestPb.MetastoreId, requestPb.StorageCredentialName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &accountsStorageCredentialInfo) - return &accountsStorageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &accountsStorageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := accountsStorageCredentialInfoFromPb(&accountsStorageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ArtifactAllowlists API methods @@ -281,24 +586,68 @@ type artifactAllowlistsImpl struct { } func (a *artifactAllowlistsImpl) Get(ctx context.Context, request GetArtifactAllowlistRequest) (*ArtifactAllowlistInfo, error) { - var artifactAllowlistInfo ArtifactAllowlistInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", request.ArtifactType) + + requestPb, pbErr := getArtifactAllowlistRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var artifactAllowlistInfoPb artifactAllowlistInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", requestPb.ArtifactType) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &artifactAllowlistInfo) - return &artifactAllowlistInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &artifactAllowlistInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := artifactAllowlistInfoFromPb(&artifactAllowlistInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *artifactAllowlistsImpl) Update(ctx context.Context, request SetArtifactAllowlist) (*ArtifactAllowlistInfo, error) { - var artifactAllowlistInfo ArtifactAllowlistInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", request.ArtifactType) + + requestPb, pbErr := setArtifactAllowlistToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var artifactAllowlistInfoPb artifactAllowlistInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", requestPb.ArtifactType) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &artifactAllowlistInfo) - return &artifactAllowlistInfo, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &artifactAllowlistInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := artifactAllowlistInfoFromPb(&artifactAllowlistInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Catalogs API methods @@ -307,34 +656,96 @@ type catalogsImpl struct { } func (a *catalogsImpl) Create(ctx context.Context, request CreateCatalog) (*CatalogInfo, error) { - var catalogInfo CatalogInfo + + requestPb, pbErr := createCatalogToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var catalogInfoPb catalogInfoPb path := "/api/2.1/unity-catalog/catalogs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &catalogInfo) - return &catalogInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &catalogInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := catalogInfoFromPb(&catalogInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *catalogsImpl) Delete(ctx context.Context, request DeleteCatalogRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + + requestPb, pbErr := deleteCatalogRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *catalogsImpl) Get(ctx context.Context, request GetCatalogRequest) (*CatalogInfo, error) { - var catalogInfo CatalogInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + + requestPb, pbErr := getCatalogRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var catalogInfoPb catalogInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &catalogInfo) - return &catalogInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &catalogInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := catalogInfoFromPb(&catalogInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List catalogs. @@ -381,24 +792,68 @@ func (a *catalogsImpl) ListAll(ctx context.Context, request ListCatalogsRequest) } func (a *catalogsImpl) internalList(ctx context.Context, request ListCatalogsRequest) (*ListCatalogsResponse, error) { - var listCatalogsResponse ListCatalogsResponse + + requestPb, pbErr := listCatalogsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listCatalogsResponsePb listCatalogsResponsePb path := "/api/2.1/unity-catalog/catalogs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCatalogsResponse) - return &listCatalogsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listCatalogsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCatalogsResponseFromPb(&listCatalogsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *catalogsImpl) Update(ctx context.Context, request UpdateCatalog) (*CatalogInfo, error) { - var catalogInfo CatalogInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + + requestPb, pbErr := updateCatalogToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var catalogInfoPb catalogInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &catalogInfo) - return &catalogInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &catalogInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := catalogInfoFromPb(&catalogInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Connections API methods @@ -407,34 +862,96 @@ type connectionsImpl struct { } func (a *connectionsImpl) Create(ctx context.Context, request CreateConnection) (*ConnectionInfo, error) { - var connectionInfo ConnectionInfo + + requestPb, pbErr := createConnectionToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var connectionInfoPb connectionInfoPb path := "/api/2.1/unity-catalog/connections" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &connectionInfo) - return &connectionInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &connectionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := connectionInfoFromPb(&connectionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *connectionsImpl) Delete(ctx context.Context, request DeleteConnectionRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + + requestPb, pbErr := deleteConnectionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *connectionsImpl) Get(ctx context.Context, request GetConnectionRequest) (*ConnectionInfo, error) { - var connectionInfo ConnectionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + + requestPb, pbErr := getConnectionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var connectionInfoPb connectionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &connectionInfo) - return &connectionInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &connectionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := connectionInfoFromPb(&connectionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List connections. @@ -475,24 +992,68 @@ func (a *connectionsImpl) ListAll(ctx context.Context, request ListConnectionsRe } func (a *connectionsImpl) internalList(ctx context.Context, request ListConnectionsRequest) (*ListConnectionsResponse, error) { - var listConnectionsResponse ListConnectionsResponse + + requestPb, pbErr := listConnectionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listConnectionsResponsePb listConnectionsResponsePb path := "/api/2.1/unity-catalog/connections" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listConnectionsResponse) - return &listConnectionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listConnectionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listConnectionsResponseFromPb(&listConnectionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *connectionsImpl) Update(ctx context.Context, request UpdateConnection) (*ConnectionInfo, error) { - var connectionInfo ConnectionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + + requestPb, pbErr := updateConnectionToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var connectionInfoPb connectionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &connectionInfo) - return &connectionInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &connectionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := connectionInfoFromPb(&connectionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Credentials API methods @@ -501,45 +1062,129 @@ type credentialsImpl struct { } func (a *credentialsImpl) CreateCredential(ctx context.Context, request CreateCredentialRequest) (*CredentialInfo, error) { - var credentialInfo CredentialInfo + + requestPb, pbErr := createCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var credentialInfoPb credentialInfoPb path := "/api/2.1/unity-catalog/credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &credentialInfo) - return &credentialInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &credentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := credentialInfoFromPb(&credentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) DeleteCredential(ctx context.Context, request DeleteCredentialRequest) error { - var deleteCredentialResponse DeleteCredentialResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + + requestPb, pbErr := deleteCredentialRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteCredentialResponsePb deleteCredentialResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", requestPb.NameArg) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteCredentialResponsePb, + ) + if err != nil { + return err + } + return err } func (a *credentialsImpl) GenerateTemporaryServiceCredential(ctx context.Context, request GenerateTemporaryServiceCredentialRequest) (*TemporaryCredentials, error) { - var temporaryCredentials TemporaryCredentials + + requestPb, pbErr := generateTemporaryServiceCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var temporaryCredentialsPb temporaryCredentialsPb path := "/api/2.1/unity-catalog/temporary-service-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &temporaryCredentials) - return &temporaryCredentials, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &temporaryCredentialsPb, + ) + if err != nil { + return nil, err + } + resp, err := temporaryCredentialsFromPb(&temporaryCredentialsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) GetCredential(ctx context.Context, request GetCredentialRequest) (*CredentialInfo, error) { - var credentialInfo CredentialInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + + requestPb, pbErr := getCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var credentialInfoPb credentialInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", requestPb.NameArg) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &credentialInfo) - return &credentialInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &credentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := credentialInfoFromPb(&credentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List credentials. @@ -588,35 +1233,101 @@ func (a *credentialsImpl) ListCredentialsAll(ctx context.Context, request ListCr } func (a *credentialsImpl) internalListCredentials(ctx context.Context, request ListCredentialsRequest) (*ListCredentialsResponse, error) { - var listCredentialsResponse ListCredentialsResponse + + requestPb, pbErr := listCredentialsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listCredentialsResponsePb listCredentialsResponsePb path := "/api/2.1/unity-catalog/credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCredentialsResponse) - return &listCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCredentialsResponseFromPb(&listCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) UpdateCredential(ctx context.Context, request UpdateCredentialRequest) (*CredentialInfo, error) { - var credentialInfo CredentialInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + + requestPb, pbErr := updateCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var credentialInfoPb credentialInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", requestPb.NameArg) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &credentialInfo) - return &credentialInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &credentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := credentialInfoFromPb(&credentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) ValidateCredential(ctx context.Context, request ValidateCredentialRequest) (*ValidateCredentialResponse, error) { - var validateCredentialResponse ValidateCredentialResponse + + requestPb, pbErr := validateCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var validateCredentialResponsePb validateCredentialResponsePb path := "/api/2.1/unity-catalog/validate-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &validateCredentialResponse) - return &validateCredentialResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &validateCredentialResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := validateCredentialResponseFromPb(&validateCredentialResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DatabaseInstances API methods @@ -625,106 +1336,473 @@ type databaseInstancesImpl struct { } func (a *databaseInstancesImpl) CreateDatabaseCatalog(ctx context.Context, request CreateDatabaseCatalogRequest) (*DatabaseCatalog, error) { - var databaseCatalog DatabaseCatalog + + requestPb, pbErr := createDatabaseCatalogRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseCatalogPb databaseCatalogPb path := "/api/2.0/database/catalogs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Catalog, &databaseCatalog) - return &databaseCatalog, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Catalog, + &databaseCatalogPb, + ) + if err != nil { + return nil, err + } + resp, err := databaseCatalogFromPb(&databaseCatalogPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *databaseInstancesImpl) CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) { - var databaseInstance DatabaseInstance + + requestPb, pbErr := createDatabaseInstanceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseInstancePb databaseInstancePb path := "/api/2.0/database/instances" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.DatabaseInstance, &databaseInstance) - return &databaseInstance, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).DatabaseInstance, + &databaseInstancePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseInstanceFromPb(&databaseInstancePb) + if err != nil { + return nil, err + } + + return resp, err +} + +func (a *databaseInstancesImpl) CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) { + + requestPb, pbErr := createDatabaseTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseTablePb databaseTablePb + path := "/api/2.0/database/tables" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Table, + &databaseTablePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseTableFromPb(&databaseTablePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *databaseInstancesImpl) CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { - var syncedDatabaseTable SyncedDatabaseTable + + requestPb, pbErr := createSyncedDatabaseTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var syncedDatabaseTablePb syncedDatabaseTablePb path := "/api/2.0/database/synced_tables" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.SyncedTable, &syncedDatabaseTable) - return &syncedDatabaseTable, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).SyncedTable, + &syncedDatabaseTablePb, + ) + if err != nil { + return nil, err + } + resp, err := syncedDatabaseTableFromPb(&syncedDatabaseTablePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *databaseInstancesImpl) DeleteDatabaseCatalog(ctx context.Context, request DeleteDatabaseCatalogRequest) error { - var deleteDatabaseCatalogResponse DeleteDatabaseCatalogResponse - path := fmt.Sprintf("/api/2.0/database/catalogs/%v", request.Name) + + requestPb, pbErr := deleteDatabaseCatalogRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteDatabaseCatalogResponsePb deleteDatabaseCatalogResponsePb + path := fmt.Sprintf("/api/2.0/database/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDatabaseCatalogResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDatabaseCatalogResponsePb, + ) + if err != nil { + return err + } + return err } func (a *databaseInstancesImpl) DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error { - var deleteDatabaseInstanceResponse DeleteDatabaseInstanceResponse - path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) + + requestPb, pbErr := deleteDatabaseInstanceRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteDatabaseInstanceResponsePb deleteDatabaseInstanceResponsePb + path := fmt.Sprintf("/api/2.0/database/instances/%v", requestPb.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDatabaseInstanceResponsePb, + ) + if err != nil { + return err + } + + return err +} + +func (a *databaseInstancesImpl) DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error { + + requestPb, pbErr := deleteDatabaseTableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteDatabaseTableResponsePb deleteDatabaseTableResponsePb + path := fmt.Sprintf("/api/2.0/database/tables/%v", requestPb.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDatabaseTableResponsePb, + ) + if err != nil { + return err + } + + return err +} + +func (a *databaseInstancesImpl) DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error { + + requestPb, pbErr := deleteSyncedDatabaseTableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteSyncedDatabaseTableResponsePb deleteSyncedDatabaseTableResponsePb + path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDatabaseInstanceResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteSyncedDatabaseTableResponsePb, + ) + if err != nil { + return err + } + return err } -func (a *databaseInstancesImpl) DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error { - var deleteSyncedDatabaseTableResponse DeleteSyncedDatabaseTableResponse - path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", request.Name) +func (a *databaseInstancesImpl) FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) { + + requestPb, pbErr := failoverDatabaseInstanceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseInstancePb databaseInstancePb + path := fmt.Sprintf("/api/2.0/database/instances/%v/failover", requestPb.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &databaseInstancePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseInstanceFromPb(&databaseInstancePb) + if err != nil { + return nil, err + } + + return resp, err +} + +func (a *databaseInstancesImpl) FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) { + + requestPb, pbErr := findDatabaseInstanceByUidRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseInstancePb databaseInstancePb + path := "/api/2.0/database/instances:findByUid" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &databaseInstancePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseInstanceFromPb(&databaseInstancePb) + if err != nil { + return nil, err + } + + return resp, err +} + +func (a *databaseInstancesImpl) GenerateDatabaseCredential(ctx context.Context, request GenerateDatabaseCredentialRequest) (*DatabaseCredential, error) { + + requestPb, pbErr := generateDatabaseCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseCredentialPb databaseCredentialPb + path := "/api/2.0/database/credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteSyncedDatabaseTableResponse) - return err + headers["Content-Type"] = "application/json" + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &databaseCredentialPb, + ) + if err != nil { + return nil, err + } + resp, err := databaseCredentialFromPb(&databaseCredentialPb) + if err != nil { + return nil, err + } + + return resp, err } -func (a *databaseInstancesImpl) FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) { - var databaseInstance DatabaseInstance - path := "/api/2.0/database/instances:findByUid" +func (a *databaseInstancesImpl) GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) { + + requestPb, pbErr := getDatabaseCatalogRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseCatalogPb databaseCatalogPb + path := fmt.Sprintf("/api/2.0/database/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &databaseInstance) - return &databaseInstance, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &databaseCatalogPb, + ) + if err != nil { + return nil, err + } + resp, err := databaseCatalogFromPb(&databaseCatalogPb) + if err != nil { + return nil, err + } + + return resp, err } -func (a *databaseInstancesImpl) GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) { - var databaseCatalog DatabaseCatalog - path := fmt.Sprintf("/api/2.0/database/catalogs/%v", request.Name) +func (a *databaseInstancesImpl) GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) { + + requestPb, pbErr := getDatabaseInstanceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseInstancePb databaseInstancePb + path := fmt.Sprintf("/api/2.0/database/instances/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &databaseCatalog) - return &databaseCatalog, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &databaseInstancePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseInstanceFromPb(&databaseInstancePb) + if err != nil { + return nil, err + } + + return resp, err } -func (a *databaseInstancesImpl) GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) { - var databaseInstance DatabaseInstance - path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) +func (a *databaseInstancesImpl) GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) { + + requestPb, pbErr := getDatabaseTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseTablePb databaseTablePb + path := fmt.Sprintf("/api/2.0/database/tables/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &databaseInstance) - return &databaseInstance, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &databaseTablePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseTableFromPb(&databaseTablePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *databaseInstancesImpl) GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { - var syncedDatabaseTable SyncedDatabaseTable - path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", request.Name) + + requestPb, pbErr := getSyncedDatabaseTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var syncedDatabaseTablePb syncedDatabaseTablePb + path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &syncedDatabaseTable) - return &syncedDatabaseTable, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &syncedDatabaseTablePb, + ) + if err != nil { + return nil, err + } + resp, err := syncedDatabaseTableFromPb(&syncedDatabaseTablePb) + if err != nil { + return nil, err + } + + return resp, err } // List Database Instances. @@ -759,27 +1837,71 @@ func (a *databaseInstancesImpl) ListDatabaseInstancesAll(ctx context.Context, re } func (a *databaseInstancesImpl) internalListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) { - var listDatabaseInstancesResponse ListDatabaseInstancesResponse + + requestPb, pbErr := listDatabaseInstancesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listDatabaseInstancesResponsePb listDatabaseInstancesResponsePb path := "/api/2.0/database/instances" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDatabaseInstancesResponse) - return &listDatabaseInstancesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listDatabaseInstancesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listDatabaseInstancesResponseFromPb(&listDatabaseInstancesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *databaseInstancesImpl) UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) { - var databaseInstance DatabaseInstance - path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) + + requestPb, pbErr := updateDatabaseInstanceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var databaseInstancePb databaseInstancePb + path := fmt.Sprintf("/api/2.0/database/instances/%v", requestPb.Name) queryParams := make(map[string]any) - if request.UpdateMask != "" { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.DatabaseInstance, &databaseInstance) - return &databaseInstance, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).DatabaseInstance, + &databaseInstancePb, + ) + if err != nil { + return nil, err + } + resp, err := databaseInstanceFromPb(&databaseInstancePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ExternalLocations API methods @@ -788,34 +1910,96 @@ type externalLocationsImpl struct { } func (a *externalLocationsImpl) Create(ctx context.Context, request CreateExternalLocation) (*ExternalLocationInfo, error) { - var externalLocationInfo ExternalLocationInfo + + requestPb, pbErr := createExternalLocationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var externalLocationInfoPb externalLocationInfoPb path := "/api/2.1/unity-catalog/external-locations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &externalLocationInfo) - return &externalLocationInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &externalLocationInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := externalLocationInfoFromPb(&externalLocationInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *externalLocationsImpl) Delete(ctx context.Context, request DeleteExternalLocationRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + + requestPb, pbErr := deleteExternalLocationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *externalLocationsImpl) Get(ctx context.Context, request GetExternalLocationRequest) (*ExternalLocationInfo, error) { - var externalLocationInfo ExternalLocationInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + + requestPb, pbErr := getExternalLocationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var externalLocationInfoPb externalLocationInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &externalLocationInfo) - return &externalLocationInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &externalLocationInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := externalLocationInfoFromPb(&externalLocationInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List external locations. @@ -862,24 +2046,68 @@ func (a *externalLocationsImpl) ListAll(ctx context.Context, request ListExterna } func (a *externalLocationsImpl) internalList(ctx context.Context, request ListExternalLocationsRequest) (*ListExternalLocationsResponse, error) { - var listExternalLocationsResponse ListExternalLocationsResponse + + requestPb, pbErr := listExternalLocationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listExternalLocationsResponsePb listExternalLocationsResponsePb path := "/api/2.1/unity-catalog/external-locations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExternalLocationsResponse) - return &listExternalLocationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listExternalLocationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listExternalLocationsResponseFromPb(&listExternalLocationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *externalLocationsImpl) Update(ctx context.Context, request UpdateExternalLocation) (*ExternalLocationInfo, error) { - var externalLocationInfo ExternalLocationInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + + requestPb, pbErr := updateExternalLocationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var externalLocationInfoPb externalLocationInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &externalLocationInfo) - return &externalLocationInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &externalLocationInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := externalLocationInfoFromPb(&externalLocationInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Functions API methods @@ -888,34 +2116,96 @@ type functionsImpl struct { } func (a *functionsImpl) Create(ctx context.Context, request CreateFunctionRequest) (*FunctionInfo, error) { - var functionInfo FunctionInfo + + requestPb, pbErr := createFunctionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var functionInfoPb functionInfoPb path := "/api/2.1/unity-catalog/functions" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &functionInfo) - return &functionInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &functionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := functionInfoFromPb(&functionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *functionsImpl) Delete(ctx context.Context, request DeleteFunctionRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + + requestPb, pbErr := deleteFunctionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *functionsImpl) Get(ctx context.Context, request GetFunctionRequest) (*FunctionInfo, error) { - var functionInfo FunctionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + + requestPb, pbErr := getFunctionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var functionInfoPb functionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &functionInfo) - return &functionInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &functionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := functionInfoFromPb(&functionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List functions. @@ -966,24 +2256,68 @@ func (a *functionsImpl) ListAll(ctx context.Context, request ListFunctionsReques } func (a *functionsImpl) internalList(ctx context.Context, request ListFunctionsRequest) (*ListFunctionsResponse, error) { - var listFunctionsResponse ListFunctionsResponse + + requestPb, pbErr := listFunctionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFunctionsResponsePb listFunctionsResponsePb path := "/api/2.1/unity-catalog/functions" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFunctionsResponse) - return &listFunctionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFunctionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFunctionsResponseFromPb(&listFunctionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *functionsImpl) Update(ctx context.Context, request UpdateFunction) (*FunctionInfo, error) { - var functionInfo FunctionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + + requestPb, pbErr := updateFunctionToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var functionInfoPb functionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &functionInfo) - return &functionInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &functionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := functionInfoFromPb(&functionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Grants API methods @@ -992,34 +2326,100 @@ type grantsImpl struct { } func (a *grantsImpl) Get(ctx context.Context, request GetGrantRequest) (*PermissionsList, error) { - var permissionsList PermissionsList - path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", request.SecurableType, request.FullName) + + requestPb, pbErr := getGrantRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var permissionsListPb permissionsListPb + path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", requestPb.SecurableType, requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &permissionsList) - return &permissionsList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &permissionsListPb, + ) + if err != nil { + return nil, err + } + resp, err := permissionsListFromPb(&permissionsListPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *grantsImpl) GetEffective(ctx context.Context, request GetEffectiveRequest) (*EffectivePermissionsList, error) { - var effectivePermissionsList EffectivePermissionsList - path := fmt.Sprintf("/api/2.1/unity-catalog/effective-permissions/%v/%v", request.SecurableType, request.FullName) + + requestPb, pbErr := getEffectiveRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var effectivePermissionsListPb effectivePermissionsListPb + path := fmt.Sprintf("/api/2.1/unity-catalog/effective-permissions/%v/%v", requestPb.SecurableType, requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &effectivePermissionsList) - return &effectivePermissionsList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &effectivePermissionsListPb, + ) + if err != nil { + return nil, err + } + resp, err := effectivePermissionsListFromPb(&effectivePermissionsListPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *grantsImpl) Update(ctx context.Context, request UpdatePermissions) (*PermissionsList, error) { - var permissionsList PermissionsList - path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", request.SecurableType, request.FullName) + + requestPb, pbErr := updatePermissionsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var permissionsListPb permissionsListPb + path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", requestPb.SecurableType, requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &permissionsList) - return &permissionsList, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &permissionsListPb, + ) + if err != nil { + return nil, err + } + resp, err := permissionsListFromPb(&permissionsListPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Metastores API methods @@ -1028,55 +2428,152 @@ type metastoresImpl struct { } func (a *metastoresImpl) Assign(ctx context.Context, request CreateMetastoreAssignment) error { - var assignResponse AssignResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + + requestPb, pbErr := createMetastoreAssignmentToPb(&request) + if pbErr != nil { + return pbErr + } + + var assignResponsePb assignResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &assignResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &assignResponsePb, + ) + if err != nil { + return err + } + return err } func (a *metastoresImpl) Create(ctx context.Context, request CreateMetastore) (*MetastoreInfo, error) { - var metastoreInfo MetastoreInfo + + requestPb, pbErr := createMetastoreToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var metastoreInfoPb metastoreInfoPb path := "/api/2.1/unity-catalog/metastores" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &metastoreInfo) - return &metastoreInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &metastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := metastoreInfoFromPb(&metastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *metastoresImpl) Current(ctx context.Context) (*MetastoreAssignment, error) { - var metastoreAssignment MetastoreAssignment + + var metastoreAssignmentPb metastoreAssignmentPb path := "/api/2.1/unity-catalog/current-metastore-assignment" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &metastoreAssignment) - return &metastoreAssignment, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &metastoreAssignmentPb, + ) + if err != nil { + return nil, err + } + resp, err := metastoreAssignmentFromPb(&metastoreAssignmentPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *metastoresImpl) Delete(ctx context.Context, request DeleteMetastoreRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + + requestPb, pbErr := deleteMetastoreRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *metastoresImpl) Get(ctx context.Context, request GetMetastoreRequest) (*MetastoreInfo, error) { - var metastoreInfo MetastoreInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + + requestPb, pbErr := getMetastoreRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var metastoreInfoPb metastoreInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &metastoreInfo) - return &metastoreInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &metastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := metastoreInfoFromPb(&metastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List metastores. @@ -1114,54 +2611,146 @@ func (a *metastoresImpl) ListAll(ctx context.Context) ([]MetastoreInfo, error) { } func (a *metastoresImpl) internalList(ctx context.Context) (*ListMetastoresResponse, error) { - var listMetastoresResponse ListMetastoresResponse + + var listMetastoresResponsePb listMetastoresResponsePb path := "/api/2.1/unity-catalog/metastores" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listMetastoresResponse) - return &listMetastoresResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listMetastoresResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listMetastoresResponseFromPb(&listMetastoresResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *metastoresImpl) Summary(ctx context.Context) (*GetMetastoreSummaryResponse, error) { - var getMetastoreSummaryResponse GetMetastoreSummaryResponse + + var getMetastoreSummaryResponsePb getMetastoreSummaryResponsePb path := "/api/2.1/unity-catalog/metastore_summary" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getMetastoreSummaryResponse) - return &getMetastoreSummaryResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getMetastoreSummaryResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getMetastoreSummaryResponseFromPb(&getMetastoreSummaryResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *metastoresImpl) Unassign(ctx context.Context, request UnassignRequest) error { - var unassignResponse UnassignResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + + requestPb, pbErr := unassignRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var unassignResponsePb unassignResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unassignResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &unassignResponsePb, + ) + if err != nil { + return err + } + return err } func (a *metastoresImpl) Update(ctx context.Context, request UpdateMetastore) (*MetastoreInfo, error) { - var metastoreInfo MetastoreInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + + requestPb, pbErr := updateMetastoreToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var metastoreInfoPb metastoreInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &metastoreInfo) - return &metastoreInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &metastoreInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := metastoreInfoFromPb(&metastoreInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *metastoresImpl) UpdateAssignment(ctx context.Context, request UpdateMetastoreAssignment) error { - var updateAssignmentResponse UpdateAssignmentResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + + requestPb, pbErr := updateMetastoreAssignmentToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateAssignmentResponsePb updateAssignmentResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateAssignmentResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateAssignmentResponsePb, + ) + if err != nil { + return err + } + return err } @@ -1171,32 +2760,94 @@ type modelVersionsImpl struct { } func (a *modelVersionsImpl) Delete(ctx context.Context, request DeleteModelVersionRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + + requestPb, pbErr := deleteModelVersionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", requestPb.FullName, requestPb.Version) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelVersionsImpl) Get(ctx context.Context, request GetModelVersionRequest) (*ModelVersionInfo, error) { - var modelVersionInfo ModelVersionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + + requestPb, pbErr := getModelVersionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var modelVersionInfoPb modelVersionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", requestPb.FullName, requestPb.Version) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &modelVersionInfo) - return &modelVersionInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &modelVersionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := modelVersionInfoFromPb(&modelVersionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelVersionsImpl) GetByAlias(ctx context.Context, request GetByAliasRequest) (*ModelVersionInfo, error) { - var modelVersionInfo ModelVersionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + + requestPb, pbErr := getByAliasRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var modelVersionInfoPb modelVersionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", requestPb.FullName, requestPb.Alias) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &modelVersionInfo) - return &modelVersionInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &modelVersionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := modelVersionInfoFromPb(&modelVersionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List Model Versions. @@ -1259,24 +2910,68 @@ func (a *modelVersionsImpl) ListAll(ctx context.Context, request ListModelVersio } func (a *modelVersionsImpl) internalList(ctx context.Context, request ListModelVersionsRequest) (*ListModelVersionsResponse, error) { - var listModelVersionsResponse ListModelVersionsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions", request.FullName) + + requestPb, pbErr := listModelVersionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listModelVersionsResponsePb listModelVersionsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listModelVersionsResponse) - return &listModelVersionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listModelVersionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listModelVersionsResponseFromPb(&listModelVersionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelVersionsImpl) Update(ctx context.Context, request UpdateModelVersionRequest) (*ModelVersionInfo, error) { - var modelVersionInfo ModelVersionInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + + requestPb, pbErr := updateModelVersionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var modelVersionInfoPb modelVersionInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", requestPb.FullName, requestPb.Version) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &modelVersionInfo) - return &modelVersionInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &modelVersionInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := modelVersionInfoFromPb(&modelVersionInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just OnlineTables API methods @@ -1285,34 +2980,96 @@ type onlineTablesImpl struct { } func (a *onlineTablesImpl) Create(ctx context.Context, request CreateOnlineTableRequest) (*OnlineTable, error) { - var onlineTable OnlineTable + + requestPb, pbErr := createOnlineTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var onlineTablePb onlineTablePb path := "/api/2.0/online-tables" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Table, &onlineTable) - return &onlineTable, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Table, + &onlineTablePb, + ) + if err != nil { + return nil, err + } + resp, err := onlineTableFromPb(&onlineTablePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *onlineTablesImpl) Delete(ctx context.Context, request DeleteOnlineTableRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/online-tables/%v", request.Name) + + requestPb, pbErr := deleteOnlineTableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/online-tables/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *onlineTablesImpl) Get(ctx context.Context, request GetOnlineTableRequest) (*OnlineTable, error) { - var onlineTable OnlineTable - path := fmt.Sprintf("/api/2.0/online-tables/%v", request.Name) + + requestPb, pbErr := getOnlineTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var onlineTablePb onlineTablePb + path := fmt.Sprintf("/api/2.0/online-tables/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &onlineTable) - return &onlineTable, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &onlineTablePb, + ) + if err != nil { + return nil, err + } + resp, err := onlineTableFromPb(&onlineTablePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QualityMonitors API methods @@ -1321,94 +3078,284 @@ type qualityMonitorsImpl struct { } func (a *qualityMonitorsImpl) CancelRefresh(ctx context.Context, request CancelRefreshRequest) error { - var cancelRefreshResponse CancelRefreshResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.TableName, request.RefreshId) + + requestPb, pbErr := cancelRefreshRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var cancelRefreshResponsePb cancelRefreshResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", requestPb.TableName, requestPb.RefreshId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelRefreshResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &cancelRefreshResponsePb, + ) + if err != nil { + return err + } + return err } func (a *qualityMonitorsImpl) Create(ctx context.Context, request CreateMonitor) (*MonitorInfo, error) { - var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + + requestPb, pbErr := createMonitorToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorInfoPb monitorInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &monitorInfo) - return &monitorInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &monitorInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := monitorInfoFromPb(&monitorInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) Delete(ctx context.Context, request DeleteQualityMonitorRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + + requestPb, pbErr := deleteQualityMonitorRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *qualityMonitorsImpl) Get(ctx context.Context, request GetQualityMonitorRequest) (*MonitorInfo, error) { - var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + + requestPb, pbErr := getQualityMonitorRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorInfoPb monitorInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorInfo) - return &monitorInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &monitorInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := monitorInfoFromPb(&monitorInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) GetRefresh(ctx context.Context, request GetRefreshRequest) (*MonitorRefreshInfo, error) { - var monitorRefreshInfo MonitorRefreshInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v", request.TableName, request.RefreshId) + + requestPb, pbErr := getRefreshRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorRefreshInfoPb monitorRefreshInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v", requestPb.TableName, requestPb.RefreshId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorRefreshInfo) - return &monitorRefreshInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &monitorRefreshInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := monitorRefreshInfoFromPb(&monitorRefreshInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) ListRefreshes(ctx context.Context, request ListRefreshesRequest) (*MonitorRefreshListResponse, error) { - var monitorRefreshListResponse MonitorRefreshListResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) + + requestPb, pbErr := listRefreshesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorRefreshListResponsePb monitorRefreshListResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorRefreshListResponse) - return &monitorRefreshListResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &monitorRefreshListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := monitorRefreshListResponseFromPb(&monitorRefreshListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) RegenerateDashboard(ctx context.Context, request RegenerateDashboardRequest) (*RegenerateDashboardResponse, error) { - var regenerateDashboardResponse RegenerateDashboardResponse - path := fmt.Sprintf("/api/2.1/quality-monitoring/tables/%v/monitor/dashboard", request.TableName) + + requestPb, pbErr := regenerateDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var regenerateDashboardResponsePb regenerateDashboardResponsePb + path := fmt.Sprintf("/api/2.1/quality-monitoring/tables/%v/monitor/dashboard", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ®enerateDashboardResponse) - return ®enerateDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + ®enerateDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := regenerateDashboardResponseFromPb(®enerateDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) RunRefresh(ctx context.Context, request RunRefreshRequest) (*MonitorRefreshInfo, error) { - var monitorRefreshInfo MonitorRefreshInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) + + requestPb, pbErr := runRefreshRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorRefreshInfoPb monitorRefreshInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &monitorRefreshInfo) - return &monitorRefreshInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &monitorRefreshInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := monitorRefreshInfoFromPb(&monitorRefreshInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *qualityMonitorsImpl) Update(ctx context.Context, request UpdateMonitor) (*MonitorInfo, error) { - var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + + requestPb, pbErr := updateMonitorToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var monitorInfoPb monitorInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", requestPb.TableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &monitorInfo) - return &monitorInfo, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &monitorInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := monitorInfoFromPb(&monitorInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just RegisteredModels API methods @@ -1417,42 +3364,122 @@ type registeredModelsImpl struct { } func (a *registeredModelsImpl) Create(ctx context.Context, request CreateRegisteredModelRequest) (*RegisteredModelInfo, error) { - var registeredModelInfo RegisteredModelInfo + + requestPb, pbErr := createRegisteredModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelInfoPb registeredModelInfoPb path := "/api/2.1/unity-catalog/models" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ®isteredModelInfo) - return ®isteredModelInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelInfoFromPb(®isteredModelInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *registeredModelsImpl) Delete(ctx context.Context, request DeleteRegisteredModelRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + + requestPb, pbErr := deleteRegisteredModelRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *registeredModelsImpl) DeleteAlias(ctx context.Context, request DeleteAliasRequest) error { - var deleteAliasResponse DeleteAliasResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + + requestPb, pbErr := deleteAliasRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteAliasResponsePb deleteAliasResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", requestPb.FullName, requestPb.Alias) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAliasResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteAliasResponsePb, + ) + if err != nil { + return err + } + return err } func (a *registeredModelsImpl) Get(ctx context.Context, request GetRegisteredModelRequest) (*RegisteredModelInfo, error) { - var registeredModelInfo RegisteredModelInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + + requestPb, pbErr := getRegisteredModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelInfoPb registeredModelInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ®isteredModelInfo) - return ®isteredModelInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelInfoFromPb(®isteredModelInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List Registered Models. @@ -1513,35 +3540,101 @@ func (a *registeredModelsImpl) ListAll(ctx context.Context, request ListRegister } func (a *registeredModelsImpl) internalList(ctx context.Context, request ListRegisteredModelsRequest) (*ListRegisteredModelsResponse, error) { - var listRegisteredModelsResponse ListRegisteredModelsResponse + + requestPb, pbErr := listRegisteredModelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listRegisteredModelsResponsePb listRegisteredModelsResponsePb path := "/api/2.1/unity-catalog/models" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRegisteredModelsResponse) - return &listRegisteredModelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listRegisteredModelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listRegisteredModelsResponseFromPb(&listRegisteredModelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *registeredModelsImpl) SetAlias(ctx context.Context, request SetRegisteredModelAliasRequest) (*RegisteredModelAlias, error) { - var registeredModelAlias RegisteredModelAlias - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + + requestPb, pbErr := setRegisteredModelAliasRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelAliasPb registeredModelAliasPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", requestPb.FullName, requestPb.Alias) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, ®isteredModelAlias) - return ®isteredModelAlias, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelAliasPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelAliasFromPb(®isteredModelAliasPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *registeredModelsImpl) Update(ctx context.Context, request UpdateRegisteredModelRequest) (*RegisteredModelInfo, error) { - var registeredModelInfo RegisteredModelInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + + requestPb, pbErr := updateRegisteredModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelInfoPb registeredModelInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ®isteredModelInfo) - return ®isteredModelInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelInfoFromPb(®isteredModelInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ResourceQuotas API methods @@ -1550,13 +3643,35 @@ type resourceQuotasImpl struct { } func (a *resourceQuotasImpl) GetQuota(ctx context.Context, request GetQuotaRequest) (*GetQuotaResponse, error) { - var getQuotaResponse GetQuotaResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/resource-quotas/%v/%v/%v", request.ParentSecurableType, request.ParentFullName, request.QuotaName) + + requestPb, pbErr := getQuotaRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getQuotaResponsePb getQuotaResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/resource-quotas/%v/%v/%v", requestPb.ParentSecurableType, requestPb.ParentFullName, requestPb.QuotaName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getQuotaResponse) - return &getQuotaResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getQuotaResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getQuotaResponseFromPb(&getQuotaResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List all resource quotas under a metastore. @@ -1599,13 +3714,35 @@ func (a *resourceQuotasImpl) ListQuotasAll(ctx context.Context, request ListQuot } func (a *resourceQuotasImpl) internalListQuotas(ctx context.Context, request ListQuotasRequest) (*ListQuotasResponse, error) { - var listQuotasResponse ListQuotasResponse + + requestPb, pbErr := listQuotasRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listQuotasResponsePb listQuotasResponsePb path := "/api/2.1/unity-catalog/resource-quotas/all-resource-quotas" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQuotasResponse) - return &listQuotasResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listQuotasResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listQuotasResponseFromPb(&listQuotasResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Schemas API methods @@ -1614,34 +3751,96 @@ type schemasImpl struct { } func (a *schemasImpl) Create(ctx context.Context, request CreateSchema) (*SchemaInfo, error) { - var schemaInfo SchemaInfo + + requestPb, pbErr := createSchemaToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schemaInfoPb schemaInfoPb path := "/api/2.1/unity-catalog/schemas" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &schemaInfo) - return &schemaInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &schemaInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := schemaInfoFromPb(&schemaInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *schemasImpl) Delete(ctx context.Context, request DeleteSchemaRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + + requestPb, pbErr := deleteSchemaRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *schemasImpl) Get(ctx context.Context, request GetSchemaRequest) (*SchemaInfo, error) { - var schemaInfo SchemaInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + + requestPb, pbErr := getSchemaRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schemaInfoPb schemaInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &schemaInfo) - return &schemaInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &schemaInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := schemaInfoFromPb(&schemaInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List schemas. @@ -1690,24 +3889,68 @@ func (a *schemasImpl) ListAll(ctx context.Context, request ListSchemasRequest) ( } func (a *schemasImpl) internalList(ctx context.Context, request ListSchemasRequest) (*ListSchemasResponse, error) { - var listSchemasResponse ListSchemasResponse + + requestPb, pbErr := listSchemasRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSchemasResponsePb listSchemasResponsePb path := "/api/2.1/unity-catalog/schemas" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSchemasResponse) - return &listSchemasResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSchemasResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSchemasResponseFromPb(&listSchemasResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *schemasImpl) Update(ctx context.Context, request UpdateSchema) (*SchemaInfo, error) { - var schemaInfo SchemaInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + + requestPb, pbErr := updateSchemaToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schemaInfoPb schemaInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &schemaInfo) - return &schemaInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &schemaInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := schemaInfoFromPb(&schemaInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just StorageCredentials API methods @@ -1716,34 +3959,96 @@ type storageCredentialsImpl struct { } func (a *storageCredentialsImpl) Create(ctx context.Context, request CreateStorageCredential) (*StorageCredentialInfo, error) { - var storageCredentialInfo StorageCredentialInfo + + requestPb, pbErr := createStorageCredentialToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var storageCredentialInfoPb storageCredentialInfoPb path := "/api/2.1/unity-catalog/storage-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &storageCredentialInfo) - return &storageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &storageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := storageCredentialInfoFromPb(&storageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *storageCredentialsImpl) Delete(ctx context.Context, request DeleteStorageCredentialRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + + requestPb, pbErr := deleteStorageCredentialRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *storageCredentialsImpl) Get(ctx context.Context, request GetStorageCredentialRequest) (*StorageCredentialInfo, error) { - var storageCredentialInfo StorageCredentialInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + + requestPb, pbErr := getStorageCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var storageCredentialInfoPb storageCredentialInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &storageCredentialInfo) - return &storageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &storageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := storageCredentialInfoFromPb(&storageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List credentials. @@ -1792,35 +4097,101 @@ func (a *storageCredentialsImpl) ListAll(ctx context.Context, request ListStorag } func (a *storageCredentialsImpl) internalList(ctx context.Context, request ListStorageCredentialsRequest) (*ListStorageCredentialsResponse, error) { - var listStorageCredentialsResponse ListStorageCredentialsResponse + + requestPb, pbErr := listStorageCredentialsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listStorageCredentialsResponsePb listStorageCredentialsResponsePb path := "/api/2.1/unity-catalog/storage-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listStorageCredentialsResponse) - return &listStorageCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listStorageCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listStorageCredentialsResponseFromPb(&listStorageCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *storageCredentialsImpl) Update(ctx context.Context, request UpdateStorageCredential) (*StorageCredentialInfo, error) { - var storageCredentialInfo StorageCredentialInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + + requestPb, pbErr := updateStorageCredentialToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var storageCredentialInfoPb storageCredentialInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &storageCredentialInfo) - return &storageCredentialInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &storageCredentialInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := storageCredentialInfoFromPb(&storageCredentialInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *storageCredentialsImpl) Validate(ctx context.Context, request ValidateStorageCredential) (*ValidateStorageCredentialResponse, error) { - var validateStorageCredentialResponse ValidateStorageCredentialResponse + + requestPb, pbErr := validateStorageCredentialToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var validateStorageCredentialResponsePb validateStorageCredentialResponsePb path := "/api/2.1/unity-catalog/validate-storage-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &validateStorageCredentialResponse) - return &validateStorageCredentialResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &validateStorageCredentialResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := validateStorageCredentialResponseFromPb(&validateStorageCredentialResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just SystemSchemas API methods @@ -1829,23 +4200,59 @@ type systemSchemasImpl struct { } func (a *systemSchemasImpl) Disable(ctx context.Context, request DisableRequest) error { - var disableResponse DisableResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) + + requestPb, pbErr := disableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var disableResponsePb disableResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", requestPb.MetastoreId, requestPb.SchemaName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &disableResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &disableResponsePb, + ) + if err != nil { + return err + } + return err } func (a *systemSchemasImpl) Enable(ctx context.Context, request EnableRequest) error { - var enableResponse EnableResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) + + requestPb, pbErr := enableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var enableResponsePb enableResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", requestPb.MetastoreId, requestPb.SchemaName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &enableResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &enableResponsePb, + ) + if err != nil { + return err + } + return err } @@ -1887,13 +4294,35 @@ func (a *systemSchemasImpl) ListAll(ctx context.Context, request ListSystemSchem } func (a *systemSchemasImpl) internalList(ctx context.Context, request ListSystemSchemasRequest) (*ListSystemSchemasResponse, error) { - var listSystemSchemasResponse ListSystemSchemasResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas", request.MetastoreId) + + requestPb, pbErr := listSystemSchemasRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSystemSchemasResponsePb listSystemSchemasResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas", requestPb.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSystemSchemasResponse) - return &listSystemSchemasResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSystemSchemasResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSystemSchemasResponseFromPb(&listSystemSchemasResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just TableConstraints API methods @@ -1902,23 +4331,63 @@ type tableConstraintsImpl struct { } func (a *tableConstraintsImpl) Create(ctx context.Context, request CreateTableConstraint) (*TableConstraint, error) { - var tableConstraint TableConstraint + + requestPb, pbErr := createTableConstraintToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var tableConstraintPb tableConstraintPb path := "/api/2.1/unity-catalog/constraints" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &tableConstraint) - return &tableConstraint, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &tableConstraintPb, + ) + if err != nil { + return nil, err + } + resp, err := tableConstraintFromPb(&tableConstraintPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tableConstraintsImpl) Delete(ctx context.Context, request DeleteTableConstraintRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/constraints/%v", request.FullName) + + requestPb, pbErr := deleteTableConstraintRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/constraints/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } @@ -1928,33 +4397,95 @@ type tablesImpl struct { } func (a *tablesImpl) Delete(ctx context.Context, request DeleteTableRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + + requestPb, pbErr := deleteTableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *tablesImpl) Exists(ctx context.Context, request ExistsRequest) (*TableExistsResponse, error) { - var tableExistsResponse TableExistsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/exists", request.FullName) + + requestPb, pbErr := existsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var tableExistsResponsePb tableExistsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/exists", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &tableExistsResponse) - return &tableExistsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &tableExistsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := tableExistsResponseFromPb(&tableExistsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tablesImpl) Get(ctx context.Context, request GetTableRequest) (*TableInfo, error) { - var tableInfo TableInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + + requestPb, pbErr := getTableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var tableInfoPb tableInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &tableInfo) - return &tableInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &tableInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := tableInfoFromPb(&tableInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List tables. @@ -2005,13 +4536,35 @@ func (a *tablesImpl) ListAll(ctx context.Context, request ListTablesRequest) ([] } func (a *tablesImpl) internalList(ctx context.Context, request ListTablesRequest) (*ListTablesResponse, error) { - var listTablesResponse ListTablesResponse + + requestPb, pbErr := listTablesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listTablesResponsePb listTablesResponsePb path := "/api/2.1/unity-catalog/tables" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTablesResponse) - return &listTablesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listTablesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listTablesResponseFromPb(&listTablesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List table summaries. @@ -2072,23 +4625,63 @@ func (a *tablesImpl) ListSummariesAll(ctx context.Context, request ListSummaries } func (a *tablesImpl) internalListSummaries(ctx context.Context, request ListSummariesRequest) (*ListTableSummariesResponse, error) { - var listTableSummariesResponse ListTableSummariesResponse + + requestPb, pbErr := listSummariesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listTableSummariesResponsePb listTableSummariesResponsePb path := "/api/2.1/unity-catalog/table-summaries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTableSummariesResponse) - return &listTableSummariesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listTableSummariesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listTableSummariesResponseFromPb(&listTableSummariesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tablesImpl) Update(ctx context.Context, request UpdateTableRequest) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + + requestPb, pbErr := updateTableRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", requestPb.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -2098,14 +4691,36 @@ type temporaryTableCredentialsImpl struct { } func (a *temporaryTableCredentialsImpl) GenerateTemporaryTableCredentials(ctx context.Context, request GenerateTemporaryTableCredentialRequest) (*GenerateTemporaryTableCredentialResponse, error) { - var generateTemporaryTableCredentialResponse GenerateTemporaryTableCredentialResponse + + requestPb, pbErr := generateTemporaryTableCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var generateTemporaryTableCredentialResponsePb generateTemporaryTableCredentialResponsePb path := "/api/2.0/unity-catalog/temporary-table-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &generateTemporaryTableCredentialResponse) - return &generateTemporaryTableCredentialResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &generateTemporaryTableCredentialResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := generateTemporaryTableCredentialResponseFromPb(&generateTemporaryTableCredentialResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Volumes API methods @@ -2114,22 +4729,62 @@ type volumesImpl struct { } func (a *volumesImpl) Create(ctx context.Context, request CreateVolumeRequestContent) (*VolumeInfo, error) { - var volumeInfo VolumeInfo + + requestPb, pbErr := createVolumeRequestContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var volumeInfoPb volumeInfoPb path := "/api/2.1/unity-catalog/volumes" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &volumeInfo) - return &volumeInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &volumeInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := volumeInfoFromPb(&volumeInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *volumesImpl) Delete(ctx context.Context, request DeleteVolumeRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + + requestPb, pbErr := deleteVolumeRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } @@ -2189,34 +4844,100 @@ func (a *volumesImpl) ListAll(ctx context.Context, request ListVolumesRequest) ( } func (a *volumesImpl) internalList(ctx context.Context, request ListVolumesRequest) (*ListVolumesResponseContent, error) { - var listVolumesResponseContent ListVolumesResponseContent + + requestPb, pbErr := listVolumesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listVolumesResponseContentPb listVolumesResponseContentPb path := "/api/2.1/unity-catalog/volumes" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVolumesResponseContent) - return &listVolumesResponseContent, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listVolumesResponseContentPb, + ) + if err != nil { + return nil, err + } + resp, err := listVolumesResponseContentFromPb(&listVolumesResponseContentPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *volumesImpl) Read(ctx context.Context, request ReadVolumeRequest) (*VolumeInfo, error) { - var volumeInfo VolumeInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + + requestPb, pbErr := readVolumeRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var volumeInfoPb volumeInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &volumeInfo) - return &volumeInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &volumeInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := volumeInfoFromPb(&volumeInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *volumesImpl) Update(ctx context.Context, request UpdateVolumeRequestContent) (*VolumeInfo, error) { - var volumeInfo VolumeInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + + requestPb, pbErr := updateVolumeRequestContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var volumeInfoPb volumeInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &volumeInfo) - return &volumeInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &volumeInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := volumeInfoFromPb(&volumeInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just WorkspaceBindings API methods @@ -2225,13 +4946,35 @@ type workspaceBindingsImpl struct { } func (a *workspaceBindingsImpl) Get(ctx context.Context, request GetWorkspaceBindingRequest) (*GetCatalogWorkspaceBindingsResponse, error) { - var getCatalogWorkspaceBindingsResponse GetCatalogWorkspaceBindingsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", request.Name) + + requestPb, pbErr := getWorkspaceBindingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCatalogWorkspaceBindingsResponsePb getCatalogWorkspaceBindingsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCatalogWorkspaceBindingsResponse) - return &getCatalogWorkspaceBindingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCatalogWorkspaceBindingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getCatalogWorkspaceBindingsResponseFromPb(&getCatalogWorkspaceBindingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get securable workspace bindings. @@ -2272,33 +5015,99 @@ func (a *workspaceBindingsImpl) GetBindingsAll(ctx context.Context, request GetB } func (a *workspaceBindingsImpl) internalGetBindings(ctx context.Context, request GetBindingsRequest) (*GetWorkspaceBindingsResponse, error) { - var getWorkspaceBindingsResponse GetWorkspaceBindingsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", request.SecurableType, request.SecurableName) + + requestPb, pbErr := getBindingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getWorkspaceBindingsResponsePb getWorkspaceBindingsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", requestPb.SecurableType, requestPb.SecurableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWorkspaceBindingsResponse) - return &getWorkspaceBindingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getWorkspaceBindingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getWorkspaceBindingsResponseFromPb(&getWorkspaceBindingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceBindingsImpl) Update(ctx context.Context, request UpdateWorkspaceBindings) (*UpdateCatalogWorkspaceBindingsResponse, error) { - var updateCatalogWorkspaceBindingsResponse UpdateCatalogWorkspaceBindingsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", request.Name) + + requestPb, pbErr := updateWorkspaceBindingsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateCatalogWorkspaceBindingsResponsePb updateCatalogWorkspaceBindingsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCatalogWorkspaceBindingsResponse) - return &updateCatalogWorkspaceBindingsResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateCatalogWorkspaceBindingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateCatalogWorkspaceBindingsResponseFromPb(&updateCatalogWorkspaceBindingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceBindingsImpl) UpdateBindings(ctx context.Context, request UpdateWorkspaceBindingsParameters) (*UpdateWorkspaceBindingsResponse, error) { - var updateWorkspaceBindingsResponse UpdateWorkspaceBindingsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", request.SecurableType, request.SecurableName) + + requestPb, pbErr := updateWorkspaceBindingsParametersToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateWorkspaceBindingsResponsePb updateWorkspaceBindingsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", requestPb.SecurableType, requestPb.SecurableName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateWorkspaceBindingsResponse) - return &updateWorkspaceBindingsResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateWorkspaceBindingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateWorkspaceBindingsResponseFromPb(&updateWorkspaceBindingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/catalog/interface.go b/service/catalog/interface.go index d0d1b0721..125ea5bcf 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -326,6 +326,9 @@ type DatabaseInstancesService interface { // Create a Database Instance. CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) + // Create a Database Table. + CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) + // Create a Synced Database Table. CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) @@ -335,18 +338,30 @@ type DatabaseInstancesService interface { // Delete a Database Instance. DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error + // Delete a Database Table. + DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error + // Delete a Synced Database Table. DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) + // Generates a credential that can be used to access database instances. + GenerateDatabaseCredential(ctx context.Context, request GenerateDatabaseCredentialRequest) (*DatabaseCredential, error) + // Get a Database Catalog. GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) // Get a Database Instance. GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) + // Get a Database Table. + GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) + // Get a Synced Database Table. GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) diff --git a/service/catalog/internal.go b/service/catalog/internal.go new file mode 100755 index 000000000..a2043c0e5 --- /dev/null +++ b/service/catalog/internal.go @@ -0,0 +1,12299 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package catalog + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func accountsCreateMetastoreToPb(st *AccountsCreateMetastore) (*accountsCreateMetastorePb, error) { + if st == nil { + return nil, nil + } + pb := &accountsCreateMetastorePb{} + pb.MetastoreInfo = st.MetastoreInfo + + return pb, nil +} + +type accountsCreateMetastorePb struct { + MetastoreInfo *CreateMetastore `json:"metastore_info,omitempty"` +} + +func accountsCreateMetastoreFromPb(pb *accountsCreateMetastorePb) (*AccountsCreateMetastore, error) { + if pb == nil { + return nil, nil + } + st := &AccountsCreateMetastore{} + st.MetastoreInfo = pb.MetastoreInfo + + return st, nil +} + +func accountsCreateMetastoreAssignmentToPb(st *AccountsCreateMetastoreAssignment) (*accountsCreateMetastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsCreateMetastoreAssignmentPb{} + pb.MetastoreAssignment = st.MetastoreAssignment + + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type accountsCreateMetastoreAssignmentPb struct { + MetastoreAssignment *CreateMetastoreAssignment `json:"metastore_assignment,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func accountsCreateMetastoreAssignmentFromPb(pb *accountsCreateMetastoreAssignmentPb) (*AccountsCreateMetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &AccountsCreateMetastoreAssignment{} + st.MetastoreAssignment = pb.MetastoreAssignment + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func accountsCreateStorageCredentialToPb(st *AccountsCreateStorageCredential) (*accountsCreateStorageCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsCreateStorageCredentialPb{} + pb.CredentialInfo = st.CredentialInfo + + pb.MetastoreId = st.MetastoreId + + return pb, nil +} + +type accountsCreateStorageCredentialPb struct { + CredentialInfo *CreateStorageCredential `json:"credential_info,omitempty"` + + MetastoreId string `json:"-" url:"-"` +} + +func accountsCreateStorageCredentialFromPb(pb *accountsCreateStorageCredentialPb) (*AccountsCreateStorageCredential, error) { + if pb == nil { + return nil, nil + } + st := &AccountsCreateStorageCredential{} + st.CredentialInfo = pb.CredentialInfo + st.MetastoreId = pb.MetastoreId + + return st, nil +} + +func accountsMetastoreAssignmentToPb(st *AccountsMetastoreAssignment) (*accountsMetastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsMetastoreAssignmentPb{} + pb.MetastoreAssignment = st.MetastoreAssignment + + return pb, nil +} + +type accountsMetastoreAssignmentPb struct { + MetastoreAssignment *MetastoreAssignment `json:"metastore_assignment,omitempty"` +} + +func accountsMetastoreAssignmentFromPb(pb *accountsMetastoreAssignmentPb) (*AccountsMetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &AccountsMetastoreAssignment{} + st.MetastoreAssignment = pb.MetastoreAssignment + + return st, nil +} + +func accountsMetastoreInfoToPb(st *AccountsMetastoreInfo) (*accountsMetastoreInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsMetastoreInfoPb{} + pb.MetastoreInfo = st.MetastoreInfo + + return pb, nil +} + +type accountsMetastoreInfoPb struct { + MetastoreInfo *MetastoreInfo `json:"metastore_info,omitempty"` +} + +func accountsMetastoreInfoFromPb(pb *accountsMetastoreInfoPb) (*AccountsMetastoreInfo, error) { + if pb == nil { + return nil, nil + } + st := &AccountsMetastoreInfo{} + st.MetastoreInfo = pb.MetastoreInfo + + return st, nil +} + +func accountsStorageCredentialInfoToPb(st *AccountsStorageCredentialInfo) (*accountsStorageCredentialInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsStorageCredentialInfoPb{} + pb.CredentialInfo = st.CredentialInfo + + return pb, nil +} + +type accountsStorageCredentialInfoPb struct { + CredentialInfo *StorageCredentialInfo `json:"credential_info,omitempty"` +} + +func accountsStorageCredentialInfoFromPb(pb *accountsStorageCredentialInfoPb) (*AccountsStorageCredentialInfo, error) { + if pb == nil { + return nil, nil + } + st := &AccountsStorageCredentialInfo{} + st.CredentialInfo = pb.CredentialInfo + + return st, nil +} + +func accountsUpdateMetastoreToPb(st *AccountsUpdateMetastore) (*accountsUpdateMetastorePb, error) { + if st == nil { + return nil, nil + } + pb := &accountsUpdateMetastorePb{} + pb.MetastoreId = st.MetastoreId + + pb.MetastoreInfo = st.MetastoreInfo + + return pb, nil +} + +type accountsUpdateMetastorePb struct { + MetastoreId string `json:"-" url:"-"` + + MetastoreInfo *UpdateMetastore `json:"metastore_info,omitempty"` +} + +func accountsUpdateMetastoreFromPb(pb *accountsUpdateMetastorePb) (*AccountsUpdateMetastore, error) { + if pb == nil { + return nil, nil + } + st := &AccountsUpdateMetastore{} + st.MetastoreId = pb.MetastoreId + st.MetastoreInfo = pb.MetastoreInfo + + return st, nil +} + +func accountsUpdateMetastoreAssignmentToPb(st *AccountsUpdateMetastoreAssignment) (*accountsUpdateMetastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsUpdateMetastoreAssignmentPb{} + pb.MetastoreAssignment = st.MetastoreAssignment + + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type accountsUpdateMetastoreAssignmentPb struct { + MetastoreAssignment *UpdateMetastoreAssignment `json:"metastore_assignment,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func accountsUpdateMetastoreAssignmentFromPb(pb *accountsUpdateMetastoreAssignmentPb) (*AccountsUpdateMetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &AccountsUpdateMetastoreAssignment{} + st.MetastoreAssignment = pb.MetastoreAssignment + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func accountsUpdateStorageCredentialToPb(st *AccountsUpdateStorageCredential) (*accountsUpdateStorageCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &accountsUpdateStorageCredentialPb{} + pb.CredentialInfo = st.CredentialInfo + + pb.MetastoreId = st.MetastoreId + + pb.StorageCredentialName = st.StorageCredentialName + + return pb, nil +} + +type accountsUpdateStorageCredentialPb struct { + CredentialInfo *UpdateStorageCredential `json:"credential_info,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + StorageCredentialName string `json:"-" url:"-"` +} + +func accountsUpdateStorageCredentialFromPb(pb *accountsUpdateStorageCredentialPb) (*AccountsUpdateStorageCredential, error) { + if pb == nil { + return nil, nil + } + st := &AccountsUpdateStorageCredential{} + st.CredentialInfo = pb.CredentialInfo + st.MetastoreId = pb.MetastoreId + st.StorageCredentialName = pb.StorageCredentialName + + return st, nil +} + +func artifactAllowlistInfoToPb(st *ArtifactAllowlistInfo) (*artifactAllowlistInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &artifactAllowlistInfoPb{} + pb.ArtifactMatchers = st.ArtifactMatchers + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.MetastoreId = st.MetastoreId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type artifactAllowlistInfoPb struct { + ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func artifactAllowlistInfoFromPb(pb *artifactAllowlistInfoPb) (*ArtifactAllowlistInfo, error) { + if pb == nil { + return nil, nil + } + st := &ArtifactAllowlistInfo{} + st.ArtifactMatchers = pb.ArtifactMatchers + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.MetastoreId = pb.MetastoreId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *artifactAllowlistInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st artifactAllowlistInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func artifactMatcherToPb(st *ArtifactMatcher) (*artifactMatcherPb, error) { + if st == nil { + return nil, nil + } + pb := &artifactMatcherPb{} + pb.Artifact = st.Artifact + + pb.MatchType = st.MatchType + + return pb, nil +} + +type artifactMatcherPb struct { + Artifact string `json:"artifact"` + + MatchType MatchType `json:"match_type"` +} + +func artifactMatcherFromPb(pb *artifactMatcherPb) (*ArtifactMatcher, error) { + if pb == nil { + return nil, nil + } + st := &ArtifactMatcher{} + st.Artifact = pb.Artifact + st.MatchType = pb.MatchType + + return st, nil +} + +func assignResponseToPb(st *AssignResponse) (*assignResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &assignResponsePb{} + + return pb, nil +} + +type assignResponsePb struct { +} + +func assignResponseFromPb(pb *assignResponsePb) (*AssignResponse, error) { + if pb == nil { + return nil, nil + } + st := &AssignResponse{} + + return st, nil +} + +func awsCredentialsToPb(st *AwsCredentials) (*awsCredentialsPb, error) { + if st == nil { + return nil, nil + } + pb := &awsCredentialsPb{} + pb.AccessKeyId = st.AccessKeyId + + pb.AccessPoint = st.AccessPoint + + pb.SecretAccessKey = st.SecretAccessKey + + pb.SessionToken = st.SessionToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsCredentialsPb struct { + AccessKeyId string `json:"access_key_id,omitempty"` + + AccessPoint string `json:"access_point,omitempty"` + + SecretAccessKey string `json:"secret_access_key,omitempty"` + + SessionToken string `json:"session_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsCredentialsFromPb(pb *awsCredentialsPb) (*AwsCredentials, error) { + if pb == nil { + return nil, nil + } + st := &AwsCredentials{} + st.AccessKeyId = pb.AccessKeyId + st.AccessPoint = pb.AccessPoint + st.SecretAccessKey = pb.SecretAccessKey + st.SessionToken = pb.SessionToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsCredentialsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsCredentialsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func awsIamRoleToPb(st *AwsIamRole) (*awsIamRolePb, error) { + if st == nil { + return nil, nil + } + pb := &awsIamRolePb{} + pb.ExternalId = st.ExternalId + + pb.RoleArn = st.RoleArn + + pb.UnityCatalogIamArn = st.UnityCatalogIamArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsIamRolePb struct { + ExternalId string `json:"external_id,omitempty"` + + RoleArn string `json:"role_arn,omitempty"` + + UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsIamRoleFromPb(pb *awsIamRolePb) (*AwsIamRole, error) { + if pb == nil { + return nil, nil + } + st := &AwsIamRole{} + st.ExternalId = pb.ExternalId + st.RoleArn = pb.RoleArn + st.UnityCatalogIamArn = pb.UnityCatalogIamArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsIamRolePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsIamRolePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func awsIamRoleRequestToPb(st *AwsIamRoleRequest) (*awsIamRoleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &awsIamRoleRequestPb{} + pb.RoleArn = st.RoleArn + + return pb, nil +} + +type awsIamRoleRequestPb struct { + RoleArn string `json:"role_arn"` +} + +func awsIamRoleRequestFromPb(pb *awsIamRoleRequestPb) (*AwsIamRoleRequest, error) { + if pb == nil { + return nil, nil + } + st := &AwsIamRoleRequest{} + st.RoleArn = pb.RoleArn + + return st, nil +} + +func awsIamRoleResponseToPb(st *AwsIamRoleResponse) (*awsIamRoleResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &awsIamRoleResponsePb{} + pb.ExternalId = st.ExternalId + + pb.RoleArn = st.RoleArn + + pb.UnityCatalogIamArn = st.UnityCatalogIamArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsIamRoleResponsePb struct { + ExternalId string `json:"external_id,omitempty"` + + RoleArn string `json:"role_arn"` + + UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsIamRoleResponseFromPb(pb *awsIamRoleResponsePb) (*AwsIamRoleResponse, error) { + if pb == nil { + return nil, nil + } + st := &AwsIamRoleResponse{} + st.ExternalId = pb.ExternalId + st.RoleArn = pb.RoleArn + st.UnityCatalogIamArn = pb.UnityCatalogIamArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsIamRoleResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsIamRoleResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func awsSqsQueueToPb(st *AwsSqsQueue) (*awsSqsQueuePb, error) { + if st == nil { + return nil, nil + } + pb := &awsSqsQueuePb{} + pb.ManagedResourceId = st.ManagedResourceId + + pb.QueueUrl = st.QueueUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsSqsQueuePb struct { + ManagedResourceId string `json:"managed_resource_id,omitempty"` + + QueueUrl string `json:"queue_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsSqsQueueFromPb(pb *awsSqsQueuePb) (*AwsSqsQueue, error) { + if pb == nil { + return nil, nil + } + st := &AwsSqsQueue{} + st.ManagedResourceId = pb.ManagedResourceId + st.QueueUrl = pb.QueueUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsSqsQueuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsSqsQueuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureActiveDirectoryTokenToPb(st *AzureActiveDirectoryToken) (*azureActiveDirectoryTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &azureActiveDirectoryTokenPb{} + pb.AadToken = st.AadToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureActiveDirectoryTokenPb struct { + AadToken string `json:"aad_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureActiveDirectoryTokenFromPb(pb *azureActiveDirectoryTokenPb) (*AzureActiveDirectoryToken, error) { + if pb == nil { + return nil, nil + } + st := &AzureActiveDirectoryToken{} + st.AadToken = pb.AadToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureActiveDirectoryTokenPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureActiveDirectoryTokenPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureManagedIdentityToPb(st *AzureManagedIdentity) (*azureManagedIdentityPb, error) { + if st == nil { + return nil, nil + } + pb := &azureManagedIdentityPb{} + pb.AccessConnectorId = st.AccessConnectorId + + pb.CredentialId = st.CredentialId + + pb.ManagedIdentityId = st.ManagedIdentityId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureManagedIdentityPb struct { + AccessConnectorId string `json:"access_connector_id"` + + CredentialId string `json:"credential_id,omitempty"` + + ManagedIdentityId string `json:"managed_identity_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureManagedIdentityFromPb(pb *azureManagedIdentityPb) (*AzureManagedIdentity, error) { + if pb == nil { + return nil, nil + } + st := &AzureManagedIdentity{} + st.AccessConnectorId = pb.AccessConnectorId + st.CredentialId = pb.CredentialId + st.ManagedIdentityId = pb.ManagedIdentityId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureManagedIdentityPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureManagedIdentityPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureManagedIdentityRequestToPb(st *AzureManagedIdentityRequest) (*azureManagedIdentityRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &azureManagedIdentityRequestPb{} + pb.AccessConnectorId = st.AccessConnectorId + + pb.ManagedIdentityId = st.ManagedIdentityId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureManagedIdentityRequestPb struct { + AccessConnectorId string `json:"access_connector_id"` + + ManagedIdentityId string `json:"managed_identity_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureManagedIdentityRequestFromPb(pb *azureManagedIdentityRequestPb) (*AzureManagedIdentityRequest, error) { + if pb == nil { + return nil, nil + } + st := &AzureManagedIdentityRequest{} + st.AccessConnectorId = pb.AccessConnectorId + st.ManagedIdentityId = pb.ManagedIdentityId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureManagedIdentityRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureManagedIdentityRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureManagedIdentityResponseToPb(st *AzureManagedIdentityResponse) (*azureManagedIdentityResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &azureManagedIdentityResponsePb{} + pb.AccessConnectorId = st.AccessConnectorId + + pb.CredentialId = st.CredentialId + + pb.ManagedIdentityId = st.ManagedIdentityId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureManagedIdentityResponsePb struct { + AccessConnectorId string `json:"access_connector_id"` + + CredentialId string `json:"credential_id,omitempty"` + + ManagedIdentityId string `json:"managed_identity_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureManagedIdentityResponseFromPb(pb *azureManagedIdentityResponsePb) (*AzureManagedIdentityResponse, error) { + if pb == nil { + return nil, nil + } + st := &AzureManagedIdentityResponse{} + st.AccessConnectorId = pb.AccessConnectorId + st.CredentialId = pb.CredentialId + st.ManagedIdentityId = pb.ManagedIdentityId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureManagedIdentityResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureManagedIdentityResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureQueueStorageToPb(st *AzureQueueStorage) (*azureQueueStoragePb, error) { + if st == nil { + return nil, nil + } + pb := &azureQueueStoragePb{} + pb.ManagedResourceId = st.ManagedResourceId + + pb.QueueUrl = st.QueueUrl + + pb.ResourceGroup = st.ResourceGroup + + pb.SubscriptionId = st.SubscriptionId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureQueueStoragePb struct { + ManagedResourceId string `json:"managed_resource_id,omitempty"` + + QueueUrl string `json:"queue_url,omitempty"` + + ResourceGroup string `json:"resource_group,omitempty"` + + SubscriptionId string `json:"subscription_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureQueueStorageFromPb(pb *azureQueueStoragePb) (*AzureQueueStorage, error) { + if pb == nil { + return nil, nil + } + st := &AzureQueueStorage{} + st.ManagedResourceId = pb.ManagedResourceId + st.QueueUrl = pb.QueueUrl + st.ResourceGroup = pb.ResourceGroup + st.SubscriptionId = pb.SubscriptionId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureQueueStoragePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureQueueStoragePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureServicePrincipalToPb(st *AzureServicePrincipal) (*azureServicePrincipalPb, error) { + if st == nil { + return nil, nil + } + pb := &azureServicePrincipalPb{} + pb.ApplicationId = st.ApplicationId + + pb.ClientSecret = st.ClientSecret + + pb.DirectoryId = st.DirectoryId + + return pb, nil +} + +type azureServicePrincipalPb struct { + ApplicationId string `json:"application_id"` + + ClientSecret string `json:"client_secret"` + + DirectoryId string `json:"directory_id"` +} + +func azureServicePrincipalFromPb(pb *azureServicePrincipalPb) (*AzureServicePrincipal, error) { + if pb == nil { + return nil, nil + } + st := &AzureServicePrincipal{} + st.ApplicationId = pb.ApplicationId + st.ClientSecret = pb.ClientSecret + st.DirectoryId = pb.DirectoryId + + return st, nil +} + +func azureUserDelegationSasToPb(st *AzureUserDelegationSas) (*azureUserDelegationSasPb, error) { + if st == nil { + return nil, nil + } + pb := &azureUserDelegationSasPb{} + pb.SasToken = st.SasToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureUserDelegationSasPb struct { + SasToken string `json:"sas_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureUserDelegationSasFromPb(pb *azureUserDelegationSasPb) (*AzureUserDelegationSas, error) { + if pb == nil { + return nil, nil + } + st := &AzureUserDelegationSas{} + st.SasToken = pb.SasToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureUserDelegationSasPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureUserDelegationSasPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelRefreshRequestToPb(st *CancelRefreshRequest) (*cancelRefreshRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelRefreshRequestPb{} + pb.RefreshId = st.RefreshId + + pb.TableName = st.TableName + + return pb, nil +} + +type cancelRefreshRequestPb struct { + RefreshId string `json:"-" url:"-"` + + TableName string `json:"-" url:"-"` +} + +func cancelRefreshRequestFromPb(pb *cancelRefreshRequestPb) (*CancelRefreshRequest, error) { + if pb == nil { + return nil, nil + } + st := &CancelRefreshRequest{} + st.RefreshId = pb.RefreshId + st.TableName = pb.TableName + + return st, nil +} + +func cancelRefreshResponseToPb(st *CancelRefreshResponse) (*cancelRefreshResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelRefreshResponsePb{} + + return pb, nil +} + +type cancelRefreshResponsePb struct { +} + +func cancelRefreshResponseFromPb(pb *cancelRefreshResponsePb) (*CancelRefreshResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelRefreshResponse{} + + return st, nil +} + +func catalogInfoToPb(st *CatalogInfo) (*catalogInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &catalogInfoPb{} + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogType = st.CatalogType + + pb.Comment = st.Comment + + pb.ConnectionName = st.ConnectionName + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag + + pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization + + pb.FullName = st.FullName + + pb.IsolationMode = st.IsolationMode + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Owner = st.Owner + + pb.Properties = st.Properties + + pb.ProviderName = st.ProviderName + + pb.ProvisioningInfo = st.ProvisioningInfo + + pb.SecurableType = st.SecurableType + + pb.ShareName = st.ShareName + + pb.StorageLocation = st.StorageLocation + + pb.StorageRoot = st.StorageRoot + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type catalogInfoPb struct { + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogType CatalogType `json:"catalog_type,omitempty"` + + Comment string `json:"comment,omitempty"` + + ConnectionName string `json:"connection_name,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + + FullName string `json:"full_name,omitempty"` + + IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Options map[string]string `json:"options,omitempty"` + + Owner string `json:"owner,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + ProviderName string `json:"provider_name,omitempty"` + + ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` + + SecurableType SecurableType `json:"securable_type,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func catalogInfoFromPb(pb *catalogInfoPb) (*CatalogInfo, error) { + if pb == nil { + return nil, nil + } + st := &CatalogInfo{} + st.BrowseOnly = pb.BrowseOnly + st.CatalogType = pb.CatalogType + st.Comment = pb.Comment + st.ConnectionName = pb.ConnectionName + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.EffectivePredictiveOptimizationFlag = pb.EffectivePredictiveOptimizationFlag + st.EnablePredictiveOptimization = pb.EnablePredictiveOptimization + st.FullName = pb.FullName + st.IsolationMode = pb.IsolationMode + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Options = pb.Options + st.Owner = pb.Owner + st.Properties = pb.Properties + st.ProviderName = pb.ProviderName + st.ProvisioningInfo = pb.ProvisioningInfo + st.SecurableType = pb.SecurableType + st.ShareName = pb.ShareName + st.StorageLocation = pb.StorageLocation + st.StorageRoot = pb.StorageRoot + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *catalogInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st catalogInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cloudflareApiTokenToPb(st *CloudflareApiToken) (*cloudflareApiTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &cloudflareApiTokenPb{} + pb.AccessKeyId = st.AccessKeyId + + pb.AccountId = st.AccountId + + pb.SecretAccessKey = st.SecretAccessKey + + return pb, nil +} + +type cloudflareApiTokenPb struct { + AccessKeyId string `json:"access_key_id"` + + AccountId string `json:"account_id"` + + SecretAccessKey string `json:"secret_access_key"` +} + +func cloudflareApiTokenFromPb(pb *cloudflareApiTokenPb) (*CloudflareApiToken, error) { + if pb == nil { + return nil, nil + } + st := &CloudflareApiToken{} + st.AccessKeyId = pb.AccessKeyId + st.AccountId = pb.AccountId + st.SecretAccessKey = pb.SecretAccessKey + + return st, nil +} + +func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &columnInfoPb{} + pb.Comment = st.Comment + + pb.Mask = st.Mask + + pb.Name = st.Name + + pb.Nullable = st.Nullable + + pb.PartitionIndex = st.PartitionIndex + + pb.Position = st.Position + + pb.TypeIntervalType = st.TypeIntervalType + + pb.TypeJson = st.TypeJson + + pb.TypeName = st.TypeName + + pb.TypePrecision = st.TypePrecision + + pb.TypeScale = st.TypeScale + + pb.TypeText = st.TypeText + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type columnInfoPb struct { + Comment string `json:"comment,omitempty"` + + Mask *ColumnMask `json:"mask,omitempty"` + + Name string `json:"name,omitempty"` + + Nullable bool `json:"nullable,omitempty"` + + PartitionIndex int `json:"partition_index,omitempty"` + + Position int `json:"position,omitempty"` + + TypeIntervalType string `json:"type_interval_type,omitempty"` + + TypeJson string `json:"type_json,omitempty"` + + TypeName ColumnTypeName `json:"type_name,omitempty"` + + TypePrecision int `json:"type_precision,omitempty"` + + TypeScale int `json:"type_scale,omitempty"` + + TypeText string `json:"type_text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func columnInfoFromPb(pb *columnInfoPb) (*ColumnInfo, error) { + if pb == nil { + return nil, nil + } + st := &ColumnInfo{} + st.Comment = pb.Comment + st.Mask = pb.Mask + st.Name = pb.Name + st.Nullable = pb.Nullable + st.PartitionIndex = pb.PartitionIndex + st.Position = pb.Position + st.TypeIntervalType = pb.TypeIntervalType + st.TypeJson = pb.TypeJson + st.TypeName = pb.TypeName + st.TypePrecision = pb.TypePrecision + st.TypeScale = pb.TypeScale + st.TypeText = pb.TypeText + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *columnInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st columnInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func columnMaskToPb(st *ColumnMask) (*columnMaskPb, error) { + if st == nil { + return nil, nil + } + pb := &columnMaskPb{} + pb.FunctionName = st.FunctionName + + pb.UsingColumnNames = st.UsingColumnNames + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type columnMaskPb struct { + FunctionName string `json:"function_name,omitempty"` + + UsingColumnNames []string `json:"using_column_names,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func columnMaskFromPb(pb *columnMaskPb) (*ColumnMask, error) { + if pb == nil { + return nil, nil + } + st := &ColumnMask{} + st.FunctionName = pb.FunctionName + st.UsingColumnNames = pb.UsingColumnNames + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *columnMaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st columnMaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func connectionInfoToPb(st *ConnectionInfo) (*connectionInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &connectionInfoPb{} + pb.Comment = st.Comment + + pb.ConnectionId = st.ConnectionId + + pb.ConnectionType = st.ConnectionType + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.CredentialType = st.CredentialType + + pb.FullName = st.FullName + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Owner = st.Owner + + pb.Properties = st.Properties + + pb.ProvisioningInfo = st.ProvisioningInfo + + pb.ReadOnly = st.ReadOnly + + pb.SecurableType = st.SecurableType + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type connectionInfoPb struct { + Comment string `json:"comment,omitempty"` + + ConnectionId string `json:"connection_id,omitempty"` + + ConnectionType ConnectionType `json:"connection_type,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + CredentialType CredentialType `json:"credential_type,omitempty"` + + FullName string `json:"full_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Options map[string]string `json:"options,omitempty"` + + Owner string `json:"owner,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + SecurableType string `json:"securable_type,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func connectionInfoFromPb(pb *connectionInfoPb) (*ConnectionInfo, error) { + if pb == nil { + return nil, nil + } + st := &ConnectionInfo{} + st.Comment = pb.Comment + st.ConnectionId = pb.ConnectionId + st.ConnectionType = pb.ConnectionType + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.CredentialType = pb.CredentialType + st.FullName = pb.FullName + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Options = pb.Options + st.Owner = pb.Owner + st.Properties = pb.Properties + st.ProvisioningInfo = pb.ProvisioningInfo + st.ReadOnly = pb.ReadOnly + st.SecurableType = pb.SecurableType + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *connectionInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st connectionInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func continuousUpdateStatusToPb(st *ContinuousUpdateStatus) (*continuousUpdateStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &continuousUpdateStatusPb{} + pb.InitialPipelineSyncProgress = st.InitialPipelineSyncProgress + + pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion + + pb.Timestamp = st.Timestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type continuousUpdateStatusPb struct { + InitialPipelineSyncProgress *PipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` + + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + + Timestamp string `json:"timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func continuousUpdateStatusFromPb(pb *continuousUpdateStatusPb) (*ContinuousUpdateStatus, error) { + if pb == nil { + return nil, nil + } + st := &ContinuousUpdateStatus{} + st.InitialPipelineSyncProgress = pb.InitialPipelineSyncProgress + st.LastProcessedCommitVersion = pb.LastProcessedCommitVersion + st.Timestamp = pb.Timestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *continuousUpdateStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st continuousUpdateStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCatalogToPb(st *CreateCatalog) (*createCatalogPb, error) { + if st == nil { + return nil, nil + } + pb := &createCatalogPb{} + pb.Comment = st.Comment + + pb.ConnectionName = st.ConnectionName + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Properties = st.Properties + + pb.ProviderName = st.ProviderName + + pb.ShareName = st.ShareName + + pb.StorageRoot = st.StorageRoot + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCatalogPb struct { + Comment string `json:"comment,omitempty"` + + ConnectionName string `json:"connection_name,omitempty"` + + Name string `json:"name"` + + Options map[string]string `json:"options,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + ProviderName string `json:"provider_name,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCatalogFromPb(pb *createCatalogPb) (*CreateCatalog, error) { + if pb == nil { + return nil, nil + } + st := &CreateCatalog{} + st.Comment = pb.Comment + st.ConnectionName = pb.ConnectionName + st.Name = pb.Name + st.Options = pb.Options + st.Properties = pb.Properties + st.ProviderName = pb.ProviderName + st.ShareName = pb.ShareName + st.StorageRoot = pb.StorageRoot + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCatalogPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCatalogPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createConnectionToPb(st *CreateConnection) (*createConnectionPb, error) { + if st == nil { + return nil, nil + } + pb := &createConnectionPb{} + pb.Comment = st.Comment + + pb.ConnectionType = st.ConnectionType + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Properties = st.Properties + + pb.ReadOnly = st.ReadOnly + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createConnectionPb struct { + Comment string `json:"comment,omitempty"` + + ConnectionType ConnectionType `json:"connection_type"` + + Name string `json:"name"` + + Options map[string]string `json:"options"` + + Properties map[string]string `json:"properties,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createConnectionFromPb(pb *createConnectionPb) (*CreateConnection, error) { + if pb == nil { + return nil, nil + } + st := &CreateConnection{} + st.Comment = pb.Comment + st.ConnectionType = pb.ConnectionType + st.Name = pb.Name + st.Options = pb.Options + st.Properties = pb.Properties + st.ReadOnly = pb.ReadOnly + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createConnectionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createConnectionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCredentialRequestToPb(st *CreateCredentialRequest) (*createCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialRequestPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.Comment = st.Comment + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.Name = st.Name + + pb.Purpose = st.Purpose + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCredentialRequestPb struct { + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + Comment string `json:"comment,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + + Name string `json:"name"` + + Purpose CredentialPurpose `json:"purpose,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCredentialRequestFromPb(pb *createCredentialRequestPb) (*CreateCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialRequest{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.Comment = pb.Comment + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.Name = pb.Name + st.Purpose = pb.Purpose + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createDatabaseCatalogRequestToPb(st *CreateDatabaseCatalogRequest) (*createDatabaseCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createDatabaseCatalogRequestPb{} + pb.Catalog = st.Catalog + + return pb, nil +} + +type createDatabaseCatalogRequestPb struct { + Catalog DatabaseCatalog `json:"catalog"` +} + +func createDatabaseCatalogRequestFromPb(pb *createDatabaseCatalogRequestPb) (*CreateDatabaseCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateDatabaseCatalogRequest{} + st.Catalog = pb.Catalog + + return st, nil +} + +func createDatabaseInstanceRequestToPb(st *CreateDatabaseInstanceRequest) (*createDatabaseInstanceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createDatabaseInstanceRequestPb{} + pb.DatabaseInstance = st.DatabaseInstance + + return pb, nil +} + +type createDatabaseInstanceRequestPb struct { + DatabaseInstance DatabaseInstance `json:"database_instance"` +} + +func createDatabaseInstanceRequestFromPb(pb *createDatabaseInstanceRequestPb) (*CreateDatabaseInstanceRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateDatabaseInstanceRequest{} + st.DatabaseInstance = pb.DatabaseInstance + + return st, nil +} + +func createDatabaseTableRequestToPb(st *CreateDatabaseTableRequest) (*createDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createDatabaseTableRequestPb{} + pb.Table = st.Table + + return pb, nil +} + +type createDatabaseTableRequestPb struct { + Table DatabaseTable `json:"table"` +} + +func createDatabaseTableRequestFromPb(pb *createDatabaseTableRequestPb) (*CreateDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateDatabaseTableRequest{} + st.Table = pb.Table + + return st, nil +} + +func createExternalLocationToPb(st *CreateExternalLocation) (*createExternalLocationPb, error) { + if st == nil { + return nil, nil + } + pb := &createExternalLocationPb{} + pb.Comment = st.Comment + + pb.CredentialName = st.CredentialName + + pb.EnableFileEvents = st.EnableFileEvents + + pb.EncryptionDetails = st.EncryptionDetails + + pb.Fallback = st.Fallback + + pb.FileEventQueue = st.FileEventQueue + + pb.Name = st.Name + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createExternalLocationPb struct { + Comment string `json:"comment,omitempty"` + + CredentialName string `json:"credential_name"` + + EnableFileEvents bool `json:"enable_file_events,omitempty"` + + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + + Fallback bool `json:"fallback,omitempty"` + + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + + Name string `json:"name"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + Url string `json:"url"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createExternalLocationFromPb(pb *createExternalLocationPb) (*CreateExternalLocation, error) { + if pb == nil { + return nil, nil + } + st := &CreateExternalLocation{} + st.Comment = pb.Comment + st.CredentialName = pb.CredentialName + st.EnableFileEvents = pb.EnableFileEvents + st.EncryptionDetails = pb.EncryptionDetails + st.Fallback = pb.Fallback + st.FileEventQueue = pb.FileEventQueue + st.Name = pb.Name + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createExternalLocationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createExternalLocationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createFunctionToPb(st *CreateFunction) (*createFunctionPb, error) { + if st == nil { + return nil, nil + } + pb := &createFunctionPb{} + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.DataType = st.DataType + + pb.ExternalLanguage = st.ExternalLanguage + + pb.ExternalName = st.ExternalName + + pb.FullDataType = st.FullDataType + + pb.InputParams = st.InputParams + + pb.IsDeterministic = st.IsDeterministic + + pb.IsNullCall = st.IsNullCall + + pb.Name = st.Name + + pb.ParameterStyle = st.ParameterStyle + + pb.Properties = st.Properties + + pb.ReturnParams = st.ReturnParams + + pb.RoutineBody = st.RoutineBody + + pb.RoutineDefinition = st.RoutineDefinition + + pb.RoutineDependencies = st.RoutineDependencies + + pb.SchemaName = st.SchemaName + + pb.SecurityType = st.SecurityType + + pb.SpecificName = st.SpecificName + + pb.SqlDataAccess = st.SqlDataAccess + + pb.SqlPath = st.SqlPath + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createFunctionPb struct { + CatalogName string `json:"catalog_name"` + + Comment string `json:"comment,omitempty"` + + DataType ColumnTypeName `json:"data_type"` + + ExternalLanguage string `json:"external_language,omitempty"` + + ExternalName string `json:"external_name,omitempty"` + + FullDataType string `json:"full_data_type"` + + InputParams FunctionParameterInfos `json:"input_params"` + + IsDeterministic bool `json:"is_deterministic"` + + IsNullCall bool `json:"is_null_call"` + + Name string `json:"name"` + + ParameterStyle CreateFunctionParameterStyle `json:"parameter_style"` + + Properties string `json:"properties,omitempty"` + + ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + + RoutineBody CreateFunctionRoutineBody `json:"routine_body"` + + RoutineDefinition string `json:"routine_definition"` + + RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + + SchemaName string `json:"schema_name"` + + SecurityType CreateFunctionSecurityType `json:"security_type"` + + SpecificName string `json:"specific_name"` + + SqlDataAccess CreateFunctionSqlDataAccess `json:"sql_data_access"` + + SqlPath string `json:"sql_path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createFunctionFromPb(pb *createFunctionPb) (*CreateFunction, error) { + if pb == nil { + return nil, nil + } + st := &CreateFunction{} + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.DataType = pb.DataType + st.ExternalLanguage = pb.ExternalLanguage + st.ExternalName = pb.ExternalName + st.FullDataType = pb.FullDataType + st.InputParams = pb.InputParams + st.IsDeterministic = pb.IsDeterministic + st.IsNullCall = pb.IsNullCall + st.Name = pb.Name + st.ParameterStyle = pb.ParameterStyle + st.Properties = pb.Properties + st.ReturnParams = pb.ReturnParams + st.RoutineBody = pb.RoutineBody + st.RoutineDefinition = pb.RoutineDefinition + st.RoutineDependencies = pb.RoutineDependencies + st.SchemaName = pb.SchemaName + st.SecurityType = pb.SecurityType + st.SpecificName = pb.SpecificName + st.SqlDataAccess = pb.SqlDataAccess + st.SqlPath = pb.SqlPath + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createFunctionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createFunctionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createFunctionRequestToPb(st *CreateFunctionRequest) (*createFunctionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createFunctionRequestPb{} + pb.FunctionInfo = st.FunctionInfo + + return pb, nil +} + +type createFunctionRequestPb struct { + FunctionInfo CreateFunction `json:"function_info"` +} + +func createFunctionRequestFromPb(pb *createFunctionRequestPb) (*CreateFunctionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateFunctionRequest{} + st.FunctionInfo = pb.FunctionInfo + + return st, nil +} + +func createMetastoreToPb(st *CreateMetastore) (*createMetastorePb, error) { + if st == nil { + return nil, nil + } + pb := &createMetastorePb{} + pb.Name = st.Name + + pb.Region = st.Region + + pb.StorageRoot = st.StorageRoot + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createMetastorePb struct { + Name string `json:"name"` + + Region string `json:"region,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createMetastoreFromPb(pb *createMetastorePb) (*CreateMetastore, error) { + if pb == nil { + return nil, nil + } + st := &CreateMetastore{} + st.Name = pb.Name + st.Region = pb.Region + st.StorageRoot = pb.StorageRoot + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createMetastorePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createMetastorePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createMetastoreAssignmentToPb(st *CreateMetastoreAssignment) (*createMetastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &createMetastoreAssignmentPb{} + pb.DefaultCatalogName = st.DefaultCatalogName + + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type createMetastoreAssignmentPb struct { + DefaultCatalogName string `json:"default_catalog_name"` + + MetastoreId string `json:"metastore_id"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func createMetastoreAssignmentFromPb(pb *createMetastoreAssignmentPb) (*CreateMetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &CreateMetastoreAssignment{} + st.DefaultCatalogName = pb.DefaultCatalogName + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func createMonitorToPb(st *CreateMonitor) (*createMonitorPb, error) { + if st == nil { + return nil, nil + } + pb := &createMonitorPb{} + pb.AssetsDir = st.AssetsDir + + pb.BaselineTableName = st.BaselineTableName + + pb.CustomMetrics = st.CustomMetrics + + pb.DataClassificationConfig = st.DataClassificationConfig + + pb.InferenceLog = st.InferenceLog + + pb.Notifications = st.Notifications + + pb.OutputSchemaName = st.OutputSchemaName + + pb.Schedule = st.Schedule + + pb.SkipBuiltinDashboard = st.SkipBuiltinDashboard + + pb.SlicingExprs = st.SlicingExprs + + pb.Snapshot = st.Snapshot + + pb.TableName = st.TableName + + pb.TimeSeries = st.TimeSeries + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createMonitorPb struct { + AssetsDir string `json:"assets_dir"` + + BaselineTableName string `json:"baseline_table_name,omitempty"` + + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + + DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + + Notifications *MonitorNotifications `json:"notifications,omitempty"` + + OutputSchemaName string `json:"output_schema_name"` + + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + + SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` + + SlicingExprs []string `json:"slicing_exprs,omitempty"` + + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + + TableName string `json:"-" url:"-"` + + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createMonitorFromPb(pb *createMonitorPb) (*CreateMonitor, error) { + if pb == nil { + return nil, nil + } + st := &CreateMonitor{} + st.AssetsDir = pb.AssetsDir + st.BaselineTableName = pb.BaselineTableName + st.CustomMetrics = pb.CustomMetrics + st.DataClassificationConfig = pb.DataClassificationConfig + st.InferenceLog = pb.InferenceLog + st.Notifications = pb.Notifications + st.OutputSchemaName = pb.OutputSchemaName + st.Schedule = pb.Schedule + st.SkipBuiltinDashboard = pb.SkipBuiltinDashboard + st.SlicingExprs = pb.SlicingExprs + st.Snapshot = pb.Snapshot + st.TableName = pb.TableName + st.TimeSeries = pb.TimeSeries + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createMonitorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createMonitorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createOnlineTableRequestToPb(st *CreateOnlineTableRequest) (*createOnlineTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createOnlineTableRequestPb{} + pb.Table = st.Table + + return pb, nil +} + +type createOnlineTableRequestPb struct { + Table OnlineTable `json:"table"` +} + +func createOnlineTableRequestFromPb(pb *createOnlineTableRequestPb) (*CreateOnlineTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateOnlineTableRequest{} + st.Table = pb.Table + + return st, nil +} + +func createRegisteredModelRequestToPb(st *CreateRegisteredModelRequest) (*createRegisteredModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createRegisteredModelRequestPb{} + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.SchemaName = st.SchemaName + + pb.StorageLocation = st.StorageLocation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRegisteredModelRequestPb struct { + CatalogName string `json:"catalog_name"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + SchemaName string `json:"schema_name"` + + StorageLocation string `json:"storage_location,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRegisteredModelRequestFromPb(pb *createRegisteredModelRequestPb) (*CreateRegisteredModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateRegisteredModelRequest{} + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.Name = pb.Name + st.SchemaName = pb.SchemaName + st.StorageLocation = pb.StorageLocation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRegisteredModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRegisteredModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createResponseToPb(st *CreateResponse) (*createResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createResponsePb{} + + return pb, nil +} + +type createResponsePb struct { +} + +func createResponseFromPb(pb *createResponsePb) (*CreateResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateResponse{} + + return st, nil +} + +func createSchemaToPb(st *CreateSchema) (*createSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := &createSchemaPb{} + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Properties = st.Properties + + pb.StorageRoot = st.StorageRoot + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createSchemaPb struct { + CatalogName string `json:"catalog_name"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + Properties map[string]string `json:"properties,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createSchemaFromPb(pb *createSchemaPb) (*CreateSchema, error) { + if pb == nil { + return nil, nil + } + st := &CreateSchema{} + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.Name = pb.Name + st.Properties = pb.Properties + st.StorageRoot = pb.StorageRoot + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createSchemaPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createSchemaPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createStorageCredentialToPb(st *CreateStorageCredential) (*createStorageCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &createStorageCredentialPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.CloudflareApiToken = st.CloudflareApiToken + + pb.Comment = st.Comment + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.Name = st.Name + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createStorageCredentialPb struct { + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + + Comment string `json:"comment,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + + Name string `json:"name"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createStorageCredentialFromPb(pb *createStorageCredentialPb) (*CreateStorageCredential, error) { + if pb == nil { + return nil, nil + } + st := &CreateStorageCredential{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.CloudflareApiToken = pb.CloudflareApiToken + st.Comment = pb.Comment + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.Name = pb.Name + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createStorageCredentialPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createStorageCredentialPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createSyncedDatabaseTableRequestToPb(st *CreateSyncedDatabaseTableRequest) (*createSyncedDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createSyncedDatabaseTableRequestPb{} + pb.SyncedTable = st.SyncedTable + + return pb, nil +} + +type createSyncedDatabaseTableRequestPb struct { + SyncedTable SyncedDatabaseTable `json:"synced_table"` +} + +func createSyncedDatabaseTableRequestFromPb(pb *createSyncedDatabaseTableRequestPb) (*CreateSyncedDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateSyncedDatabaseTableRequest{} + st.SyncedTable = pb.SyncedTable + + return st, nil +} + +func createTableConstraintToPb(st *CreateTableConstraint) (*createTableConstraintPb, error) { + if st == nil { + return nil, nil + } + pb := &createTableConstraintPb{} + pb.Constraint = st.Constraint + + pb.FullNameArg = st.FullNameArg + + return pb, nil +} + +type createTableConstraintPb struct { + Constraint TableConstraint `json:"constraint"` + + FullNameArg string `json:"full_name_arg"` +} + +func createTableConstraintFromPb(pb *createTableConstraintPb) (*CreateTableConstraint, error) { + if pb == nil { + return nil, nil + } + st := &CreateTableConstraint{} + st.Constraint = pb.Constraint + st.FullNameArg = pb.FullNameArg + + return st, nil +} + +func createVolumeRequestContentToPb(st *CreateVolumeRequestContent) (*createVolumeRequestContentPb, error) { + if st == nil { + return nil, nil + } + pb := &createVolumeRequestContentPb{} + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.SchemaName = st.SchemaName + + pb.StorageLocation = st.StorageLocation + + pb.VolumeType = st.VolumeType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createVolumeRequestContentPb struct { + CatalogName string `json:"catalog_name"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + SchemaName string `json:"schema_name"` + + StorageLocation string `json:"storage_location,omitempty"` + + VolumeType VolumeType `json:"volume_type"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createVolumeRequestContentFromPb(pb *createVolumeRequestContentPb) (*CreateVolumeRequestContent, error) { + if pb == nil { + return nil, nil + } + st := &CreateVolumeRequestContent{} + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.Name = pb.Name + st.SchemaName = pb.SchemaName + st.StorageLocation = pb.StorageLocation + st.VolumeType = pb.VolumeType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createVolumeRequestContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createVolumeRequestContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &credentialInfoPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.FullName = st.FullName + + pb.Id = st.Id + + pb.IsolationMode = st.IsolationMode + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.Purpose = st.Purpose + + pb.ReadOnly = st.ReadOnly + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.UsedForManagedStorage = st.UsedForManagedStorage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type credentialInfoPb struct { + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + + FullName string `json:"full_name,omitempty"` + + Id string `json:"id,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + Purpose CredentialPurpose `json:"purpose,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func credentialInfoFromPb(pb *credentialInfoPb) (*CredentialInfo, error) { + if pb == nil { + return nil, nil + } + st := &CredentialInfo{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.FullName = pb.FullName + st.Id = pb.Id + st.IsolationMode = pb.IsolationMode + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.Purpose = pb.Purpose + st.ReadOnly = pb.ReadOnly + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.UsedForManagedStorage = pb.UsedForManagedStorage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *credentialInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st credentialInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func credentialValidationResultToPb(st *CredentialValidationResult) (*credentialValidationResultPb, error) { + if st == nil { + return nil, nil + } + pb := &credentialValidationResultPb{} + pb.Message = st.Message + + pb.Result = st.Result + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type credentialValidationResultPb struct { + Message string `json:"message,omitempty"` + + Result ValidateCredentialResult `json:"result,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func credentialValidationResultFromPb(pb *credentialValidationResultPb) (*CredentialValidationResult, error) { + if pb == nil { + return nil, nil + } + st := &CredentialValidationResult{} + st.Message = pb.Message + st.Result = pb.Result + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *credentialValidationResultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st credentialValidationResultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databaseCatalogToPb(st *DatabaseCatalog) (*databaseCatalogPb, error) { + if st == nil { + return nil, nil + } + pb := &databaseCatalogPb{} + pb.CreateDatabaseIfNotExists = st.CreateDatabaseIfNotExists + + pb.DatabaseInstanceName = st.DatabaseInstanceName + + pb.DatabaseName = st.DatabaseName + + pb.Name = st.Name + + pb.Uid = st.Uid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databaseCatalogPb struct { + CreateDatabaseIfNotExists bool `json:"create_database_if_not_exists,omitempty"` + + DatabaseInstanceName string `json:"database_instance_name"` + + DatabaseName string `json:"database_name"` + + Name string `json:"name"` + + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databaseCatalogFromPb(pb *databaseCatalogPb) (*DatabaseCatalog, error) { + if pb == nil { + return nil, nil + } + st := &DatabaseCatalog{} + st.CreateDatabaseIfNotExists = pb.CreateDatabaseIfNotExists + st.DatabaseInstanceName = pb.DatabaseInstanceName + st.DatabaseName = pb.DatabaseName + st.Name = pb.Name + st.Uid = pb.Uid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databaseCatalogPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databaseCatalogPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databaseCredentialToPb(st *DatabaseCredential) (*databaseCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &databaseCredentialPb{} + pb.Token = st.Token + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databaseCredentialPb struct { + Token string `json:"token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databaseCredentialFromPb(pb *databaseCredentialPb) (*DatabaseCredential, error) { + if pb == nil { + return nil, nil + } + st := &DatabaseCredential{} + st.Token = pb.Token + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databaseCredentialPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databaseCredentialPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databaseInstanceToPb(st *DatabaseInstance) (*databaseInstancePb, error) { + if st == nil { + return nil, nil + } + pb := &databaseInstancePb{} + pb.AdminPassword = st.AdminPassword + + pb.AdminRolename = st.AdminRolename + + pb.Capacity = st.Capacity + + pb.ChildInstanceRefs = st.ChildInstanceRefs + + pb.CreationTime = st.CreationTime + + pb.Creator = st.Creator + + pb.EnableReadableSecondaries = st.EnableReadableSecondaries + + pb.Name = st.Name + + pb.NodeCount = st.NodeCount + + pb.ParentInstanceRef = st.ParentInstanceRef + + pb.PgVersion = st.PgVersion + + pb.ReadOnlyDns = st.ReadOnlyDns + + pb.ReadWriteDns = st.ReadWriteDns + + pb.RetentionWindowInDays = st.RetentionWindowInDays + + pb.State = st.State + + pb.Stopped = st.Stopped + + pb.Uid = st.Uid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databaseInstancePb struct { + AdminPassword string `json:"admin_password,omitempty"` + + AdminRolename string `json:"admin_rolename,omitempty"` + + Capacity string `json:"capacity,omitempty"` + + ChildInstanceRefs []DatabaseInstanceRef `json:"child_instance_refs,omitempty"` + + CreationTime string `json:"creation_time,omitempty"` + + Creator string `json:"creator,omitempty"` + + EnableReadableSecondaries bool `json:"enable_readable_secondaries,omitempty"` + + Name string `json:"name"` + + NodeCount int `json:"node_count,omitempty"` + + ParentInstanceRef *DatabaseInstanceRef `json:"parent_instance_ref,omitempty"` + + PgVersion string `json:"pg_version,omitempty"` + + ReadOnlyDns string `json:"read_only_dns,omitempty"` + + ReadWriteDns string `json:"read_write_dns,omitempty"` + + RetentionWindowInDays int `json:"retention_window_in_days,omitempty"` + + State DatabaseInstanceState `json:"state,omitempty"` + + Stopped bool `json:"stopped,omitempty"` + + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databaseInstanceFromPb(pb *databaseInstancePb) (*DatabaseInstance, error) { + if pb == nil { + return nil, nil + } + st := &DatabaseInstance{} + st.AdminPassword = pb.AdminPassword + st.AdminRolename = pb.AdminRolename + st.Capacity = pb.Capacity + st.ChildInstanceRefs = pb.ChildInstanceRefs + st.CreationTime = pb.CreationTime + st.Creator = pb.Creator + st.EnableReadableSecondaries = pb.EnableReadableSecondaries + st.Name = pb.Name + st.NodeCount = pb.NodeCount + st.ParentInstanceRef = pb.ParentInstanceRef + st.PgVersion = pb.PgVersion + st.ReadOnlyDns = pb.ReadOnlyDns + st.ReadWriteDns = pb.ReadWriteDns + st.RetentionWindowInDays = pb.RetentionWindowInDays + st.State = pb.State + st.Stopped = pb.Stopped + st.Uid = pb.Uid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databaseInstancePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databaseInstancePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databaseInstanceRefToPb(st *DatabaseInstanceRef) (*databaseInstanceRefPb, error) { + if st == nil { + return nil, nil + } + pb := &databaseInstanceRefPb{} + pb.BranchTime = st.BranchTime + + pb.Lsn = st.Lsn + + pb.Name = st.Name + + pb.Uid = st.Uid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databaseInstanceRefPb struct { + BranchTime string `json:"branch_time,omitempty"` + + Lsn string `json:"lsn,omitempty"` + + Name string `json:"name,omitempty"` + + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databaseInstanceRefFromPb(pb *databaseInstanceRefPb) (*DatabaseInstanceRef, error) { + if pb == nil { + return nil, nil + } + st := &DatabaseInstanceRef{} + st.BranchTime = pb.BranchTime + st.Lsn = pb.Lsn + st.Name = pb.Name + st.Uid = pb.Uid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databaseInstanceRefPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databaseInstanceRefPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databaseTableToPb(st *DatabaseTable) (*databaseTablePb, error) { + if st == nil { + return nil, nil + } + pb := &databaseTablePb{} + pb.DatabaseInstanceName = st.DatabaseInstanceName + + pb.LogicalDatabaseName = st.LogicalDatabaseName + + pb.Name = st.Name + + pb.TableServingUrl = st.TableServingUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databaseTablePb struct { + DatabaseInstanceName string `json:"database_instance_name,omitempty"` + + LogicalDatabaseName string `json:"logical_database_name,omitempty"` + + Name string `json:"name"` + + TableServingUrl string `json:"table_serving_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databaseTableFromPb(pb *databaseTablePb) (*DatabaseTable, error) { + if pb == nil { + return nil, nil + } + st := &DatabaseTable{} + st.DatabaseInstanceName = pb.DatabaseInstanceName + st.LogicalDatabaseName = pb.LogicalDatabaseName + st.Name = pb.Name + st.TableServingUrl = pb.TableServingUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databaseTablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databaseTablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databricksGcpServiceAccountToPb(st *DatabricksGcpServiceAccount) (*databricksGcpServiceAccountPb, error) { + if st == nil { + return nil, nil + } + pb := &databricksGcpServiceAccountPb{} + pb.CredentialId = st.CredentialId + + pb.Email = st.Email + + pb.PrivateKeyId = st.PrivateKeyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databricksGcpServiceAccountPb struct { + CredentialId string `json:"credential_id,omitempty"` + + Email string `json:"email,omitempty"` + + PrivateKeyId string `json:"private_key_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databricksGcpServiceAccountFromPb(pb *databricksGcpServiceAccountPb) (*DatabricksGcpServiceAccount, error) { + if pb == nil { + return nil, nil + } + st := &DatabricksGcpServiceAccount{} + st.CredentialId = pb.CredentialId + st.Email = pb.Email + st.PrivateKeyId = pb.PrivateKeyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databricksGcpServiceAccountPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databricksGcpServiceAccountPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databricksGcpServiceAccountRequestToPb(st *DatabricksGcpServiceAccountRequest) (*databricksGcpServiceAccountRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &databricksGcpServiceAccountRequestPb{} + + return pb, nil +} + +type databricksGcpServiceAccountRequestPb struct { +} + +func databricksGcpServiceAccountRequestFromPb(pb *databricksGcpServiceAccountRequestPb) (*DatabricksGcpServiceAccountRequest, error) { + if pb == nil { + return nil, nil + } + st := &DatabricksGcpServiceAccountRequest{} + + return st, nil +} + +func databricksGcpServiceAccountResponseToPb(st *DatabricksGcpServiceAccountResponse) (*databricksGcpServiceAccountResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &databricksGcpServiceAccountResponsePb{} + pb.CredentialId = st.CredentialId + + pb.Email = st.Email + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databricksGcpServiceAccountResponsePb struct { + CredentialId string `json:"credential_id,omitempty"` + + Email string `json:"email,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databricksGcpServiceAccountResponseFromPb(pb *databricksGcpServiceAccountResponsePb) (*DatabricksGcpServiceAccountResponse, error) { + if pb == nil { + return nil, nil + } + st := &DatabricksGcpServiceAccountResponse{} + st.CredentialId = pb.CredentialId + st.Email = pb.Email + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databricksGcpServiceAccountResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databricksGcpServiceAccountResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAccountMetastoreAssignmentRequestToPb(st *DeleteAccountMetastoreAssignmentRequest) (*deleteAccountMetastoreAssignmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountMetastoreAssignmentRequestPb{} + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type deleteAccountMetastoreAssignmentRequestPb struct { + MetastoreId string `json:"-" url:"-"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func deleteAccountMetastoreAssignmentRequestFromPb(pb *deleteAccountMetastoreAssignmentRequestPb) (*DeleteAccountMetastoreAssignmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountMetastoreAssignmentRequest{} + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func deleteAccountMetastoreRequestToPb(st *DeleteAccountMetastoreRequest) (*deleteAccountMetastoreRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountMetastoreRequestPb{} + pb.Force = st.Force + + pb.MetastoreId = st.MetastoreId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteAccountMetastoreRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteAccountMetastoreRequestFromPb(pb *deleteAccountMetastoreRequestPb) (*DeleteAccountMetastoreRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountMetastoreRequest{} + st.Force = pb.Force + st.MetastoreId = pb.MetastoreId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteAccountMetastoreRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteAccountMetastoreRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAccountStorageCredentialRequestToPb(st *DeleteAccountStorageCredentialRequest) (*deleteAccountStorageCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountStorageCredentialRequestPb{} + pb.Force = st.Force + + pb.MetastoreId = st.MetastoreId + + pb.StorageCredentialName = st.StorageCredentialName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteAccountStorageCredentialRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + StorageCredentialName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteAccountStorageCredentialRequestFromPb(pb *deleteAccountStorageCredentialRequestPb) (*DeleteAccountStorageCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountStorageCredentialRequest{} + st.Force = pb.Force + st.MetastoreId = pb.MetastoreId + st.StorageCredentialName = pb.StorageCredentialName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteAccountStorageCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteAccountStorageCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAliasRequestToPb(st *DeleteAliasRequest) (*deleteAliasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAliasRequestPb{} + pb.Alias = st.Alias + + pb.FullName = st.FullName + + return pb, nil +} + +type deleteAliasRequestPb struct { + Alias string `json:"-" url:"-"` + + FullName string `json:"-" url:"-"` +} + +func deleteAliasRequestFromPb(pb *deleteAliasRequestPb) (*DeleteAliasRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAliasRequest{} + st.Alias = pb.Alias + st.FullName = pb.FullName + + return st, nil +} + +func deleteAliasResponseToPb(st *DeleteAliasResponse) (*deleteAliasResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAliasResponsePb{} + + return pb, nil +} + +type deleteAliasResponsePb struct { +} + +func deleteAliasResponseFromPb(pb *deleteAliasResponsePb) (*DeleteAliasResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAliasResponse{} + + return st, nil +} + +func deleteCatalogRequestToPb(st *DeleteCatalogRequest) (*deleteCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCatalogRequestPb{} + pb.Force = st.Force + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteCatalogRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteCatalogRequestFromPb(pb *deleteCatalogRequestPb) (*DeleteCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCatalogRequest{} + st.Force = pb.Force + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteCatalogRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteCatalogRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteConnectionRequestToPb(st *DeleteConnectionRequest) (*deleteConnectionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteConnectionRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteConnectionRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteConnectionRequestFromPb(pb *deleteConnectionRequestPb) (*DeleteConnectionRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteConnectionRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteCredentialRequestToPb(st *DeleteCredentialRequest) (*deleteCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCredentialRequestPb{} + pb.Force = st.Force + + pb.NameArg = st.NameArg + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteCredentialRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + NameArg string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteCredentialRequestFromPb(pb *deleteCredentialRequestPb) (*DeleteCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCredentialRequest{} + st.Force = pb.Force + st.NameArg = pb.NameArg + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteCredentialResponseToPb(st *DeleteCredentialResponse) (*deleteCredentialResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCredentialResponsePb{} + + return pb, nil +} + +type deleteCredentialResponsePb struct { +} + +func deleteCredentialResponseFromPb(pb *deleteCredentialResponsePb) (*DeleteCredentialResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCredentialResponse{} + + return st, nil +} + +func deleteDatabaseCatalogRequestToPb(st *DeleteDatabaseCatalogRequest) (*deleteDatabaseCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseCatalogRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteDatabaseCatalogRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteDatabaseCatalogRequestFromPb(pb *deleteDatabaseCatalogRequestPb) (*DeleteDatabaseCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseCatalogRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteDatabaseCatalogResponseToPb(st *DeleteDatabaseCatalogResponse) (*deleteDatabaseCatalogResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseCatalogResponsePb{} + + return pb, nil +} + +type deleteDatabaseCatalogResponsePb struct { +} + +func deleteDatabaseCatalogResponseFromPb(pb *deleteDatabaseCatalogResponsePb) (*DeleteDatabaseCatalogResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseCatalogResponse{} + + return st, nil +} + +func deleteDatabaseInstanceRequestToPb(st *DeleteDatabaseInstanceRequest) (*deleteDatabaseInstanceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseInstanceRequestPb{} + pb.Force = st.Force + + pb.Name = st.Name + + pb.Purge = st.Purge + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDatabaseInstanceRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Name string `json:"-" url:"-"` + + Purge bool `json:"-" url:"purge,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDatabaseInstanceRequestFromPb(pb *deleteDatabaseInstanceRequestPb) (*DeleteDatabaseInstanceRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseInstanceRequest{} + st.Force = pb.Force + st.Name = pb.Name + st.Purge = pb.Purge + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDatabaseInstanceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDatabaseInstanceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDatabaseInstanceResponseToPb(st *DeleteDatabaseInstanceResponse) (*deleteDatabaseInstanceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseInstanceResponsePb{} + + return pb, nil +} + +type deleteDatabaseInstanceResponsePb struct { +} + +func deleteDatabaseInstanceResponseFromPb(pb *deleteDatabaseInstanceResponsePb) (*DeleteDatabaseInstanceResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseInstanceResponse{} + + return st, nil +} + +func deleteDatabaseTableRequestToPb(st *DeleteDatabaseTableRequest) (*deleteDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteDatabaseTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteDatabaseTableRequestFromPb(pb *deleteDatabaseTableRequestPb) (*DeleteDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteDatabaseTableResponseToPb(st *DeleteDatabaseTableResponse) (*deleteDatabaseTableResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDatabaseTableResponsePb{} + + return pb, nil +} + +type deleteDatabaseTableResponsePb struct { +} + +func deleteDatabaseTableResponseFromPb(pb *deleteDatabaseTableResponsePb) (*DeleteDatabaseTableResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDatabaseTableResponse{} + + return st, nil +} + +func deleteExternalLocationRequestToPb(st *DeleteExternalLocationRequest) (*deleteExternalLocationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExternalLocationRequestPb{} + pb.Force = st.Force + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteExternalLocationRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteExternalLocationRequestFromPb(pb *deleteExternalLocationRequestPb) (*DeleteExternalLocationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExternalLocationRequest{} + st.Force = pb.Force + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteExternalLocationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteExternalLocationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteFunctionRequestToPb(st *DeleteFunctionRequest) (*deleteFunctionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteFunctionRequestPb{} + pb.Force = st.Force + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteFunctionRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteFunctionRequestFromPb(pb *deleteFunctionRequestPb) (*DeleteFunctionRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteFunctionRequest{} + st.Force = pb.Force + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteFunctionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteFunctionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteMetastoreRequestToPb(st *DeleteMetastoreRequest) (*deleteMetastoreRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteMetastoreRequestPb{} + pb.Force = st.Force + + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteMetastoreRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Id string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteMetastoreRequestFromPb(pb *deleteMetastoreRequestPb) (*DeleteMetastoreRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteMetastoreRequest{} + st.Force = pb.Force + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteMetastoreRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteMetastoreRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteModelVersionRequestToPb(st *DeleteModelVersionRequest) (*deleteModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelVersionRequestPb{} + pb.FullName = st.FullName + + pb.Version = st.Version + + return pb, nil +} + +type deleteModelVersionRequestPb struct { + FullName string `json:"-" url:"-"` + + Version int `json:"-" url:"-"` +} + +func deleteModelVersionRequestFromPb(pb *deleteModelVersionRequestPb) (*DeleteModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelVersionRequest{} + st.FullName = pb.FullName + st.Version = pb.Version + + return st, nil +} + +func deleteOnlineTableRequestToPb(st *DeleteOnlineTableRequest) (*deleteOnlineTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteOnlineTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteOnlineTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteOnlineTableRequestFromPb(pb *deleteOnlineTableRequestPb) (*DeleteOnlineTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteOnlineTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteQualityMonitorRequestToPb(st *DeleteQualityMonitorRequest) (*deleteQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteQualityMonitorRequestPb{} + pb.TableName = st.TableName + + return pb, nil +} + +type deleteQualityMonitorRequestPb struct { + TableName string `json:"-" url:"-"` +} + +func deleteQualityMonitorRequestFromPb(pb *deleteQualityMonitorRequestPb) (*DeleteQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteQualityMonitorRequest{} + st.TableName = pb.TableName + + return st, nil +} + +func deleteRegisteredModelRequestToPb(st *DeleteRegisteredModelRequest) (*deleteRegisteredModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRegisteredModelRequestPb{} + pb.FullName = st.FullName + + return pb, nil +} + +type deleteRegisteredModelRequestPb struct { + FullName string `json:"-" url:"-"` +} + +func deleteRegisteredModelRequestFromPb(pb *deleteRegisteredModelRequestPb) (*DeleteRegisteredModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRegisteredModelRequest{} + st.FullName = pb.FullName + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteSchemaRequestToPb(st *DeleteSchemaRequest) (*deleteSchemaRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSchemaRequestPb{} + pb.Force = st.Force + + pb.FullName = st.FullName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteSchemaRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + FullName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteSchemaRequestFromPb(pb *deleteSchemaRequestPb) (*DeleteSchemaRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSchemaRequest{} + st.Force = pb.Force + st.FullName = pb.FullName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteSchemaRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteSchemaRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteStorageCredentialRequestToPb(st *DeleteStorageCredentialRequest) (*deleteStorageCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteStorageCredentialRequestPb{} + pb.Force = st.Force + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteStorageCredentialRequestPb struct { + Force bool `json:"-" url:"force,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteStorageCredentialRequestFromPb(pb *deleteStorageCredentialRequestPb) (*DeleteStorageCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteStorageCredentialRequest{} + st.Force = pb.Force + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteStorageCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteStorageCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteSyncedDatabaseTableRequestToPb(st *DeleteSyncedDatabaseTableRequest) (*deleteSyncedDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSyncedDatabaseTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteSyncedDatabaseTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteSyncedDatabaseTableRequestFromPb(pb *deleteSyncedDatabaseTableRequestPb) (*DeleteSyncedDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSyncedDatabaseTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteSyncedDatabaseTableResponseToPb(st *DeleteSyncedDatabaseTableResponse) (*deleteSyncedDatabaseTableResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSyncedDatabaseTableResponsePb{} + + return pb, nil +} + +type deleteSyncedDatabaseTableResponsePb struct { +} + +func deleteSyncedDatabaseTableResponseFromPb(pb *deleteSyncedDatabaseTableResponsePb) (*DeleteSyncedDatabaseTableResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSyncedDatabaseTableResponse{} + + return st, nil +} + +func deleteTableConstraintRequestToPb(st *DeleteTableConstraintRequest) (*deleteTableConstraintRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTableConstraintRequestPb{} + pb.Cascade = st.Cascade + + pb.ConstraintName = st.ConstraintName + + pb.FullName = st.FullName + + return pb, nil +} + +type deleteTableConstraintRequestPb struct { + Cascade bool `json:"-" url:"cascade"` + + ConstraintName string `json:"-" url:"constraint_name"` + + FullName string `json:"-" url:"-"` +} + +func deleteTableConstraintRequestFromPb(pb *deleteTableConstraintRequestPb) (*DeleteTableConstraintRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTableConstraintRequest{} + st.Cascade = pb.Cascade + st.ConstraintName = pb.ConstraintName + st.FullName = pb.FullName + + return st, nil +} + +func deleteTableRequestToPb(st *DeleteTableRequest) (*deleteTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTableRequestPb{} + pb.FullName = st.FullName + + return pb, nil +} + +type deleteTableRequestPb struct { + FullName string `json:"-" url:"-"` +} + +func deleteTableRequestFromPb(pb *deleteTableRequestPb) (*DeleteTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTableRequest{} + st.FullName = pb.FullName + + return st, nil +} + +func deleteVolumeRequestToPb(st *DeleteVolumeRequest) (*deleteVolumeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteVolumeRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteVolumeRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteVolumeRequestFromPb(pb *deleteVolumeRequestPb) (*DeleteVolumeRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteVolumeRequest{} + st.Name = pb.Name + + return st, nil +} + +func deltaRuntimePropertiesKvPairsToPb(st *DeltaRuntimePropertiesKvPairs) (*deltaRuntimePropertiesKvPairsPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaRuntimePropertiesKvPairsPb{} + pb.DeltaRuntimeProperties = st.DeltaRuntimeProperties + + return pb, nil +} + +type deltaRuntimePropertiesKvPairsPb struct { + DeltaRuntimeProperties map[string]string `json:"delta_runtime_properties"` +} + +func deltaRuntimePropertiesKvPairsFromPb(pb *deltaRuntimePropertiesKvPairsPb) (*DeltaRuntimePropertiesKvPairs, error) { + if pb == nil { + return nil, nil + } + st := &DeltaRuntimePropertiesKvPairs{} + st.DeltaRuntimeProperties = pb.DeltaRuntimeProperties + + return st, nil +} + +func dependencyToPb(st *Dependency) (*dependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &dependencyPb{} + pb.Function = st.Function + + pb.Table = st.Table + + return pb, nil +} + +type dependencyPb struct { + Function *FunctionDependency `json:"function,omitempty"` + + Table *TableDependency `json:"table,omitempty"` +} + +func dependencyFromPb(pb *dependencyPb) (*Dependency, error) { + if pb == nil { + return nil, nil + } + st := &Dependency{} + st.Function = pb.Function + st.Table = pb.Table + + return st, nil +} + +func dependencyListToPb(st *DependencyList) (*dependencyListPb, error) { + if st == nil { + return nil, nil + } + pb := &dependencyListPb{} + pb.Dependencies = st.Dependencies + + return pb, nil +} + +type dependencyListPb struct { + Dependencies []Dependency `json:"dependencies,omitempty"` +} + +func dependencyListFromPb(pb *dependencyListPb) (*DependencyList, error) { + if pb == nil { + return nil, nil + } + st := &DependencyList{} + st.Dependencies = pb.Dependencies + + return st, nil +} + +func disableRequestToPb(st *DisableRequest) (*disableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &disableRequestPb{} + pb.MetastoreId = st.MetastoreId + + pb.SchemaName = st.SchemaName + + return pb, nil +} + +type disableRequestPb struct { + MetastoreId string `json:"-" url:"-"` + + SchemaName string `json:"-" url:"-"` +} + +func disableRequestFromPb(pb *disableRequestPb) (*DisableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DisableRequest{} + st.MetastoreId = pb.MetastoreId + st.SchemaName = pb.SchemaName + + return st, nil +} + +func disableResponseToPb(st *DisableResponse) (*disableResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &disableResponsePb{} + + return pb, nil +} + +type disableResponsePb struct { +} + +func disableResponseFromPb(pb *disableResponsePb) (*DisableResponse, error) { + if pb == nil { + return nil, nil + } + st := &DisableResponse{} + + return st, nil +} + +func effectivePermissionsListToPb(st *EffectivePermissionsList) (*effectivePermissionsListPb, error) { + if st == nil { + return nil, nil + } + pb := &effectivePermissionsListPb{} + pb.PrivilegeAssignments = st.PrivilegeAssignments + + return pb, nil +} + +type effectivePermissionsListPb struct { + PrivilegeAssignments []EffectivePrivilegeAssignment `json:"privilege_assignments,omitempty"` +} + +func effectivePermissionsListFromPb(pb *effectivePermissionsListPb) (*EffectivePermissionsList, error) { + if pb == nil { + return nil, nil + } + st := &EffectivePermissionsList{} + st.PrivilegeAssignments = pb.PrivilegeAssignments + + return st, nil +} + +func effectivePredictiveOptimizationFlagToPb(st *EffectivePredictiveOptimizationFlag) (*effectivePredictiveOptimizationFlagPb, error) { + if st == nil { + return nil, nil + } + pb := &effectivePredictiveOptimizationFlagPb{} + pb.InheritedFromName = st.InheritedFromName + + pb.InheritedFromType = st.InheritedFromType + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type effectivePredictiveOptimizationFlagPb struct { + InheritedFromName string `json:"inherited_from_name,omitempty"` + + InheritedFromType EffectivePredictiveOptimizationFlagInheritedFromType `json:"inherited_from_type,omitempty"` + + Value EnablePredictiveOptimization `json:"value"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func effectivePredictiveOptimizationFlagFromPb(pb *effectivePredictiveOptimizationFlagPb) (*EffectivePredictiveOptimizationFlag, error) { + if pb == nil { + return nil, nil + } + st := &EffectivePredictiveOptimizationFlag{} + st.InheritedFromName = pb.InheritedFromName + st.InheritedFromType = pb.InheritedFromType + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *effectivePredictiveOptimizationFlagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st effectivePredictiveOptimizationFlagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func effectivePrivilegeToPb(st *EffectivePrivilege) (*effectivePrivilegePb, error) { + if st == nil { + return nil, nil + } + pb := &effectivePrivilegePb{} + pb.InheritedFromName = st.InheritedFromName + + pb.InheritedFromType = st.InheritedFromType + + pb.Privilege = st.Privilege + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type effectivePrivilegePb struct { + InheritedFromName string `json:"inherited_from_name,omitempty"` + + InheritedFromType SecurableType `json:"inherited_from_type,omitempty"` + + Privilege Privilege `json:"privilege,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func effectivePrivilegeFromPb(pb *effectivePrivilegePb) (*EffectivePrivilege, error) { + if pb == nil { + return nil, nil + } + st := &EffectivePrivilege{} + st.InheritedFromName = pb.InheritedFromName + st.InheritedFromType = pb.InheritedFromType + st.Privilege = pb.Privilege + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *effectivePrivilegePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st effectivePrivilegePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func effectivePrivilegeAssignmentToPb(st *EffectivePrivilegeAssignment) (*effectivePrivilegeAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &effectivePrivilegeAssignmentPb{} + pb.Principal = st.Principal + + pb.Privileges = st.Privileges + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type effectivePrivilegeAssignmentPb struct { + Principal string `json:"principal,omitempty"` + + Privileges []EffectivePrivilege `json:"privileges,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func effectivePrivilegeAssignmentFromPb(pb *effectivePrivilegeAssignmentPb) (*EffectivePrivilegeAssignment, error) { + if pb == nil { + return nil, nil + } + st := &EffectivePrivilegeAssignment{} + st.Principal = pb.Principal + st.Privileges = pb.Privileges + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *effectivePrivilegeAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st effectivePrivilegeAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enableRequestToPb(st *EnableRequest) (*enableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &enableRequestPb{} + pb.CatalogName = st.CatalogName + + pb.MetastoreId = st.MetastoreId + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enableRequestPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + SchemaName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enableRequestFromPb(pb *enableRequestPb) (*EnableRequest, error) { + if pb == nil { + return nil, nil + } + st := &EnableRequest{} + st.CatalogName = pb.CatalogName + st.MetastoreId = pb.MetastoreId + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enableRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enableRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enableResponseToPb(st *EnableResponse) (*enableResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &enableResponsePb{} + + return pb, nil +} + +type enableResponsePb struct { +} + +func enableResponseFromPb(pb *enableResponsePb) (*EnableResponse, error) { + if pb == nil { + return nil, nil + } + st := &EnableResponse{} + + return st, nil +} + +func encryptionDetailsToPb(st *EncryptionDetails) (*encryptionDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &encryptionDetailsPb{} + pb.SseEncryptionDetails = st.SseEncryptionDetails + + return pb, nil +} + +type encryptionDetailsPb struct { + SseEncryptionDetails *SseEncryptionDetails `json:"sse_encryption_details,omitempty"` +} + +func encryptionDetailsFromPb(pb *encryptionDetailsPb) (*EncryptionDetails, error) { + if pb == nil { + return nil, nil + } + st := &EncryptionDetails{} + st.SseEncryptionDetails = pb.SseEncryptionDetails + + return st, nil +} + +func existsRequestToPb(st *ExistsRequest) (*existsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &existsRequestPb{} + pb.FullName = st.FullName + + return pb, nil +} + +type existsRequestPb struct { + FullName string `json:"-" url:"-"` +} + +func existsRequestFromPb(pb *existsRequestPb) (*ExistsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExistsRequest{} + st.FullName = pb.FullName + + return st, nil +} + +func externalLocationInfoToPb(st *ExternalLocationInfo) (*externalLocationInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &externalLocationInfoPb{} + pb.BrowseOnly = st.BrowseOnly + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.CredentialId = st.CredentialId + + pb.CredentialName = st.CredentialName + + pb.EnableFileEvents = st.EnableFileEvents + + pb.EncryptionDetails = st.EncryptionDetails + + pb.Fallback = st.Fallback + + pb.FileEventQueue = st.FileEventQueue + + pb.IsolationMode = st.IsolationMode + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.ReadOnly = st.ReadOnly + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalLocationInfoPb struct { + BrowseOnly bool `json:"browse_only,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + CredentialId string `json:"credential_id,omitempty"` + + CredentialName string `json:"credential_name,omitempty"` + + EnableFileEvents bool `json:"enable_file_events,omitempty"` + + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + + Fallback bool `json:"fallback,omitempty"` + + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalLocationInfoFromPb(pb *externalLocationInfoPb) (*ExternalLocationInfo, error) { + if pb == nil { + return nil, nil + } + st := &ExternalLocationInfo{} + st.BrowseOnly = pb.BrowseOnly + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.CredentialId = pb.CredentialId + st.CredentialName = pb.CredentialName + st.EnableFileEvents = pb.EnableFileEvents + st.EncryptionDetails = pb.EncryptionDetails + st.Fallback = pb.Fallback + st.FileEventQueue = pb.FileEventQueue + st.IsolationMode = pb.IsolationMode + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.ReadOnly = pb.ReadOnly + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalLocationInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalLocationInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func failedStatusToPb(st *FailedStatus) (*failedStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &failedStatusPb{} + pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion + + pb.Timestamp = st.Timestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type failedStatusPb struct { + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + + Timestamp string `json:"timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func failedStatusFromPb(pb *failedStatusPb) (*FailedStatus, error) { + if pb == nil { + return nil, nil + } + st := &FailedStatus{} + st.LastProcessedCommitVersion = pb.LastProcessedCommitVersion + st.Timestamp = pb.Timestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *failedStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st failedStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func failoverDatabaseInstanceRequestToPb(st *FailoverDatabaseInstanceRequest) (*failoverDatabaseInstanceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &failoverDatabaseInstanceRequestPb{} + pb.FailoverTargetDatabaseInstanceName = st.FailoverTargetDatabaseInstanceName + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type failoverDatabaseInstanceRequestPb struct { + FailoverTargetDatabaseInstanceName string `json:"failover_target_database_instance_name,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func failoverDatabaseInstanceRequestFromPb(pb *failoverDatabaseInstanceRequestPb) (*FailoverDatabaseInstanceRequest, error) { + if pb == nil { + return nil, nil + } + st := &FailoverDatabaseInstanceRequest{} + st.FailoverTargetDatabaseInstanceName = pb.FailoverTargetDatabaseInstanceName + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *failoverDatabaseInstanceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st failoverDatabaseInstanceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileEventQueueToPb(st *FileEventQueue) (*fileEventQueuePb, error) { + if st == nil { + return nil, nil + } + pb := &fileEventQueuePb{} + pb.ManagedAqs = st.ManagedAqs + + pb.ManagedPubsub = st.ManagedPubsub + + pb.ManagedSqs = st.ManagedSqs + + pb.ProvidedAqs = st.ProvidedAqs + + pb.ProvidedPubsub = st.ProvidedPubsub + + pb.ProvidedSqs = st.ProvidedSqs + + return pb, nil +} + +type fileEventQueuePb struct { + ManagedAqs *AzureQueueStorage `json:"managed_aqs,omitempty"` + + ManagedPubsub *GcpPubsub `json:"managed_pubsub,omitempty"` + + ManagedSqs *AwsSqsQueue `json:"managed_sqs,omitempty"` + + ProvidedAqs *AzureQueueStorage `json:"provided_aqs,omitempty"` + + ProvidedPubsub *GcpPubsub `json:"provided_pubsub,omitempty"` + + ProvidedSqs *AwsSqsQueue `json:"provided_sqs,omitempty"` +} + +func fileEventQueueFromPb(pb *fileEventQueuePb) (*FileEventQueue, error) { + if pb == nil { + return nil, nil + } + st := &FileEventQueue{} + st.ManagedAqs = pb.ManagedAqs + st.ManagedPubsub = pb.ManagedPubsub + st.ManagedSqs = pb.ManagedSqs + st.ProvidedAqs = pb.ProvidedAqs + st.ProvidedPubsub = pb.ProvidedPubsub + st.ProvidedSqs = pb.ProvidedSqs + + return st, nil +} + +func findDatabaseInstanceByUidRequestToPb(st *FindDatabaseInstanceByUidRequest) (*findDatabaseInstanceByUidRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &findDatabaseInstanceByUidRequestPb{} + pb.Uid = st.Uid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type findDatabaseInstanceByUidRequestPb struct { + Uid string `json:"-" url:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func findDatabaseInstanceByUidRequestFromPb(pb *findDatabaseInstanceByUidRequestPb) (*FindDatabaseInstanceByUidRequest, error) { + if pb == nil { + return nil, nil + } + st := &FindDatabaseInstanceByUidRequest{} + st.Uid = pb.Uid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *findDatabaseInstanceByUidRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st findDatabaseInstanceByUidRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func foreignKeyConstraintToPb(st *ForeignKeyConstraint) (*foreignKeyConstraintPb, error) { + if st == nil { + return nil, nil + } + pb := &foreignKeyConstraintPb{} + pb.ChildColumns = st.ChildColumns + + pb.Name = st.Name + + pb.ParentColumns = st.ParentColumns + + pb.ParentTable = st.ParentTable + + return pb, nil +} + +type foreignKeyConstraintPb struct { + ChildColumns []string `json:"child_columns"` + + Name string `json:"name"` + + ParentColumns []string `json:"parent_columns"` + + ParentTable string `json:"parent_table"` +} + +func foreignKeyConstraintFromPb(pb *foreignKeyConstraintPb) (*ForeignKeyConstraint, error) { + if pb == nil { + return nil, nil + } + st := &ForeignKeyConstraint{} + st.ChildColumns = pb.ChildColumns + st.Name = pb.Name + st.ParentColumns = pb.ParentColumns + st.ParentTable = pb.ParentTable + + return st, nil +} + +func functionDependencyToPb(st *FunctionDependency) (*functionDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &functionDependencyPb{} + pb.FunctionFullName = st.FunctionFullName + + return pb, nil +} + +type functionDependencyPb struct { + FunctionFullName string `json:"function_full_name"` +} + +func functionDependencyFromPb(pb *functionDependencyPb) (*FunctionDependency, error) { + if pb == nil { + return nil, nil + } + st := &FunctionDependency{} + st.FunctionFullName = pb.FunctionFullName + + return st, nil +} + +func functionInfoToPb(st *FunctionInfo) (*functionInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &functionInfoPb{} + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DataType = st.DataType + + pb.ExternalLanguage = st.ExternalLanguage + + pb.ExternalName = st.ExternalName + + pb.FullDataType = st.FullDataType + + pb.FullName = st.FullName + + pb.FunctionId = st.FunctionId + + pb.InputParams = st.InputParams + + pb.IsDeterministic = st.IsDeterministic + + pb.IsNullCall = st.IsNullCall + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.ParameterStyle = st.ParameterStyle + + pb.Properties = st.Properties + + pb.ReturnParams = st.ReturnParams + + pb.RoutineBody = st.RoutineBody + + pb.RoutineDefinition = st.RoutineDefinition + + pb.RoutineDependencies = st.RoutineDependencies + + pb.SchemaName = st.SchemaName + + pb.SecurityType = st.SecurityType + + pb.SpecificName = st.SpecificName + + pb.SqlDataAccess = st.SqlDataAccess + + pb.SqlPath = st.SqlPath + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type functionInfoPb struct { + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DataType ColumnTypeName `json:"data_type,omitempty"` + + ExternalLanguage string `json:"external_language,omitempty"` + + ExternalName string `json:"external_name,omitempty"` + + FullDataType string `json:"full_data_type,omitempty"` + + FullName string `json:"full_name,omitempty"` + + FunctionId string `json:"function_id,omitempty"` + + InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + + IsDeterministic bool `json:"is_deterministic,omitempty"` + + IsNullCall bool `json:"is_null_call,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ParameterStyle FunctionInfoParameterStyle `json:"parameter_style,omitempty"` + + Properties string `json:"properties,omitempty"` + + ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + + RoutineBody FunctionInfoRoutineBody `json:"routine_body,omitempty"` + + RoutineDefinition string `json:"routine_definition,omitempty"` + + RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + SecurityType FunctionInfoSecurityType `json:"security_type,omitempty"` + + SpecificName string `json:"specific_name,omitempty"` + + SqlDataAccess FunctionInfoSqlDataAccess `json:"sql_data_access,omitempty"` + + SqlPath string `json:"sql_path,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func functionInfoFromPb(pb *functionInfoPb) (*FunctionInfo, error) { + if pb == nil { + return nil, nil + } + st := &FunctionInfo{} + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DataType = pb.DataType + st.ExternalLanguage = pb.ExternalLanguage + st.ExternalName = pb.ExternalName + st.FullDataType = pb.FullDataType + st.FullName = pb.FullName + st.FunctionId = pb.FunctionId + st.InputParams = pb.InputParams + st.IsDeterministic = pb.IsDeterministic + st.IsNullCall = pb.IsNullCall + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.ParameterStyle = pb.ParameterStyle + st.Properties = pb.Properties + st.ReturnParams = pb.ReturnParams + st.RoutineBody = pb.RoutineBody + st.RoutineDefinition = pb.RoutineDefinition + st.RoutineDependencies = pb.RoutineDependencies + st.SchemaName = pb.SchemaName + st.SecurityType = pb.SecurityType + st.SpecificName = pb.SpecificName + st.SqlDataAccess = pb.SqlDataAccess + st.SqlPath = pb.SqlPath + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *functionInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st functionInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &functionParameterInfoPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.ParameterDefault = st.ParameterDefault + + pb.ParameterMode = st.ParameterMode + + pb.ParameterType = st.ParameterType + + pb.Position = st.Position + + pb.TypeIntervalType = st.TypeIntervalType + + pb.TypeJson = st.TypeJson + + pb.TypeName = st.TypeName + + pb.TypePrecision = st.TypePrecision + + pb.TypeScale = st.TypeScale + + pb.TypeText = st.TypeText + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type functionParameterInfoPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + ParameterDefault string `json:"parameter_default,omitempty"` + + ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + + ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + + Position int `json:"position"` + + TypeIntervalType string `json:"type_interval_type,omitempty"` + + TypeJson string `json:"type_json,omitempty"` + + TypeName ColumnTypeName `json:"type_name"` + + TypePrecision int `json:"type_precision,omitempty"` + + TypeScale int `json:"type_scale,omitempty"` + + TypeText string `json:"type_text"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func functionParameterInfoFromPb(pb *functionParameterInfoPb) (*FunctionParameterInfo, error) { + if pb == nil { + return nil, nil + } + st := &FunctionParameterInfo{} + st.Comment = pb.Comment + st.Name = pb.Name + st.ParameterDefault = pb.ParameterDefault + st.ParameterMode = pb.ParameterMode + st.ParameterType = pb.ParameterType + st.Position = pb.Position + st.TypeIntervalType = pb.TypeIntervalType + st.TypeJson = pb.TypeJson + st.TypeName = pb.TypeName + st.TypePrecision = pb.TypePrecision + st.TypeScale = pb.TypeScale + st.TypeText = pb.TypeText + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *functionParameterInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st functionParameterInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func functionParameterInfosToPb(st *FunctionParameterInfos) (*functionParameterInfosPb, error) { + if st == nil { + return nil, nil + } + pb := &functionParameterInfosPb{} + pb.Parameters = st.Parameters + + return pb, nil +} + +type functionParameterInfosPb struct { + Parameters []FunctionParameterInfo `json:"parameters,omitempty"` +} + +func functionParameterInfosFromPb(pb *functionParameterInfosPb) (*FunctionParameterInfos, error) { + if pb == nil { + return nil, nil + } + st := &FunctionParameterInfos{} + st.Parameters = pb.Parameters + + return st, nil +} + +func gcpOauthTokenToPb(st *GcpOauthToken) (*gcpOauthTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpOauthTokenPb{} + pb.OauthToken = st.OauthToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gcpOauthTokenPb struct { + OauthToken string `json:"oauth_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gcpOauthTokenFromPb(pb *gcpOauthTokenPb) (*GcpOauthToken, error) { + if pb == nil { + return nil, nil + } + st := &GcpOauthToken{} + st.OauthToken = pb.OauthToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gcpOauthTokenPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gcpOauthTokenPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gcpPubsubToPb(st *GcpPubsub) (*gcpPubsubPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpPubsubPb{} + pb.ManagedResourceId = st.ManagedResourceId + + pb.SubscriptionName = st.SubscriptionName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gcpPubsubPb struct { + ManagedResourceId string `json:"managed_resource_id,omitempty"` + + SubscriptionName string `json:"subscription_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gcpPubsubFromPb(pb *gcpPubsubPb) (*GcpPubsub, error) { + if pb == nil { + return nil, nil + } + st := &GcpPubsub{} + st.ManagedResourceId = pb.ManagedResourceId + st.SubscriptionName = pb.SubscriptionName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gcpPubsubPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gcpPubsubPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func generateDatabaseCredentialRequestToPb(st *GenerateDatabaseCredentialRequest) (*generateDatabaseCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &generateDatabaseCredentialRequestPb{} + pb.InstanceNames = st.InstanceNames + + pb.RequestId = st.RequestId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type generateDatabaseCredentialRequestPb struct { + InstanceNames []string `json:"instance_names,omitempty"` + + RequestId string `json:"request_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func generateDatabaseCredentialRequestFromPb(pb *generateDatabaseCredentialRequestPb) (*GenerateDatabaseCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenerateDatabaseCredentialRequest{} + st.InstanceNames = pb.InstanceNames + st.RequestId = pb.RequestId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *generateDatabaseCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st generateDatabaseCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func generateTemporaryServiceCredentialAzureOptionsToPb(st *GenerateTemporaryServiceCredentialAzureOptions) (*generateTemporaryServiceCredentialAzureOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &generateTemporaryServiceCredentialAzureOptionsPb{} + pb.Resources = st.Resources + + return pb, nil +} + +type generateTemporaryServiceCredentialAzureOptionsPb struct { + Resources []string `json:"resources,omitempty"` +} + +func generateTemporaryServiceCredentialAzureOptionsFromPb(pb *generateTemporaryServiceCredentialAzureOptionsPb) (*GenerateTemporaryServiceCredentialAzureOptions, error) { + if pb == nil { + return nil, nil + } + st := &GenerateTemporaryServiceCredentialAzureOptions{} + st.Resources = pb.Resources + + return st, nil +} + +func generateTemporaryServiceCredentialGcpOptionsToPb(st *GenerateTemporaryServiceCredentialGcpOptions) (*generateTemporaryServiceCredentialGcpOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &generateTemporaryServiceCredentialGcpOptionsPb{} + pb.Scopes = st.Scopes + + return pb, nil +} + +type generateTemporaryServiceCredentialGcpOptionsPb struct { + Scopes []string `json:"scopes,omitempty"` +} + +func generateTemporaryServiceCredentialGcpOptionsFromPb(pb *generateTemporaryServiceCredentialGcpOptionsPb) (*GenerateTemporaryServiceCredentialGcpOptions, error) { + if pb == nil { + return nil, nil + } + st := &GenerateTemporaryServiceCredentialGcpOptions{} + st.Scopes = pb.Scopes + + return st, nil +} + +func generateTemporaryServiceCredentialRequestToPb(st *GenerateTemporaryServiceCredentialRequest) (*generateTemporaryServiceCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &generateTemporaryServiceCredentialRequestPb{} + pb.AzureOptions = st.AzureOptions + + pb.CredentialName = st.CredentialName + + pb.GcpOptions = st.GcpOptions + + return pb, nil +} + +type generateTemporaryServiceCredentialRequestPb struct { + AzureOptions *GenerateTemporaryServiceCredentialAzureOptions `json:"azure_options,omitempty"` + + CredentialName string `json:"credential_name"` + + GcpOptions *GenerateTemporaryServiceCredentialGcpOptions `json:"gcp_options,omitempty"` +} + +func generateTemporaryServiceCredentialRequestFromPb(pb *generateTemporaryServiceCredentialRequestPb) (*GenerateTemporaryServiceCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenerateTemporaryServiceCredentialRequest{} + st.AzureOptions = pb.AzureOptions + st.CredentialName = pb.CredentialName + st.GcpOptions = pb.GcpOptions + + return st, nil +} + +func generateTemporaryTableCredentialRequestToPb(st *GenerateTemporaryTableCredentialRequest) (*generateTemporaryTableCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &generateTemporaryTableCredentialRequestPb{} + pb.Operation = st.Operation + + pb.TableId = st.TableId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type generateTemporaryTableCredentialRequestPb struct { + Operation TableOperation `json:"operation,omitempty"` + + TableId string `json:"table_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func generateTemporaryTableCredentialRequestFromPb(pb *generateTemporaryTableCredentialRequestPb) (*GenerateTemporaryTableCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenerateTemporaryTableCredentialRequest{} + st.Operation = pb.Operation + st.TableId = pb.TableId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *generateTemporaryTableCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st generateTemporaryTableCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func generateTemporaryTableCredentialResponseToPb(st *GenerateTemporaryTableCredentialResponse) (*generateTemporaryTableCredentialResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &generateTemporaryTableCredentialResponsePb{} + pb.AwsTempCredentials = st.AwsTempCredentials + + pb.AzureAad = st.AzureAad + + pb.AzureUserDelegationSas = st.AzureUserDelegationSas + + pb.ExpirationTime = st.ExpirationTime + + pb.GcpOauthToken = st.GcpOauthToken + + pb.R2TempCredentials = st.R2TempCredentials + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type generateTemporaryTableCredentialResponsePb struct { + AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + + AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + + AzureUserDelegationSas *AzureUserDelegationSas `json:"azure_user_delegation_sas,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + + R2TempCredentials *R2Credentials `json:"r2_temp_credentials,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func generateTemporaryTableCredentialResponseFromPb(pb *generateTemporaryTableCredentialResponsePb) (*GenerateTemporaryTableCredentialResponse, error) { + if pb == nil { + return nil, nil + } + st := &GenerateTemporaryTableCredentialResponse{} + st.AwsTempCredentials = pb.AwsTempCredentials + st.AzureAad = pb.AzureAad + st.AzureUserDelegationSas = pb.AzureUserDelegationSas + st.ExpirationTime = pb.ExpirationTime + st.GcpOauthToken = pb.GcpOauthToken + st.R2TempCredentials = pb.R2TempCredentials + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *generateTemporaryTableCredentialResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st generateTemporaryTableCredentialResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAccountMetastoreAssignmentRequestToPb(st *GetAccountMetastoreAssignmentRequest) (*getAccountMetastoreAssignmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountMetastoreAssignmentRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type getAccountMetastoreAssignmentRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func getAccountMetastoreAssignmentRequestFromPb(pb *getAccountMetastoreAssignmentRequestPb) (*GetAccountMetastoreAssignmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountMetastoreAssignmentRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func getAccountMetastoreRequestToPb(st *GetAccountMetastoreRequest) (*getAccountMetastoreRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountMetastoreRequestPb{} + pb.MetastoreId = st.MetastoreId + + return pb, nil +} + +type getAccountMetastoreRequestPb struct { + MetastoreId string `json:"-" url:"-"` +} + +func getAccountMetastoreRequestFromPb(pb *getAccountMetastoreRequestPb) (*GetAccountMetastoreRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountMetastoreRequest{} + st.MetastoreId = pb.MetastoreId + + return st, nil +} + +func getAccountStorageCredentialRequestToPb(st *GetAccountStorageCredentialRequest) (*getAccountStorageCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountStorageCredentialRequestPb{} + pb.MetastoreId = st.MetastoreId + + pb.StorageCredentialName = st.StorageCredentialName + + return pb, nil +} + +type getAccountStorageCredentialRequestPb struct { + MetastoreId string `json:"-" url:"-"` + + StorageCredentialName string `json:"-" url:"-"` +} + +func getAccountStorageCredentialRequestFromPb(pb *getAccountStorageCredentialRequestPb) (*GetAccountStorageCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountStorageCredentialRequest{} + st.MetastoreId = pb.MetastoreId + st.StorageCredentialName = pb.StorageCredentialName + + return st, nil +} + +func getArtifactAllowlistRequestToPb(st *GetArtifactAllowlistRequest) (*getArtifactAllowlistRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getArtifactAllowlistRequestPb{} + pb.ArtifactType = st.ArtifactType + + return pb, nil +} + +type getArtifactAllowlistRequestPb struct { + ArtifactType ArtifactType `json:"-" url:"-"` +} + +func getArtifactAllowlistRequestFromPb(pb *getArtifactAllowlistRequestPb) (*GetArtifactAllowlistRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetArtifactAllowlistRequest{} + st.ArtifactType = pb.ArtifactType + + return st, nil +} + +func getBindingsRequestToPb(st *GetBindingsRequest) (*getBindingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getBindingsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.SecurableName = st.SecurableName + + pb.SecurableType = st.SecurableType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getBindingsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SecurableName string `json:"-" url:"-"` + + SecurableType string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getBindingsRequestFromPb(pb *getBindingsRequestPb) (*GetBindingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetBindingsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.SecurableName = pb.SecurableName + st.SecurableType = pb.SecurableType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getBindingsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getBindingsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getByAliasRequestToPb(st *GetByAliasRequest) (*getByAliasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getByAliasRequestPb{} + pb.Alias = st.Alias + + pb.FullName = st.FullName + + pb.IncludeAliases = st.IncludeAliases + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getByAliasRequestPb struct { + Alias string `json:"-" url:"-"` + + FullName string `json:"-" url:"-"` + + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getByAliasRequestFromPb(pb *getByAliasRequestPb) (*GetByAliasRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetByAliasRequest{} + st.Alias = pb.Alias + st.FullName = pb.FullName + st.IncludeAliases = pb.IncludeAliases + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getByAliasRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getByAliasRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getCatalogRequestToPb(st *GetCatalogRequest) (*getCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCatalogRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getCatalogRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getCatalogRequestFromPb(pb *getCatalogRequestPb) (*GetCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCatalogRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getCatalogRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getCatalogRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getCatalogWorkspaceBindingsResponseToPb(st *GetCatalogWorkspaceBindingsResponse) (*getCatalogWorkspaceBindingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getCatalogWorkspaceBindingsResponsePb{} + pb.Workspaces = st.Workspaces + + return pb, nil +} + +type getCatalogWorkspaceBindingsResponsePb struct { + Workspaces []int64 `json:"workspaces,omitempty"` +} + +func getCatalogWorkspaceBindingsResponseFromPb(pb *getCatalogWorkspaceBindingsResponsePb) (*GetCatalogWorkspaceBindingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetCatalogWorkspaceBindingsResponse{} + st.Workspaces = pb.Workspaces + + return st, nil +} + +func getConnectionRequestToPb(st *GetConnectionRequest) (*getConnectionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getConnectionRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getConnectionRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getConnectionRequestFromPb(pb *getConnectionRequestPb) (*GetConnectionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetConnectionRequest{} + st.Name = pb.Name + + return st, nil +} + +func getCredentialRequestToPb(st *GetCredentialRequest) (*getCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialRequestPb{} + pb.NameArg = st.NameArg + + return pb, nil +} + +type getCredentialRequestPb struct { + NameArg string `json:"-" url:"-"` +} + +func getCredentialRequestFromPb(pb *getCredentialRequestPb) (*GetCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialRequest{} + st.NameArg = pb.NameArg + + return st, nil +} + +func getDatabaseCatalogRequestToPb(st *GetDatabaseCatalogRequest) (*getDatabaseCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDatabaseCatalogRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getDatabaseCatalogRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getDatabaseCatalogRequestFromPb(pb *getDatabaseCatalogRequestPb) (*GetDatabaseCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDatabaseCatalogRequest{} + st.Name = pb.Name + + return st, nil +} + +func getDatabaseInstanceRequestToPb(st *GetDatabaseInstanceRequest) (*getDatabaseInstanceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDatabaseInstanceRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getDatabaseInstanceRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getDatabaseInstanceRequestFromPb(pb *getDatabaseInstanceRequestPb) (*GetDatabaseInstanceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDatabaseInstanceRequest{} + st.Name = pb.Name + + return st, nil +} + +func getDatabaseTableRequestToPb(st *GetDatabaseTableRequest) (*getDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDatabaseTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getDatabaseTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getDatabaseTableRequestFromPb(pb *getDatabaseTableRequestPb) (*GetDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDatabaseTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func getEffectiveRequestToPb(st *GetEffectiveRequest) (*getEffectiveRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getEffectiveRequestPb{} + pb.FullName = st.FullName + + pb.Principal = st.Principal + + pb.SecurableType = st.SecurableType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getEffectiveRequestPb struct { + FullName string `json:"-" url:"-"` + + Principal string `json:"-" url:"principal,omitempty"` + + SecurableType SecurableType `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getEffectiveRequestFromPb(pb *getEffectiveRequestPb) (*GetEffectiveRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetEffectiveRequest{} + st.FullName = pb.FullName + st.Principal = pb.Principal + st.SecurableType = pb.SecurableType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getEffectiveRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getEffectiveRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getExternalLocationRequestToPb(st *GetExternalLocationRequest) (*getExternalLocationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getExternalLocationRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getExternalLocationRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getExternalLocationRequestFromPb(pb *getExternalLocationRequestPb) (*GetExternalLocationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetExternalLocationRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getExternalLocationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getExternalLocationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getFunctionRequestToPb(st *GetFunctionRequest) (*getFunctionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getFunctionRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getFunctionRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getFunctionRequestFromPb(pb *getFunctionRequestPb) (*GetFunctionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetFunctionRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getFunctionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getFunctionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getGrantRequestToPb(st *GetGrantRequest) (*getGrantRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getGrantRequestPb{} + pb.FullName = st.FullName + + pb.Principal = st.Principal + + pb.SecurableType = st.SecurableType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getGrantRequestPb struct { + FullName string `json:"-" url:"-"` + + Principal string `json:"-" url:"principal,omitempty"` + + SecurableType SecurableType `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getGrantRequestFromPb(pb *getGrantRequestPb) (*GetGrantRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetGrantRequest{} + st.FullName = pb.FullName + st.Principal = pb.Principal + st.SecurableType = pb.SecurableType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getGrantRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getGrantRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getMetastoreRequestToPb(st *GetMetastoreRequest) (*getMetastoreRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getMetastoreRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getMetastoreRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getMetastoreRequestFromPb(pb *getMetastoreRequestPb) (*GetMetastoreRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetMetastoreRequest{} + st.Id = pb.Id + + return st, nil +} + +func getMetastoreSummaryResponseToPb(st *GetMetastoreSummaryResponse) (*getMetastoreSummaryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getMetastoreSummaryResponsePb{} + pb.Cloud = st.Cloud + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DefaultDataAccessConfigId = st.DefaultDataAccessConfigId + + pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName + + pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds + + pb.DeltaSharingScope = st.DeltaSharingScope + + pb.ExternalAccessEnabled = st.ExternalAccessEnabled + + pb.GlobalMetastoreId = st.GlobalMetastoreId + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.PrivilegeModelVersion = st.PrivilegeModelVersion + + pb.Region = st.Region + + pb.StorageRoot = st.StorageRoot + + pb.StorageRootCredentialId = st.StorageRootCredentialId + + pb.StorageRootCredentialName = st.StorageRootCredentialName + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getMetastoreSummaryResponsePb struct { + Cloud string `json:"cloud,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + + DeltaSharingScope GetMetastoreSummaryResponseDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + + ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + + Region string `json:"region,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + + StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getMetastoreSummaryResponseFromPb(pb *getMetastoreSummaryResponsePb) (*GetMetastoreSummaryResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetMetastoreSummaryResponse{} + st.Cloud = pb.Cloud + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DefaultDataAccessConfigId = pb.DefaultDataAccessConfigId + st.DeltaSharingOrganizationName = pb.DeltaSharingOrganizationName + st.DeltaSharingRecipientTokenLifetimeInSeconds = pb.DeltaSharingRecipientTokenLifetimeInSeconds + st.DeltaSharingScope = pb.DeltaSharingScope + st.ExternalAccessEnabled = pb.ExternalAccessEnabled + st.GlobalMetastoreId = pb.GlobalMetastoreId + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.PrivilegeModelVersion = pb.PrivilegeModelVersion + st.Region = pb.Region + st.StorageRoot = pb.StorageRoot + st.StorageRootCredentialId = pb.StorageRootCredentialId + st.StorageRootCredentialName = pb.StorageRootCredentialName + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getMetastoreSummaryResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getMetastoreSummaryResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getModelVersionRequestToPb(st *GetModelVersionRequest) (*getModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getModelVersionRequestPb{} + pb.FullName = st.FullName + + pb.IncludeAliases = st.IncludeAliases + + pb.IncludeBrowse = st.IncludeBrowse + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getModelVersionRequestPb struct { + FullName string `json:"-" url:"-"` + + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + Version int `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getModelVersionRequestFromPb(pb *getModelVersionRequestPb) (*GetModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetModelVersionRequest{} + st.FullName = pb.FullName + st.IncludeAliases = pb.IncludeAliases + st.IncludeBrowse = pb.IncludeBrowse + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getModelVersionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getModelVersionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getOnlineTableRequestToPb(st *GetOnlineTableRequest) (*getOnlineTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getOnlineTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getOnlineTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getOnlineTableRequestFromPb(pb *getOnlineTableRequestPb) (*GetOnlineTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetOnlineTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func getQualityMonitorRequestToPb(st *GetQualityMonitorRequest) (*getQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getQualityMonitorRequestPb{} + pb.TableName = st.TableName + + return pb, nil +} + +type getQualityMonitorRequestPb struct { + TableName string `json:"-" url:"-"` +} + +func getQualityMonitorRequestFromPb(pb *getQualityMonitorRequestPb) (*GetQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetQualityMonitorRequest{} + st.TableName = pb.TableName + + return st, nil +} + +func getQuotaRequestToPb(st *GetQuotaRequest) (*getQuotaRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getQuotaRequestPb{} + pb.ParentFullName = st.ParentFullName + + pb.ParentSecurableType = st.ParentSecurableType + + pb.QuotaName = st.QuotaName + + return pb, nil +} + +type getQuotaRequestPb struct { + ParentFullName string `json:"-" url:"-"` + + ParentSecurableType string `json:"-" url:"-"` + + QuotaName string `json:"-" url:"-"` +} + +func getQuotaRequestFromPb(pb *getQuotaRequestPb) (*GetQuotaRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetQuotaRequest{} + st.ParentFullName = pb.ParentFullName + st.ParentSecurableType = pb.ParentSecurableType + st.QuotaName = pb.QuotaName + + return st, nil +} + +func getQuotaResponseToPb(st *GetQuotaResponse) (*getQuotaResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getQuotaResponsePb{} + pb.QuotaInfo = st.QuotaInfo + + return pb, nil +} + +type getQuotaResponsePb struct { + QuotaInfo *QuotaInfo `json:"quota_info,omitempty"` +} + +func getQuotaResponseFromPb(pb *getQuotaResponsePb) (*GetQuotaResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetQuotaResponse{} + st.QuotaInfo = pb.QuotaInfo + + return st, nil +} + +func getRefreshRequestToPb(st *GetRefreshRequest) (*getRefreshRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRefreshRequestPb{} + pb.RefreshId = st.RefreshId + + pb.TableName = st.TableName + + return pb, nil +} + +type getRefreshRequestPb struct { + RefreshId string `json:"-" url:"-"` + + TableName string `json:"-" url:"-"` +} + +func getRefreshRequestFromPb(pb *getRefreshRequestPb) (*GetRefreshRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRefreshRequest{} + st.RefreshId = pb.RefreshId + st.TableName = pb.TableName + + return st, nil +} + +func getRegisteredModelRequestToPb(st *GetRegisteredModelRequest) (*getRegisteredModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRegisteredModelRequestPb{} + pb.FullName = st.FullName + + pb.IncludeAliases = st.IncludeAliases + + pb.IncludeBrowse = st.IncludeBrowse + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRegisteredModelRequestPb struct { + FullName string `json:"-" url:"-"` + + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRegisteredModelRequestFromPb(pb *getRegisteredModelRequestPb) (*GetRegisteredModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRegisteredModelRequest{} + st.FullName = pb.FullName + st.IncludeAliases = pb.IncludeAliases + st.IncludeBrowse = pb.IncludeBrowse + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRegisteredModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRegisteredModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getSchemaRequestToPb(st *GetSchemaRequest) (*getSchemaRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getSchemaRequestPb{} + pb.FullName = st.FullName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getSchemaRequestPb struct { + FullName string `json:"-" url:"-"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getSchemaRequestFromPb(pb *getSchemaRequestPb) (*GetSchemaRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetSchemaRequest{} + st.FullName = pb.FullName + st.IncludeBrowse = pb.IncludeBrowse + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getSchemaRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getSchemaRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getStorageCredentialRequestToPb(st *GetStorageCredentialRequest) (*getStorageCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStorageCredentialRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getStorageCredentialRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getStorageCredentialRequestFromPb(pb *getStorageCredentialRequestPb) (*GetStorageCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStorageCredentialRequest{} + st.Name = pb.Name + + return st, nil +} + +func getSyncedDatabaseTableRequestToPb(st *GetSyncedDatabaseTableRequest) (*getSyncedDatabaseTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getSyncedDatabaseTableRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getSyncedDatabaseTableRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getSyncedDatabaseTableRequestFromPb(pb *getSyncedDatabaseTableRequestPb) (*GetSyncedDatabaseTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetSyncedDatabaseTableRequest{} + st.Name = pb.Name + + return st, nil +} + +func getTableRequestToPb(st *GetTableRequest) (*getTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getTableRequestPb{} + pb.FullName = st.FullName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.IncludeDeltaMetadata = st.IncludeDeltaMetadata + + pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getTableRequestPb struct { + FullName string `json:"-" url:"-"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getTableRequestFromPb(pb *getTableRequestPb) (*GetTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetTableRequest{} + st.FullName = pb.FullName + st.IncludeBrowse = pb.IncludeBrowse + st.IncludeDeltaMetadata = pb.IncludeDeltaMetadata + st.IncludeManifestCapabilities = pb.IncludeManifestCapabilities + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getTableRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getTableRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getWorkspaceBindingRequestToPb(st *GetWorkspaceBindingRequest) (*getWorkspaceBindingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceBindingRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getWorkspaceBindingRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getWorkspaceBindingRequestFromPb(pb *getWorkspaceBindingRequestPb) (*GetWorkspaceBindingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceBindingRequest{} + st.Name = pb.Name + + return st, nil +} + +func getWorkspaceBindingsResponseToPb(st *GetWorkspaceBindingsResponse) (*getWorkspaceBindingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceBindingsResponsePb{} + pb.Bindings = st.Bindings + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getWorkspaceBindingsResponsePb struct { + Bindings []WorkspaceBinding `json:"bindings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getWorkspaceBindingsResponseFromPb(pb *getWorkspaceBindingsResponsePb) (*GetWorkspaceBindingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceBindingsResponse{} + st.Bindings = pb.Bindings + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getWorkspaceBindingsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getWorkspaceBindingsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAccountMetastoreAssignmentsRequestToPb(st *ListAccountMetastoreAssignmentsRequest) (*listAccountMetastoreAssignmentsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountMetastoreAssignmentsRequestPb{} + pb.MetastoreId = st.MetastoreId + + return pb, nil +} + +type listAccountMetastoreAssignmentsRequestPb struct { + MetastoreId string `json:"-" url:"-"` +} + +func listAccountMetastoreAssignmentsRequestFromPb(pb *listAccountMetastoreAssignmentsRequestPb) (*ListAccountMetastoreAssignmentsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountMetastoreAssignmentsRequest{} + st.MetastoreId = pb.MetastoreId + + return st, nil +} + +func listAccountMetastoreAssignmentsResponseToPb(st *ListAccountMetastoreAssignmentsResponse) (*listAccountMetastoreAssignmentsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountMetastoreAssignmentsResponsePb{} + pb.WorkspaceIds = st.WorkspaceIds + + return pb, nil +} + +type listAccountMetastoreAssignmentsResponsePb struct { + WorkspaceIds []int64 `json:"workspace_ids,omitempty"` +} + +func listAccountMetastoreAssignmentsResponseFromPb(pb *listAccountMetastoreAssignmentsResponsePb) (*ListAccountMetastoreAssignmentsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountMetastoreAssignmentsResponse{} + st.WorkspaceIds = pb.WorkspaceIds + + return st, nil +} + +func listAccountStorageCredentialsRequestToPb(st *ListAccountStorageCredentialsRequest) (*listAccountStorageCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountStorageCredentialsRequestPb{} + pb.MetastoreId = st.MetastoreId + + return pb, nil +} + +type listAccountStorageCredentialsRequestPb struct { + MetastoreId string `json:"-" url:"-"` +} + +func listAccountStorageCredentialsRequestFromPb(pb *listAccountStorageCredentialsRequestPb) (*ListAccountStorageCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountStorageCredentialsRequest{} + st.MetastoreId = pb.MetastoreId + + return st, nil +} + +func listAccountStorageCredentialsResponseToPb(st *ListAccountStorageCredentialsResponse) (*listAccountStorageCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountStorageCredentialsResponsePb{} + pb.StorageCredentials = st.StorageCredentials + + return pb, nil +} + +type listAccountStorageCredentialsResponsePb struct { + StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` +} + +func listAccountStorageCredentialsResponseFromPb(pb *listAccountStorageCredentialsResponsePb) (*ListAccountStorageCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountStorageCredentialsResponse{} + st.StorageCredentials = pb.StorageCredentials + + return st, nil +} + +func listCatalogsRequestToPb(st *ListCatalogsRequest) (*listCatalogsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCatalogsRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCatalogsRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCatalogsRequestFromPb(pb *listCatalogsRequestPb) (*ListCatalogsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCatalogsRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCatalogsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCatalogsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCatalogsResponseToPb(st *ListCatalogsResponse) (*listCatalogsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCatalogsResponsePb{} + pb.Catalogs = st.Catalogs + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCatalogsResponsePb struct { + Catalogs []CatalogInfo `json:"catalogs,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCatalogsResponseFromPb(pb *listCatalogsResponsePb) (*ListCatalogsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCatalogsResponse{} + st.Catalogs = pb.Catalogs + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCatalogsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCatalogsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listConnectionsRequestToPb(st *ListConnectionsRequest) (*listConnectionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listConnectionsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listConnectionsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listConnectionsRequestFromPb(pb *listConnectionsRequestPb) (*ListConnectionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListConnectionsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listConnectionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listConnectionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listConnectionsResponseToPb(st *ListConnectionsResponse) (*listConnectionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listConnectionsResponsePb{} + pb.Connections = st.Connections + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listConnectionsResponsePb struct { + Connections []ConnectionInfo `json:"connections,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listConnectionsResponseFromPb(pb *listConnectionsResponsePb) (*ListConnectionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListConnectionsResponse{} + st.Connections = pb.Connections + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listConnectionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listConnectionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCredentialsRequestToPb(st *ListCredentialsRequest) (*listCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCredentialsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.Purpose = st.Purpose + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCredentialsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCredentialsRequestFromPb(pb *listCredentialsRequestPb) (*ListCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCredentialsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.Purpose = pb.Purpose + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCredentialsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCredentialsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCredentialsResponseToPb(st *ListCredentialsResponse) (*listCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCredentialsResponsePb{} + pb.Credentials = st.Credentials + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCredentialsResponsePb struct { + Credentials []CredentialInfo `json:"credentials,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCredentialsResponseFromPb(pb *listCredentialsResponsePb) (*ListCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCredentialsResponse{} + st.Credentials = pb.Credentials + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCredentialsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCredentialsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listDatabaseInstancesRequestToPb(st *ListDatabaseInstancesRequest) (*listDatabaseInstancesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listDatabaseInstancesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDatabaseInstancesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDatabaseInstancesRequestFromPb(pb *listDatabaseInstancesRequestPb) (*ListDatabaseInstancesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListDatabaseInstancesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDatabaseInstancesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDatabaseInstancesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listDatabaseInstancesResponseToPb(st *ListDatabaseInstancesResponse) (*listDatabaseInstancesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listDatabaseInstancesResponsePb{} + pb.DatabaseInstances = st.DatabaseInstances + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDatabaseInstancesResponsePb struct { + DatabaseInstances []DatabaseInstance `json:"database_instances,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDatabaseInstancesResponseFromPb(pb *listDatabaseInstancesResponsePb) (*ListDatabaseInstancesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListDatabaseInstancesResponse{} + st.DatabaseInstances = pb.DatabaseInstances + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDatabaseInstancesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDatabaseInstancesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExternalLocationsRequestToPb(st *ListExternalLocationsRequest) (*listExternalLocationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listExternalLocationsRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExternalLocationsRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExternalLocationsRequestFromPb(pb *listExternalLocationsRequestPb) (*ListExternalLocationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListExternalLocationsRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExternalLocationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExternalLocationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExternalLocationsResponseToPb(st *ListExternalLocationsResponse) (*listExternalLocationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listExternalLocationsResponsePb{} + pb.ExternalLocations = st.ExternalLocations + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExternalLocationsResponsePb struct { + ExternalLocations []ExternalLocationInfo `json:"external_locations,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExternalLocationsResponseFromPb(pb *listExternalLocationsResponsePb) (*ListExternalLocationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListExternalLocationsResponse{} + st.ExternalLocations = pb.ExternalLocations + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExternalLocationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExternalLocationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFunctionsRequestToPb(st *ListFunctionsRequest) (*listFunctionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listFunctionsRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFunctionsRequestPb struct { + CatalogName string `json:"-" url:"catalog_name"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SchemaName string `json:"-" url:"schema_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFunctionsRequestFromPb(pb *listFunctionsRequestPb) (*ListFunctionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListFunctionsRequest{} + st.CatalogName = pb.CatalogName + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFunctionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFunctionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFunctionsResponseToPb(st *ListFunctionsResponse) (*listFunctionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listFunctionsResponsePb{} + pb.Functions = st.Functions + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFunctionsResponsePb struct { + Functions []FunctionInfo `json:"functions,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFunctionsResponseFromPb(pb *listFunctionsResponsePb) (*ListFunctionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListFunctionsResponse{} + st.Functions = pb.Functions + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFunctionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFunctionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listMetastoresResponseToPb(st *ListMetastoresResponse) (*listMetastoresResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listMetastoresResponsePb{} + pb.Metastores = st.Metastores + + return pb, nil +} + +type listMetastoresResponsePb struct { + Metastores []MetastoreInfo `json:"metastores,omitempty"` +} + +func listMetastoresResponseFromPb(pb *listMetastoresResponsePb) (*ListMetastoresResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListMetastoresResponse{} + st.Metastores = pb.Metastores + + return st, nil +} + +func listModelVersionsRequestToPb(st *ListModelVersionsRequest) (*listModelVersionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listModelVersionsRequestPb{} + pb.FullName = st.FullName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listModelVersionsRequestPb struct { + FullName string `json:"-" url:"-"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listModelVersionsRequestFromPb(pb *listModelVersionsRequestPb) (*ListModelVersionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListModelVersionsRequest{} + st.FullName = pb.FullName + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listModelVersionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listModelVersionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listModelVersionsResponseToPb(st *ListModelVersionsResponse) (*listModelVersionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listModelVersionsResponsePb{} + pb.ModelVersions = st.ModelVersions + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listModelVersionsResponsePb struct { + ModelVersions []ModelVersionInfo `json:"model_versions,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listModelVersionsResponseFromPb(pb *listModelVersionsResponsePb) (*ListModelVersionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListModelVersionsResponse{} + st.ModelVersions = pb.ModelVersions + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listModelVersionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listModelVersionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQuotasRequestToPb(st *ListQuotasRequest) (*listQuotasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listQuotasRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQuotasRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQuotasRequestFromPb(pb *listQuotasRequestPb) (*ListQuotasRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListQuotasRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQuotasRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQuotasRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQuotasResponseToPb(st *ListQuotasResponse) (*listQuotasResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listQuotasResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Quotas = st.Quotas + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQuotasResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Quotas []QuotaInfo `json:"quotas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQuotasResponseFromPb(pb *listQuotasResponsePb) (*ListQuotasResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListQuotasResponse{} + st.NextPageToken = pb.NextPageToken + st.Quotas = pb.Quotas + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQuotasResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQuotasResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRefreshesRequestToPb(st *ListRefreshesRequest) (*listRefreshesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listRefreshesRequestPb{} + pb.TableName = st.TableName + + return pb, nil +} + +type listRefreshesRequestPb struct { + TableName string `json:"-" url:"-"` +} + +func listRefreshesRequestFromPb(pb *listRefreshesRequestPb) (*ListRefreshesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListRefreshesRequest{} + st.TableName = pb.TableName + + return st, nil +} + +func listRegisteredModelsRequestToPb(st *ListRegisteredModelsRequest) (*listRegisteredModelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listRegisteredModelsRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRegisteredModelsRequestPb struct { + CatalogName string `json:"-" url:"catalog_name,omitempty"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SchemaName string `json:"-" url:"schema_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRegisteredModelsRequestFromPb(pb *listRegisteredModelsRequestPb) (*ListRegisteredModelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListRegisteredModelsRequest{} + st.CatalogName = pb.CatalogName + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRegisteredModelsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRegisteredModelsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRegisteredModelsResponseToPb(st *ListRegisteredModelsResponse) (*listRegisteredModelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listRegisteredModelsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.RegisteredModels = st.RegisteredModels + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRegisteredModelsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + RegisteredModels []RegisteredModelInfo `json:"registered_models,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRegisteredModelsResponseFromPb(pb *listRegisteredModelsResponsePb) (*ListRegisteredModelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListRegisteredModelsResponse{} + st.NextPageToken = pb.NextPageToken + st.RegisteredModels = pb.RegisteredModels + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRegisteredModelsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRegisteredModelsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSchemasRequestToPb(st *ListSchemasRequest) (*listSchemasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSchemasRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSchemasRequestPb struct { + CatalogName string `json:"-" url:"catalog_name"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSchemasRequestFromPb(pb *listSchemasRequestPb) (*ListSchemasRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSchemasRequest{} + st.CatalogName = pb.CatalogName + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSchemasRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSchemasRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSchemasResponseToPb(st *ListSchemasResponse) (*listSchemasResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSchemasResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Schemas = st.Schemas + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSchemasResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Schemas []SchemaInfo `json:"schemas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSchemasResponseFromPb(pb *listSchemasResponsePb) (*ListSchemasResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSchemasResponse{} + st.NextPageToken = pb.NextPageToken + st.Schemas = pb.Schemas + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSchemasResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSchemasResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listStorageCredentialsRequestToPb(st *ListStorageCredentialsRequest) (*listStorageCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listStorageCredentialsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listStorageCredentialsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listStorageCredentialsRequestFromPb(pb *listStorageCredentialsRequestPb) (*ListStorageCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListStorageCredentialsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listStorageCredentialsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listStorageCredentialsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listStorageCredentialsResponseToPb(st *ListStorageCredentialsResponse) (*listStorageCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listStorageCredentialsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.StorageCredentials = st.StorageCredentials + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listStorageCredentialsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listStorageCredentialsResponseFromPb(pb *listStorageCredentialsResponsePb) (*ListStorageCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListStorageCredentialsResponse{} + st.NextPageToken = pb.NextPageToken + st.StorageCredentials = pb.StorageCredentials + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listStorageCredentialsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listStorageCredentialsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSummariesRequestToPb(st *ListSummariesRequest) (*listSummariesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSummariesRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.SchemaNamePattern = st.SchemaNamePattern + + pb.TableNamePattern = st.TableNamePattern + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSummariesRequestPb struct { + CatalogName string `json:"-" url:"catalog_name"` + + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SchemaNamePattern string `json:"-" url:"schema_name_pattern,omitempty"` + + TableNamePattern string `json:"-" url:"table_name_pattern,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSummariesRequestFromPb(pb *listSummariesRequestPb) (*ListSummariesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSummariesRequest{} + st.CatalogName = pb.CatalogName + st.IncludeManifestCapabilities = pb.IncludeManifestCapabilities + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.SchemaNamePattern = pb.SchemaNamePattern + st.TableNamePattern = pb.TableNamePattern + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSummariesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSummariesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSystemSchemasRequestToPb(st *ListSystemSchemasRequest) (*listSystemSchemasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSystemSchemasRequestPb{} + pb.MaxResults = st.MaxResults + + pb.MetastoreId = st.MetastoreId + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSystemSchemasRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + MetastoreId string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSystemSchemasRequestFromPb(pb *listSystemSchemasRequestPb) (*ListSystemSchemasRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSystemSchemasRequest{} + st.MaxResults = pb.MaxResults + st.MetastoreId = pb.MetastoreId + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSystemSchemasRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSystemSchemasRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSystemSchemasResponseToPb(st *ListSystemSchemasResponse) (*listSystemSchemasResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSystemSchemasResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Schemas = st.Schemas + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSystemSchemasResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Schemas []SystemSchemaInfo `json:"schemas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSystemSchemasResponseFromPb(pb *listSystemSchemasResponsePb) (*ListSystemSchemasResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSystemSchemasResponse{} + st.NextPageToken = pb.NextPageToken + st.Schemas = pb.Schemas + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSystemSchemasResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSystemSchemasResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listTableSummariesResponseToPb(st *ListTableSummariesResponse) (*listTableSummariesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listTableSummariesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Tables = st.Tables + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listTableSummariesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Tables []TableSummary `json:"tables,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listTableSummariesResponseFromPb(pb *listTableSummariesResponsePb) (*ListTableSummariesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListTableSummariesResponse{} + st.NextPageToken = pb.NextPageToken + st.Tables = pb.Tables + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listTableSummariesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listTableSummariesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listTablesRequestToPb(st *ListTablesRequest) (*listTablesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listTablesRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.IncludeDeltaMetadata = st.IncludeDeltaMetadata + + pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities + + pb.MaxResults = st.MaxResults + + pb.OmitColumns = st.OmitColumns + + pb.OmitProperties = st.OmitProperties + + pb.OmitUsername = st.OmitUsername + + pb.PageToken = st.PageToken + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listTablesRequestPb struct { + CatalogName string `json:"-" url:"catalog_name"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + OmitColumns bool `json:"-" url:"omit_columns,omitempty"` + + OmitProperties bool `json:"-" url:"omit_properties,omitempty"` + + OmitUsername bool `json:"-" url:"omit_username,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SchemaName string `json:"-" url:"schema_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listTablesRequestFromPb(pb *listTablesRequestPb) (*ListTablesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListTablesRequest{} + st.CatalogName = pb.CatalogName + st.IncludeBrowse = pb.IncludeBrowse + st.IncludeDeltaMetadata = pb.IncludeDeltaMetadata + st.IncludeManifestCapabilities = pb.IncludeManifestCapabilities + st.MaxResults = pb.MaxResults + st.OmitColumns = pb.OmitColumns + st.OmitProperties = pb.OmitProperties + st.OmitUsername = pb.OmitUsername + st.PageToken = pb.PageToken + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listTablesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listTablesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listTablesResponseToPb(st *ListTablesResponse) (*listTablesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listTablesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Tables = st.Tables + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listTablesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Tables []TableInfo `json:"tables,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listTablesResponseFromPb(pb *listTablesResponsePb) (*ListTablesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListTablesResponse{} + st.NextPageToken = pb.NextPageToken + st.Tables = pb.Tables + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listTablesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listTablesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listVolumesRequestToPb(st *ListVolumesRequest) (*listVolumesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listVolumesRequestPb{} + pb.CatalogName = st.CatalogName + + pb.IncludeBrowse = st.IncludeBrowse + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listVolumesRequestPb struct { + CatalogName string `json:"-" url:"catalog_name"` + + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SchemaName string `json:"-" url:"schema_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listVolumesRequestFromPb(pb *listVolumesRequestPb) (*ListVolumesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListVolumesRequest{} + st.CatalogName = pb.CatalogName + st.IncludeBrowse = pb.IncludeBrowse + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listVolumesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listVolumesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listVolumesResponseContentToPb(st *ListVolumesResponseContent) (*listVolumesResponseContentPb, error) { + if st == nil { + return nil, nil + } + pb := &listVolumesResponseContentPb{} + pb.NextPageToken = st.NextPageToken + + pb.Volumes = st.Volumes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listVolumesResponseContentPb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Volumes []VolumeInfo `json:"volumes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listVolumesResponseContentFromPb(pb *listVolumesResponseContentPb) (*ListVolumesResponseContent, error) { + if pb == nil { + return nil, nil + } + st := &ListVolumesResponseContent{} + st.NextPageToken = pb.NextPageToken + st.Volumes = pb.Volumes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listVolumesResponseContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listVolumesResponseContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func metastoreAssignmentToPb(st *MetastoreAssignment) (*metastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &metastoreAssignmentPb{} + pb.DefaultCatalogName = st.DefaultCatalogName + + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type metastoreAssignmentPb struct { + DefaultCatalogName string `json:"default_catalog_name,omitempty"` + + MetastoreId string `json:"metastore_id"` + + WorkspaceId int64 `json:"workspace_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func metastoreAssignmentFromPb(pb *metastoreAssignmentPb) (*MetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &MetastoreAssignment{} + st.DefaultCatalogName = pb.DefaultCatalogName + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *metastoreAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st metastoreAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func metastoreInfoToPb(st *MetastoreInfo) (*metastoreInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &metastoreInfoPb{} + pb.Cloud = st.Cloud + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DefaultDataAccessConfigId = st.DefaultDataAccessConfigId + + pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName + + pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds + + pb.DeltaSharingScope = st.DeltaSharingScope + + pb.ExternalAccessEnabled = st.ExternalAccessEnabled + + pb.GlobalMetastoreId = st.GlobalMetastoreId + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.PrivilegeModelVersion = st.PrivilegeModelVersion + + pb.Region = st.Region + + pb.StorageRoot = st.StorageRoot + + pb.StorageRootCredentialId = st.StorageRootCredentialId + + pb.StorageRootCredentialName = st.StorageRootCredentialName + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type metastoreInfoPb struct { + Cloud string `json:"cloud,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + + DeltaSharingScope MetastoreInfoDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + + ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + + Region string `json:"region,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + + StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func metastoreInfoFromPb(pb *metastoreInfoPb) (*MetastoreInfo, error) { + if pb == nil { + return nil, nil + } + st := &MetastoreInfo{} + st.Cloud = pb.Cloud + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DefaultDataAccessConfigId = pb.DefaultDataAccessConfigId + st.DeltaSharingOrganizationName = pb.DeltaSharingOrganizationName + st.DeltaSharingRecipientTokenLifetimeInSeconds = pb.DeltaSharingRecipientTokenLifetimeInSeconds + st.DeltaSharingScope = pb.DeltaSharingScope + st.ExternalAccessEnabled = pb.ExternalAccessEnabled + st.GlobalMetastoreId = pb.GlobalMetastoreId + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.PrivilegeModelVersion = pb.PrivilegeModelVersion + st.Region = pb.Region + st.StorageRoot = pb.StorageRoot + st.StorageRootCredentialId = pb.StorageRootCredentialId + st.StorageRootCredentialName = pb.StorageRootCredentialName + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *metastoreInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st metastoreInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelVersionInfoToPb(st *ModelVersionInfo) (*modelVersionInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &modelVersionInfoPb{} + pb.Aliases = st.Aliases + + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Id = st.Id + + pb.MetastoreId = st.MetastoreId + + pb.ModelName = st.ModelName + + pb.ModelVersionDependencies = st.ModelVersionDependencies + + pb.RunId = st.RunId + + pb.RunWorkspaceId = st.RunWorkspaceId + + pb.SchemaName = st.SchemaName + + pb.Source = st.Source + + pb.Status = st.Status + + pb.StorageLocation = st.StorageLocation + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelVersionInfoPb struct { + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Id string `json:"id,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + ModelName string `json:"model_name,omitempty"` + + ModelVersionDependencies *DependencyList `json:"model_version_dependencies,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunWorkspaceId int `json:"run_workspace_id,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + Source string `json:"source,omitempty"` + + Status ModelVersionInfoStatus `json:"status,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + Version int `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelVersionInfoFromPb(pb *modelVersionInfoPb) (*ModelVersionInfo, error) { + if pb == nil { + return nil, nil + } + st := &ModelVersionInfo{} + st.Aliases = pb.Aliases + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Id = pb.Id + st.MetastoreId = pb.MetastoreId + st.ModelName = pb.ModelName + st.ModelVersionDependencies = pb.ModelVersionDependencies + st.RunId = pb.RunId + st.RunWorkspaceId = pb.RunWorkspaceId + st.SchemaName = pb.SchemaName + st.Source = pb.Source + st.Status = pb.Status + st.StorageLocation = pb.StorageLocation + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelVersionInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelVersionInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func monitorCronScheduleToPb(st *MonitorCronSchedule) (*monitorCronSchedulePb, error) { + if st == nil { + return nil, nil + } + pb := &monitorCronSchedulePb{} + pb.PauseStatus = st.PauseStatus + + pb.QuartzCronExpression = st.QuartzCronExpression + + pb.TimezoneId = st.TimezoneId + + return pb, nil +} + +type monitorCronSchedulePb struct { + PauseStatus MonitorCronSchedulePauseStatus `json:"pause_status,omitempty"` + + QuartzCronExpression string `json:"quartz_cron_expression"` + + TimezoneId string `json:"timezone_id"` +} + +func monitorCronScheduleFromPb(pb *monitorCronSchedulePb) (*MonitorCronSchedule, error) { + if pb == nil { + return nil, nil + } + st := &MonitorCronSchedule{} + st.PauseStatus = pb.PauseStatus + st.QuartzCronExpression = pb.QuartzCronExpression + st.TimezoneId = pb.TimezoneId + + return st, nil +} + +func monitorDataClassificationConfigToPb(st *MonitorDataClassificationConfig) (*monitorDataClassificationConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorDataClassificationConfigPb{} + pb.Enabled = st.Enabled + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type monitorDataClassificationConfigPb struct { + Enabled bool `json:"enabled,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func monitorDataClassificationConfigFromPb(pb *monitorDataClassificationConfigPb) (*MonitorDataClassificationConfig, error) { + if pb == nil { + return nil, nil + } + st := &MonitorDataClassificationConfig{} + st.Enabled = pb.Enabled + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *monitorDataClassificationConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st monitorDataClassificationConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func monitorDestinationToPb(st *MonitorDestination) (*monitorDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorDestinationPb{} + pb.EmailAddresses = st.EmailAddresses + + return pb, nil +} + +type monitorDestinationPb struct { + EmailAddresses []string `json:"email_addresses,omitempty"` +} + +func monitorDestinationFromPb(pb *monitorDestinationPb) (*MonitorDestination, error) { + if pb == nil { + return nil, nil + } + st := &MonitorDestination{} + st.EmailAddresses = pb.EmailAddresses + + return st, nil +} + +func monitorInferenceLogToPb(st *MonitorInferenceLog) (*monitorInferenceLogPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorInferenceLogPb{} + pb.Granularities = st.Granularities + + pb.LabelCol = st.LabelCol + + pb.ModelIdCol = st.ModelIdCol + + pb.PredictionCol = st.PredictionCol + + pb.PredictionProbaCol = st.PredictionProbaCol + + pb.ProblemType = st.ProblemType + + pb.TimestampCol = st.TimestampCol + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type monitorInferenceLogPb struct { + Granularities []string `json:"granularities"` + + LabelCol string `json:"label_col,omitempty"` + + ModelIdCol string `json:"model_id_col"` + + PredictionCol string `json:"prediction_col"` + + PredictionProbaCol string `json:"prediction_proba_col,omitempty"` + + ProblemType MonitorInferenceLogProblemType `json:"problem_type"` + + TimestampCol string `json:"timestamp_col"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func monitorInferenceLogFromPb(pb *monitorInferenceLogPb) (*MonitorInferenceLog, error) { + if pb == nil { + return nil, nil + } + st := &MonitorInferenceLog{} + st.Granularities = pb.Granularities + st.LabelCol = pb.LabelCol + st.ModelIdCol = pb.ModelIdCol + st.PredictionCol = pb.PredictionCol + st.PredictionProbaCol = pb.PredictionProbaCol + st.ProblemType = pb.ProblemType + st.TimestampCol = pb.TimestampCol + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *monitorInferenceLogPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st monitorInferenceLogPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func monitorInfoToPb(st *MonitorInfo) (*monitorInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorInfoPb{} + pb.AssetsDir = st.AssetsDir + + pb.BaselineTableName = st.BaselineTableName + + pb.CustomMetrics = st.CustomMetrics + + pb.DashboardId = st.DashboardId + + pb.DataClassificationConfig = st.DataClassificationConfig + + pb.DriftMetricsTableName = st.DriftMetricsTableName + + pb.InferenceLog = st.InferenceLog + + pb.LatestMonitorFailureMsg = st.LatestMonitorFailureMsg + + pb.MonitorVersion = st.MonitorVersion + + pb.Notifications = st.Notifications + + pb.OutputSchemaName = st.OutputSchemaName + + pb.ProfileMetricsTableName = st.ProfileMetricsTableName + + pb.Schedule = st.Schedule + + pb.SlicingExprs = st.SlicingExprs + + pb.Snapshot = st.Snapshot + + pb.Status = st.Status + + pb.TableName = st.TableName + + pb.TimeSeries = st.TimeSeries + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type monitorInfoPb struct { + AssetsDir string `json:"assets_dir,omitempty"` + + BaselineTableName string `json:"baseline_table_name,omitempty"` + + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + + DashboardId string `json:"dashboard_id,omitempty"` + + DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + + DriftMetricsTableName string `json:"drift_metrics_table_name"` + + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + + MonitorVersion string `json:"monitor_version"` + + Notifications *MonitorNotifications `json:"notifications,omitempty"` + + OutputSchemaName string `json:"output_schema_name,omitempty"` + + ProfileMetricsTableName string `json:"profile_metrics_table_name"` + + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + + SlicingExprs []string `json:"slicing_exprs,omitempty"` + + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + + Status MonitorInfoStatus `json:"status"` + + TableName string `json:"table_name"` + + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func monitorInfoFromPb(pb *monitorInfoPb) (*MonitorInfo, error) { + if pb == nil { + return nil, nil + } + st := &MonitorInfo{} + st.AssetsDir = pb.AssetsDir + st.BaselineTableName = pb.BaselineTableName + st.CustomMetrics = pb.CustomMetrics + st.DashboardId = pb.DashboardId + st.DataClassificationConfig = pb.DataClassificationConfig + st.DriftMetricsTableName = pb.DriftMetricsTableName + st.InferenceLog = pb.InferenceLog + st.LatestMonitorFailureMsg = pb.LatestMonitorFailureMsg + st.MonitorVersion = pb.MonitorVersion + st.Notifications = pb.Notifications + st.OutputSchemaName = pb.OutputSchemaName + st.ProfileMetricsTableName = pb.ProfileMetricsTableName + st.Schedule = pb.Schedule + st.SlicingExprs = pb.SlicingExprs + st.Snapshot = pb.Snapshot + st.Status = pb.Status + st.TableName = pb.TableName + st.TimeSeries = pb.TimeSeries + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *monitorInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st monitorInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func monitorMetricToPb(st *MonitorMetric) (*monitorMetricPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorMetricPb{} + pb.Definition = st.Definition + + pb.InputColumns = st.InputColumns + + pb.Name = st.Name + + pb.OutputDataType = st.OutputDataType + + pb.Type = st.Type + + return pb, nil +} + +type monitorMetricPb struct { + Definition string `json:"definition"` + + InputColumns []string `json:"input_columns"` + + Name string `json:"name"` + + OutputDataType string `json:"output_data_type"` + + Type MonitorMetricType `json:"type"` +} + +func monitorMetricFromPb(pb *monitorMetricPb) (*MonitorMetric, error) { + if pb == nil { + return nil, nil + } + st := &MonitorMetric{} + st.Definition = pb.Definition + st.InputColumns = pb.InputColumns + st.Name = pb.Name + st.OutputDataType = pb.OutputDataType + st.Type = pb.Type + + return st, nil +} + +func monitorNotificationsToPb(st *MonitorNotifications) (*monitorNotificationsPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorNotificationsPb{} + pb.OnFailure = st.OnFailure + + pb.OnNewClassificationTagDetected = st.OnNewClassificationTagDetected + + return pb, nil +} + +type monitorNotificationsPb struct { + OnFailure *MonitorDestination `json:"on_failure,omitempty"` + + OnNewClassificationTagDetected *MonitorDestination `json:"on_new_classification_tag_detected,omitempty"` +} + +func monitorNotificationsFromPb(pb *monitorNotificationsPb) (*MonitorNotifications, error) { + if pb == nil { + return nil, nil + } + st := &MonitorNotifications{} + st.OnFailure = pb.OnFailure + st.OnNewClassificationTagDetected = pb.OnNewClassificationTagDetected + + return st, nil +} + +func monitorRefreshInfoToPb(st *MonitorRefreshInfo) (*monitorRefreshInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorRefreshInfoPb{} + pb.EndTimeMs = st.EndTimeMs + + pb.Message = st.Message + + pb.RefreshId = st.RefreshId + + pb.StartTimeMs = st.StartTimeMs + + pb.State = st.State + + pb.Trigger = st.Trigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type monitorRefreshInfoPb struct { + EndTimeMs int64 `json:"end_time_ms,omitempty"` + + Message string `json:"message,omitempty"` + + RefreshId int64 `json:"refresh_id"` + + StartTimeMs int64 `json:"start_time_ms"` + + State MonitorRefreshInfoState `json:"state"` + + Trigger MonitorRefreshInfoTrigger `json:"trigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func monitorRefreshInfoFromPb(pb *monitorRefreshInfoPb) (*MonitorRefreshInfo, error) { + if pb == nil { + return nil, nil + } + st := &MonitorRefreshInfo{} + st.EndTimeMs = pb.EndTimeMs + st.Message = pb.Message + st.RefreshId = pb.RefreshId + st.StartTimeMs = pb.StartTimeMs + st.State = pb.State + st.Trigger = pb.Trigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *monitorRefreshInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st monitorRefreshInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func monitorRefreshListResponseToPb(st *MonitorRefreshListResponse) (*monitorRefreshListResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &monitorRefreshListResponsePb{} + pb.Refreshes = st.Refreshes + + return pb, nil +} + +type monitorRefreshListResponsePb struct { + Refreshes []MonitorRefreshInfo `json:"refreshes,omitempty"` +} + +func monitorRefreshListResponseFromPb(pb *monitorRefreshListResponsePb) (*MonitorRefreshListResponse, error) { + if pb == nil { + return nil, nil + } + st := &MonitorRefreshListResponse{} + st.Refreshes = pb.Refreshes + + return st, nil +} + +func monitorSnapshotToPb(st *MonitorSnapshot) (*monitorSnapshotPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorSnapshotPb{} + + return pb, nil +} + +type monitorSnapshotPb struct { +} + +func monitorSnapshotFromPb(pb *monitorSnapshotPb) (*MonitorSnapshot, error) { + if pb == nil { + return nil, nil + } + st := &MonitorSnapshot{} + + return st, nil +} + +func monitorTimeSeriesToPb(st *MonitorTimeSeries) (*monitorTimeSeriesPb, error) { + if st == nil { + return nil, nil + } + pb := &monitorTimeSeriesPb{} + pb.Granularities = st.Granularities + + pb.TimestampCol = st.TimestampCol + + return pb, nil +} + +type monitorTimeSeriesPb struct { + Granularities []string `json:"granularities"` + + TimestampCol string `json:"timestamp_col"` +} + +func monitorTimeSeriesFromPb(pb *monitorTimeSeriesPb) (*MonitorTimeSeries, error) { + if pb == nil { + return nil, nil + } + st := &MonitorTimeSeries{} + st.Granularities = pb.Granularities + st.TimestampCol = pb.TimestampCol + + return st, nil +} + +func namedTableConstraintToPb(st *NamedTableConstraint) (*namedTableConstraintPb, error) { + if st == nil { + return nil, nil + } + pb := &namedTableConstraintPb{} + pb.Name = st.Name + + return pb, nil +} + +type namedTableConstraintPb struct { + Name string `json:"name"` +} + +func namedTableConstraintFromPb(pb *namedTableConstraintPb) (*NamedTableConstraint, error) { + if pb == nil { + return nil, nil + } + st := &NamedTableConstraint{} + st.Name = pb.Name + + return st, nil +} + +func newPipelineSpecToPb(st *NewPipelineSpec) (*newPipelineSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &newPipelineSpecPb{} + pb.StorageCatalog = st.StorageCatalog + + pb.StorageSchema = st.StorageSchema + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type newPipelineSpecPb struct { + StorageCatalog string `json:"storage_catalog,omitempty"` + + StorageSchema string `json:"storage_schema,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func newPipelineSpecFromPb(pb *newPipelineSpecPb) (*NewPipelineSpec, error) { + if pb == nil { + return nil, nil + } + st := &NewPipelineSpec{} + st.StorageCatalog = pb.StorageCatalog + st.StorageSchema = pb.StorageSchema + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *newPipelineSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st newPipelineSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func onlineTableToPb(st *OnlineTable) (*onlineTablePb, error) { + if st == nil { + return nil, nil + } + pb := &onlineTablePb{} + pb.Name = st.Name + + pb.Spec = st.Spec + + pb.Status = st.Status + + pb.TableServingUrl = st.TableServingUrl + + pb.UnityCatalogProvisioningState = st.UnityCatalogProvisioningState + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type onlineTablePb struct { + Name string `json:"name,omitempty"` + + Spec *OnlineTableSpec `json:"spec,omitempty"` + + Status *OnlineTableStatus `json:"status,omitempty"` + + TableServingUrl string `json:"table_serving_url,omitempty"` + + UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func onlineTableFromPb(pb *onlineTablePb) (*OnlineTable, error) { + if pb == nil { + return nil, nil + } + st := &OnlineTable{} + st.Name = pb.Name + st.Spec = pb.Spec + st.Status = pb.Status + st.TableServingUrl = pb.TableServingUrl + st.UnityCatalogProvisioningState = pb.UnityCatalogProvisioningState + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *onlineTablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st onlineTablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func onlineTableSpecToPb(st *OnlineTableSpec) (*onlineTableSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &onlineTableSpecPb{} + pb.PerformFullCopy = st.PerformFullCopy + + pb.PipelineId = st.PipelineId + + pb.PrimaryKeyColumns = st.PrimaryKeyColumns + + pb.RunContinuously = st.RunContinuously + + pb.RunTriggered = st.RunTriggered + + pb.SourceTableFullName = st.SourceTableFullName + + pb.TimeseriesKey = st.TimeseriesKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type onlineTableSpecPb struct { + PerformFullCopy bool `json:"perform_full_copy,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + + RunContinuously *OnlineTableSpecContinuousSchedulingPolicy `json:"run_continuously,omitempty"` + + RunTriggered *OnlineTableSpecTriggeredSchedulingPolicy `json:"run_triggered,omitempty"` + + SourceTableFullName string `json:"source_table_full_name,omitempty"` + + TimeseriesKey string `json:"timeseries_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func onlineTableSpecFromPb(pb *onlineTableSpecPb) (*OnlineTableSpec, error) { + if pb == nil { + return nil, nil + } + st := &OnlineTableSpec{} + st.PerformFullCopy = pb.PerformFullCopy + st.PipelineId = pb.PipelineId + st.PrimaryKeyColumns = pb.PrimaryKeyColumns + st.RunContinuously = pb.RunContinuously + st.RunTriggered = pb.RunTriggered + st.SourceTableFullName = pb.SourceTableFullName + st.TimeseriesKey = pb.TimeseriesKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *onlineTableSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st onlineTableSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func onlineTableSpecContinuousSchedulingPolicyToPb(st *OnlineTableSpecContinuousSchedulingPolicy) (*onlineTableSpecContinuousSchedulingPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &onlineTableSpecContinuousSchedulingPolicyPb{} + + return pb, nil +} + +type onlineTableSpecContinuousSchedulingPolicyPb struct { +} + +func onlineTableSpecContinuousSchedulingPolicyFromPb(pb *onlineTableSpecContinuousSchedulingPolicyPb) (*OnlineTableSpecContinuousSchedulingPolicy, error) { + if pb == nil { + return nil, nil + } + st := &OnlineTableSpecContinuousSchedulingPolicy{} + + return st, nil +} + +func onlineTableSpecTriggeredSchedulingPolicyToPb(st *OnlineTableSpecTriggeredSchedulingPolicy) (*onlineTableSpecTriggeredSchedulingPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &onlineTableSpecTriggeredSchedulingPolicyPb{} + + return pb, nil +} + +type onlineTableSpecTriggeredSchedulingPolicyPb struct { +} + +func onlineTableSpecTriggeredSchedulingPolicyFromPb(pb *onlineTableSpecTriggeredSchedulingPolicyPb) (*OnlineTableSpecTriggeredSchedulingPolicy, error) { + if pb == nil { + return nil, nil + } + st := &OnlineTableSpecTriggeredSchedulingPolicy{} + + return st, nil +} + +func onlineTableStatusToPb(st *OnlineTableStatus) (*onlineTableStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &onlineTableStatusPb{} + pb.ContinuousUpdateStatus = st.ContinuousUpdateStatus + + pb.DetailedState = st.DetailedState + + pb.FailedStatus = st.FailedStatus + + pb.Message = st.Message + + pb.ProvisioningStatus = st.ProvisioningStatus + + pb.TriggeredUpdateStatus = st.TriggeredUpdateStatus + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type onlineTableStatusPb struct { + ContinuousUpdateStatus *ContinuousUpdateStatus `json:"continuous_update_status,omitempty"` + + DetailedState OnlineTableState `json:"detailed_state,omitempty"` + + FailedStatus *FailedStatus `json:"failed_status,omitempty"` + + Message string `json:"message,omitempty"` + + ProvisioningStatus *ProvisioningStatus `json:"provisioning_status,omitempty"` + + TriggeredUpdateStatus *TriggeredUpdateStatus `json:"triggered_update_status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func onlineTableStatusFromPb(pb *onlineTableStatusPb) (*OnlineTableStatus, error) { + if pb == nil { + return nil, nil + } + st := &OnlineTableStatus{} + st.ContinuousUpdateStatus = pb.ContinuousUpdateStatus + st.DetailedState = pb.DetailedState + st.FailedStatus = pb.FailedStatus + st.Message = pb.Message + st.ProvisioningStatus = pb.ProvisioningStatus + st.TriggeredUpdateStatus = pb.TriggeredUpdateStatus + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *onlineTableStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st onlineTableStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) { + if st == nil { + return nil, nil + } + pb := &permissionsChangePb{} + pb.Add = st.Add + + pb.Principal = st.Principal + + pb.Remove = st.Remove + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionsChangePb struct { + Add []Privilege `json:"add,omitempty"` + + Principal string `json:"principal,omitempty"` + + Remove []Privilege `json:"remove,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionsChangeFromPb(pb *permissionsChangePb) (*PermissionsChange, error) { + if pb == nil { + return nil, nil + } + st := &PermissionsChange{} + st.Add = pb.Add + st.Principal = pb.Principal + st.Remove = pb.Remove + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionsChangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionsChangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionsListToPb(st *PermissionsList) (*permissionsListPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionsListPb{} + pb.PrivilegeAssignments = st.PrivilegeAssignments + + return pb, nil +} + +type permissionsListPb struct { + PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` +} + +func permissionsListFromPb(pb *permissionsListPb) (*PermissionsList, error) { + if pb == nil { + return nil, nil + } + st := &PermissionsList{} + st.PrivilegeAssignments = pb.PrivilegeAssignments + + return st, nil +} + +func pipelineProgressToPb(st *PipelineProgress) (*pipelineProgressPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineProgressPb{} + pb.EstimatedCompletionTimeSeconds = st.EstimatedCompletionTimeSeconds + + pb.LatestVersionCurrentlyProcessing = st.LatestVersionCurrentlyProcessing + + pb.SyncProgressCompletion = st.SyncProgressCompletion + + pb.SyncedRowCount = st.SyncedRowCount + + pb.TotalRowCount = st.TotalRowCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineProgressPb struct { + EstimatedCompletionTimeSeconds float64 `json:"estimated_completion_time_seconds,omitempty"` + + LatestVersionCurrentlyProcessing int64 `json:"latest_version_currently_processing,omitempty"` + + SyncProgressCompletion float64 `json:"sync_progress_completion,omitempty"` + + SyncedRowCount int64 `json:"synced_row_count,omitempty"` + + TotalRowCount int64 `json:"total_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineProgressFromPb(pb *pipelineProgressPb) (*PipelineProgress, error) { + if pb == nil { + return nil, nil + } + st := &PipelineProgress{} + st.EstimatedCompletionTimeSeconds = pb.EstimatedCompletionTimeSeconds + st.LatestVersionCurrentlyProcessing = pb.LatestVersionCurrentlyProcessing + st.SyncProgressCompletion = pb.SyncProgressCompletion + st.SyncedRowCount = pb.SyncedRowCount + st.TotalRowCount = pb.TotalRowCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineProgressPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineProgressPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func primaryKeyConstraintToPb(st *PrimaryKeyConstraint) (*primaryKeyConstraintPb, error) { + if st == nil { + return nil, nil + } + pb := &primaryKeyConstraintPb{} + pb.ChildColumns = st.ChildColumns + + pb.Name = st.Name + + pb.TimeseriesColumns = st.TimeseriesColumns + + return pb, nil +} + +type primaryKeyConstraintPb struct { + ChildColumns []string `json:"child_columns"` + + Name string `json:"name"` + + TimeseriesColumns []string `json:"timeseries_columns,omitempty"` +} + +func primaryKeyConstraintFromPb(pb *primaryKeyConstraintPb) (*PrimaryKeyConstraint, error) { + if pb == nil { + return nil, nil + } + st := &PrimaryKeyConstraint{} + st.ChildColumns = pb.ChildColumns + st.Name = pb.Name + st.TimeseriesColumns = pb.TimeseriesColumns + + return st, nil +} + +func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &privilegeAssignmentPb{} + pb.Principal = st.Principal + + pb.Privileges = st.Privileges + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type privilegeAssignmentPb struct { + Principal string `json:"principal,omitempty"` + + Privileges []Privilege `json:"privileges,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func privilegeAssignmentFromPb(pb *privilegeAssignmentPb) (*PrivilegeAssignment, error) { + if pb == nil { + return nil, nil + } + st := &PrivilegeAssignment{} + st.Principal = pb.Principal + st.Privileges = pb.Privileges + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *privilegeAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st privilegeAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func provisioningInfoToPb(st *ProvisioningInfo) (*provisioningInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &provisioningInfoPb{} + pb.State = st.State + + return pb, nil +} + +type provisioningInfoPb struct { + State ProvisioningInfoState `json:"state,omitempty"` +} + +func provisioningInfoFromPb(pb *provisioningInfoPb) (*ProvisioningInfo, error) { + if pb == nil { + return nil, nil + } + st := &ProvisioningInfo{} + st.State = pb.State + + return st, nil +} + +func provisioningStatusToPb(st *ProvisioningStatus) (*provisioningStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &provisioningStatusPb{} + pb.InitialPipelineSyncProgress = st.InitialPipelineSyncProgress + + return pb, nil +} + +type provisioningStatusPb struct { + InitialPipelineSyncProgress *PipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` +} + +func provisioningStatusFromPb(pb *provisioningStatusPb) (*ProvisioningStatus, error) { + if pb == nil { + return nil, nil + } + st := &ProvisioningStatus{} + st.InitialPipelineSyncProgress = pb.InitialPipelineSyncProgress + + return st, nil +} + +func quotaInfoToPb(st *QuotaInfo) (*quotaInfoPb, error) { + if st == nil { + return nil, nil + } + pb := "aInfoPb{} + pb.LastRefreshedAt = st.LastRefreshedAt + + pb.ParentFullName = st.ParentFullName + + pb.ParentSecurableType = st.ParentSecurableType + + pb.QuotaCount = st.QuotaCount + + pb.QuotaLimit = st.QuotaLimit + + pb.QuotaName = st.QuotaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type quotaInfoPb struct { + LastRefreshedAt int64 `json:"last_refreshed_at,omitempty"` + + ParentFullName string `json:"parent_full_name,omitempty"` + + ParentSecurableType SecurableType `json:"parent_securable_type,omitempty"` + + QuotaCount int `json:"quota_count,omitempty"` + + QuotaLimit int `json:"quota_limit,omitempty"` + + QuotaName string `json:"quota_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func quotaInfoFromPb(pb *quotaInfoPb) (*QuotaInfo, error) { + if pb == nil { + return nil, nil + } + st := &QuotaInfo{} + st.LastRefreshedAt = pb.LastRefreshedAt + st.ParentFullName = pb.ParentFullName + st.ParentSecurableType = pb.ParentSecurableType + st.QuotaCount = pb.QuotaCount + st.QuotaLimit = pb.QuotaLimit + st.QuotaName = pb.QuotaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *quotaInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st quotaInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func r2CredentialsToPb(st *R2Credentials) (*r2CredentialsPb, error) { + if st == nil { + return nil, nil + } + pb := &r2CredentialsPb{} + pb.AccessKeyId = st.AccessKeyId + + pb.SecretAccessKey = st.SecretAccessKey + + pb.SessionToken = st.SessionToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type r2CredentialsPb struct { + AccessKeyId string `json:"access_key_id,omitempty"` + + SecretAccessKey string `json:"secret_access_key,omitempty"` + + SessionToken string `json:"session_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func r2CredentialsFromPb(pb *r2CredentialsPb) (*R2Credentials, error) { + if pb == nil { + return nil, nil + } + st := &R2Credentials{} + st.AccessKeyId = pb.AccessKeyId + st.SecretAccessKey = pb.SecretAccessKey + st.SessionToken = pb.SessionToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *r2CredentialsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st r2CredentialsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func readVolumeRequestToPb(st *ReadVolumeRequest) (*readVolumeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &readVolumeRequestPb{} + pb.IncludeBrowse = st.IncludeBrowse + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type readVolumeRequestPb struct { + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func readVolumeRequestFromPb(pb *readVolumeRequestPb) (*ReadVolumeRequest, error) { + if pb == nil { + return nil, nil + } + st := &ReadVolumeRequest{} + st.IncludeBrowse = pb.IncludeBrowse + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *readVolumeRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st readVolumeRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func regenerateDashboardRequestToPb(st *RegenerateDashboardRequest) (*regenerateDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := ®enerateDashboardRequestPb{} + pb.TableName = st.TableName + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type regenerateDashboardRequestPb struct { + TableName string `json:"-" url:"-"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func regenerateDashboardRequestFromPb(pb *regenerateDashboardRequestPb) (*RegenerateDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &RegenerateDashboardRequest{} + st.TableName = pb.TableName + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *regenerateDashboardRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st regenerateDashboardRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func regenerateDashboardResponseToPb(st *RegenerateDashboardResponse) (*regenerateDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := ®enerateDashboardResponsePb{} + pb.DashboardId = st.DashboardId + + pb.ParentFolder = st.ParentFolder + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type regenerateDashboardResponsePb struct { + DashboardId string `json:"dashboard_id,omitempty"` + + ParentFolder string `json:"parent_folder,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func regenerateDashboardResponseFromPb(pb *regenerateDashboardResponsePb) (*RegenerateDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &RegenerateDashboardResponse{} + st.DashboardId = pb.DashboardId + st.ParentFolder = pb.ParentFolder + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *regenerateDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st regenerateDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelAliasPb{} + pb.AliasName = st.AliasName + + pb.VersionNum = st.VersionNum + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelAliasPb struct { + AliasName string `json:"alias_name,omitempty"` + + VersionNum int `json:"version_num,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelAliasFromPb(pb *registeredModelAliasPb) (*RegisteredModelAlias, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelAlias{} + st.AliasName = pb.AliasName + st.VersionNum = pb.VersionNum + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelAliasPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelAliasPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelInfoToPb(st *RegisteredModelInfo) (*registeredModelInfoPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelInfoPb{} + pb.Aliases = st.Aliases + + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.FullName = st.FullName + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.SchemaName = st.SchemaName + + pb.StorageLocation = st.StorageLocation + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelInfoPb struct { + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + FullName string `json:"full_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelInfoFromPb(pb *registeredModelInfoPb) (*RegisteredModelInfo, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelInfo{} + st.Aliases = pb.Aliases + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.FullName = pb.FullName + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.SchemaName = pb.SchemaName + st.StorageLocation = pb.StorageLocation + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runRefreshRequestToPb(st *RunRefreshRequest) (*runRefreshRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &runRefreshRequestPb{} + pb.TableName = st.TableName + + return pb, nil +} + +type runRefreshRequestPb struct { + TableName string `json:"-" url:"-"` +} + +func runRefreshRequestFromPb(pb *runRefreshRequestPb) (*RunRefreshRequest, error) { + if pb == nil { + return nil, nil + } + st := &RunRefreshRequest{} + st.TableName = pb.TableName + + return st, nil +} + +func schemaInfoToPb(st *SchemaInfo) (*schemaInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &schemaInfoPb{} + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.CatalogType = st.CatalogType + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag + + pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization + + pb.FullName = st.FullName + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.Properties = st.Properties + + pb.SchemaId = st.SchemaId + + pb.StorageLocation = st.StorageLocation + + pb.StorageRoot = st.StorageRoot + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type schemaInfoPb struct { + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + CatalogType string `json:"catalog_type,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + + FullName string `json:"full_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + SchemaId string `json:"schema_id,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func schemaInfoFromPb(pb *schemaInfoPb) (*SchemaInfo, error) { + if pb == nil { + return nil, nil + } + st := &SchemaInfo{} + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.CatalogType = pb.CatalogType + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.EffectivePredictiveOptimizationFlag = pb.EffectivePredictiveOptimizationFlag + st.EnablePredictiveOptimization = pb.EnablePredictiveOptimization + st.FullName = pb.FullName + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.Properties = pb.Properties + st.SchemaId = pb.SchemaId + st.StorageLocation = pb.StorageLocation + st.StorageRoot = pb.StorageRoot + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *schemaInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st schemaInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setArtifactAllowlistToPb(st *SetArtifactAllowlist) (*setArtifactAllowlistPb, error) { + if st == nil { + return nil, nil + } + pb := &setArtifactAllowlistPb{} + pb.ArtifactMatchers = st.ArtifactMatchers + + pb.ArtifactType = st.ArtifactType + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.MetastoreId = st.MetastoreId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type setArtifactAllowlistPb struct { + ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers"` + + ArtifactType ArtifactType `json:"-" url:"-"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func setArtifactAllowlistFromPb(pb *setArtifactAllowlistPb) (*SetArtifactAllowlist, error) { + if pb == nil { + return nil, nil + } + st := &SetArtifactAllowlist{} + st.ArtifactMatchers = pb.ArtifactMatchers + st.ArtifactType = pb.ArtifactType + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.MetastoreId = pb.MetastoreId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *setArtifactAllowlistPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st setArtifactAllowlistPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setRegisteredModelAliasRequestToPb(st *SetRegisteredModelAliasRequest) (*setRegisteredModelAliasRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setRegisteredModelAliasRequestPb{} + pb.Alias = st.Alias + + pb.FullName = st.FullName + + pb.VersionNum = st.VersionNum + + return pb, nil +} + +type setRegisteredModelAliasRequestPb struct { + Alias string `json:"alias" url:"-"` + + FullName string `json:"full_name" url:"-"` + + VersionNum int `json:"version_num"` +} + +func setRegisteredModelAliasRequestFromPb(pb *setRegisteredModelAliasRequestPb) (*SetRegisteredModelAliasRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetRegisteredModelAliasRequest{} + st.Alias = pb.Alias + st.FullName = pb.FullName + st.VersionNum = pb.VersionNum + + return st, nil +} + +func sseEncryptionDetailsToPb(st *SseEncryptionDetails) (*sseEncryptionDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &sseEncryptionDetailsPb{} + pb.Algorithm = st.Algorithm + + pb.AwsKmsKeyArn = st.AwsKmsKeyArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sseEncryptionDetailsPb struct { + Algorithm SseEncryptionDetailsAlgorithm `json:"algorithm,omitempty"` + + AwsKmsKeyArn string `json:"aws_kms_key_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sseEncryptionDetailsFromPb(pb *sseEncryptionDetailsPb) (*SseEncryptionDetails, error) { + if pb == nil { + return nil, nil + } + st := &SseEncryptionDetails{} + st.Algorithm = pb.Algorithm + st.AwsKmsKeyArn = pb.AwsKmsKeyArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sseEncryptionDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sseEncryptionDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func storageCredentialInfoToPb(st *StorageCredentialInfo) (*storageCredentialInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &storageCredentialInfoPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.CloudflareApiToken = st.CloudflareApiToken + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.FullName = st.FullName + + pb.Id = st.Id + + pb.IsolationMode = st.IsolationMode + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.ReadOnly = st.ReadOnly + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.UsedForManagedStorage = st.UsedForManagedStorage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type storageCredentialInfoPb struct { + AwsIamRole *AwsIamRoleResponse `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountResponse `json:"databricks_gcp_service_account,omitempty"` + + FullName string `json:"full_name,omitempty"` + + Id string `json:"id,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func storageCredentialInfoFromPb(pb *storageCredentialInfoPb) (*StorageCredentialInfo, error) { + if pb == nil { + return nil, nil + } + st := &StorageCredentialInfo{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.CloudflareApiToken = pb.CloudflareApiToken + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.FullName = pb.FullName + st.Id = pb.Id + st.IsolationMode = pb.IsolationMode + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.ReadOnly = pb.ReadOnly + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.UsedForManagedStorage = pb.UsedForManagedStorage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *storageCredentialInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st storageCredentialInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func syncedDatabaseTableToPb(st *SyncedDatabaseTable) (*syncedDatabaseTablePb, error) { + if st == nil { + return nil, nil + } + pb := &syncedDatabaseTablePb{} + pb.DataSynchronizationStatus = st.DataSynchronizationStatus + + pb.DatabaseInstanceName = st.DatabaseInstanceName + + pb.LogicalDatabaseName = st.LogicalDatabaseName + + pb.Name = st.Name + + pb.Spec = st.Spec + + pb.TableServingUrl = st.TableServingUrl + + pb.UnityCatalogProvisioningState = st.UnityCatalogProvisioningState + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type syncedDatabaseTablePb struct { + DataSynchronizationStatus *OnlineTableStatus `json:"data_synchronization_status,omitempty"` + + DatabaseInstanceName string `json:"database_instance_name,omitempty"` + + LogicalDatabaseName string `json:"logical_database_name,omitempty"` + + Name string `json:"name"` + + Spec *SyncedTableSpec `json:"spec,omitempty"` + + TableServingUrl string `json:"table_serving_url,omitempty"` + + UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func syncedDatabaseTableFromPb(pb *syncedDatabaseTablePb) (*SyncedDatabaseTable, error) { + if pb == nil { + return nil, nil + } + st := &SyncedDatabaseTable{} + st.DataSynchronizationStatus = pb.DataSynchronizationStatus + st.DatabaseInstanceName = pb.DatabaseInstanceName + st.LogicalDatabaseName = pb.LogicalDatabaseName + st.Name = pb.Name + st.Spec = pb.Spec + st.TableServingUrl = pb.TableServingUrl + st.UnityCatalogProvisioningState = pb.UnityCatalogProvisioningState + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *syncedDatabaseTablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st syncedDatabaseTablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func syncedTableSpecToPb(st *SyncedTableSpec) (*syncedTableSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &syncedTableSpecPb{} + pb.CreateDatabaseObjectsIfMissing = st.CreateDatabaseObjectsIfMissing + + pb.NewPipelineSpec = st.NewPipelineSpec + + pb.PipelineId = st.PipelineId + + pb.PrimaryKeyColumns = st.PrimaryKeyColumns + + pb.SchedulingPolicy = st.SchedulingPolicy + + pb.SourceTableFullName = st.SourceTableFullName + + pb.TimeseriesKey = st.TimeseriesKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type syncedTableSpecPb struct { + CreateDatabaseObjectsIfMissing bool `json:"create_database_objects_if_missing,omitempty"` + + NewPipelineSpec *NewPipelineSpec `json:"new_pipeline_spec,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + + SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` + + SourceTableFullName string `json:"source_table_full_name,omitempty"` + + TimeseriesKey string `json:"timeseries_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func syncedTableSpecFromPb(pb *syncedTableSpecPb) (*SyncedTableSpec, error) { + if pb == nil { + return nil, nil + } + st := &SyncedTableSpec{} + st.CreateDatabaseObjectsIfMissing = pb.CreateDatabaseObjectsIfMissing + st.NewPipelineSpec = pb.NewPipelineSpec + st.PipelineId = pb.PipelineId + st.PrimaryKeyColumns = pb.PrimaryKeyColumns + st.SchedulingPolicy = pb.SchedulingPolicy + st.SourceTableFullName = pb.SourceTableFullName + st.TimeseriesKey = pb.TimeseriesKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *syncedTableSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st syncedTableSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func systemSchemaInfoToPb(st *SystemSchemaInfo) (*systemSchemaInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &systemSchemaInfoPb{} + pb.Schema = st.Schema + + pb.State = st.State + + return pb, nil +} + +type systemSchemaInfoPb struct { + Schema string `json:"schema"` + + State string `json:"state"` +} + +func systemSchemaInfoFromPb(pb *systemSchemaInfoPb) (*SystemSchemaInfo, error) { + if pb == nil { + return nil, nil + } + st := &SystemSchemaInfo{} + st.Schema = pb.Schema + st.State = pb.State + + return st, nil +} + +func tableConstraintToPb(st *TableConstraint) (*tableConstraintPb, error) { + if st == nil { + return nil, nil + } + pb := &tableConstraintPb{} + pb.ForeignKeyConstraint = st.ForeignKeyConstraint + + pb.NamedTableConstraint = st.NamedTableConstraint + + pb.PrimaryKeyConstraint = st.PrimaryKeyConstraint + + return pb, nil +} + +type tableConstraintPb struct { + ForeignKeyConstraint *ForeignKeyConstraint `json:"foreign_key_constraint,omitempty"` + + NamedTableConstraint *NamedTableConstraint `json:"named_table_constraint,omitempty"` + + PrimaryKeyConstraint *PrimaryKeyConstraint `json:"primary_key_constraint,omitempty"` +} + +func tableConstraintFromPb(pb *tableConstraintPb) (*TableConstraint, error) { + if pb == nil { + return nil, nil + } + st := &TableConstraint{} + st.ForeignKeyConstraint = pb.ForeignKeyConstraint + st.NamedTableConstraint = pb.NamedTableConstraint + st.PrimaryKeyConstraint = pb.PrimaryKeyConstraint + + return st, nil +} + +func tableDependencyToPb(st *TableDependency) (*tableDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &tableDependencyPb{} + pb.TableFullName = st.TableFullName + + return pb, nil +} + +type tableDependencyPb struct { + TableFullName string `json:"table_full_name"` +} + +func tableDependencyFromPb(pb *tableDependencyPb) (*TableDependency, error) { + if pb == nil { + return nil, nil + } + st := &TableDependency{} + st.TableFullName = pb.TableFullName + + return st, nil +} + +func tableExistsResponseToPb(st *TableExistsResponse) (*tableExistsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &tableExistsResponsePb{} + pb.TableExists = st.TableExists + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableExistsResponsePb struct { + TableExists bool `json:"table_exists,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableExistsResponseFromPb(pb *tableExistsResponsePb) (*TableExistsResponse, error) { + if pb == nil { + return nil, nil + } + st := &TableExistsResponse{} + st.TableExists = pb.TableExists + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableExistsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableExistsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tableInfoToPb(st *TableInfo) (*tableInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &tableInfoPb{} + pb.AccessPoint = st.AccessPoint + + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.Columns = st.Columns + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DataAccessConfigurationId = st.DataAccessConfigurationId + + pb.DataSourceFormat = st.DataSourceFormat + + pb.DeletedAt = st.DeletedAt + + pb.DeltaRuntimePropertiesKvpairs = st.DeltaRuntimePropertiesKvpairs + + pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag + + pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization + + pb.EncryptionDetails = st.EncryptionDetails + + pb.FullName = st.FullName + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.PipelineId = st.PipelineId + + pb.Properties = st.Properties + + pb.RowFilter = st.RowFilter + + pb.SchemaName = st.SchemaName + + pb.SqlPath = st.SqlPath + + pb.StorageCredentialName = st.StorageCredentialName + + pb.StorageLocation = st.StorageLocation + + pb.TableConstraints = st.TableConstraints + + pb.TableId = st.TableId + + pb.TableType = st.TableType + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ViewDefinition = st.ViewDefinition + + pb.ViewDependencies = st.ViewDependencies + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableInfoPb struct { + AccessPoint string `json:"access_point,omitempty"` + + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + Columns []ColumnInfo `json:"columns,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DataAccessConfigurationId string `json:"data_access_configuration_id,omitempty"` + + DataSourceFormat DataSourceFormat `json:"data_source_format,omitempty"` + + DeletedAt int64 `json:"deleted_at,omitempty"` + + DeltaRuntimePropertiesKvpairs *DeltaRuntimePropertiesKvPairs `json:"delta_runtime_properties_kvpairs,omitempty"` + + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + + FullName string `json:"full_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + RowFilter *TableRowFilter `json:"row_filter,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + SqlPath string `json:"sql_path,omitempty"` + + StorageCredentialName string `json:"storage_credential_name,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + TableConstraints []TableConstraint `json:"table_constraints,omitempty"` + + TableId string `json:"table_id,omitempty"` + + TableType TableType `json:"table_type,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ViewDefinition string `json:"view_definition,omitempty"` + + ViewDependencies *DependencyList `json:"view_dependencies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableInfoFromPb(pb *tableInfoPb) (*TableInfo, error) { + if pb == nil { + return nil, nil + } + st := &TableInfo{} + st.AccessPoint = pb.AccessPoint + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.Columns = pb.Columns + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DataAccessConfigurationId = pb.DataAccessConfigurationId + st.DataSourceFormat = pb.DataSourceFormat + st.DeletedAt = pb.DeletedAt + st.DeltaRuntimePropertiesKvpairs = pb.DeltaRuntimePropertiesKvpairs + st.EffectivePredictiveOptimizationFlag = pb.EffectivePredictiveOptimizationFlag + st.EnablePredictiveOptimization = pb.EnablePredictiveOptimization + st.EncryptionDetails = pb.EncryptionDetails + st.FullName = pb.FullName + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.PipelineId = pb.PipelineId + st.Properties = pb.Properties + st.RowFilter = pb.RowFilter + st.SchemaName = pb.SchemaName + st.SqlPath = pb.SqlPath + st.StorageCredentialName = pb.StorageCredentialName + st.StorageLocation = pb.StorageLocation + st.TableConstraints = pb.TableConstraints + st.TableId = pb.TableId + st.TableType = pb.TableType + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.ViewDefinition = pb.ViewDefinition + st.ViewDependencies = pb.ViewDependencies + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tableRowFilterToPb(st *TableRowFilter) (*tableRowFilterPb, error) { + if st == nil { + return nil, nil + } + pb := &tableRowFilterPb{} + pb.FunctionName = st.FunctionName + + pb.InputColumnNames = st.InputColumnNames + + return pb, nil +} + +type tableRowFilterPb struct { + FunctionName string `json:"function_name"` + + InputColumnNames []string `json:"input_column_names"` +} + +func tableRowFilterFromPb(pb *tableRowFilterPb) (*TableRowFilter, error) { + if pb == nil { + return nil, nil + } + st := &TableRowFilter{} + st.FunctionName = pb.FunctionName + st.InputColumnNames = pb.InputColumnNames + + return st, nil +} + +func tableSummaryToPb(st *TableSummary) (*tableSummaryPb, error) { + if st == nil { + return nil, nil + } + pb := &tableSummaryPb{} + pb.FullName = st.FullName + + pb.TableType = st.TableType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableSummaryPb struct { + FullName string `json:"full_name,omitempty"` + + TableType TableType `json:"table_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableSummaryFromPb(pb *tableSummaryPb) (*TableSummary, error) { + if pb == nil { + return nil, nil + } + st := &TableSummary{} + st.FullName = pb.FullName + st.TableType = pb.TableType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableSummaryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableSummaryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tagKeyValueToPb(st *TagKeyValue) (*tagKeyValuePb, error) { + if st == nil { + return nil, nil + } + pb := &tagKeyValuePb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tagKeyValuePb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tagKeyValueFromPb(pb *tagKeyValuePb) (*TagKeyValue, error) { + if pb == nil { + return nil, nil + } + st := &TagKeyValue{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tagKeyValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tagKeyValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func temporaryCredentialsToPb(st *TemporaryCredentials) (*temporaryCredentialsPb, error) { + if st == nil { + return nil, nil + } + pb := &temporaryCredentialsPb{} + pb.AwsTempCredentials = st.AwsTempCredentials + + pb.AzureAad = st.AzureAad + + pb.ExpirationTime = st.ExpirationTime + + pb.GcpOauthToken = st.GcpOauthToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type temporaryCredentialsPb struct { + AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + + AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func temporaryCredentialsFromPb(pb *temporaryCredentialsPb) (*TemporaryCredentials, error) { + if pb == nil { + return nil, nil + } + st := &TemporaryCredentials{} + st.AwsTempCredentials = pb.AwsTempCredentials + st.AzureAad = pb.AzureAad + st.ExpirationTime = pb.ExpirationTime + st.GcpOauthToken = pb.GcpOauthToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *temporaryCredentialsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st temporaryCredentialsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func triggeredUpdateStatusToPb(st *TriggeredUpdateStatus) (*triggeredUpdateStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &triggeredUpdateStatusPb{} + pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion + + pb.Timestamp = st.Timestamp + + pb.TriggeredUpdateProgress = st.TriggeredUpdateProgress + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type triggeredUpdateStatusPb struct { + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + + Timestamp string `json:"timestamp,omitempty"` + + TriggeredUpdateProgress *PipelineProgress `json:"triggered_update_progress,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func triggeredUpdateStatusFromPb(pb *triggeredUpdateStatusPb) (*TriggeredUpdateStatus, error) { + if pb == nil { + return nil, nil + } + st := &TriggeredUpdateStatus{} + st.LastProcessedCommitVersion = pb.LastProcessedCommitVersion + st.Timestamp = pb.Timestamp + st.TriggeredUpdateProgress = pb.TriggeredUpdateProgress + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *triggeredUpdateStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st triggeredUpdateStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func unassignRequestToPb(st *UnassignRequest) (*unassignRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &unassignRequestPb{} + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type unassignRequestPb struct { + MetastoreId string `json:"-" url:"metastore_id"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func unassignRequestFromPb(pb *unassignRequestPb) (*UnassignRequest, error) { + if pb == nil { + return nil, nil + } + st := &UnassignRequest{} + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func unassignResponseToPb(st *UnassignResponse) (*unassignResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &unassignResponsePb{} + + return pb, nil +} + +type unassignResponsePb struct { +} + +func unassignResponseFromPb(pb *unassignResponsePb) (*UnassignResponse, error) { + if pb == nil { + return nil, nil + } + st := &UnassignResponse{} + + return st, nil +} + +func updateAssignmentResponseToPb(st *UpdateAssignmentResponse) (*updateAssignmentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateAssignmentResponsePb{} + + return pb, nil +} + +type updateAssignmentResponsePb struct { +} + +func updateAssignmentResponseFromPb(pb *updateAssignmentResponsePb) (*UpdateAssignmentResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAssignmentResponse{} + + return st, nil +} + +func updateCatalogToPb(st *UpdateCatalog) (*updateCatalogPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCatalogPb{} + pb.Comment = st.Comment + + pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization + + pb.IsolationMode = st.IsolationMode + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Options = st.Options + + pb.Owner = st.Owner + + pb.Properties = st.Properties + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateCatalogPb struct { + Comment string `json:"comment,omitempty"` + + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + + IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Options map[string]string `json:"options,omitempty"` + + Owner string `json:"owner,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateCatalogFromPb(pb *updateCatalogPb) (*UpdateCatalog, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCatalog{} + st.Comment = pb.Comment + st.EnablePredictiveOptimization = pb.EnablePredictiveOptimization + st.IsolationMode = pb.IsolationMode + st.Name = pb.Name + st.NewName = pb.NewName + st.Options = pb.Options + st.Owner = pb.Owner + st.Properties = pb.Properties + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateCatalogPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateCatalogPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateCatalogWorkspaceBindingsResponseToPb(st *UpdateCatalogWorkspaceBindingsResponse) (*updateCatalogWorkspaceBindingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateCatalogWorkspaceBindingsResponsePb{} + pb.Workspaces = st.Workspaces + + return pb, nil +} + +type updateCatalogWorkspaceBindingsResponsePb struct { + Workspaces []int64 `json:"workspaces,omitempty"` +} + +func updateCatalogWorkspaceBindingsResponseFromPb(pb *updateCatalogWorkspaceBindingsResponsePb) (*UpdateCatalogWorkspaceBindingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCatalogWorkspaceBindingsResponse{} + st.Workspaces = pb.Workspaces + + return st, nil +} + +func updateConnectionToPb(st *UpdateConnection) (*updateConnectionPb, error) { + if st == nil { + return nil, nil + } + pb := &updateConnectionPb{} + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Options = st.Options + + pb.Owner = st.Owner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateConnectionPb struct { + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Options map[string]string `json:"options"` + + Owner string `json:"owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateConnectionFromPb(pb *updateConnectionPb) (*UpdateConnection, error) { + if pb == nil { + return nil, nil + } + st := &UpdateConnection{} + st.Name = pb.Name + st.NewName = pb.NewName + st.Options = pb.Options + st.Owner = pb.Owner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateConnectionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateConnectionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateCredentialRequestToPb(st *UpdateCredentialRequest) (*updateCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCredentialRequestPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.Comment = st.Comment + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.Force = st.Force + + pb.IsolationMode = st.IsolationMode + + pb.NameArg = st.NameArg + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateCredentialRequestPb struct { + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + Comment string `json:"comment,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + + Force bool `json:"force,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + NameArg string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateCredentialRequestFromPb(pb *updateCredentialRequestPb) (*UpdateCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCredentialRequest{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.Comment = pb.Comment + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.Force = pb.Force + st.IsolationMode = pb.IsolationMode + st.NameArg = pb.NameArg + st.NewName = pb.NewName + st.Owner = pb.Owner + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateDatabaseInstanceRequestToPb(st *UpdateDatabaseInstanceRequest) (*updateDatabaseInstanceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDatabaseInstanceRequestPb{} + pb.DatabaseInstance = st.DatabaseInstance + + pb.Name = st.Name + + pb.UpdateMask = st.UpdateMask + + return pb, nil +} + +type updateDatabaseInstanceRequestPb struct { + DatabaseInstance DatabaseInstance `json:"database_instance"` + + Name string `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask"` +} + +func updateDatabaseInstanceRequestFromPb(pb *updateDatabaseInstanceRequestPb) (*UpdateDatabaseInstanceRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDatabaseInstanceRequest{} + st.DatabaseInstance = pb.DatabaseInstance + st.Name = pb.Name + st.UpdateMask = pb.UpdateMask + + return st, nil +} + +func updateExternalLocationToPb(st *UpdateExternalLocation) (*updateExternalLocationPb, error) { + if st == nil { + return nil, nil + } + pb := &updateExternalLocationPb{} + pb.Comment = st.Comment + + pb.CredentialName = st.CredentialName + + pb.EnableFileEvents = st.EnableFileEvents + + pb.EncryptionDetails = st.EncryptionDetails + + pb.Fallback = st.Fallback + + pb.FileEventQueue = st.FileEventQueue + + pb.Force = st.Force + + pb.IsolationMode = st.IsolationMode + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateExternalLocationPb struct { + Comment string `json:"comment,omitempty"` + + CredentialName string `json:"credential_name,omitempty"` + + EnableFileEvents bool `json:"enable_file_events,omitempty"` + + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + + Fallback bool `json:"fallback,omitempty"` + + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + + Force bool `json:"force,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateExternalLocationFromPb(pb *updateExternalLocationPb) (*UpdateExternalLocation, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExternalLocation{} + st.Comment = pb.Comment + st.CredentialName = pb.CredentialName + st.EnableFileEvents = pb.EnableFileEvents + st.EncryptionDetails = pb.EncryptionDetails + st.Fallback = pb.Fallback + st.FileEventQueue = pb.FileEventQueue + st.Force = pb.Force + st.IsolationMode = pb.IsolationMode + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateExternalLocationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateExternalLocationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateFunctionToPb(st *UpdateFunction) (*updateFunctionPb, error) { + if st == nil { + return nil, nil + } + pb := &updateFunctionPb{} + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateFunctionPb struct { + Name string `json:"-" url:"-"` + + Owner string `json:"owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateFunctionFromPb(pb *updateFunctionPb) (*UpdateFunction, error) { + if pb == nil { + return nil, nil + } + st := &UpdateFunction{} + st.Name = pb.Name + st.Owner = pb.Owner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateFunctionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateFunctionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateMetastoreToPb(st *UpdateMetastore) (*updateMetastorePb, error) { + if st == nil { + return nil, nil + } + pb := &updateMetastorePb{} + pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName + + pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds + + pb.DeltaSharingScope = st.DeltaSharingScope + + pb.Id = st.Id + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.PrivilegeModelVersion = st.PrivilegeModelVersion + + pb.StorageRootCredentialId = st.StorageRootCredentialId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateMetastorePb struct { + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + + DeltaSharingScope UpdateMetastoreDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + + Id string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateMetastoreFromPb(pb *updateMetastorePb) (*UpdateMetastore, error) { + if pb == nil { + return nil, nil + } + st := &UpdateMetastore{} + st.DeltaSharingOrganizationName = pb.DeltaSharingOrganizationName + st.DeltaSharingRecipientTokenLifetimeInSeconds = pb.DeltaSharingRecipientTokenLifetimeInSeconds + st.DeltaSharingScope = pb.DeltaSharingScope + st.Id = pb.Id + st.NewName = pb.NewName + st.Owner = pb.Owner + st.PrivilegeModelVersion = pb.PrivilegeModelVersion + st.StorageRootCredentialId = pb.StorageRootCredentialId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateMetastorePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateMetastorePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateMetastoreAssignmentToPb(st *UpdateMetastoreAssignment) (*updateMetastoreAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &updateMetastoreAssignmentPb{} + pb.DefaultCatalogName = st.DefaultCatalogName + + pb.MetastoreId = st.MetastoreId + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateMetastoreAssignmentPb struct { + DefaultCatalogName string `json:"default_catalog_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + WorkspaceId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateMetastoreAssignmentFromPb(pb *updateMetastoreAssignmentPb) (*UpdateMetastoreAssignment, error) { + if pb == nil { + return nil, nil + } + st := &UpdateMetastoreAssignment{} + st.DefaultCatalogName = pb.DefaultCatalogName + st.MetastoreId = pb.MetastoreId + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateMetastoreAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateMetastoreAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateModelVersionRequestPb{} + pb.Comment = st.Comment + + pb.FullName = st.FullName + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateModelVersionRequestPb struct { + Comment string `json:"comment,omitempty"` + + FullName string `json:"-" url:"-"` + + Version int `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateModelVersionRequestFromPb(pb *updateModelVersionRequestPb) (*UpdateModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateModelVersionRequest{} + st.Comment = pb.Comment + st.FullName = pb.FullName + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateModelVersionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateModelVersionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateMonitorToPb(st *UpdateMonitor) (*updateMonitorPb, error) { + if st == nil { + return nil, nil + } + pb := &updateMonitorPb{} + pb.BaselineTableName = st.BaselineTableName + + pb.CustomMetrics = st.CustomMetrics + + pb.DashboardId = st.DashboardId + + pb.DataClassificationConfig = st.DataClassificationConfig + + pb.InferenceLog = st.InferenceLog + + pb.Notifications = st.Notifications + + pb.OutputSchemaName = st.OutputSchemaName + + pb.Schedule = st.Schedule + + pb.SlicingExprs = st.SlicingExprs + + pb.Snapshot = st.Snapshot + + pb.TableName = st.TableName + + pb.TimeSeries = st.TimeSeries + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateMonitorPb struct { + BaselineTableName string `json:"baseline_table_name,omitempty"` + + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + + DashboardId string `json:"dashboard_id,omitempty"` + + DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + + Notifications *MonitorNotifications `json:"notifications,omitempty"` + + OutputSchemaName string `json:"output_schema_name"` + + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + + SlicingExprs []string `json:"slicing_exprs,omitempty"` + + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + + TableName string `json:"-" url:"-"` + + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateMonitorFromPb(pb *updateMonitorPb) (*UpdateMonitor, error) { + if pb == nil { + return nil, nil + } + st := &UpdateMonitor{} + st.BaselineTableName = pb.BaselineTableName + st.CustomMetrics = pb.CustomMetrics + st.DashboardId = pb.DashboardId + st.DataClassificationConfig = pb.DataClassificationConfig + st.InferenceLog = pb.InferenceLog + st.Notifications = pb.Notifications + st.OutputSchemaName = pb.OutputSchemaName + st.Schedule = pb.Schedule + st.SlicingExprs = pb.SlicingExprs + st.Snapshot = pb.Snapshot + st.TableName = pb.TableName + st.TimeSeries = pb.TimeSeries + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateMonitorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateMonitorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updatePermissionsToPb(st *UpdatePermissions) (*updatePermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &updatePermissionsPb{} + pb.Changes = st.Changes + + pb.FullName = st.FullName + + pb.SecurableType = st.SecurableType + + return pb, nil +} + +type updatePermissionsPb struct { + Changes []PermissionsChange `json:"changes,omitempty"` + + FullName string `json:"-" url:"-"` + + SecurableType SecurableType `json:"-" url:"-"` +} + +func updatePermissionsFromPb(pb *updatePermissionsPb) (*UpdatePermissions, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePermissions{} + st.Changes = pb.Changes + st.FullName = pb.FullName + st.SecurableType = pb.SecurableType + + return st, nil +} + +func updateRegisteredModelRequestToPb(st *UpdateRegisteredModelRequest) (*updateRegisteredModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRegisteredModelRequestPb{} + pb.Comment = st.Comment + + pb.FullName = st.FullName + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateRegisteredModelRequestPb struct { + Comment string `json:"comment,omitempty"` + + FullName string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateRegisteredModelRequestFromPb(pb *updateRegisteredModelRequestPb) (*UpdateRegisteredModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRegisteredModelRequest{} + st.Comment = pb.Comment + st.FullName = pb.FullName + st.NewName = pb.NewName + st.Owner = pb.Owner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateRegisteredModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateRegisteredModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func updateSchemaToPb(st *UpdateSchema) (*updateSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := &updateSchemaPb{} + pb.Comment = st.Comment + + pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization + + pb.FullName = st.FullName + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.Properties = st.Properties + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateSchemaPb struct { + Comment string `json:"comment,omitempty"` + + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + + FullName string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + Properties map[string]string `json:"properties,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateSchemaFromPb(pb *updateSchemaPb) (*UpdateSchema, error) { + if pb == nil { + return nil, nil + } + st := &UpdateSchema{} + st.Comment = pb.Comment + st.EnablePredictiveOptimization = pb.EnablePredictiveOptimization + st.FullName = pb.FullName + st.NewName = pb.NewName + st.Owner = pb.Owner + st.Properties = pb.Properties + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateSchemaPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateSchemaPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateStorageCredentialToPb(st *UpdateStorageCredential) (*updateStorageCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &updateStorageCredentialPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.CloudflareApiToken = st.CloudflareApiToken + + pb.Comment = st.Comment + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.Force = st.Force + + pb.IsolationMode = st.IsolationMode + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.ReadOnly = st.ReadOnly + + pb.SkipValidation = st.SkipValidation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateStorageCredentialPb struct { + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + + Comment string `json:"comment,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + + Force bool `json:"force,omitempty"` + + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateStorageCredentialFromPb(pb *updateStorageCredentialPb) (*UpdateStorageCredential, error) { + if pb == nil { + return nil, nil + } + st := &UpdateStorageCredential{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.CloudflareApiToken = pb.CloudflareApiToken + st.Comment = pb.Comment + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.Force = pb.Force + st.IsolationMode = pb.IsolationMode + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + st.ReadOnly = pb.ReadOnly + st.SkipValidation = pb.SkipValidation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateStorageCredentialPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateStorageCredentialPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateTableRequestToPb(st *UpdateTableRequest) (*updateTableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateTableRequestPb{} + pb.FullName = st.FullName + + pb.Owner = st.Owner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateTableRequestPb struct { + FullName string `json:"-" url:"-"` + + Owner string `json:"owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateTableRequestFromPb(pb *updateTableRequestPb) (*UpdateTableRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateTableRequest{} + st.FullName = pb.FullName + st.Owner = pb.Owner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateTableRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateTableRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateVolumeRequestContentToPb(st *UpdateVolumeRequestContent) (*updateVolumeRequestContentPb, error) { + if st == nil { + return nil, nil + } + pb := &updateVolumeRequestContentPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateVolumeRequestContentPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateVolumeRequestContentFromPb(pb *updateVolumeRequestContentPb) (*UpdateVolumeRequestContent, error) { + if pb == nil { + return nil, nil + } + st := &UpdateVolumeRequestContent{} + st.Comment = pb.Comment + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateVolumeRequestContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateVolumeRequestContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateWorkspaceBindingsToPb(st *UpdateWorkspaceBindings) (*updateWorkspaceBindingsPb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceBindingsPb{} + pb.AssignWorkspaces = st.AssignWorkspaces + + pb.Name = st.Name + + pb.UnassignWorkspaces = st.UnassignWorkspaces + + return pb, nil +} + +type updateWorkspaceBindingsPb struct { + AssignWorkspaces []int64 `json:"assign_workspaces,omitempty"` + + Name string `json:"-" url:"-"` + + UnassignWorkspaces []int64 `json:"unassign_workspaces,omitempty"` +} + +func updateWorkspaceBindingsFromPb(pb *updateWorkspaceBindingsPb) (*UpdateWorkspaceBindings, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceBindings{} + st.AssignWorkspaces = pb.AssignWorkspaces + st.Name = pb.Name + st.UnassignWorkspaces = pb.UnassignWorkspaces + + return st, nil +} + +func updateWorkspaceBindingsParametersToPb(st *UpdateWorkspaceBindingsParameters) (*updateWorkspaceBindingsParametersPb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceBindingsParametersPb{} + pb.Add = st.Add + + pb.Remove = st.Remove + + pb.SecurableName = st.SecurableName + + pb.SecurableType = st.SecurableType + + return pb, nil +} + +type updateWorkspaceBindingsParametersPb struct { + Add []WorkspaceBinding `json:"add,omitempty"` + + Remove []WorkspaceBinding `json:"remove,omitempty"` + + SecurableName string `json:"-" url:"-"` + + SecurableType string `json:"-" url:"-"` +} + +func updateWorkspaceBindingsParametersFromPb(pb *updateWorkspaceBindingsParametersPb) (*UpdateWorkspaceBindingsParameters, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceBindingsParameters{} + st.Add = pb.Add + st.Remove = pb.Remove + st.SecurableName = pb.SecurableName + st.SecurableType = pb.SecurableType + + return st, nil +} + +func updateWorkspaceBindingsResponseToPb(st *UpdateWorkspaceBindingsResponse) (*updateWorkspaceBindingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceBindingsResponsePb{} + pb.Bindings = st.Bindings + + return pb, nil +} + +type updateWorkspaceBindingsResponsePb struct { + Bindings []WorkspaceBinding `json:"bindings,omitempty"` +} + +func updateWorkspaceBindingsResponseFromPb(pb *updateWorkspaceBindingsResponsePb) (*UpdateWorkspaceBindingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceBindingsResponse{} + st.Bindings = pb.Bindings + + return st, nil +} + +func validateCredentialRequestToPb(st *ValidateCredentialRequest) (*validateCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &validateCredentialRequestPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.CredentialName = st.CredentialName + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.ExternalLocationName = st.ExternalLocationName + + pb.Purpose = st.Purpose + + pb.ReadOnly = st.ReadOnly + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type validateCredentialRequestPb struct { + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + + CredentialName string `json:"credential_name,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + + ExternalLocationName string `json:"external_location_name,omitempty"` + + Purpose CredentialPurpose `json:"purpose,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func validateCredentialRequestFromPb(pb *validateCredentialRequestPb) (*ValidateCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &ValidateCredentialRequest{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.CredentialName = pb.CredentialName + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.ExternalLocationName = pb.ExternalLocationName + st.Purpose = pb.Purpose + st.ReadOnly = pb.ReadOnly + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *validateCredentialRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st validateCredentialRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func validateCredentialResponseToPb(st *ValidateCredentialResponse) (*validateCredentialResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &validateCredentialResponsePb{} + pb.IsDir = st.IsDir + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type validateCredentialResponsePb struct { + IsDir bool `json:"isDir,omitempty"` + + Results []CredentialValidationResult `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func validateCredentialResponseFromPb(pb *validateCredentialResponsePb) (*ValidateCredentialResponse, error) { + if pb == nil { + return nil, nil + } + st := &ValidateCredentialResponse{} + st.IsDir = pb.IsDir + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *validateCredentialResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st validateCredentialResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func validateStorageCredentialToPb(st *ValidateStorageCredential) (*validateStorageCredentialPb, error) { + if st == nil { + return nil, nil + } + pb := &validateStorageCredentialPb{} + pb.AwsIamRole = st.AwsIamRole + + pb.AzureManagedIdentity = st.AzureManagedIdentity + + pb.AzureServicePrincipal = st.AzureServicePrincipal + + pb.CloudflareApiToken = st.CloudflareApiToken + + pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount + + pb.ExternalLocationName = st.ExternalLocationName + + pb.ReadOnly = st.ReadOnly + + pb.StorageCredentialName = st.StorageCredentialName + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type validateStorageCredentialPb struct { + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + + ExternalLocationName string `json:"external_location_name,omitempty"` + + ReadOnly bool `json:"read_only,omitempty"` + + StorageCredentialName string `json:"storage_credential_name,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func validateStorageCredentialFromPb(pb *validateStorageCredentialPb) (*ValidateStorageCredential, error) { + if pb == nil { + return nil, nil + } + st := &ValidateStorageCredential{} + st.AwsIamRole = pb.AwsIamRole + st.AzureManagedIdentity = pb.AzureManagedIdentity + st.AzureServicePrincipal = pb.AzureServicePrincipal + st.CloudflareApiToken = pb.CloudflareApiToken + st.DatabricksGcpServiceAccount = pb.DatabricksGcpServiceAccount + st.ExternalLocationName = pb.ExternalLocationName + st.ReadOnly = pb.ReadOnly + st.StorageCredentialName = pb.StorageCredentialName + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *validateStorageCredentialPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st validateStorageCredentialPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func validateStorageCredentialResponseToPb(st *ValidateStorageCredentialResponse) (*validateStorageCredentialResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &validateStorageCredentialResponsePb{} + pb.IsDir = st.IsDir + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type validateStorageCredentialResponsePb struct { + IsDir bool `json:"isDir,omitempty"` + + Results []ValidationResult `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func validateStorageCredentialResponseFromPb(pb *validateStorageCredentialResponsePb) (*ValidateStorageCredentialResponse, error) { + if pb == nil { + return nil, nil + } + st := &ValidateStorageCredentialResponse{} + st.IsDir = pb.IsDir + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *validateStorageCredentialResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st validateStorageCredentialResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func validationResultToPb(st *ValidationResult) (*validationResultPb, error) { + if st == nil { + return nil, nil + } + pb := &validationResultPb{} + pb.Message = st.Message + + pb.Operation = st.Operation + + pb.Result = st.Result + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type validationResultPb struct { + Message string `json:"message,omitempty"` + + Operation ValidationResultOperation `json:"operation,omitempty"` + + Result ValidationResultResult `json:"result,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func validationResultFromPb(pb *validationResultPb) (*ValidationResult, error) { + if pb == nil { + return nil, nil + } + st := &ValidationResult{} + st.Message = pb.Message + st.Operation = pb.Operation + st.Result = pb.Result + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *validationResultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st validationResultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func volumeInfoToPb(st *VolumeInfo) (*volumeInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &volumeInfoPb{} + pb.AccessPoint = st.AccessPoint + + pb.BrowseOnly = st.BrowseOnly + + pb.CatalogName = st.CatalogName + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.EncryptionDetails = st.EncryptionDetails + + pb.FullName = st.FullName + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.SchemaName = st.SchemaName + + pb.StorageLocation = st.StorageLocation + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.VolumeId = st.VolumeId + + pb.VolumeType = st.VolumeType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type volumeInfoPb struct { + AccessPoint string `json:"access_point,omitempty"` + + BrowseOnly bool `json:"browse_only,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + + FullName string `json:"full_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + VolumeId string `json:"volume_id,omitempty"` + + VolumeType VolumeType `json:"volume_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func volumeInfoFromPb(pb *volumeInfoPb) (*VolumeInfo, error) { + if pb == nil { + return nil, nil + } + st := &VolumeInfo{} + st.AccessPoint = pb.AccessPoint + st.BrowseOnly = pb.BrowseOnly + st.CatalogName = pb.CatalogName + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.EncryptionDetails = pb.EncryptionDetails + st.FullName = pb.FullName + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.SchemaName = pb.SchemaName + st.StorageLocation = pb.StorageLocation + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.VolumeId = pb.VolumeId + st.VolumeType = pb.VolumeType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *volumeInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st volumeInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceBindingToPb(st *WorkspaceBinding) (*workspaceBindingPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceBindingPb{} + pb.BindingType = st.BindingType + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type workspaceBindingPb struct { + BindingType WorkspaceBindingBindingType `json:"binding_type,omitempty"` + + WorkspaceId int64 `json:"workspace_id"` +} + +func workspaceBindingFromPb(pb *workspaceBindingPb) (*WorkspaceBinding, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceBinding{} + st.BindingType = pb.BindingType + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} diff --git a/service/catalog/model.go b/service/catalog/model.go index 726327ff9..42e2567a4 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -3,94 +3,394 @@ package catalog import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AccountsCreateMetastore struct { - MetastoreInfo *CreateMetastore `json:"metastore_info,omitempty"` + + // Wire name: 'metastore_info' + MetastoreInfo *CreateMetastore +} + +func (st *AccountsCreateMetastore) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsCreateMetastorePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsCreateMetastoreFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsCreateMetastore) MarshalJSON() ([]byte, error) { + pb, err := accountsCreateMetastoreToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsCreateMetastoreAssignment struct { - MetastoreAssignment *CreateMetastoreAssignment `json:"metastore_assignment,omitempty"` + + // Wire name: 'metastore_assignment' + MetastoreAssignment *CreateMetastoreAssignment // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *AccountsCreateMetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsCreateMetastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsCreateMetastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsCreateMetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := accountsCreateMetastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsCreateStorageCredential struct { - CredentialInfo *CreateStorageCredential `json:"credential_info,omitempty"` + + // Wire name: 'credential_info' + CredentialInfo *CreateStorageCredential // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` +} + +func (st *AccountsCreateStorageCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsCreateStorageCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsCreateStorageCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsCreateStorageCredential) MarshalJSON() ([]byte, error) { + pb, err := accountsCreateStorageCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsMetastoreAssignment struct { - MetastoreAssignment *MetastoreAssignment `json:"metastore_assignment,omitempty"` + + // Wire name: 'metastore_assignment' + MetastoreAssignment *MetastoreAssignment +} + +func (st *AccountsMetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsMetastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsMetastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsMetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := accountsMetastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsMetastoreInfo struct { - MetastoreInfo *MetastoreInfo `json:"metastore_info,omitempty"` + + // Wire name: 'metastore_info' + MetastoreInfo *MetastoreInfo +} + +func (st *AccountsMetastoreInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsMetastoreInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsMetastoreInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsMetastoreInfo) MarshalJSON() ([]byte, error) { + pb, err := accountsMetastoreInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsStorageCredentialInfo struct { - CredentialInfo *StorageCredentialInfo `json:"credential_info,omitempty"` + + // Wire name: 'credential_info' + CredentialInfo *StorageCredentialInfo +} + +func (st *AccountsStorageCredentialInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsStorageCredentialInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsStorageCredentialInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsStorageCredentialInfo) MarshalJSON() ([]byte, error) { + pb, err := accountsStorageCredentialInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsUpdateMetastore struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` + + // Wire name: 'metastore_info' + MetastoreInfo *UpdateMetastore +} + +func (st *AccountsUpdateMetastore) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsUpdateMetastorePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsUpdateMetastoreFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - MetastoreInfo *UpdateMetastore `json:"metastore_info,omitempty"` +func (st AccountsUpdateMetastore) MarshalJSON() ([]byte, error) { + pb, err := accountsUpdateMetastoreToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsUpdateMetastoreAssignment struct { - MetastoreAssignment *UpdateMetastoreAssignment `json:"metastore_assignment,omitempty"` + + // Wire name: 'metastore_assignment' + MetastoreAssignment *UpdateMetastoreAssignment // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *AccountsUpdateMetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsUpdateMetastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsUpdateMetastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsUpdateMetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := accountsUpdateMetastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountsUpdateStorageCredential struct { - CredentialInfo *UpdateStorageCredential `json:"credential_info,omitempty"` + + // Wire name: 'credential_info' + CredentialInfo *UpdateStorageCredential // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Name of the storage credential. - StorageCredentialName string `json:"-" url:"-"` + // Wire name: 'storage_credential_name' + StorageCredentialName string `tf:"-"` +} + +func (st *AccountsUpdateStorageCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountsUpdateStorageCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountsUpdateStorageCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AccountsUpdateStorageCredential) MarshalJSON() ([]byte, error) { + pb, err := accountsUpdateStorageCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ArtifactAllowlistInfo struct { // A list of allowed artifact match patterns. - ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers,omitempty"` + // Wire name: 'artifact_matchers' + ArtifactMatchers []ArtifactMatcher // Time at which this artifact allowlist was set, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of the user who set the artifact allowlist. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ArtifactAllowlistInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ArtifactAllowlistInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &artifactAllowlistInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := artifactAllowlistInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ArtifactAllowlistInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ArtifactAllowlistInfo) MarshalJSON() ([]byte, error) { + pb, err := artifactAllowlistInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ArtifactMatcher struct { // The artifact path or maven coordinate - Artifact string `json:"artifact"` + // Wire name: 'artifact' + Artifact string // The pattern matching type of the artifact - MatchType MatchType `json:"match_type"` + // Wire name: 'match_type' + MatchType MatchType +} + +func (st *ArtifactMatcher) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &artifactMatcherPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := artifactMatcherFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ArtifactMatcher) MarshalJSON() ([]byte, error) { + pb, err := artifactMatcherToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The artifact type type ArtifactType string +type artifactTypePb string const ArtifactTypeInitScript ArtifactType = `INIT_SCRIPT` @@ -119,101 +419,248 @@ func (f *ArtifactType) Type() string { return "ArtifactType" } +func artifactTypeToPb(st *ArtifactType) (*artifactTypePb, error) { + if st == nil { + return nil, nil + } + pb := artifactTypePb(*st) + return &pb, nil +} + +func artifactTypeFromPb(pb *artifactTypePb) (*ArtifactType, error) { + if pb == nil { + return nil, nil + } + st := ArtifactType(*pb) + return &st, nil +} + type AssignResponse struct { } +func (st *AssignResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &assignResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := assignResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AssignResponse) MarshalJSON() ([]byte, error) { + pb, err := assignResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. type AwsCredentials struct { // The access key ID that identifies the temporary credentials. - AccessKeyId string `json:"access_key_id,omitempty"` + // Wire name: 'access_key_id' + AccessKeyId string // The Amazon Resource Name (ARN) of the S3 access point for temporary // credentials related the external location. - AccessPoint string `json:"access_point,omitempty"` + // Wire name: 'access_point' + AccessPoint string // The secret access key that can be used to sign AWS API requests. - SecretAccessKey string `json:"secret_access_key,omitempty"` + // Wire name: 'secret_access_key' + SecretAccessKey string // The token that users must pass to AWS API to use the temporary // credentials. - SessionToken string `json:"session_token,omitempty"` + // Wire name: 'session_token' + SessionToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsCredentials) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsCredentials) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsCredentialsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsCredentialsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsCredentials) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsCredentials) MarshalJSON() ([]byte, error) { + pb, err := awsCredentialsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The AWS IAM role configuration type AwsIamRole struct { // The external ID used in role assumption to prevent the confused deputy // problem. - ExternalId string `json:"external_id,omitempty"` + // Wire name: 'external_id' + ExternalId string // The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary // credentials. - RoleArn string `json:"role_arn,omitempty"` + // Wire name: 'role_arn' + RoleArn string // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` + // Wire name: 'unity_catalog_iam_arn' + UnityCatalogIamArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsIamRole) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsIamRole) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsIamRolePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsIamRoleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsIamRole) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsIamRole) MarshalJSON() ([]byte, error) { + pb, err := awsIamRoleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AwsIamRoleRequest struct { // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn string `json:"role_arn"` + // Wire name: 'role_arn' + RoleArn string +} + +func (st *AwsIamRoleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsIamRoleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsIamRoleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AwsIamRoleRequest) MarshalJSON() ([]byte, error) { + pb, err := awsIamRoleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AwsIamRoleResponse struct { // The external ID used in role assumption to prevent confused deputy // problem.. - ExternalId string `json:"external_id,omitempty"` + // Wire name: 'external_id' + ExternalId string // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn string `json:"role_arn"` + // Wire name: 'role_arn' + RoleArn string // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` + // Wire name: 'unity_catalog_iam_arn' + UnityCatalogIamArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsIamRoleResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsIamRoleResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsIamRoleResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsIamRoleResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsIamRoleResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsIamRoleResponse) MarshalJSON() ([]byte, error) { + pb, err := awsIamRoleResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AwsSqsQueue struct { // Unique identifier included in the name of file events managed cloud // resources. - ManagedResourceId string `json:"managed_resource_id,omitempty"` + // Wire name: 'managed_resource_id' + ManagedResourceId string // The AQS queue url in the format // https://sqs.{region}.amazonaws.com/{account id}/{queue name} REQUIRED for // provided_sqs. - QueueUrl string `json:"queue_url,omitempty"` + // Wire name: 'queue_url' + QueueUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsSqsQueue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsSqsQueue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsSqsQueuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsSqsQueueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsSqsQueue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsSqsQueue) MarshalJSON() ([]byte, error) { + pb, err := awsSqsQueueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Azure Active Directory token, essentially the Oauth token for Azure Service @@ -222,17 +669,35 @@ func (s AwsSqsQueue) MarshalJSON() ([]byte, error) { type AzureActiveDirectoryToken struct { // Opaque token that contains claims that you can use in Azure Active // Directory to access cloud services. - AadToken string `json:"aad_token,omitempty"` + // Wire name: 'aad_token' + AadToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureActiveDirectoryToken) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureActiveDirectoryToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureActiveDirectoryTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureActiveDirectoryTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureActiveDirectoryToken) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureActiveDirectoryToken) MarshalJSON() ([]byte, error) { + pb, err := azureActiveDirectoryTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The Azure managed identity configuration. @@ -240,106 +705,186 @@ type AzureManagedIdentity struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}`. - AccessConnectorId string `json:"access_connector_id"` + // Wire name: 'access_connector_id' + AccessConnectorId string // The Databricks internal ID that represents this managed identity. This // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database. . - CredentialId string `json:"credential_id,omitempty"` + // Wire name: 'credential_id' + CredentialId string // The Azure resource ID of the managed identity. Use the format, // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}` // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // using the system-assigned identity. - ManagedIdentityId string `json:"managed_identity_id,omitempty"` + // Wire name: 'managed_identity_id' + ManagedIdentityId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureManagedIdentity) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureManagedIdentity) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureManagedIdentityPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureManagedIdentityFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureManagedIdentity) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureManagedIdentity) MarshalJSON() ([]byte, error) { + pb, err := azureManagedIdentityToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AzureManagedIdentityRequest struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId string `json:"access_connector_id"` + // Wire name: 'access_connector_id' + AccessConnectorId string // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId string `json:"managed_identity_id,omitempty"` + // Wire name: 'managed_identity_id' + ManagedIdentityId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureManagedIdentityRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureManagedIdentityRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureManagedIdentityRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureManagedIdentityRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureManagedIdentityRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureManagedIdentityRequest) MarshalJSON() ([]byte, error) { + pb, err := azureManagedIdentityRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AzureManagedIdentityResponse struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId string `json:"access_connector_id"` + // Wire name: 'access_connector_id' + AccessConnectorId string // The Databricks internal ID that represents this managed identity. - CredentialId string `json:"credential_id,omitempty"` + // Wire name: 'credential_id' + CredentialId string // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId string `json:"managed_identity_id,omitempty"` + // Wire name: 'managed_identity_id' + ManagedIdentityId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureManagedIdentityResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureManagedIdentityResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureManagedIdentityResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureManagedIdentityResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureManagedIdentityResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureManagedIdentityResponse) MarshalJSON() ([]byte, error) { + pb, err := azureManagedIdentityResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AzureQueueStorage struct { // Unique identifier included in the name of file events managed cloud // resources. - ManagedResourceId string `json:"managed_resource_id,omitempty"` + // Wire name: 'managed_resource_id' + ManagedResourceId string // The AQS queue url in the format https://{storage // account}.queue.core.windows.net/{queue name} REQUIRED for provided_aqs. - QueueUrl string `json:"queue_url,omitempty"` + // Wire name: 'queue_url' + QueueUrl string // The resource group for the queue, event grid subscription, and external // location storage account. ONLY REQUIRED for locations with a service // principal storage credential - ResourceGroup string `json:"resource_group,omitempty"` + // Wire name: 'resource_group' + ResourceGroup string // OPTIONAL: The subscription id for the queue, event grid subscription, and // external location storage account. REQUIRED for locations with a service // principal storage credential - SubscriptionId string `json:"subscription_id,omitempty"` + // Wire name: 'subscription_id' + SubscriptionId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureQueueStorage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureQueueStorage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureQueueStoragePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureQueueStorageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureQueueStorage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureQueueStorage) MarshalJSON() ([]byte, error) { + pb, err := azureQueueStorageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The Azure service principal configuration. Only applicable when purpose is @@ -347,109 +892,248 @@ func (s AzureQueueStorage) MarshalJSON() ([]byte, error) { type AzureServicePrincipal struct { // The application ID of the application registration within the referenced // AAD tenant. - ApplicationId string `json:"application_id"` + // Wire name: 'application_id' + ApplicationId string // The client secret generated for the above app ID in AAD. - ClientSecret string `json:"client_secret"` + // Wire name: 'client_secret' + ClientSecret string // The directory ID corresponding to the Azure Active Directory (AAD) tenant // of the application. - DirectoryId string `json:"directory_id"` + // Wire name: 'directory_id' + DirectoryId string +} + +func (st *AzureServicePrincipal) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureServicePrincipalPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureServicePrincipalFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AzureServicePrincipal) MarshalJSON() ([]byte, error) { + pb, err := azureServicePrincipalToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Azure temporary credentials for API authentication. Read more at // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas type AzureUserDelegationSas struct { // The signed URI (SAS Token) used to access blob services for a given path - SasToken string `json:"sas_token,omitempty"` + // Wire name: 'sas_token' + SasToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureUserDelegationSas) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureUserDelegationSas) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureUserDelegationSasPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureUserDelegationSasFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureUserDelegationSas) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureUserDelegationSas) MarshalJSON() ([]byte, error) { + pb, err := azureUserDelegationSasToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Cancel refresh type CancelRefreshRequest struct { // ID of the refresh. - RefreshId string `json:"-" url:"-"` + // Wire name: 'refresh_id' + RefreshId string `tf:"-"` // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *CancelRefreshRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelRefreshRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelRefreshRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelRefreshRequest) MarshalJSON() ([]byte, error) { + pb, err := cancelRefreshRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelRefreshResponse struct { } +func (st *CancelRefreshResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelRefreshResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelRefreshResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelRefreshResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelRefreshResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type CatalogInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // The type of the catalog. - CatalogType CatalogType `json:"catalog_type,omitempty"` + // Wire name: 'catalog_type' + CatalogType CatalogType // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the connection to an external data source. - ConnectionName string `json:"connection_name,omitempty"` + // Wire name: 'connection_name' + ConnectionName string // Time at which this catalog was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of catalog creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string - EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + // Wire name: 'effective_predictive_optimization_flag' + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + // Wire name: 'enable_predictive_optimization' + EnablePredictiveOptimization EnablePredictiveOptimization // The full name of the catalog. Corresponds with the name field. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode CatalogIsolationMode // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of catalog. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options,omitempty"` + // Wire name: 'options' + Options map[string]string // Username of current owner of catalog. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName string `json:"provider_name,omitempty"` + // Wire name: 'provider_name' + ProviderName string // Status of an asynchronously provisioned resource. - ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` + // Wire name: 'provisioning_info' + ProvisioningInfo *ProvisioningInfo // The type of Unity Catalog securable. - SecurableType SecurableType `json:"securable_type,omitempty"` + // Wire name: 'securable_type' + SecurableType SecurableType // The name of the share under the share provider. - ShareName string `json:"share_name,omitempty"` + // Wire name: 'share_name' + ShareName string // Storage Location URL (full path) for managed tables within catalog. - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // Storage root URL for managed tables within catalog. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // Time at which this catalog was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified catalog. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CatalogInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CatalogInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &catalogInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := catalogInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CatalogInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CatalogInfo) MarshalJSON() ([]byte, error) { + pb, err := catalogInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CatalogIsolationMode string +type catalogIsolationModePb string const CatalogIsolationModeIsolated CatalogIsolationMode = `ISOLATED` @@ -476,8 +1160,25 @@ func (f *CatalogIsolationMode) Type() string { return "CatalogIsolationMode" } +func catalogIsolationModeToPb(st *CatalogIsolationMode) (*catalogIsolationModePb, error) { + if st == nil { + return nil, nil + } + pb := catalogIsolationModePb(*st) + return &pb, nil +} + +func catalogIsolationModeFromPb(pb *catalogIsolationModePb) (*CatalogIsolationMode, error) { + if pb == nil { + return nil, nil + } + st := CatalogIsolationMode(*pb) + return &st, nil +} + // The type of the catalog. type CatalogType string +type catalogTypePb string const CatalogTypeDeltasharingCatalog CatalogType = `DELTASHARING_CATALOG` @@ -514,73 +1215,166 @@ func (f *CatalogType) Type() string { return "CatalogType" } +func catalogTypeToPb(st *CatalogType) (*catalogTypePb, error) { + if st == nil { + return nil, nil + } + pb := catalogTypePb(*st) + return &pb, nil +} + +func catalogTypeFromPb(pb *catalogTypePb) (*CatalogType, error) { + if pb == nil { + return nil, nil + } + st := CatalogType(*pb) + return &st, nil +} + type CloudflareApiToken struct { // The Cloudflare access key id of the token. - AccessKeyId string `json:"access_key_id"` + // Wire name: 'access_key_id' + AccessKeyId string // The account id associated with the API token. - AccountId string `json:"account_id"` + // Wire name: 'account_id' + AccountId string // The secret access token generated for the access key id - SecretAccessKey string `json:"secret_access_key"` + // Wire name: 'secret_access_key' + SecretAccessKey string +} + +func (st *CloudflareApiToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cloudflareApiTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cloudflareApiTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CloudflareApiToken) MarshalJSON() ([]byte, error) { + pb, err := cloudflareApiTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ColumnInfo struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string - Mask *ColumnMask `json:"mask,omitempty"` + // Wire name: 'mask' + Mask *ColumnMask // Name of Column. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Whether field may be Null (default: true). - Nullable bool `json:"nullable,omitempty"` + // Wire name: 'nullable' + Nullable bool // Partition index for column. - PartitionIndex int `json:"partition_index,omitempty"` + // Wire name: 'partition_index' + PartitionIndex int // Ordinal position of column (starting at position 0). - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // Format of IntervalType. - TypeIntervalType string `json:"type_interval_type,omitempty"` + // Wire name: 'type_interval_type' + TypeIntervalType string // Full data type specification, JSON-serialized. - TypeJson string `json:"type_json,omitempty"` + // Wire name: 'type_json' + TypeJson string - TypeName ColumnTypeName `json:"type_name,omitempty"` + // Wire name: 'type_name' + TypeName ColumnTypeName // Digits of precision; required for DecimalTypes. - TypePrecision int `json:"type_precision,omitempty"` + // Wire name: 'type_precision' + TypePrecision int // Digits to right of decimal; Required for DecimalTypes. - TypeScale int `json:"type_scale,omitempty"` + // Wire name: 'type_scale' + TypeScale int // Full data type specification as SQL/catalogString text. - TypeText string `json:"type_text,omitempty"` + // Wire name: 'type_text' + TypeText string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ColumnInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ColumnInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &columnInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := columnInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ColumnInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ColumnInfo) MarshalJSON() ([]byte, error) { + pb, err := columnInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ColumnMask struct { // The full name of the column mask SQL UDF. - FunctionName string `json:"function_name,omitempty"` + // Wire name: 'function_name' + FunctionName string // The list of additional table columns to be passed as input to the column // mask function. The first arg of the mask function should be of the type // of the column being masked and the types of the rest of the args should // match the types of columns in 'using_column_names'. - UsingColumnNames []string `json:"using_column_names,omitempty"` + // Wire name: 'using_column_names' + UsingColumnNames []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ColumnMask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ColumnMask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &columnMaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := columnMaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ColumnMask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ColumnMask) MarshalJSON() ([]byte, error) { + pb, err := columnMaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ColumnTypeName string +type columnTypeNamePb string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -651,58 +1445,110 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } +func columnTypeNameToPb(st *ColumnTypeName) (*columnTypeNamePb, error) { + if st == nil { + return nil, nil + } + pb := columnTypeNamePb(*st) + return &pb, nil +} + +func columnTypeNameFromPb(pb *columnTypeNamePb) (*ColumnTypeName, error) { + if pb == nil { + return nil, nil + } + st := ColumnTypeName(*pb) + return &st, nil +} + type ConnectionInfo struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Unique identifier of the Connection. - ConnectionId string `json:"connection_id,omitempty"` + // Wire name: 'connection_id' + ConnectionId string // The type of connection. - ConnectionType ConnectionType `json:"connection_type,omitempty"` + // Wire name: 'connection_type' + ConnectionType ConnectionType // Time at which this connection was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of connection creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The type of credential. - CredentialType CredentialType `json:"credential_type,omitempty"` + // Wire name: 'credential_type' + CredentialType CredentialType // Full name of connection. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of the connection. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options,omitempty"` + // Wire name: 'options' + Options map[string]string // Username of current owner of the connection. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // An object containing map of key-value properties attached to the // connection. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // Status of an asynchronously provisioned resource. - ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` + // Wire name: 'provisioning_info' + ProvisioningInfo *ProvisioningInfo // If the connection is read only. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool - SecurableType string `json:"securable_type,omitempty"` + // Wire name: 'securable_type' + SecurableType string // Time at which this connection was updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified connection. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // URL of the remote data source, extracted from options. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ConnectionInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ConnectionInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &connectionInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := connectionInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ConnectionInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ConnectionInfo) MarshalJSON() ([]byte, error) { + pb, err := connectionInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of connection. type ConnectionType string +type connectionTypePb string const ConnectionTypeBigquery ConnectionType = `BIGQUERY` @@ -751,234 +1597,495 @@ func (f *ConnectionType) Type() string { return "ConnectionType" } +func connectionTypeToPb(st *ConnectionType) (*connectionTypePb, error) { + if st == nil { + return nil, nil + } + pb := connectionTypePb(*st) + return &pb, nil +} + +func connectionTypeFromPb(pb *connectionTypePb) (*ConnectionType, error) { + if pb == nil { + return nil, nil + } + st := ConnectionType(*pb) + return &st, nil +} + // Detailed status of an online table. Shown if the online table is in the // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. type ContinuousUpdateStatus struct { // Progress of the initial data synchronization. - InitialPipelineSyncProgress *PipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` + // Wire name: 'initial_pipeline_sync_progress' + InitialPipelineSyncProgress *PipelineProgress // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + // Wire name: 'last_processed_commit_version' + LastProcessedCommitVersion int64 // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp string `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ContinuousUpdateStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ContinuousUpdateStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &continuousUpdateStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := continuousUpdateStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ContinuousUpdateStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ContinuousUpdateStatus) MarshalJSON() ([]byte, error) { + pb, err := continuousUpdateStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCatalog struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the connection to an external data source. - ConnectionName string `json:"connection_name,omitempty"` + // Wire name: 'connection_name' + ConnectionName string // Name of catalog. - Name string `json:"name"` + // Wire name: 'name' + Name string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options,omitempty"` + // Wire name: 'options' + Options map[string]string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName string `json:"provider_name,omitempty"` + // Wire name: 'provider_name' + ProviderName string // The name of the share under the share provider. - ShareName string `json:"share_name,omitempty"` + // Wire name: 'share_name' + ShareName string // Storage root URL for managed tables within catalog. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCatalog) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCatalog) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCatalogPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCatalogFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCatalog) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCatalog) MarshalJSON() ([]byte, error) { + pb, err := createCatalogToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateConnection struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The type of connection. - ConnectionType ConnectionType `json:"connection_type"` + // Wire name: 'connection_type' + ConnectionType ConnectionType // Name of the connection. - Name string `json:"name"` + // Wire name: 'name' + Name string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options"` + // Wire name: 'options' + Options map[string]string // An object containing map of key-value properties attached to the // connection. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // If the connection is read only. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateConnection) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateConnection) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createConnectionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createConnectionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateConnection) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateConnection) MarshalJSON() ([]byte, error) { + pb, err := createConnectionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRole // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentity // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name string `json:"name"` + // Wire name: 'name' + Name string // Indicates the purpose of the credential. - Purpose CredentialPurpose `json:"purpose,omitempty"` + // Wire name: 'purpose' + Purpose CredentialPurpose // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Optional. Supplying true to this argument skips validation of the created // set of credentials. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := createCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a Database Catalog type CreateDatabaseCatalogRequest struct { - Catalog DatabaseCatalog `json:"catalog"` + + // Wire name: 'catalog' + Catalog DatabaseCatalog +} + +func (st *CreateDatabaseCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDatabaseCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDatabaseCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := createDatabaseCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a Database Instance type CreateDatabaseInstanceRequest struct { // A DatabaseInstance represents a logical Postgres instance, comprised of // both compute and storage. - DatabaseInstance DatabaseInstance `json:"database_instance"` + // Wire name: 'database_instance' + DatabaseInstance DatabaseInstance } -type CreateExternalLocation struct { - // User-provided free-form text description. - Comment string `json:"comment,omitempty"` - // Name of the storage credential used with this location. - CredentialName string `json:"credential_name"` - // [Create:OPT Update:OPT] Whether to enable file events on this external +func (st *CreateDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDatabaseInstanceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDatabaseInstanceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + pb, err := createDatabaseInstanceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Create a Database Table +type CreateDatabaseTableRequest struct { + // Next field marker: 13 + // Wire name: 'table' + Table DatabaseTable +} + +func (st *CreateDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := createDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type CreateExternalLocation struct { + // User-provided free-form text description. + // Wire name: 'comment' + Comment string + // Name of the storage credential used with this location. + // Wire name: 'credential_name' + CredentialName string + // [Create:OPT Update:OPT] Whether to enable file events on this external // location. - EnableFileEvents bool `json:"enable_file_events,omitempty"` + // Wire name: 'enable_file_events' + EnableFileEvents bool // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Wire name: 'encryption_details' + EncryptionDetails *EncryptionDetails // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback bool `json:"fallback,omitempty"` + // Wire name: 'fallback' + Fallback bool // [Create:OPT Update:OPT] File event queue settings. - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + // Wire name: 'file_event_queue' + FileEventQueue *FileEventQueue // Name of the external location. - Name string `json:"name"` + // Wire name: 'name' + Name string // Indicates whether the external location is read-only. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Skips validation of the storage credential associated with the external // location. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool // Path URL of the external location. - Url string `json:"url"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateExternalLocation) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateExternalLocation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExternalLocationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExternalLocationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateExternalLocation) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateExternalLocation) MarshalJSON() ([]byte, error) { + pb, err := createExternalLocationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateFunction struct { // Name of parent catalog. - CatalogName string `json:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Scalar function return data type. - DataType ColumnTypeName `json:"data_type"` + // Wire name: 'data_type' + DataType ColumnTypeName // External function language. - ExternalLanguage string `json:"external_language,omitempty"` + // Wire name: 'external_language' + ExternalLanguage string // External function name. - ExternalName string `json:"external_name,omitempty"` + // Wire name: 'external_name' + ExternalName string // Pretty printed function data type. - FullDataType string `json:"full_data_type"` + // Wire name: 'full_data_type' + FullDataType string - InputParams FunctionParameterInfos `json:"input_params"` + // Wire name: 'input_params' + InputParams FunctionParameterInfos // Whether the function is deterministic. - IsDeterministic bool `json:"is_deterministic"` + // Wire name: 'is_deterministic' + IsDeterministic bool // Function null call. - IsNullCall bool `json:"is_null_call"` + // Wire name: 'is_null_call' + IsNullCall bool // Name of function, relative to parent schema. - Name string `json:"name"` + // Wire name: 'name' + Name string // Function parameter style. **S** is the value for SQL. - ParameterStyle CreateFunctionParameterStyle `json:"parameter_style"` + // Wire name: 'parameter_style' + ParameterStyle CreateFunctionParameterStyle // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties string // Table function return parameters. - ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + // Wire name: 'return_params' + ReturnParams *FunctionParameterInfos // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody CreateFunctionRoutineBody `json:"routine_body"` + // Wire name: 'routine_body' + RoutineBody CreateFunctionRoutineBody // Function body. - RoutineDefinition string `json:"routine_definition"` + // Wire name: 'routine_definition' + RoutineDefinition string // Function dependencies. - RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + // Wire name: 'routine_dependencies' + RoutineDependencies *DependencyList // Name of parent schema relative to its parent catalog. - SchemaName string `json:"schema_name"` + // Wire name: 'schema_name' + SchemaName string // Function security type. - SecurityType CreateFunctionSecurityType `json:"security_type"` + // Wire name: 'security_type' + SecurityType CreateFunctionSecurityType // Specific name of the function; Reserved for future use. - SpecificName string `json:"specific_name"` + // Wire name: 'specific_name' + SpecificName string // Function SQL data access. - SqlDataAccess CreateFunctionSqlDataAccess `json:"sql_data_access"` + // Wire name: 'sql_data_access' + SqlDataAccess CreateFunctionSqlDataAccess // List of schemes whose objects can be referenced without qualification. - SqlPath string `json:"sql_path,omitempty"` + // Wire name: 'sql_path' + SqlPath string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateFunction) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateFunction) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createFunctionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFunctionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateFunction) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateFunction) MarshalJSON() ([]byte, error) { + pb, err := createFunctionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Function parameter style. **S** is the value for SQL. type CreateFunctionParameterStyle string +type createFunctionParameterStylePb string const CreateFunctionParameterStyleS CreateFunctionParameterStyle = `S` @@ -1003,9 +2110,51 @@ func (f *CreateFunctionParameterStyle) Type() string { return "CreateFunctionParameterStyle" } +func createFunctionParameterStyleToPb(st *CreateFunctionParameterStyle) (*createFunctionParameterStylePb, error) { + if st == nil { + return nil, nil + } + pb := createFunctionParameterStylePb(*st) + return &pb, nil +} + +func createFunctionParameterStyleFromPb(pb *createFunctionParameterStylePb) (*CreateFunctionParameterStyle, error) { + if pb == nil { + return nil, nil + } + st := CreateFunctionParameterStyle(*pb) + return &st, nil +} + type CreateFunctionRequest struct { // Partial __FunctionInfo__ specifying the function to be created. - FunctionInfo CreateFunction `json:"function_info"` + // Wire name: 'function_info' + FunctionInfo CreateFunction +} + +func (st *CreateFunctionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createFunctionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFunctionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateFunctionRequest) MarshalJSON() ([]byte, error) { + pb, err := createFunctionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Function language. When **EXTERNAL** is used, the language of the routine @@ -1013,6 +2162,7 @@ type CreateFunctionRequest struct { // __return_params__ of the function cannot be used (as **TABLE** return type is // not supported), and the __sql_data_access__ field must be **NO_SQL**. type CreateFunctionRoutineBody string +type createFunctionRoutineBodyPb string const CreateFunctionRoutineBodyExternal CreateFunctionRoutineBody = `EXTERNAL` @@ -1039,8 +2189,25 @@ func (f *CreateFunctionRoutineBody) Type() string { return "CreateFunctionRoutineBody" } +func createFunctionRoutineBodyToPb(st *CreateFunctionRoutineBody) (*createFunctionRoutineBodyPb, error) { + if st == nil { + return nil, nil + } + pb := createFunctionRoutineBodyPb(*st) + return &pb, nil +} + +func createFunctionRoutineBodyFromPb(pb *createFunctionRoutineBodyPb) (*CreateFunctionRoutineBody, error) { + if pb == nil { + return nil, nil + } + st := CreateFunctionRoutineBody(*pb) + return &st, nil +} + // The security type of the function. type CreateFunctionSecurityType string +type createFunctionSecurityTypePb string const CreateFunctionSecurityTypeDefiner CreateFunctionSecurityType = `DEFINER` @@ -1065,8 +2232,25 @@ func (f *CreateFunctionSecurityType) Type() string { return "CreateFunctionSecurityType" } +func createFunctionSecurityTypeToPb(st *CreateFunctionSecurityType) (*createFunctionSecurityTypePb, error) { + if st == nil { + return nil, nil + } + pb := createFunctionSecurityTypePb(*st) + return &pb, nil +} + +func createFunctionSecurityTypeFromPb(pb *createFunctionSecurityTypePb) (*CreateFunctionSecurityType, error) { + if pb == nil { + return nil, nil + } + st := CreateFunctionSecurityType(*pb) + return &st, nil +} + // Function SQL data access. type CreateFunctionSqlDataAccess string +type createFunctionSqlDataAccessPb string const CreateFunctionSqlDataAccessContainsSql CreateFunctionSqlDataAccess = `CONTAINS_SQL` @@ -1095,279 +2279,607 @@ func (f *CreateFunctionSqlDataAccess) Type() string { return "CreateFunctionSqlDataAccess" } +func createFunctionSqlDataAccessToPb(st *CreateFunctionSqlDataAccess) (*createFunctionSqlDataAccessPb, error) { + if st == nil { + return nil, nil + } + pb := createFunctionSqlDataAccessPb(*st) + return &pb, nil +} + +func createFunctionSqlDataAccessFromPb(pb *createFunctionSqlDataAccessPb) (*CreateFunctionSqlDataAccess, error) { + if pb == nil { + return nil, nil + } + st := CreateFunctionSqlDataAccess(*pb) + return &st, nil +} + type CreateMetastore struct { // The user-specified name of the metastore. - Name string `json:"name"` + // Wire name: 'name' + Name string // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). // The field can be omitted in the __workspace-level__ __API__ but not in // the __account-level__ __API__. If this field is omitted, the region of // the workspace receiving the request will be used. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The storage root URL for metastore - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateMetastore) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateMetastore) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createMetastorePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createMetastoreFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateMetastore) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateMetastore) MarshalJSON() ([]byte, error) { + pb, err := createMetastoreToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateMetastoreAssignment struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName string `json:"default_catalog_name"` + // Wire name: 'default_catalog_name' + DefaultCatalogName string // The unique ID of the metastore. - MetastoreId string `json:"metastore_id"` + // Wire name: 'metastore_id' + MetastoreId string // A workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *CreateMetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createMetastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createMetastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateMetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := createMetastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateMonitor struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir string `json:"assets_dir"` + // Wire name: 'assets_dir' + AssetsDir string // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName string `json:"baseline_table_name,omitempty"` + // Wire name: 'baseline_table_name' + BaselineTableName string // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + // Wire name: 'custom_metrics' + CustomMetrics []MonitorMetric // The data classification config for the monitor. - DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + // Wire name: 'data_classification_config' + DataClassificationConfig *MonitorDataClassificationConfig // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + // Wire name: 'inference_log' + InferenceLog *MonitorInferenceLog // The notification settings for the monitor. - Notifications *MonitorNotifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications *MonitorNotifications // Schema where output metric tables are created. - OutputSchemaName string `json:"output_schema_name"` + // Wire name: 'output_schema_name' + OutputSchemaName string // The schedule for automatically updating and refreshing metric tables. - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *MonitorCronSchedule // Whether to skip creating a default dashboard summarizing data quality // metrics. - SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` + // Wire name: 'skip_builtin_dashboard' + SkipBuiltinDashboard bool // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs []string `json:"slicing_exprs,omitempty"` + // Wire name: 'slicing_exprs' + SlicingExprs []string // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + // Wire name: 'snapshot' + Snapshot *MonitorSnapshot // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + // Wire name: 'time_series' + TimeSeries *MonitorTimeSeries // Optional argument to specify the warehouse for dashboard creation. If not // specified, the first running warehouse will be used. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateMonitor) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateMonitor) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createMonitorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createMonitorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateMonitor) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateMonitor) MarshalJSON() ([]byte, error) { + pb, err := createMonitorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an Online Table type CreateOnlineTableRequest struct { // Online Table information. - Table OnlineTable `json:"table"` + // Wire name: 'table' + Table OnlineTable +} + +func (st *CreateOnlineTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createOnlineTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createOnlineTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateOnlineTableRequest) MarshalJSON() ([]byte, error) { + pb, err := createOnlineTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRegisteredModelRequest struct { // The name of the catalog where the schema and the registered model reside - CatalogName string `json:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string // The comment attached to the registered model - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the registered model - Name string `json:"name"` + // Wire name: 'name' + Name string // The name of the schema where the registered model resides - SchemaName string `json:"schema_name"` + // Wire name: 'schema_name' + SchemaName string // The storage location on the cloud under which model version data files // are stored - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRegisteredModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRegisteredModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRegisteredModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRegisteredModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRegisteredModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + pb, err := createRegisteredModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateResponse struct { } +func (st *CreateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateResponse) MarshalJSON() ([]byte, error) { + pb, err := createResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type CreateSchema struct { // Name of parent catalog. - CatalogName string `json:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of schema, relative to parent catalog. - Name string `json:"name"` + // Wire name: 'name' + Name string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // Storage root URL for managed tables within schema. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateSchema) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateSchema) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createSchemaPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createSchemaFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateSchema) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateSchema) MarshalJSON() ([]byte, error) { + pb, err := createSchemaToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRoleRequest // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentityRequest // The Azure service principal configuration. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // The Cloudflare API token configuration. - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + // Wire name: 'cloudflare_api_token' + CloudflareApiToken *CloudflareApiToken // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest // The credential name. The name must be unique within the metastore. - Name string `json:"name"` + // Wire name: 'name' + Name string // Whether the storage credential is only usable for read operations. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Supplying true to this argument skips validation of the created // credential. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateStorageCredential) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateStorageCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createStorageCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createStorageCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateStorageCredential) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateStorageCredential) MarshalJSON() ([]byte, error) { + pb, err := createStorageCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a Synced Database Table type CreateSyncedDatabaseTableRequest struct { // Next field marker: 10 - SyncedTable SyncedDatabaseTable `json:"synced_table"` + // Wire name: 'synced_table' + SyncedTable SyncedDatabaseTable +} + +func (st *CreateSyncedDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createSyncedDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createSyncedDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := createSyncedDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateTableConstraint struct { // A table constraint, as defined by *one* of the following fields being // set: __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. - Constraint TableConstraint `json:"constraint"` + // Wire name: 'constraint' + Constraint TableConstraint // The full name of the table referenced by the constraint. - FullNameArg string `json:"full_name_arg"` + // Wire name: 'full_name_arg' + FullNameArg string +} + +func (st *CreateTableConstraint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createTableConstraintPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createTableConstraintFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateTableConstraint) MarshalJSON() ([]byte, error) { + pb, err := createTableConstraintToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateVolumeRequestContent struct { // The name of the catalog where the schema and the volume are - CatalogName string `json:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string // The comment attached to the volume - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the volume - Name string `json:"name"` + // Wire name: 'name' + Name string // The name of the schema where the volume is - SchemaName string `json:"schema_name"` + // Wire name: 'schema_name' + SchemaName string // The storage location on the cloud - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // The type of the volume. An external volume is located in the specified // external location. A managed volume is located in the default location // which is specified by the parent schema, or the parent catalog, or the // Metastore. [Learn more] // // [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external - VolumeType VolumeType `json:"volume_type"` + // Wire name: 'volume_type' + VolumeType VolumeType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateVolumeRequestContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateVolumeRequestContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createVolumeRequestContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createVolumeRequestContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateVolumeRequestContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateVolumeRequestContent) MarshalJSON() ([]byte, error) { + pb, err := createVolumeRequestContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CredentialInfo struct { // The AWS IAM role configuration - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRole // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentity // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this credential was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of credential creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount // The full name of the credential. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // The unique identifier of the credential. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Unique identifier of the parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of current owner of credential. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Indicates the purpose of the credential. - Purpose CredentialPurpose `json:"purpose,omitempty"` + // Wire name: 'purpose' + Purpose CredentialPurpose // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the credential. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // Whether this credential is the current metastore's root storage // credential. Only applicable when purpose is **STORAGE**. - UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + // Wire name: 'used_for_managed_storage' + UsedForManagedStorage bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CredentialInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CredentialInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &credentialInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := credentialInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CredentialInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CredentialInfo) MarshalJSON() ([]byte, error) { + pb, err := credentialInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CredentialPurpose string +type credentialPurposePb string const CredentialPurposeService CredentialPurpose = `SERVICE` @@ -1394,8 +2906,25 @@ func (f *CredentialPurpose) Type() string { return "CredentialPurpose" } +func credentialPurposeToPb(st *CredentialPurpose) (*credentialPurposePb, error) { + if st == nil { + return nil, nil + } + pb := credentialPurposePb(*st) + return &pb, nil +} + +func credentialPurposeFromPb(pb *credentialPurposePb) (*CredentialPurpose, error) { + if pb == nil { + return nil, nil + } + st := CredentialPurpose(*pb) + return &st, nil +} + // The type of credential. type CredentialType string +type credentialTypePb string const CredentialTypeBearerToken CredentialType = `BEARER_TOKEN` @@ -1422,25 +2951,61 @@ func (f *CredentialType) Type() string { return "CredentialType" } +func credentialTypeToPb(st *CredentialType) (*credentialTypePb, error) { + if st == nil { + return nil, nil + } + pb := credentialTypePb(*st) + return &pb, nil +} + +func credentialTypeFromPb(pb *credentialTypePb) (*CredentialType, error) { + if pb == nil { + return nil, nil + } + st := CredentialType(*pb) + return &st, nil +} + type CredentialValidationResult struct { // Error message would exist when the result does not equal to **PASS**. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // The results of the tested operation. - Result ValidateCredentialResult `json:"result,omitempty"` + // Wire name: 'result' + Result ValidateCredentialResult - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CredentialValidationResult) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CredentialValidationResult) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &credentialValidationResultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := credentialValidationResultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CredentialValidationResult) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CredentialValidationResult) MarshalJSON() ([]byte, error) { + pb, err := credentialValidationResultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Data source format type DataSourceFormat string +type dataSourceFormatPb string const DataSourceFormatAvro DataSourceFormat = `AVRO` @@ -1509,26 +3074,98 @@ func (f *DataSourceFormat) Type() string { return "DataSourceFormat" } +func dataSourceFormatToPb(st *DataSourceFormat) (*dataSourceFormatPb, error) { + if st == nil { + return nil, nil + } + pb := dataSourceFormatPb(*st) + return &pb, nil +} + +func dataSourceFormatFromPb(pb *dataSourceFormatPb) (*DataSourceFormat, error) { + if pb == nil { + return nil, nil + } + st := DataSourceFormat(*pb) + return &st, nil +} + type DatabaseCatalog struct { - CreateDatabaseIfNotExists bool `json:"create_database_if_not_exists,omitempty"` + + // Wire name: 'create_database_if_not_exists' + CreateDatabaseIfNotExists bool // The name of the DatabaseInstance housing the database. - DatabaseInstanceName string `json:"database_instance_name"` + // Wire name: 'database_instance_name' + DatabaseInstanceName string // The name of the database (in a instance) associated with the catalog. - DatabaseName string `json:"database_name"` + // Wire name: 'database_name' + DatabaseName string // The name of the catalog in UC. - Name string `json:"name"` + // Wire name: 'name' + Name string + + // Wire name: 'uid' + Uid string + + ForceSendFields []string `tf:"-"` +} + +func (st *DatabaseCatalog) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databaseCatalogPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databaseCatalogFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DatabaseCatalog) MarshalJSON() ([]byte, error) { + pb, err := databaseCatalogToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} - Uid string `json:"uid,omitempty"` +type DatabaseCredential struct { - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'token' + Token string + + ForceSendFields []string `tf:"-"` } -func (s *DatabaseCatalog) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DatabaseCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databaseCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databaseCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DatabaseCatalog) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DatabaseCredential) MarshalJSON() ([]byte, error) { + pb, err := databaseCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A DatabaseInstance represents a logical Postgres instance, comprised of both @@ -1536,41 +3173,155 @@ func (s DatabaseCatalog) MarshalJSON() ([]byte, error) { type DatabaseInstance struct { // Password for admin user to create. If not provided, no user will be // created. - AdminPassword string `json:"admin_password,omitempty"` + // Wire name: 'admin_password' + AdminPassword string // Name of the admin role for the instance. If not provided, defaults to // 'databricks_admin'. - AdminRolename string `json:"admin_rolename,omitempty"` + // Wire name: 'admin_rolename' + AdminRolename string // The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4". - Capacity string `json:"capacity,omitempty"` + // Wire name: 'capacity' + Capacity string + // The refs of the child instances. This is only available if the instance + // is parent instance. + // Wire name: 'child_instance_refs' + ChildInstanceRefs []DatabaseInstanceRef // The timestamp when the instance was created. - CreationTime string `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime string // The email of the creator of the instance. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string + // Whether to enable secondaries to serve read-only traffic. Defaults to + // false. + // Wire name: 'enable_readable_secondaries' + EnableReadableSecondaries bool // The name of the instance. This is the unique identifier for the instance. - Name string `json:"name"` + // Wire name: 'name' + Name string + // The number of nodes in the instance, composed of 1 primary and 0 or more + // secondaries. Defaults to 1 primary and 0 secondaries. + // Wire name: 'node_count' + NodeCount int + // The ref of the parent instance. This is only available if the instance is + // child instance. Input: For specifying the parent instance to create a + // child instance. Optional. Output: Only populated if provided as input to + // create a child instance. + // Wire name: 'parent_instance_ref' + ParentInstanceRef *DatabaseInstanceRef // The version of Postgres running on the instance. - PgVersion string `json:"pg_version,omitempty"` + // Wire name: 'pg_version' + PgVersion string + // The DNS endpoint to connect to the instance for read only access. This is + // only available if enable_readable_secondaries is true. + // Wire name: 'read_only_dns' + ReadOnlyDns string // The DNS endpoint to connect to the instance for read+write access. - ReadWriteDns string `json:"read_write_dns,omitempty"` + // Wire name: 'read_write_dns' + ReadWriteDns string + // The retention window for the instance. This is the time window in days + // for which the historical data is retained. The default value is 7 days. + // Valid values are 2 to 35 days. + // Wire name: 'retention_window_in_days' + RetentionWindowInDays int // The current state of the instance. - State DatabaseInstanceState `json:"state,omitempty"` + // Wire name: 'state' + State DatabaseInstanceState // Whether the instance is stopped. - Stopped bool `json:"stopped,omitempty"` + // Wire name: 'stopped' + Stopped bool // An immutable UUID identifier for the instance. - Uid string `json:"uid,omitempty"` + // Wire name: 'uid' + Uid string + + ForceSendFields []string `tf:"-"` +} - ForceSendFields []string `json:"-" url:"-"` +func (st *DatabaseInstance) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databaseInstancePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databaseInstanceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s *DatabaseInstance) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st DatabaseInstance) MarshalJSON() ([]byte, error) { + pb, err := databaseInstanceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// DatabaseInstanceRef is a reference to a database instance. It is used in the +// DatabaseInstance object to refer to the parent instance of an instance and to +// refer the child instances of an instance. To specify as a parent instance +// during creation of an instance, the lsn and branch_time fields are optional. +// If not specified, the child instance will be created from the latest lsn of +// the parent. If both lsn and branch_time are specified, the lsn will be used +// to create the child instance. +type DatabaseInstanceRef struct { + // Branch time of the ref database instance. For a parent ref instance, this + // is the point in time on the parent instance from which the instance was + // created. For a child ref instance, this is the point in time on the + // instance from which the child instance was created. Input: For specifying + // the point in time to create a child instance. Optional. Output: Only + // populated if provided as input to create a child instance. + // Wire name: 'branch_time' + BranchTime string + // WAL LSN of the ref database instance. For a parent ref instance, this is + // the LSN on the parent instance from which the instance was created. For a + // child ref instance, this is the LSN on the instance from which the child + // instance was created. Input: For specifying the WAL LSN to create a child + // instance. Optional. Output: Always populated + // Wire name: 'lsn' + Lsn string + // Name of the ref database instance. + // Wire name: 'name' + Name string + // Id of the ref database instance. + // Wire name: 'uid' + Uid string + + ForceSendFields []string `tf:"-"` +} + +func (st *DatabaseInstanceRef) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databaseInstanceRefPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databaseInstanceRefFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DatabaseInstance) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DatabaseInstanceRef) MarshalJSON() ([]byte, error) { + pb, err := databaseInstanceRefToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DatabaseInstanceState string +type databaseInstanceStatePb string const DatabaseInstanceStateAvailable DatabaseInstanceState = `AVAILABLE` @@ -1605,6 +3356,83 @@ func (f *DatabaseInstanceState) Type() string { return "DatabaseInstanceState" } +func databaseInstanceStateToPb(st *DatabaseInstanceState) (*databaseInstanceStatePb, error) { + if st == nil { + return nil, nil + } + pb := databaseInstanceStatePb(*st) + return &pb, nil +} + +func databaseInstanceStateFromPb(pb *databaseInstanceStatePb) (*DatabaseInstanceState, error) { + if pb == nil { + return nil, nil + } + st := DatabaseInstanceState(*pb) + return &st, nil +} + +// Next field marker: 13 +type DatabaseTable struct { + // Name of the target database instance. This is required when creating + // database tables in standard catalogs. This is optional when creating + // database tables in registered catalogs. If this field is specified when + // creating database tables in registered catalogs, the database instance + // name MUST match that of the registered catalog (or the request will be + // rejected). + // Wire name: 'database_instance_name' + DatabaseInstanceName string + // Target Postgres database object (logical database) name for this table. + // This field is optional in all scenarios. + // + // When creating a table in a registered Postgres catalog, the target + // Postgres database name is inferred to be that of the registered catalog. + // If this field is specified in this scenario, the Postgres database name + // MUST match that of the registered catalog (or the request will be + // rejected). + // + // When creating a table in a standard catalog, the target database name is + // inferred to be that of the standard catalog. In this scenario, specifying + // this field will allow targeting an arbitrary postgres database. Note that + // this has implications for the `create_database_objects_is_missing` field + // in `spec`. + // Wire name: 'logical_database_name' + LogicalDatabaseName string + // Full three-part (catalog, schema, table) name of the table. + // Wire name: 'name' + Name string + // Data serving REST API URL for this table + // Wire name: 'table_serving_url' + TableServingUrl string + + ForceSendFields []string `tf:"-"` +} + +func (st *DatabaseTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databaseTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databaseTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DatabaseTable) MarshalJSON() ([]byte, error) { + pb, err := databaseTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // GCP long-lived credential. Databricks-created Google Cloud Storage service // account. type DatabricksGcpServiceAccount struct { @@ -1612,124 +3440,351 @@ type DatabricksGcpServiceAccount struct { // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database - CredentialId string `json:"credential_id,omitempty"` + // Wire name: 'credential_id' + CredentialId string // The email of the service account. - Email string `json:"email,omitempty"` + // Wire name: 'email' + Email string // The ID that represents the private key for this Service Account - PrivateKeyId string `json:"private_key_id,omitempty"` + // Wire name: 'private_key_id' + PrivateKeyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DatabricksGcpServiceAccount) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DatabricksGcpServiceAccount) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databricksGcpServiceAccountPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databricksGcpServiceAccountFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DatabricksGcpServiceAccount) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DatabricksGcpServiceAccount) MarshalJSON() ([]byte, error) { + pb, err := databricksGcpServiceAccountToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DatabricksGcpServiceAccountRequest struct { } +func (st *DatabricksGcpServiceAccountRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databricksGcpServiceAccountRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databricksGcpServiceAccountRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DatabricksGcpServiceAccountRequest) MarshalJSON() ([]byte, error) { + pb, err := databricksGcpServiceAccountRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DatabricksGcpServiceAccountResponse struct { // The Databricks internal ID that represents this service account. This is // an output-only field. - CredentialId string `json:"credential_id,omitempty"` + // Wire name: 'credential_id' + CredentialId string // The email of the service account. This is an output-only field. - Email string `json:"email,omitempty"` + // Wire name: 'email' + Email string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DatabricksGcpServiceAccountResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DatabricksGcpServiceAccountResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databricksGcpServiceAccountResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databricksGcpServiceAccountResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DatabricksGcpServiceAccountResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DatabricksGcpServiceAccountResponse) MarshalJSON() ([]byte, error) { + pb, err := databricksGcpServiceAccountResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a metastore assignment type DeleteAccountMetastoreAssignmentRequest struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *DeleteAccountMetastoreAssignmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountMetastoreAssignmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountMetastoreAssignmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountMetastoreAssignmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a metastore type DeleteAccountMetastoreRequest struct { // Force deletion even if the metastore is not empty. Default is false. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteAccountMetastoreRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAccountMetastoreRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountMetastoreRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountMetastoreRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteAccountMetastoreRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAccountMetastoreRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountMetastoreRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a storage credential type DeleteAccountStorageCredentialRequest struct { // Force deletion even if the Storage Credential is not empty. Default is // false. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Name of the storage credential. - StorageCredentialName string `json:"-" url:"-"` + // Wire name: 'storage_credential_name' + StorageCredentialName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteAccountStorageCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAccountStorageCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountStorageCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountStorageCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteAccountStorageCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAccountStorageCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountStorageCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a Registered Model Alias type DeleteAliasRequest struct { // The name of the alias - Alias string `json:"-" url:"-"` + // Wire name: 'alias' + Alias string `tf:"-"` // The three-level (fully qualified) name of the registered model - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` } -type DeleteAliasResponse struct { +func (st *DeleteAliasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAliasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAliasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -// Delete a catalog -type DeleteCatalogRequest struct { - // Force deletion even if the catalog is not empty. - Force bool `json:"-" url:"force,omitempty"` - // The name of the catalog. - Name string `json:"-" url:"-"` +func (st DeleteAliasRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAliasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} - ForceSendFields []string `json:"-" url:"-"` +type DeleteAliasResponse struct { } -func (s *DeleteCatalogRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAliasResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAliasResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAliasResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteCatalogRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAliasResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteAliasResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Delete a catalog +type DeleteCatalogRequest struct { + // Force deletion even if the catalog is not empty. + // Wire name: 'force' + Force bool `tf:"-"` + // The name of the catalog. + // Wire name: 'name' + Name string `tf:"-"` + + ForceSendFields []string `tf:"-"` +} + +func (st *DeleteCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a connection type DeleteConnectionRequest struct { // The name of the connection to be deleted. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteConnectionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteConnectionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteConnectionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteConnectionRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteConnectionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a credential @@ -1737,212 +3792,770 @@ type DeleteCredentialRequest struct { // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when // purpose is **STORAGE**). - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Name of the credential. - NameArg string `json:"-" url:"-"` + // Wire name: 'name_arg' + NameArg string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteCredentialResponse struct { } +func (st *DeleteCredentialResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCredentialResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCredentialResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCredentialResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteCredentialResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a Database Catalog type DeleteDatabaseCatalogRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteDatabaseCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDatabaseCatalogResponse struct { } +func (st *DeleteDatabaseCatalogResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseCatalogResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseCatalogResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDatabaseCatalogResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseCatalogResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a Database Instance type DeleteDatabaseInstanceRequest struct { // By default, a instance cannot be deleted if it has descendant instances // created via PITR. If this flag is specified as true, all descendent // instances will be deleted as well. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Name of the instance to delete. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // If false, the database instance is soft deleted. Soft deleted instances // behave as if they are deleted, and cannot be used for CRUD operations nor // connected to. However they can be undeleted by calling the undelete API // for a limited time. If true, the database instance is hard deleted and // cannot be undeleted. - Purge bool `json:"-" url:"purge,omitempty"` + // Wire name: 'purge' + Purge bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseInstanceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseInstanceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseInstanceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDatabaseInstanceResponse struct { } +func (st *DeleteDatabaseInstanceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseInstanceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseInstanceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDatabaseInstanceResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseInstanceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Delete a Database Table +type DeleteDatabaseTableRequest struct { + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type DeleteDatabaseTableResponse struct { +} + +func (st *DeleteDatabaseTableResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDatabaseTableResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDatabaseTableResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDatabaseTableResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDatabaseTableResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete an external location type DeleteExternalLocationRequest struct { // Force deletion even if there are dependent external tables or mounts. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Name of the external location. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteExternalLocationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteExternalLocationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExternalLocationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExternalLocationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteExternalLocationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteExternalLocationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteExternalLocationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a function type DeleteFunctionRequest struct { // Force deletion even if the function is notempty. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // The fully-qualified name of the function (of the form // __catalog_name__.__schema_name__.__function__name__). - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteFunctionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteFunctionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteFunctionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFunctionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteFunctionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteFunctionRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteFunctionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a metastore type DeleteMetastoreRequest struct { // Force deletion even if the metastore is not empty. Default is false. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Unique ID of the metastore. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteMetastoreRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteMetastoreRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteMetastoreRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteMetastoreRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteMetastoreRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteMetastoreRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteMetastoreRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a Model Version type DeleteModelVersionRequest struct { // The three-level (fully qualified) name of the model version - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // The integer version number of the model version - Version int `json:"-" url:"-"` + // Wire name: 'version' + Version int `tf:"-"` +} + +func (st *DeleteModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an Online Table type DeleteOnlineTableRequest struct { // Full three-part (catalog, schema, table) name of the table. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteOnlineTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteOnlineTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteOnlineTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteOnlineTableRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteOnlineTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a table monitor type DeleteQualityMonitorRequest struct { // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *DeleteQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a Registered Model type DeleteRegisteredModelRequest struct { // The three-level (fully qualified) name of the registered model - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` +} + +func (st *DeleteRegisteredModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRegisteredModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRegisteredModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRegisteredModelRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteRegisteredModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a schema type DeleteSchemaRequest struct { // Force deletion even if the schema is not empty. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Full name of the schema. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteSchemaRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteSchemaRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSchemaRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSchemaRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteSchemaRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteSchemaRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteSchemaRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a credential type DeleteStorageCredentialRequest struct { // Force deletion even if there are dependent external locations or external // tables. - Force bool `json:"-" url:"force,omitempty"` + // Wire name: 'force' + Force bool `tf:"-"` // Name of the storage credential. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteStorageCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteStorageCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteStorageCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteStorageCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteStorageCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a Synced Database Table type DeleteSyncedDatabaseTableRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteSyncedDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSyncedDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSyncedDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteSyncedDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteSyncedDatabaseTableResponse struct { } +func (st *DeleteSyncedDatabaseTableResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSyncedDatabaseTableResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSyncedDatabaseTableResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteSyncedDatabaseTableResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteSyncedDatabaseTableResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a table constraint type DeleteTableConstraintRequest struct { // If true, try deleting all child constraints of the current constraint. If // false, reject this operation if the current constraint has any child // constraints. - Cascade bool `json:"-" url:"cascade"` + // Wire name: 'cascade' + Cascade bool `tf:"-"` // The name of the constraint to delete. - ConstraintName string `json:"-" url:"constraint_name"` + // Wire name: 'constraint_name' + ConstraintName string `tf:"-"` // Full name of the table referenced by the constraint. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` +} + +func (st *DeleteTableConstraintRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTableConstraintRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTableConstraintRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTableConstraintRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteTableConstraintRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a table type DeleteTableRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` +} + +func (st *DeleteTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTableRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a Volume type DeleteVolumeRequest struct { // The three-level (fully qualified) name of the volume - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteVolumeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteVolumeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteVolumeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteVolumeRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteVolumeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties pertaining to the current state of the delta table as given by the @@ -1950,66 +4563,244 @@ type DeleteVolumeRequest struct { // __TableInfo.properties__. type DeltaRuntimePropertiesKvPairs struct { // A map of key-value properties attached to the securable. - DeltaRuntimeProperties map[string]string `json:"delta_runtime_properties"` + // Wire name: 'delta_runtime_properties' + DeltaRuntimeProperties map[string]string +} + +func (st *DeltaRuntimePropertiesKvPairs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaRuntimePropertiesKvPairsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaRuntimePropertiesKvPairsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeltaRuntimePropertiesKvPairs) MarshalJSON() ([]byte, error) { + pb, err := deltaRuntimePropertiesKvPairsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A dependency of a SQL object. Either the __table__ field or the __function__ // field must be defined. type Dependency struct { // A function that is dependent on a SQL object. - Function *FunctionDependency `json:"function,omitempty"` + // Wire name: 'function' + Function *FunctionDependency // A table that is dependent on a SQL object. - Table *TableDependency `json:"table,omitempty"` + // Wire name: 'table' + Table *TableDependency +} + +func (st *Dependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Dependency) MarshalJSON() ([]byte, error) { + pb, err := dependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A list of dependencies. type DependencyList struct { // Array of dependencies. - Dependencies []Dependency `json:"dependencies,omitempty"` + // Wire name: 'dependencies' + Dependencies []Dependency +} + +func (st *DependencyList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dependencyListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dependencyListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DependencyList) MarshalJSON() ([]byte, error) { + pb, err := dependencyListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Disable a system schema type DisableRequest struct { // The metastore ID under which the system schema lives. - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Full name of the system schema. - SchemaName string `json:"-" url:"-"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` +} + +func (st *DisableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &disableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := disableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DisableRequest) MarshalJSON() ([]byte, error) { + pb, err := disableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DisableResponse struct { } +func (st *DisableResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &disableResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := disableResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DisableResponse) MarshalJSON() ([]byte, error) { + pb, err := disableResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EffectivePermissionsList struct { // The privileges conveyed to each principal (either directly or via // inheritance) - PrivilegeAssignments []EffectivePrivilegeAssignment `json:"privilege_assignments,omitempty"` + // Wire name: 'privilege_assignments' + PrivilegeAssignments []EffectivePrivilegeAssignment +} + +func (st *EffectivePermissionsList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &effectivePermissionsListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := effectivePermissionsListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EffectivePermissionsList) MarshalJSON() ([]byte, error) { + pb, err := effectivePermissionsListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EffectivePredictiveOptimizationFlag struct { // The name of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromName string `json:"inherited_from_name,omitempty"` + // Wire name: 'inherited_from_name' + InheritedFromName string // The type of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromType EffectivePredictiveOptimizationFlagInheritedFromType `json:"inherited_from_type,omitempty"` + // Wire name: 'inherited_from_type' + InheritedFromType EffectivePredictiveOptimizationFlagInheritedFromType // Whether predictive optimization should be enabled for this object and // objects under it. - Value EnablePredictiveOptimization `json:"value"` + // Wire name: 'value' + Value EnablePredictiveOptimization - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EffectivePredictiveOptimizationFlag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EffectivePredictiveOptimizationFlag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &effectivePredictiveOptimizationFlagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := effectivePredictiveOptimizationFlagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { + pb, err := effectivePredictiveOptimizationFlagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. type EffectivePredictiveOptimizationFlagInheritedFromType string +type effectivePredictiveOptimizationFlagInheritedFromTypePb string const EffectivePredictiveOptimizationFlagInheritedFromTypeCatalog EffectivePredictiveOptimizationFlagInheritedFromType = `CATALOG` @@ -2036,48 +4827,104 @@ func (f *EffectivePredictiveOptimizationFlagInheritedFromType) Type() string { return "EffectivePredictiveOptimizationFlagInheritedFromType" } +func effectivePredictiveOptimizationFlagInheritedFromTypeToPb(st *EffectivePredictiveOptimizationFlagInheritedFromType) (*effectivePredictiveOptimizationFlagInheritedFromTypePb, error) { + if st == nil { + return nil, nil + } + pb := effectivePredictiveOptimizationFlagInheritedFromTypePb(*st) + return &pb, nil +} + +func effectivePredictiveOptimizationFlagInheritedFromTypeFromPb(pb *effectivePredictiveOptimizationFlagInheritedFromTypePb) (*EffectivePredictiveOptimizationFlagInheritedFromType, error) { + if pb == nil { + return nil, nil + } + st := EffectivePredictiveOptimizationFlagInheritedFromType(*pb) + return &st, nil +} + type EffectivePrivilege struct { // The full name of the object that conveys this privilege via inheritance. // This field is omitted when privilege is not inherited (it's assigned to // the securable itself). - InheritedFromName string `json:"inherited_from_name,omitempty"` + // Wire name: 'inherited_from_name' + InheritedFromName string // The type of the object that conveys this privilege via inheritance. This // field is omitted when privilege is not inherited (it's assigned to the // securable itself). - InheritedFromType SecurableType `json:"inherited_from_type,omitempty"` + // Wire name: 'inherited_from_type' + InheritedFromType SecurableType // The privilege assigned to the principal. - Privilege Privilege `json:"privilege,omitempty"` + // Wire name: 'privilege' + Privilege Privilege - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EffectivePrivilege) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EffectivePrivilege) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &effectivePrivilegePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := effectivePrivilegeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EffectivePrivilege) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EffectivePrivilege) MarshalJSON() ([]byte, error) { + pb, err := effectivePrivilegeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EffectivePrivilegeAssignment struct { // The principal (user email address or group name). - Principal string `json:"principal,omitempty"` + // Wire name: 'principal' + Principal string // The privileges conveyed to the principal (either directly or via // inheritance). - Privileges []EffectivePrivilege `json:"privileges,omitempty"` + // Wire name: 'privileges' + Privileges []EffectivePrivilege - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EffectivePrivilegeAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EffectivePrivilegeAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &effectivePrivilegeAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := effectivePrivilegeAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EffectivePrivilegeAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EffectivePrivilegeAssignment) MarshalJSON() ([]byte, error) { + pb, err := effectivePrivilegeAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnablePredictiveOptimization string +type enablePredictiveOptimizationPb string const EnablePredictiveOptimizationDisable EnablePredictiveOptimization = `DISABLE` @@ -2106,93 +4953,241 @@ func (f *EnablePredictiveOptimization) Type() string { return "EnablePredictiveOptimization" } +func enablePredictiveOptimizationToPb(st *EnablePredictiveOptimization) (*enablePredictiveOptimizationPb, error) { + if st == nil { + return nil, nil + } + pb := enablePredictiveOptimizationPb(*st) + return &pb, nil +} + +func enablePredictiveOptimizationFromPb(pb *enablePredictiveOptimizationPb) (*EnablePredictiveOptimization, error) { + if pb == nil { + return nil, nil + } + st := EnablePredictiveOptimization(*pb) + return &st, nil +} + type EnableRequest struct { // the catalog for which the system schema is to enabled in - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The metastore ID under which the system schema lives. - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Full name of the system schema. - SchemaName string `json:"-" url:"-"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnableRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnableRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnableRequest) MarshalJSON() ([]byte, error) { + pb, err := enableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnableResponse struct { } +func (st *EnableResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enableResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enableResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EnableResponse) MarshalJSON() ([]byte, error) { + pb, err := enableResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Encryption options that apply to clients connecting to cloud storage. type EncryptionDetails struct { // Server-Side Encryption properties for clients communicating with AWS s3. - SseEncryptionDetails *SseEncryptionDetails `json:"sse_encryption_details,omitempty"` + // Wire name: 'sse_encryption_details' + SseEncryptionDetails *SseEncryptionDetails +} + +func (st *EncryptionDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &encryptionDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := encryptionDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EncryptionDetails) MarshalJSON() ([]byte, error) { + pb, err := encryptionDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get boolean reflecting if table exists type ExistsRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` +} + +func (st *ExistsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &existsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := existsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExistsRequest) MarshalJSON() ([]byte, error) { + pb, err := existsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExternalLocationInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this external location was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of external location creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique ID of the location's storage credential. - CredentialId string `json:"credential_id,omitempty"` + // Wire name: 'credential_id' + CredentialId string // Name of the storage credential used with this location. - CredentialName string `json:"credential_name,omitempty"` + // Wire name: 'credential_name' + CredentialName string // [Create:OPT Update:OPT] Whether to enable file events on this external // location. - EnableFileEvents bool `json:"enable_file_events,omitempty"` + // Wire name: 'enable_file_events' + EnableFileEvents bool // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Wire name: 'encryption_details' + EncryptionDetails *EncryptionDetails // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback bool `json:"fallback,omitempty"` + // Wire name: 'fallback' + Fallback bool // [Create:OPT Update:OPT] File event queue settings. - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + // Wire name: 'file_event_queue' + FileEventQueue *FileEventQueue - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Unique identifier of metastore hosting the external location. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of the external location. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The owner of the external location. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Indicates whether the external location is read-only. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Time at which external location this was last modified, in epoch // milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the external location. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // Path URL of the external location. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalLocationInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalLocationInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalLocationInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalLocationInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalLocationInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalLocationInfo) MarshalJSON() ([]byte, error) { + pb, err := externalLocationInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Detailed status of an online table. Shown if the online table is in the @@ -2202,153 +5197,361 @@ type FailedStatus struct { // Note that this Delta version may only be partially synced to the online // table. Only populated if the table is still online and available for // serving. - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + // Wire name: 'last_processed_commit_version' + LastProcessedCommitVersion int64 // The timestamp of the last time any data was synchronized from the source // table to the online table. Only populated if the table is still online // and available for serving. - Timestamp string `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp string + + ForceSendFields []string `tf:"-"` +} + +func (st *FailedStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &failedStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := failedStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FailedStatus) MarshalJSON() ([]byte, error) { + pb, err := failedStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type FailoverDatabaseInstanceRequest struct { - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'failover_target_database_instance_name' + FailoverTargetDatabaseInstanceName string + // Name of the instance to failover. + // Wire name: 'name' + Name string `tf:"-"` + + ForceSendFields []string `tf:"-"` } -func (s *FailedStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FailoverDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &failoverDatabaseInstanceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := failoverDatabaseInstanceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FailedStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FailoverDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + pb, err := failoverDatabaseInstanceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileEventQueue struct { - ManagedAqs *AzureQueueStorage `json:"managed_aqs,omitempty"` - ManagedPubsub *GcpPubsub `json:"managed_pubsub,omitempty"` + // Wire name: 'managed_aqs' + ManagedAqs *AzureQueueStorage + + // Wire name: 'managed_pubsub' + ManagedPubsub *GcpPubsub + + // Wire name: 'managed_sqs' + ManagedSqs *AwsSqsQueue - ManagedSqs *AwsSqsQueue `json:"managed_sqs,omitempty"` + // Wire name: 'provided_aqs' + ProvidedAqs *AzureQueueStorage - ProvidedAqs *AzureQueueStorage `json:"provided_aqs,omitempty"` + // Wire name: 'provided_pubsub' + ProvidedPubsub *GcpPubsub - ProvidedPubsub *GcpPubsub `json:"provided_pubsub,omitempty"` + // Wire name: 'provided_sqs' + ProvidedSqs *AwsSqsQueue +} - ProvidedSqs *AwsSqsQueue `json:"provided_sqs,omitempty"` +func (st *FileEventQueue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileEventQueuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileEventQueueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FileEventQueue) MarshalJSON() ([]byte, error) { + pb, err := fileEventQueueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Find a Database Instance by uid type FindDatabaseInstanceByUidRequest struct { // UID of the cluster to get. - Uid string `json:"-" url:"uid,omitempty"` + // Wire name: 'uid' + Uid string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FindDatabaseInstanceByUidRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FindDatabaseInstanceByUidRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &findDatabaseInstanceByUidRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := findDatabaseInstanceByUidRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FindDatabaseInstanceByUidRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FindDatabaseInstanceByUidRequest) MarshalJSON() ([]byte, error) { + pb, err := findDatabaseInstanceByUidRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForeignKeyConstraint struct { // Column names for this constraint. - ChildColumns []string `json:"child_columns"` + // Wire name: 'child_columns' + ChildColumns []string // The name of the constraint. - Name string `json:"name"` + // Wire name: 'name' + Name string // Column names for this constraint. - ParentColumns []string `json:"parent_columns"` + // Wire name: 'parent_columns' + ParentColumns []string // The full name of the parent constraint. - ParentTable string `json:"parent_table"` + // Wire name: 'parent_table' + ParentTable string +} + +func (st *ForeignKeyConstraint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &foreignKeyConstraintPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := foreignKeyConstraintFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ForeignKeyConstraint) MarshalJSON() ([]byte, error) { + pb, err := foreignKeyConstraintToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A function that is dependent on a SQL object. type FunctionDependency struct { // Full name of the dependent function, in the form of // __catalog_name__.__schema_name__.__function_name__. - FunctionFullName string `json:"function_full_name"` + // Wire name: 'function_full_name' + FunctionFullName string +} + +func (st *FunctionDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FunctionDependency) MarshalJSON() ([]byte, error) { + pb, err := functionDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FunctionInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // Name of parent catalog. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this function was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of function creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Scalar function return data type. - DataType ColumnTypeName `json:"data_type,omitempty"` + // Wire name: 'data_type' + DataType ColumnTypeName // External function language. - ExternalLanguage string `json:"external_language,omitempty"` + // Wire name: 'external_language' + ExternalLanguage string // External function name. - ExternalName string `json:"external_name,omitempty"` + // Wire name: 'external_name' + ExternalName string // Pretty printed function data type. - FullDataType string `json:"full_data_type,omitempty"` + // Wire name: 'full_data_type' + FullDataType string // Full name of function, in form of // __catalog_name__.__schema_name__.__function__name__ - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // Id of Function, relative to parent schema. - FunctionId string `json:"function_id,omitempty"` + // Wire name: 'function_id' + FunctionId string - InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + // Wire name: 'input_params' + InputParams *FunctionParameterInfos // Whether the function is deterministic. - IsDeterministic bool `json:"is_deterministic,omitempty"` + // Wire name: 'is_deterministic' + IsDeterministic bool // Function null call. - IsNullCall bool `json:"is_null_call,omitempty"` + // Wire name: 'is_null_call' + IsNullCall bool // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of function, relative to parent schema. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of current owner of function. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Function parameter style. **S** is the value for SQL. - ParameterStyle FunctionInfoParameterStyle `json:"parameter_style,omitempty"` + // Wire name: 'parameter_style' + ParameterStyle FunctionInfoParameterStyle // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties string // Table function return parameters. - ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + // Wire name: 'return_params' + ReturnParams *FunctionParameterInfos // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody FunctionInfoRoutineBody `json:"routine_body,omitempty"` + // Wire name: 'routine_body' + RoutineBody FunctionInfoRoutineBody // Function body. - RoutineDefinition string `json:"routine_definition,omitempty"` + // Wire name: 'routine_definition' + RoutineDefinition string // Function dependencies. - RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + // Wire name: 'routine_dependencies' + RoutineDependencies *DependencyList // Name of parent schema relative to its parent catalog. - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // Function security type. - SecurityType FunctionInfoSecurityType `json:"security_type,omitempty"` + // Wire name: 'security_type' + SecurityType FunctionInfoSecurityType // Specific name of the function; Reserved for future use. - SpecificName string `json:"specific_name,omitempty"` + // Wire name: 'specific_name' + SpecificName string // Function SQL data access. - SqlDataAccess FunctionInfoSqlDataAccess `json:"sql_data_access,omitempty"` + // Wire name: 'sql_data_access' + SqlDataAccess FunctionInfoSqlDataAccess // List of schemes whose objects can be referenced without qualification. - SqlPath string `json:"sql_path,omitempty"` + // Wire name: 'sql_path' + SqlPath string // Time at which this function was created, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified function. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FunctionInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FunctionInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FunctionInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FunctionInfo) MarshalJSON() ([]byte, error) { + pb, err := functionInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Function parameter style. **S** is the value for SQL. type FunctionInfoParameterStyle string +type functionInfoParameterStylePb string const FunctionInfoParameterStyleS FunctionInfoParameterStyle = `S` @@ -2373,11 +5576,28 @@ func (f *FunctionInfoParameterStyle) Type() string { return "FunctionInfoParameterStyle" } +func functionInfoParameterStyleToPb(st *FunctionInfoParameterStyle) (*functionInfoParameterStylePb, error) { + if st == nil { + return nil, nil + } + pb := functionInfoParameterStylePb(*st) + return &pb, nil +} + +func functionInfoParameterStyleFromPb(pb *functionInfoParameterStylePb) (*FunctionInfoParameterStyle, error) { + if pb == nil { + return nil, nil + } + st := FunctionInfoParameterStyle(*pb) + return &st, nil +} + // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return type is // not supported), and the __sql_data_access__ field must be **NO_SQL**. type FunctionInfoRoutineBody string +type functionInfoRoutineBodyPb string const FunctionInfoRoutineBodyExternal FunctionInfoRoutineBody = `EXTERNAL` @@ -2404,8 +5624,25 @@ func (f *FunctionInfoRoutineBody) Type() string { return "FunctionInfoRoutineBody" } +func functionInfoRoutineBodyToPb(st *FunctionInfoRoutineBody) (*functionInfoRoutineBodyPb, error) { + if st == nil { + return nil, nil + } + pb := functionInfoRoutineBodyPb(*st) + return &pb, nil +} + +func functionInfoRoutineBodyFromPb(pb *functionInfoRoutineBodyPb) (*FunctionInfoRoutineBody, error) { + if pb == nil { + return nil, nil + } + st := FunctionInfoRoutineBody(*pb) + return &st, nil +} + // The security type of the function. type FunctionInfoSecurityType string +type functionInfoSecurityTypePb string const FunctionInfoSecurityTypeDefiner FunctionInfoSecurityType = `DEFINER` @@ -2430,8 +5667,25 @@ func (f *FunctionInfoSecurityType) Type() string { return "FunctionInfoSecurityType" } +func functionInfoSecurityTypeToPb(st *FunctionInfoSecurityType) (*functionInfoSecurityTypePb, error) { + if st == nil { + return nil, nil + } + pb := functionInfoSecurityTypePb(*st) + return &pb, nil +} + +func functionInfoSecurityTypeFromPb(pb *functionInfoSecurityTypePb) (*FunctionInfoSecurityType, error) { + if pb == nil { + return nil, nil + } + st := FunctionInfoSecurityType(*pb) + return &st, nil +} + // Function SQL data access. type FunctionInfoSqlDataAccess string +type functionInfoSqlDataAccessPb string const FunctionInfoSqlDataAccessContainsSql FunctionInfoSqlDataAccess = `CONTAINS_SQL` @@ -2460,51 +5714,123 @@ func (f *FunctionInfoSqlDataAccess) Type() string { return "FunctionInfoSqlDataAccess" } +func functionInfoSqlDataAccessToPb(st *FunctionInfoSqlDataAccess) (*functionInfoSqlDataAccessPb, error) { + if st == nil { + return nil, nil + } + pb := functionInfoSqlDataAccessPb(*st) + return &pb, nil +} + +func functionInfoSqlDataAccessFromPb(pb *functionInfoSqlDataAccessPb) (*FunctionInfoSqlDataAccess, error) { + if pb == nil { + return nil, nil + } + st := FunctionInfoSqlDataAccess(*pb) + return &st, nil +} + type FunctionParameterInfo struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of parameter. - Name string `json:"name"` + // Wire name: 'name' + Name string // Default value of the parameter. - ParameterDefault string `json:"parameter_default,omitempty"` + // Wire name: 'parameter_default' + ParameterDefault string // The mode of the function parameter. - ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + // Wire name: 'parameter_mode' + ParameterMode FunctionParameterMode // The type of function parameter. - ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + // Wire name: 'parameter_type' + ParameterType FunctionParameterType // Ordinal position of column (starting at position 0). - Position int `json:"position"` + // Wire name: 'position' + Position int // Format of IntervalType. - TypeIntervalType string `json:"type_interval_type,omitempty"` + // Wire name: 'type_interval_type' + TypeIntervalType string // Full data type spec, JSON-serialized. - TypeJson string `json:"type_json,omitempty"` + // Wire name: 'type_json' + TypeJson string - TypeName ColumnTypeName `json:"type_name"` + // Wire name: 'type_name' + TypeName ColumnTypeName // Digits of precision; required on Create for DecimalTypes. - TypePrecision int `json:"type_precision,omitempty"` + // Wire name: 'type_precision' + TypePrecision int // Digits to right of decimal; Required on Create for DecimalTypes. - TypeScale int `json:"type_scale,omitempty"` + // Wire name: 'type_scale' + TypeScale int // Full data type spec, SQL/catalogString text. - TypeText string `json:"type_text"` + // Wire name: 'type_text' + TypeText string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FunctionParameterInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FunctionParameterInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionParameterInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionParameterInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FunctionParameterInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FunctionParameterInfo) MarshalJSON() ([]byte, error) { + pb, err := functionParameterInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FunctionParameterInfos struct { // The array of __FunctionParameterInfo__ definitions of the function's // parameters. - Parameters []FunctionParameterInfo `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []FunctionParameterInfo +} + +func (st *FunctionParameterInfos) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionParameterInfosPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionParameterInfosFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FunctionParameterInfos) MarshalJSON() ([]byte, error) { + pb, err := functionParameterInfosToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The mode of the function parameter. type FunctionParameterMode string +type functionParameterModePb string const FunctionParameterModeIn FunctionParameterMode = `IN` @@ -2529,8 +5855,25 @@ func (f *FunctionParameterMode) Type() string { return "FunctionParameterMode" } +func functionParameterModeToPb(st *FunctionParameterMode) (*functionParameterModePb, error) { + if st == nil { + return nil, nil + } + pb := functionParameterModePb(*st) + return &pb, nil +} + +func functionParameterModeFromPb(pb *functionParameterModePb) (*FunctionParameterMode, error) { + if pb == nil { + return nil, nil + } + st := FunctionParameterMode(*pb) + return &st, nil +} + // The type of function parameter. type FunctionParameterType string +type functionParameterTypePb string const FunctionParameterTypeColumn FunctionParameterType = `COLUMN` @@ -2557,40 +5900,131 @@ func (f *FunctionParameterType) Type() string { return "FunctionParameterType" } +func functionParameterTypeToPb(st *FunctionParameterType) (*functionParameterTypePb, error) { + if st == nil { + return nil, nil + } + pb := functionParameterTypePb(*st) + return &pb, nil +} + +func functionParameterTypeFromPb(pb *functionParameterTypePb) (*FunctionParameterType, error) { + if pb == nil { + return nil, nil + } + st := FunctionParameterType(*pb) + return &st, nil +} + // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account type GcpOauthToken struct { - OauthToken string `json:"oauth_token,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'oauth_token' + OauthToken string + + ForceSendFields []string `tf:"-"` } -func (s *GcpOauthToken) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GcpOauthToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpOauthTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpOauthTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GcpOauthToken) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GcpOauthToken) MarshalJSON() ([]byte, error) { + pb, err := gcpOauthTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GcpPubsub struct { // Unique identifier included in the name of file events managed cloud // resources. - ManagedResourceId string `json:"managed_resource_id,omitempty"` + // Wire name: 'managed_resource_id' + ManagedResourceId string // The Pub/Sub subscription name in the format // projects/{project}/subscriptions/{subscription name} REQUIRED for // provided_pubsub. - SubscriptionName string `json:"subscription_name,omitempty"` + // Wire name: 'subscription_name' + SubscriptionName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GcpPubsub) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GcpPubsub) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpPubsubPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpPubsubFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GcpPubsub) MarshalJSON() ([]byte, error) { + pb, err := gcpPubsubToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Generates a credential that can be used to access database instances +type GenerateDatabaseCredentialRequest struct { + // Instances to which the token will be scoped. + // Wire name: 'instance_names' + InstanceNames []string + + // Wire name: 'request_id' + RequestId string + + ForceSendFields []string `tf:"-"` +} + +func (st *GenerateDatabaseCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateDatabaseCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateDatabaseCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GcpPubsub) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenerateDatabaseCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := generateDatabaseCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The Azure cloud options to customize the requested temporary credential @@ -2598,7 +6032,33 @@ type GenerateTemporaryServiceCredentialAzureOptions struct { // The resources to which the temporary Azure credential should apply. These // resources are the scopes that are passed to the token provider (see // https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential?view=azure-python) - Resources []string `json:"resources,omitempty"` + // Wire name: 'resources' + Resources []string +} + +func (st *GenerateTemporaryServiceCredentialAzureOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateTemporaryServiceCredentialAzureOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateTemporaryServiceCredentialAzureOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenerateTemporaryServiceCredentialAzureOptions) MarshalJSON() ([]byte, error) { + pb, err := generateTemporaryServiceCredentialAzureOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The GCP cloud options to customize the requested temporary credential @@ -2606,96 +6066,298 @@ type GenerateTemporaryServiceCredentialGcpOptions struct { // The scopes to which the temporary GCP credential should apply. These // resources are the scopes that are passed to the token provider (see // https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials) - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string +} + +func (st *GenerateTemporaryServiceCredentialGcpOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateTemporaryServiceCredentialGcpOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateTemporaryServiceCredentialGcpOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenerateTemporaryServiceCredentialGcpOptions) MarshalJSON() ([]byte, error) { + pb, err := generateTemporaryServiceCredentialGcpOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenerateTemporaryServiceCredentialRequest struct { // The Azure cloud options to customize the requested temporary credential - AzureOptions *GenerateTemporaryServiceCredentialAzureOptions `json:"azure_options,omitempty"` + // Wire name: 'azure_options' + AzureOptions *GenerateTemporaryServiceCredentialAzureOptions // The name of the service credential used to generate a temporary // credential - CredentialName string `json:"credential_name"` + // Wire name: 'credential_name' + CredentialName string // The GCP cloud options to customize the requested temporary credential - GcpOptions *GenerateTemporaryServiceCredentialGcpOptions `json:"gcp_options,omitempty"` + // Wire name: 'gcp_options' + GcpOptions *GenerateTemporaryServiceCredentialGcpOptions +} + +func (st *GenerateTemporaryServiceCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateTemporaryServiceCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateTemporaryServiceCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenerateTemporaryServiceCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := generateTemporaryServiceCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenerateTemporaryTableCredentialRequest struct { // The operation performed against the table data, either READ or // READ_WRITE. If READ_WRITE is specified, the credentials returned will // have write permissions, otherwise, it will be read only. - Operation TableOperation `json:"operation,omitempty"` + // Wire name: 'operation' + Operation TableOperation // UUID of the table to read or write. - TableId string `json:"table_id,omitempty"` + // Wire name: 'table_id' + TableId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenerateTemporaryTableCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenerateTemporaryTableCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateTemporaryTableCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateTemporaryTableCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenerateTemporaryTableCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenerateTemporaryTableCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := generateTemporaryTableCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenerateTemporaryTableCredentialResponse struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + // Wire name: 'aws_temp_credentials' + AwsTempCredentials *AwsCredentials // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + // Wire name: 'azure_aad' + AzureAad *AzureActiveDirectoryToken // Azure temporary credentials for API authentication. Read more at // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas - AzureUserDelegationSas *AzureUserDelegationSas `json:"azure_user_delegation_sas,omitempty"` + // Wire name: 'azure_user_delegation_sas' + AzureUserDelegationSas *AzureUserDelegationSas // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account - GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + // Wire name: 'gcp_oauth_token' + GcpOauthToken *GcpOauthToken // R2 temporary credentials for API authentication. Read more at // https://developers.cloudflare.com/r2/api/s3/tokens/. - R2TempCredentials *R2Credentials `json:"r2_temp_credentials,omitempty"` + // Wire name: 'r2_temp_credentials' + R2TempCredentials *R2Credentials // The URL of the storage path accessible by the temporary credential. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenerateTemporaryTableCredentialResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenerateTemporaryTableCredentialResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &generateTemporaryTableCredentialResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := generateTemporaryTableCredentialResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenerateTemporaryTableCredentialResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenerateTemporaryTableCredentialResponse) MarshalJSON() ([]byte, error) { + pb, err := generateTemporaryTableCredentialResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Gets the metastore assignment for a workspace type GetAccountMetastoreAssignmentRequest struct { // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *GetAccountMetastoreAssignmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountMetastoreAssignmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountMetastoreAssignmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountMetastoreAssignmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a metastore type GetAccountMetastoreRequest struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` +} + +func (st *GetAccountMetastoreRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountMetastoreRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountMetastoreRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountMetastoreRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountMetastoreRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Gets the named storage credential type GetAccountStorageCredentialRequest struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Name of the storage credential. - StorageCredentialName string `json:"-" url:"-"` + // Wire name: 'storage_credential_name' + StorageCredentialName string `tf:"-"` +} + +func (st *GetAccountStorageCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountStorageCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountStorageCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountStorageCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountStorageCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an artifact allowlist type GetArtifactAllowlistRequest struct { // The artifact type of the allowlist. - ArtifactType ArtifactType `json:"-" url:"-"` + // Wire name: 'artifact_type' + ArtifactType ArtifactType `tf:"-"` +} + +func (st *GetArtifactAllowlistRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getArtifactAllowlistRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getArtifactAllowlistRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetArtifactAllowlistRequest) MarshalJSON() ([]byte, error) { + pb, err := getArtifactAllowlistRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get securable workspace bindings @@ -2706,238 +6368,602 @@ type GetBindingsRequest struct { // server configured value; - When set to a value less than 0, an invalid // parameter error is returned; - If not set, all the workspace bindings are // returned (not recommended). - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The name of the securable. - SecurableName string `json:"-" url:"-"` + // Wire name: 'securable_name' + SecurableName string `tf:"-"` // The type of the securable to bind to a workspace (catalog, // storage_credential, credential, or external_location). - SecurableType string `json:"-" url:"-"` + // Wire name: 'securable_type' + SecurableType string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetBindingsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetBindingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getBindingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getBindingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetBindingsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetBindingsRequest) MarshalJSON() ([]byte, error) { + pb, err := getBindingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get Model Version By Alias type GetByAliasRequest struct { // The name of the alias - Alias string `json:"-" url:"-"` + // Wire name: 'alias' + Alias string `tf:"-"` // The three-level (fully qualified) name of the registered model - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include aliases associated with the model version in the // response - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + // Wire name: 'include_aliases' + IncludeAliases bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetByAliasRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetByAliasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getByAliasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getByAliasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetByAliasRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetByAliasRequest) MarshalJSON() ([]byte, error) { + pb, err := getByAliasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a catalog type GetCatalogRequest struct { // Whether to include catalogs in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // The name of the catalog. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetCatalogRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetCatalogRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := getCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCatalogWorkspaceBindingsResponse struct { // A list of workspace IDs - Workspaces []int64 `json:"workspaces,omitempty"` + // Wire name: 'workspaces' + Workspaces []int64 +} + +func (st *GetCatalogWorkspaceBindingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCatalogWorkspaceBindingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCatalogWorkspaceBindingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCatalogWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + pb, err := getCatalogWorkspaceBindingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a connection type GetConnectionRequest struct { // Name of the connection. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetConnectionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getConnectionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getConnectionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetConnectionRequest) MarshalJSON() ([]byte, error) { + pb, err := getConnectionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a credential type GetCredentialRequest struct { // Name of the credential. - NameArg string `json:"-" url:"-"` + // Wire name: 'name_arg' + NameArg string `tf:"-"` +} + +func (st *GetCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := getCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a Database Catalog type GetDatabaseCatalogRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetDatabaseCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDatabaseCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDatabaseCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := getDatabaseCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a Database Instance type GetDatabaseInstanceRequest struct { // Name of the cluster to get. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDatabaseInstanceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDatabaseInstanceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + pb, err := getDatabaseInstanceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Get a Database Table +type GetDatabaseTableRequest struct { + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := getDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get effective permissions type GetEffectiveRequest struct { // Full name of securable. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // If provided, only the effective permissions for the specified principal // (user or group) are returned. - Principal string `json:"-" url:"principal,omitempty"` + // Wire name: 'principal' + Principal string `tf:"-"` // Type of securable. - SecurableType SecurableType `json:"-" url:"-"` + // Wire name: 'securable_type' + SecurableType SecurableType `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetEffectiveRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetEffectiveRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEffectiveRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEffectiveRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetEffectiveRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetEffectiveRequest) MarshalJSON() ([]byte, error) { + pb, err := getEffectiveRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an external location type GetExternalLocationRequest struct { // Whether to include external locations in the response for which the // principal can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Name of the external location. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetExternalLocationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetExternalLocationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExternalLocationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExternalLocationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetExternalLocationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetExternalLocationRequest) MarshalJSON() ([]byte, error) { + pb, err := getExternalLocationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a function type GetFunctionRequest struct { // Whether to include functions in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // The fully-qualified name of the function (of the form // __catalog_name__.__schema_name__.__function__name__). - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetFunctionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetFunctionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getFunctionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getFunctionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetFunctionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetFunctionRequest) MarshalJSON() ([]byte, error) { + pb, err := getFunctionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get permissions type GetGrantRequest struct { // Full name of securable. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // If provided, only the permissions for the specified principal (user or // group) are returned. - Principal string `json:"-" url:"principal,omitempty"` + // Wire name: 'principal' + Principal string `tf:"-"` // Type of securable. - SecurableType SecurableType `json:"-" url:"-"` + // Wire name: 'securable_type' + SecurableType SecurableType `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetGrantRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetGrantRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getGrantRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getGrantRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetGrantRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetGrantRequest) MarshalJSON() ([]byte, error) { + pb, err := getGrantRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a metastore type GetMetastoreRequest struct { // Unique ID of the metastore. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetMetastoreRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getMetastoreRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getMetastoreRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetMetastoreRequest) MarshalJSON() ([]byte, error) { + pb, err := getMetastoreRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetMetastoreSummaryResponse struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // Time at which this metastore was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of metastore creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + // Wire name: 'default_data_access_config_id' + DefaultDataAccessConfigId string // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + // Wire name: 'delta_sharing_organization_name' + DeltaSharingOrganizationName string // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + // Wire name: 'delta_sharing_recipient_token_lifetime_in_seconds' + DeltaSharingRecipientTokenLifetimeInSeconds int64 // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope GetMetastoreSummaryResponseDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + // Wire name: 'delta_sharing_scope' + DeltaSharingScope GetMetastoreSummaryResponseDeltaSharingScope // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + // Wire name: 'external_access_enabled' + ExternalAccessEnabled bool // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + // Wire name: 'global_metastore_id' + GlobalMetastoreId string // Unique identifier of metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The user-specified name of the metastore. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The owner of the metastore. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + // Wire name: 'privilege_model_version' + PrivilegeModelVersion string // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The storage root URL for metastore - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + // Wire name: 'storage_root_credential_id' + StorageRootCredentialId string // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + // Wire name: 'storage_root_credential_name' + StorageRootCredentialName string // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the metastore. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetMetastoreSummaryResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetMetastoreSummaryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getMetastoreSummaryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getMetastoreSummaryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetMetastoreSummaryResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetMetastoreSummaryResponse) MarshalJSON() ([]byte, error) { + pb, err := getMetastoreSummaryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The scope of Delta Sharing enabled for the metastore. type GetMetastoreSummaryResponseDeltaSharingScope string +type getMetastoreSummaryResponseDeltaSharingScopePb string const GetMetastoreSummaryResponseDeltaSharingScopeInternal GetMetastoreSummaryResponseDeltaSharingScope = `INTERNAL` @@ -2964,167 +6990,496 @@ func (f *GetMetastoreSummaryResponseDeltaSharingScope) Type() string { return "GetMetastoreSummaryResponseDeltaSharingScope" } +func getMetastoreSummaryResponseDeltaSharingScopeToPb(st *GetMetastoreSummaryResponseDeltaSharingScope) (*getMetastoreSummaryResponseDeltaSharingScopePb, error) { + if st == nil { + return nil, nil + } + pb := getMetastoreSummaryResponseDeltaSharingScopePb(*st) + return &pb, nil +} + +func getMetastoreSummaryResponseDeltaSharingScopeFromPb(pb *getMetastoreSummaryResponseDeltaSharingScopePb) (*GetMetastoreSummaryResponseDeltaSharingScope, error) { + if pb == nil { + return nil, nil + } + st := GetMetastoreSummaryResponseDeltaSharingScope(*pb) + return &st, nil +} + // Get a Model Version type GetModelVersionRequest struct { // The three-level (fully qualified) name of the model version - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include aliases associated with the model version in the // response - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + // Wire name: 'include_aliases' + IncludeAliases bool `tf:"-"` // Whether to include model versions in the response for which the principal // can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // The integer version number of the model version - Version int `json:"-" url:"-"` + // Wire name: 'version' + Version int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetModelVersionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetModelVersionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := getModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an Online Table type GetOnlineTableRequest struct { // Full three-part (catalog, schema, table) name of the table. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetOnlineTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getOnlineTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getOnlineTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetOnlineTableRequest) MarshalJSON() ([]byte, error) { + pb, err := getOnlineTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a table monitor type GetQualityMonitorRequest struct { // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *GetQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := getQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get information for a single resource quota. type GetQuotaRequest struct { // Full name of the parent resource. Provide the metastore ID if the parent // is a metastore. - ParentFullName string `json:"-" url:"-"` + // Wire name: 'parent_full_name' + ParentFullName string `tf:"-"` // Securable type of the quota parent. - ParentSecurableType string `json:"-" url:"-"` + // Wire name: 'parent_securable_type' + ParentSecurableType string `tf:"-"` // Name of the quota. Follows the pattern of the quota type, with "-quota" // added as a suffix. - QuotaName string `json:"-" url:"-"` + // Wire name: 'quota_name' + QuotaName string `tf:"-"` +} + +func (st *GetQuotaRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQuotaRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQuotaRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQuotaRequest) MarshalJSON() ([]byte, error) { + pb, err := getQuotaRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetQuotaResponse struct { // The returned QuotaInfo. - QuotaInfo *QuotaInfo `json:"quota_info,omitempty"` + // Wire name: 'quota_info' + QuotaInfo *QuotaInfo +} + +func (st *GetQuotaResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQuotaResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQuotaResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQuotaResponse) MarshalJSON() ([]byte, error) { + pb, err := getQuotaResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get refresh type GetRefreshRequest struct { // ID of the refresh. - RefreshId string `json:"-" url:"-"` + // Wire name: 'refresh_id' + RefreshId string `tf:"-"` // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *GetRefreshRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRefreshRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRefreshRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRefreshRequest) MarshalJSON() ([]byte, error) { + pb, err := getRefreshRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a Registered Model type GetRegisteredModelRequest struct { // The three-level (fully qualified) name of the registered model - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include registered model aliases in the response - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + // Wire name: 'include_aliases' + IncludeAliases bool `tf:"-"` // Whether to include registered models in the response for which the // principal can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRegisteredModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRegisteredModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRegisteredModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRegisteredModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRegisteredModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRegisteredModelRequest) MarshalJSON() ([]byte, error) { + pb, err := getRegisteredModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a schema type GetSchemaRequest struct { // Full name of the schema. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include schemas in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetSchemaRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetSchemaRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSchemaRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSchemaRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetSchemaRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetSchemaRequest) MarshalJSON() ([]byte, error) { + pb, err := getSchemaRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a credential type GetStorageCredentialRequest struct { // Name of the storage credential. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetStorageCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStorageCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStorageCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStorageCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := getStorageCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a Synced Database Table type GetSyncedDatabaseTableRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetSyncedDatabaseTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSyncedDatabaseTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSyncedDatabaseTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + pb, err := getSyncedDatabaseTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a table type GetTableRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include tables in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Whether delta metadata should be included in the response. - IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + // Wire name: 'include_delta_metadata' + IncludeDeltaMetadata bool `tf:"-"` // Whether to include a manifest containing capabilities the table has. - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + // Wire name: 'include_manifest_capabilities' + IncludeManifestCapabilities bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetTableRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetTableRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetTableRequest) MarshalJSON() ([]byte, error) { + pb, err := getTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get catalog workspace bindings type GetWorkspaceBindingRequest struct { // The name of the catalog. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetWorkspaceBindingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceBindingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceBindingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceBindingRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceBindingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetWorkspaceBindingsResponse struct { // List of workspace bindings - Bindings []WorkspaceBinding `json:"bindings,omitempty"` + // Wire name: 'bindings' + Bindings []WorkspaceBinding // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetWorkspaceBindingsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetWorkspaceBindingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceBindingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceBindingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceBindingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IsolationMode string +type isolationModePb string const IsolationModeIsolationModeIsolated IsolationMode = `ISOLATION_MODE_ISOLATED` @@ -3151,33 +7506,155 @@ func (f *IsolationMode) Type() string { return "IsolationMode" } +func isolationModeToPb(st *IsolationMode) (*isolationModePb, error) { + if st == nil { + return nil, nil + } + pb := isolationModePb(*st) + return &pb, nil +} + +func isolationModeFromPb(pb *isolationModePb) (*IsolationMode, error) { + if pb == nil { + return nil, nil + } + st := IsolationMode(*pb) + return &st, nil +} + // Get all workspaces assigned to a metastore type ListAccountMetastoreAssignmentsRequest struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` +} + +func (st *ListAccountMetastoreAssignmentsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountMetastoreAssignmentsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountMetastoreAssignmentsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAccountMetastoreAssignmentsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountMetastoreAssignmentsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The list of workspaces to which the given metastore is assigned. type ListAccountMetastoreAssignmentsResponse struct { - WorkspaceIds []int64 `json:"workspace_ids,omitempty"` + + // Wire name: 'workspace_ids' + WorkspaceIds []int64 +} + +func (st *ListAccountMetastoreAssignmentsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountMetastoreAssignmentsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountMetastoreAssignmentsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAccountMetastoreAssignmentsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAccountMetastoreAssignmentsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get all storage credentials assigned to a metastore type ListAccountStorageCredentialsRequest struct { // Unity Catalog metastore ID - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` +} + +func (st *ListAccountStorageCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountStorageCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountStorageCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAccountStorageCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountStorageCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAccountStorageCredentialsResponse struct { // An array of metastore storage credentials. - StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` + // Wire name: 'storage_credentials' + StorageCredentials []StorageCredentialInfo +} + +func (st *ListAccountStorageCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountStorageCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountStorageCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAccountStorageCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAccountStorageCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List catalogs type ListCatalogsRequest struct { // Whether to include catalogs in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of catalogs to return. - when set to 0, the page length is // set to a server configured value (recommended); - when set to a value // greater than 0, the page length is the minimum of this value and a server @@ -3187,38 +7664,76 @@ type ListCatalogsRequest struct { // the specified max_results size, even zero. The only definitive indication // that no further catalogs can be fetched is when the next_page_token is // unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCatalogsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCatalogsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCatalogsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCatalogsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCatalogsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCatalogsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCatalogsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListCatalogsResponse struct { // An array of catalog information objects. - Catalogs []CatalogInfo `json:"catalogs,omitempty"` + // Wire name: 'catalogs' + Catalogs []CatalogInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCatalogsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCatalogsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCatalogsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCatalogsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCatalogsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCatalogsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCatalogsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List connections @@ -3229,38 +7744,76 @@ type ListConnectionsRequest struct { // when set to 0, the page length is set to a server configured value // (recommended); - when set to a value less than 0, an invalid parameter // error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListConnectionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListConnectionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listConnectionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listConnectionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListConnectionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListConnectionsRequest) MarshalJSON() ([]byte, error) { + pb, err := listConnectionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListConnectionsResponse struct { // An array of connection information objects. - Connections []ConnectionInfo `json:"connections,omitempty"` + // Wire name: 'connections' + Connections []ConnectionInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListConnectionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListConnectionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listConnectionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listConnectionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListConnectionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListConnectionsResponse) MarshalJSON() ([]byte, error) { + pb, err := listConnectionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List credentials @@ -3270,184 +7823,370 @@ type ListCredentialsRequest struct { // is the minimum of this value and a server-configured value. - When set to // 0, the page length is set to a server-configured value (recommended). - // When set to a value less than 0, an invalid parameter error is returned. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque token to retrieve the next page of results. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Return only credentials for the specified purpose. - Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` + // Wire name: 'purpose' + Purpose CredentialPurpose `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCredentialsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCredentialsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListCredentialsResponse struct { - Credentials []CredentialInfo `json:"credentials,omitempty"` + + // Wire name: 'credentials' + Credentials []CredentialInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCredentialsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCredentialsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List Database Instances type ListDatabaseInstancesRequest struct { // Upper bound for items returned. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Pagination token to go to the next page of Database Instances. Requests // first page if absent. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDatabaseInstancesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDatabaseInstancesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDatabaseInstancesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDatabaseInstancesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDatabaseInstancesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDatabaseInstancesRequest) MarshalJSON() ([]byte, error) { + pb, err := listDatabaseInstancesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListDatabaseInstancesResponse struct { // List of instances. - DatabaseInstances []DatabaseInstance `json:"database_instances,omitempty"` + // Wire name: 'database_instances' + DatabaseInstances []DatabaseInstance // Pagination token to request the next page of instances. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDatabaseInstancesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDatabaseInstancesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDatabaseInstancesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDatabaseInstancesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { + pb, err := listDatabaseInstancesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List external locations type ListExternalLocationsRequest struct { // Whether to include external locations in the response for which the // principal can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of external locations to return. If not set, all the // external locations are returned (not recommended). - when set to a value // greater than 0, the page length is the minimum of this value and a server // configured value; - when set to 0, the page length is set to a server // configured value (recommended); - when set to a value less than 0, an // invalid parameter error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExternalLocationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExternalLocationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExternalLocationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExternalLocationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExternalLocationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExternalLocationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listExternalLocationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListExternalLocationsResponse struct { // An array of external locations. - ExternalLocations []ExternalLocationInfo `json:"external_locations,omitempty"` + // Wire name: 'external_locations' + ExternalLocations []ExternalLocationInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExternalLocationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExternalLocationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExternalLocationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExternalLocationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExternalLocationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExternalLocationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listExternalLocationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List functions type ListFunctionsRequest struct { // Name of parent catalog for functions of interest. - CatalogName string `json:"-" url:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include functions in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of functions to return. If not set, all the functions are // returned (not recommended). - when set to a value greater than 0, the // page length is the minimum of this value and a server configured value; - // when set to 0, the page length is set to a server configured value // (recommended); - when set to a value less than 0, an invalid parameter // error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Parent schema of functions. - SchemaName string `json:"-" url:"schema_name"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFunctionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFunctionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFunctionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFunctionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFunctionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFunctionsRequest) MarshalJSON() ([]byte, error) { + pb, err := listFunctionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListFunctionsResponse struct { // An array of function information objects. - Functions []FunctionInfo `json:"functions,omitempty"` + // Wire name: 'functions' + Functions []FunctionInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFunctionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFunctionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFunctionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFunctionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFunctionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFunctionsResponse) MarshalJSON() ([]byte, error) { + pb, err := listFunctionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListMetastoresResponse struct { // An array of metastore information objects. - Metastores []MetastoreInfo `json:"metastores,omitempty"` + // Wire name: 'metastores' + Metastores []MetastoreInfo +} + +func (st *ListMetastoresResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listMetastoresResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listMetastoresResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListMetastoresResponse) MarshalJSON() ([]byte, error) { + pb, err := listMetastoresResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List Model Versions type ListModelVersionsRequest struct { // The full three-level name of the registered model under which to list // model versions - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Whether to include model versions in the response for which the principal // can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of model versions to return. If not set, the page length // is set to a server configured value (100, as of 1/3/2024). - when set to // a value greater than 0, the page length is the minimum of this value and @@ -3455,90 +8194,195 @@ type ListModelVersionsRequest struct { // page length is set to a server configured value (100, as of 1/3/2024) // (recommended); - when set to a value less than 0, an invalid parameter // error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListModelVersionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListModelVersionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listModelVersionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listModelVersionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListModelVersionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListModelVersionsRequest) MarshalJSON() ([]byte, error) { + pb, err := listModelVersionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListModelVersionsResponse struct { - ModelVersions []ModelVersionInfo `json:"model_versions,omitempty"` + + // Wire name: 'model_versions' + ModelVersions []ModelVersionInfo // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListModelVersionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListModelVersionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listModelVersionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listModelVersionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListModelVersionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListModelVersionsResponse) MarshalJSON() ([]byte, error) { + pb, err := listModelVersionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List all resource quotas under a metastore. type ListQuotasRequest struct { // The number of quotas to return. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque token for the next page of results. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQuotasRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQuotasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQuotasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQuotasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQuotasRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQuotasRequest) MarshalJSON() ([]byte, error) { + pb, err := listQuotasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListQuotasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of returned QuotaInfos. - Quotas []QuotaInfo `json:"quotas,omitempty"` + // Wire name: 'quotas' + Quotas []QuotaInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQuotasResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQuotasResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQuotasResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQuotasResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQuotasResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQuotasResponse) MarshalJSON() ([]byte, error) { + pb, err := listQuotasResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List refreshes type ListRefreshesRequest struct { // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *ListRefreshesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRefreshesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRefreshesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListRefreshesRequest) MarshalJSON() ([]byte, error) { + pb, err := listRefreshesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List Registered Models type ListRegisteredModelsRequest struct { // The identifier of the catalog under which to list registered models. If // specified, schema_name must be specified. - CatalogName string `json:"-" url:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include registered models in the response for which the // principal can only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Max number of registered models to return. // // If both catalog and schema are specified: - when max_results is not @@ -3556,87 +8400,166 @@ type ListRegisteredModelsRequest struct { // 4/2/2024); - when set to 0, the page length is set to a server configured // value (100, as of 4/2/2024); - when set to a value less than 0, an // invalid parameter error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque token to send for the next page of results (pagination). - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The identifier of the schema under which to list registered models. If // specified, catalog_name must be specified. - SchemaName string `json:"-" url:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRegisteredModelsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRegisteredModelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRegisteredModelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRegisteredModelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRegisteredModelsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRegisteredModelsRequest) MarshalJSON() ([]byte, error) { + pb, err := listRegisteredModelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListRegisteredModelsResponse struct { // Opaque token for pagination. Omitted if there are no more results. // page_token should be set to this value for fetching the next page. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - RegisteredModels []RegisteredModelInfo `json:"registered_models,omitempty"` + // Wire name: 'registered_models' + RegisteredModels []RegisteredModelInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRegisteredModelsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRegisteredModelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRegisteredModelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRegisteredModelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRegisteredModelsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRegisteredModelsResponse) MarshalJSON() ([]byte, error) { + pb, err := listRegisteredModelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List schemas type ListSchemasRequest struct { // Parent catalog for schemas of interest. - CatalogName string `json:"-" url:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include schemas in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of schemas to return. If not set, all the schemas are // returned (not recommended). - when set to a value greater than 0, the // page length is the minimum of this value and a server configured value; - // when set to 0, the page length is set to a server configured value // (recommended); - when set to a value less than 0, an invalid parameter // error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSchemasRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSchemasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSchemasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSchemasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSchemasRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSchemasRequest) MarshalJSON() ([]byte, error) { + pb, err := listSchemasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSchemasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of schema information objects. - Schemas []SchemaInfo `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []SchemaInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSchemasResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSchemasResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSchemasResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSchemasResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSchemasResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSchemasResponse) MarshalJSON() ([]byte, error) { + pb, err := listSchemasResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List credentials @@ -3647,46 +8570,86 @@ type ListStorageCredentialsRequest struct { // configured value; - when set to 0, the page length is set to a server // configured value (recommended); - when set to a value less than 0, an // invalid parameter error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListStorageCredentialsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListStorageCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listStorageCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listStorageCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListStorageCredentialsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListStorageCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := listStorageCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListStorageCredentialsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` + // Wire name: 'storage_credentials' + StorageCredentials []StorageCredentialInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListStorageCredentialsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListStorageCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listStorageCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listStorageCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListStorageCredentialsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListStorageCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := listStorageCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List table summaries type ListSummariesRequest struct { // Name of parent catalog for tables of interest. - CatalogName string `json:"-" url:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include a manifest containing capabilities the table has. - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + // Wire name: 'include_manifest_capabilities' + IncludeManifestCapabilities bool `tf:"-"` // Maximum number of summaries for tables to return. If not set, the page // length is set to a server configured value (10000, as of 1/5/2024). - // when set to a value greater than 0, the page length is the minimum of @@ -3694,25 +8657,46 @@ type ListSummariesRequest struct { // set to 0, the page length is set to a server configured value (10000, as // of 1/5/2024) (recommended); - when set to a value less than 0, an invalid // parameter error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // A sql LIKE pattern (% and _) for schema names. All schemas will be // returned if not set or empty. - SchemaNamePattern string `json:"-" url:"schema_name_pattern,omitempty"` + // Wire name: 'schema_name_pattern' + SchemaNamePattern string `tf:"-"` // A sql LIKE pattern (% and _) for table names. All tables will be returned // if not set or empty. - TableNamePattern string `json:"-" url:"table_name_pattern,omitempty"` + // Wire name: 'table_name_pattern' + TableNamePattern string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSummariesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSummariesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSummariesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSummariesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSummariesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSummariesRequest) MarshalJSON() ([]byte, error) { + pb, err := listSummariesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List system schemas @@ -3723,128 +8707,234 @@ type ListSystemSchemasRequest struct { // configured value; - When set to a value less than 0, an invalid parameter // error is returned; - If not set, all the schemas are returned (not // recommended). - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // The ID for the metastore in which the system schema resides. - MetastoreId string `json:"-" url:"-"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSystemSchemasRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSystemSchemasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSystemSchemasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSystemSchemasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSystemSchemasRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSystemSchemasRequest) MarshalJSON() ([]byte, error) { + pb, err := listSystemSchemasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSystemSchemasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of system schema information objects. - Schemas []SystemSchemaInfo `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []SystemSchemaInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSystemSchemasResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSystemSchemasResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSystemSchemasResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSystemSchemasResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSystemSchemasResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSystemSchemasResponse) MarshalJSON() ([]byte, error) { + pb, err := listSystemSchemasResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListTableSummariesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // List of table summaries. - Tables []TableSummary `json:"tables,omitempty"` + // Wire name: 'tables' + Tables []TableSummary - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListTableSummariesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListTableSummariesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTableSummariesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTableSummariesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListTableSummariesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListTableSummariesResponse) MarshalJSON() ([]byte, error) { + pb, err := listTableSummariesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List tables type ListTablesRequest struct { // Name of parent catalog for tables of interest. - CatalogName string `json:"-" url:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include tables in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Whether delta metadata should be included in the response. - IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + // Wire name: 'include_delta_metadata' + IncludeDeltaMetadata bool `tf:"-"` // Whether to include a manifest containing capabilities the table has. - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + // Wire name: 'include_manifest_capabilities' + IncludeManifestCapabilities bool `tf:"-"` // Maximum number of tables to return. If not set, all the tables are // returned (not recommended). - when set to a value greater than 0, the // page length is the minimum of this value and a server configured value; - // when set to 0, the page length is set to a server configured value // (recommended); - when set to a value less than 0, an invalid parameter // error is returned; - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Whether to omit the columns of the table from the response or not. - OmitColumns bool `json:"-" url:"omit_columns,omitempty"` + // Wire name: 'omit_columns' + OmitColumns bool `tf:"-"` // Whether to omit the properties of the table from the response or not. - OmitProperties bool `json:"-" url:"omit_properties,omitempty"` + // Wire name: 'omit_properties' + OmitProperties bool `tf:"-"` // Whether to omit the username of the table (e.g. owner, updated_by, // created_by) from the response or not. - OmitUsername bool `json:"-" url:"omit_username,omitempty"` + // Wire name: 'omit_username' + OmitUsername bool `tf:"-"` // Opaque token to send for the next page of results (pagination). - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Parent schema of tables. - SchemaName string `json:"-" url:"schema_name"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListTablesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListTablesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTablesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTablesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListTablesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListTablesRequest) MarshalJSON() ([]byte, error) { + pb, err := listTablesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListTablesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of table information objects. - Tables []TableInfo `json:"tables,omitempty"` + // Wire name: 'tables' + Tables []TableInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListTablesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListTablesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTablesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTablesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListTablesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListTablesResponse) MarshalJSON() ([]byte, error) { + pb, err := listTablesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List Volumes type ListVolumesRequest struct { // The identifier of the catalog - CatalogName string `json:"-" url:"catalog_name"` + // Wire name: 'catalog_name' + CatalogName string `tf:"-"` // Whether to include volumes in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // Maximum number of volumes to return (page length). // // If not set, the page length is set to a server configured value (10000, @@ -3857,45 +8947,85 @@ type ListVolumesRequest struct { // Note: this parameter controls only the maximum number of volumes to // return. The actual number of volumes returned in a page may be smaller // than this value, including 0, even if there are more pages. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque token returned by a previous request. It must be included in the // request to retrieve the next page of results (pagination). - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The identifier of the schema - SchemaName string `json:"-" url:"schema_name"` + // Wire name: 'schema_name' + SchemaName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListVolumesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListVolumesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listVolumesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listVolumesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListVolumesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListVolumesRequest) MarshalJSON() ([]byte, error) { + pb, err := listVolumesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListVolumesResponseContent struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request to retrieve the next page of results. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - Volumes []VolumeInfo `json:"volumes,omitempty"` + // Wire name: 'volumes' + Volumes []VolumeInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListVolumesResponseContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListVolumesResponseContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listVolumesResponseContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listVolumesResponseContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListVolumesResponseContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListVolumesResponseContent) MarshalJSON() ([]byte, error) { + pb, err := listVolumesResponseContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The artifact pattern matching type type MatchType string +type matchTypePb string const MatchTypePrefixMatch MatchType = `PREFIX_MATCH` @@ -3920,82 +9050,155 @@ func (f *MatchType) Type() string { return "MatchType" } +func matchTypeToPb(st *MatchType) (*matchTypePb, error) { + if st == nil { + return nil, nil + } + pb := matchTypePb(*st) + return &pb, nil +} + +func matchTypeFromPb(pb *matchTypePb) (*MatchType, error) { + if pb == nil { + return nil, nil + } + st := MatchType(*pb) + return &st, nil +} + type MetastoreAssignment struct { // The name of the default catalog in the metastore. - DefaultCatalogName string `json:"default_catalog_name,omitempty"` + // Wire name: 'default_catalog_name' + DefaultCatalogName string // The unique ID of the metastore. - MetastoreId string `json:"metastore_id"` + // Wire name: 'metastore_id' + MetastoreId string // The unique ID of the Databricks workspace. - WorkspaceId int64 `json:"workspace_id"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MetastoreAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &metastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := metastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MetastoreAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := metastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MetastoreInfo struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // Time at which this metastore was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of metastore creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + // Wire name: 'default_data_access_config_id' + DefaultDataAccessConfigId string // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + // Wire name: 'delta_sharing_organization_name' + DeltaSharingOrganizationName string // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + // Wire name: 'delta_sharing_recipient_token_lifetime_in_seconds' + DeltaSharingRecipientTokenLifetimeInSeconds int64 // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope MetastoreInfoDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + // Wire name: 'delta_sharing_scope' + DeltaSharingScope MetastoreInfoDeltaSharingScope // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + // Wire name: 'external_access_enabled' + ExternalAccessEnabled bool // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + // Wire name: 'global_metastore_id' + GlobalMetastoreId string // Unique identifier of metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The user-specified name of the metastore. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The owner of the metastore. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + // Wire name: 'privilege_model_version' + PrivilegeModelVersion string // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The storage root URL for metastore - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + // Wire name: 'storage_root_credential_id' + StorageRootCredentialId string // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + // Wire name: 'storage_root_credential_name' + StorageRootCredentialName string // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the metastore. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MetastoreInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MetastoreInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &metastoreInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := metastoreInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MetastoreInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MetastoreInfo) MarshalJSON() ([]byte, error) { + pb, err := metastoreInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The scope of Delta Sharing enabled for the metastore. type MetastoreInfoDeltaSharingScope string +type metastoreInfoDeltaSharingScopePb string const MetastoreInfoDeltaSharingScopeInternal MetastoreInfoDeltaSharingScope = `INTERNAL` @@ -4022,67 +9225,119 @@ func (f *MetastoreInfoDeltaSharingScope) Type() string { return "MetastoreInfoDeltaSharingScope" } +func metastoreInfoDeltaSharingScopeToPb(st *MetastoreInfoDeltaSharingScope) (*metastoreInfoDeltaSharingScopePb, error) { + if st == nil { + return nil, nil + } + pb := metastoreInfoDeltaSharingScopePb(*st) + return &pb, nil +} + +func metastoreInfoDeltaSharingScopeFromPb(pb *metastoreInfoDeltaSharingScopePb) (*MetastoreInfoDeltaSharingScope, error) { + if pb == nil { + return nil, nil + } + st := MetastoreInfoDeltaSharingScope(*pb) + return &st, nil +} + type ModelVersionInfo struct { // List of aliases associated with the model version - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + // Wire name: 'aliases' + Aliases []RegisteredModelAlias // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // The name of the catalog containing the model version - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The comment attached to the model version - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // The identifier of the user who created the model version - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The unique identifier of the model version - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The unique identifier of the metastore containing the model version - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The name of the parent registered model of the model version, relative to // parent schema - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string // Model version dependencies, for feature-store packaged models - ModelVersionDependencies *DependencyList `json:"model_version_dependencies,omitempty"` + // Wire name: 'model_version_dependencies' + ModelVersionDependencies *DependencyList // MLflow run ID used when creating the model version, if ``source`` was // generated by an experiment run stored in an MLflow tracking server - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // ID of the Databricks workspace containing the MLflow run that generated // this model version, if applicable - RunWorkspaceId int `json:"run_workspace_id,omitempty"` + // Wire name: 'run_workspace_id' + RunWorkspaceId int // The name of the schema containing the model version, relative to parent // catalog - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // URI indicating the location of the source artifacts (files) for the model // version - Source string `json:"source,omitempty"` + // Wire name: 'source' + Source string // Current status of the model version. Newly created model versions start // in PENDING_REGISTRATION status, then move to READY status once the model // version files are uploaded and the model version is finalized. Only model // versions in READY status can be loaded for inference or served. - Status ModelVersionInfoStatus `json:"status,omitempty"` + // Wire name: 'status' + Status ModelVersionInfoStatus // The storage location on the cloud under which model version data files // are stored - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // The identifier of the user who updated the model version last time - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // Integer model version number, used to reference the model version in API // requests. - Version int `json:"version,omitempty"` + // Wire name: 'version' + Version int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelVersionInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelVersionInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelVersionInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelVersionInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelVersionInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelVersionInfo) MarshalJSON() ([]byte, error) { + pb, err := modelVersionInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Current status of the model version. Newly created model versions start in @@ -4090,6 +9345,7 @@ func (s ModelVersionInfo) MarshalJSON() ([]byte, error) { // files are uploaded and the model version is finalized. Only model versions in // READY status can be loaded for inference or served. type ModelVersionInfoStatus string +type modelVersionInfoStatusPb string const ModelVersionInfoStatusFailedRegistration ModelVersionInfoStatus = `FAILED_REGISTRATION` @@ -4118,20 +9374,65 @@ func (f *ModelVersionInfoStatus) Type() string { return "ModelVersionInfoStatus" } +func modelVersionInfoStatusToPb(st *ModelVersionInfoStatus) (*modelVersionInfoStatusPb, error) { + if st == nil { + return nil, nil + } + pb := modelVersionInfoStatusPb(*st) + return &pb, nil +} + +func modelVersionInfoStatusFromPb(pb *modelVersionInfoStatusPb) (*ModelVersionInfoStatus, error) { + if pb == nil { + return nil, nil + } + st := ModelVersionInfoStatus(*pb) + return &st, nil +} + type MonitorCronSchedule struct { // Read only field that indicates whether a schedule is paused or not. - PauseStatus MonitorCronSchedulePauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus MonitorCronSchedulePauseStatus // The expression that determines when to run the monitor. See [examples]. // // [examples]: https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression string `json:"quartz_cron_expression"` + // Wire name: 'quartz_cron_expression' + QuartzCronExpression string // The timezone id (e.g., ``"PST"``) in which to evaluate the quartz // expression. - TimezoneId string `json:"timezone_id"` + // Wire name: 'timezone_id' + TimezoneId string +} + +func (st *MonitorCronSchedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorCronSchedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorCronScheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorCronSchedule) MarshalJSON() ([]byte, error) { + pb, err := monitorCronScheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Read only field that indicates whether a schedule is paused or not. type MonitorCronSchedulePauseStatus string +type monitorCronSchedulePauseStatusPb string const MonitorCronSchedulePauseStatusPaused MonitorCronSchedulePauseStatus = `PAUSED` @@ -4158,25 +9459,85 @@ func (f *MonitorCronSchedulePauseStatus) Type() string { return "MonitorCronSchedulePauseStatus" } +func monitorCronSchedulePauseStatusToPb(st *MonitorCronSchedulePauseStatus) (*monitorCronSchedulePauseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := monitorCronSchedulePauseStatusPb(*st) + return &pb, nil +} + +func monitorCronSchedulePauseStatusFromPb(pb *monitorCronSchedulePauseStatusPb) (*MonitorCronSchedulePauseStatus, error) { + if pb == nil { + return nil, nil + } + st := MonitorCronSchedulePauseStatus(*pb) + return &st, nil +} + type MonitorDataClassificationConfig struct { // Whether data classification is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MonitorDataClassificationConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MonitorDataClassificationConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorDataClassificationConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorDataClassificationConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MonitorDataClassificationConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MonitorDataClassificationConfig) MarshalJSON() ([]byte, error) { + pb, err := monitorDataClassificationConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MonitorDestination struct { // The list of email addresses to send the notification to. A maximum of 5 // email addresses is supported. - EmailAddresses []string `json:"email_addresses,omitempty"` + // Wire name: 'email_addresses' + EmailAddresses []string +} + +func (st *MonitorDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorDestination) MarshalJSON() ([]byte, error) { + pb, err := monitorDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MonitorInferenceLog struct { @@ -4184,45 +9545,70 @@ type MonitorInferenceLog struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities []string `json:"granularities"` + // Wire name: 'granularities' + Granularities []string // Optional column that contains the ground truth for the prediction. - LabelCol string `json:"label_col,omitempty"` + // Wire name: 'label_col' + LabelCol string // Column that contains the id of the model generating the predictions. // Metrics will be computed per model id by default, and also across all // model ids. - ModelIdCol string `json:"model_id_col"` + // Wire name: 'model_id_col' + ModelIdCol string // Column that contains the output/prediction from the model. - PredictionCol string `json:"prediction_col"` + // Wire name: 'prediction_col' + PredictionCol string // Optional column that contains the prediction probabilities for each class // in a classification problem type. The values in this column should be a // map, mapping each class label to the prediction probability for a given // sample. The map should be of PySpark MapType(). - PredictionProbaCol string `json:"prediction_proba_col,omitempty"` + // Wire name: 'prediction_proba_col' + PredictionProbaCol string // Problem type the model aims to solve. Determines the type of // model-quality metrics that will be computed. - ProblemType MonitorInferenceLogProblemType `json:"problem_type"` + // Wire name: 'problem_type' + ProblemType MonitorInferenceLogProblemType // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol string `json:"timestamp_col"` + // Wire name: 'timestamp_col' + TimestampCol string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MonitorInferenceLog) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MonitorInferenceLog) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorInferenceLogPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorInferenceLogFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MonitorInferenceLog) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MonitorInferenceLog) MarshalJSON() ([]byte, error) { + pb, err := monitorInferenceLogToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Problem type the model aims to solve. Determines the type of model-quality // metrics that will be computed. type MonitorInferenceLogProblemType string +type monitorInferenceLogProblemTypePb string const MonitorInferenceLogProblemTypeProblemTypeClassification MonitorInferenceLogProblemType = `PROBLEM_TYPE_CLASSIFICATION` @@ -4249,70 +9635,122 @@ func (f *MonitorInferenceLogProblemType) Type() string { return "MonitorInferenceLogProblemType" } +func monitorInferenceLogProblemTypeToPb(st *MonitorInferenceLogProblemType) (*monitorInferenceLogProblemTypePb, error) { + if st == nil { + return nil, nil + } + pb := monitorInferenceLogProblemTypePb(*st) + return &pb, nil +} + +func monitorInferenceLogProblemTypeFromPb(pb *monitorInferenceLogProblemTypePb) (*MonitorInferenceLogProblemType, error) { + if pb == nil { + return nil, nil + } + st := MonitorInferenceLogProblemType(*pb) + return &st, nil +} + type MonitorInfo struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir string `json:"assets_dir,omitempty"` + // Wire name: 'assets_dir' + AssetsDir string // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName string `json:"baseline_table_name,omitempty"` + // Wire name: 'baseline_table_name' + BaselineTableName string // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + // Wire name: 'custom_metrics' + CustomMetrics []MonitorMetric // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The data classification config for the monitor. - DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + // Wire name: 'data_classification_config' + DataClassificationConfig *MonitorDataClassificationConfig // The full name of the drift metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - DriftMetricsTableName string `json:"drift_metrics_table_name"` + // Wire name: 'drift_metrics_table_name' + DriftMetricsTableName string // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + // Wire name: 'inference_log' + InferenceLog *MonitorInferenceLog // The latest failure message of the monitor (if any). - LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + // Wire name: 'latest_monitor_failure_msg' + LatestMonitorFailureMsg string // The version of the monitor config (e.g. 1,2,3). If negative, the monitor // may be corrupted. - MonitorVersion string `json:"monitor_version"` + // Wire name: 'monitor_version' + MonitorVersion string // The notification settings for the monitor. - Notifications *MonitorNotifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications *MonitorNotifications // Schema where output metric tables are created. - OutputSchemaName string `json:"output_schema_name,omitempty"` + // Wire name: 'output_schema_name' + OutputSchemaName string // The full name of the profile metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - ProfileMetricsTableName string `json:"profile_metrics_table_name"` + // Wire name: 'profile_metrics_table_name' + ProfileMetricsTableName string // The schedule for automatically updating and refreshing metric tables. - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *MonitorCronSchedule // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs []string `json:"slicing_exprs,omitempty"` + // Wire name: 'slicing_exprs' + SlicingExprs []string // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + // Wire name: 'snapshot' + Snapshot *MonitorSnapshot // The status of the monitor. - Status MonitorInfoStatus `json:"status"` + // Wire name: 'status' + Status MonitorInfoStatus // The full name of the table to monitor. Format: // __catalog_name__.__schema_name__.__table_name__. - TableName string `json:"table_name"` + // Wire name: 'table_name' + TableName string // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + // Wire name: 'time_series' + TimeSeries *MonitorTimeSeries - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MonitorInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MonitorInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MonitorInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MonitorInfo) MarshalJSON() ([]byte, error) { + pb, err := monitorInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status of the monitor. type MonitorInfoStatus string +type monitorInfoStatusPb string const MonitorInfoStatusMonitorStatusActive MonitorInfoStatus = `MONITOR_STATUS_ACTIVE` @@ -4345,20 +9783,40 @@ func (f *MonitorInfoStatus) Type() string { return "MonitorInfoStatus" } +func monitorInfoStatusToPb(st *MonitorInfoStatus) (*monitorInfoStatusPb, error) { + if st == nil { + return nil, nil + } + pb := monitorInfoStatusPb(*st) + return &pb, nil +} + +func monitorInfoStatusFromPb(pb *monitorInfoStatusPb) (*MonitorInfoStatus, error) { + if pb == nil { + return nil, nil + } + st := MonitorInfoStatus(*pb) + return &st, nil +} + type MonitorMetric struct { // Jinja template for a SQL expression that specifies how to compute the // metric. See [create metric definition]. // // [create metric definition]: https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition - Definition string `json:"definition"` + // Wire name: 'definition' + Definition string // A list of column names in the input table the metric should be computed // for. Can use ``":table"`` to indicate that the metric needs information // from multiple columns. - InputColumns []string `json:"input_columns"` + // Wire name: 'input_columns' + InputColumns []string // Name of the metric in the output tables. - Name string `json:"name"` + // Wire name: 'name' + Name string // The output type of the custom metric. - OutputDataType string `json:"output_data_type"` + // Wire name: 'output_data_type' + OutputDataType string // Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, // ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. The // ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` @@ -4369,7 +9827,33 @@ type MonitorMetric struct { // table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed // aggregate metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously // computed aggregate or derived metrics - Type MonitorMetricType `json:"type"` + // Wire name: 'type' + Type MonitorMetricType +} + +func (st *MonitorMetric) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorMetricPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorMetricFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorMetric) MarshalJSON() ([]byte, error) { + pb, err := monitorMetricToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Can only be one of “"CUSTOM_METRIC_TYPE_AGGREGATE"“, @@ -4383,6 +9867,7 @@ type MonitorMetric struct { // metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate // or derived metrics type MonitorMetricType string +type monitorMetricTypePb string const MonitorMetricTypeCustomMetricTypeAggregate MonitorMetricType = `CUSTOM_METRIC_TYPE_AGGREGATE` @@ -4411,44 +9896,111 @@ func (f *MonitorMetricType) Type() string { return "MonitorMetricType" } +func monitorMetricTypeToPb(st *MonitorMetricType) (*monitorMetricTypePb, error) { + if st == nil { + return nil, nil + } + pb := monitorMetricTypePb(*st) + return &pb, nil +} + +func monitorMetricTypeFromPb(pb *monitorMetricTypePb) (*MonitorMetricType, error) { + if pb == nil { + return nil, nil + } + st := MonitorMetricType(*pb) + return &st, nil +} + type MonitorNotifications struct { // Who to send notifications to on monitor failure. - OnFailure *MonitorDestination `json:"on_failure,omitempty"` + // Wire name: 'on_failure' + OnFailure *MonitorDestination // Who to send notifications to when new data classification tags are // detected. - OnNewClassificationTagDetected *MonitorDestination `json:"on_new_classification_tag_detected,omitempty"` + // Wire name: 'on_new_classification_tag_detected' + OnNewClassificationTagDetected *MonitorDestination +} + +func (st *MonitorNotifications) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorNotificationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorNotificationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorNotifications) MarshalJSON() ([]byte, error) { + pb, err := monitorNotificationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MonitorRefreshInfo struct { // Time at which refresh operation completed (milliseconds since 1/1/1970 // UTC). - EndTimeMs int64 `json:"end_time_ms,omitempty"` + // Wire name: 'end_time_ms' + EndTimeMs int64 // An optional message to give insight into the current state of the job // (e.g. FAILURE messages). - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Unique id of the refresh operation. - RefreshId int64 `json:"refresh_id"` + // Wire name: 'refresh_id' + RefreshId int64 // Time at which refresh operation was initiated (milliseconds since // 1/1/1970 UTC). - StartTimeMs int64 `json:"start_time_ms"` + // Wire name: 'start_time_ms' + StartTimeMs int64 // The current state of the refresh. - State MonitorRefreshInfoState `json:"state"` + // Wire name: 'state' + State MonitorRefreshInfoState // The method by which the refresh was triggered. - Trigger MonitorRefreshInfoTrigger `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger MonitorRefreshInfoTrigger - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MonitorRefreshInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MonitorRefreshInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorRefreshInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorRefreshInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MonitorRefreshInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MonitorRefreshInfo) MarshalJSON() ([]byte, error) { + pb, err := monitorRefreshInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The current state of the refresh. type MonitorRefreshInfoState string +type monitorRefreshInfoStatePb string const MonitorRefreshInfoStateCanceled MonitorRefreshInfoState = `CANCELED` @@ -4481,8 +10033,25 @@ func (f *MonitorRefreshInfoState) Type() string { return "MonitorRefreshInfoState" } +func monitorRefreshInfoStateToPb(st *MonitorRefreshInfoState) (*monitorRefreshInfoStatePb, error) { + if st == nil { + return nil, nil + } + pb := monitorRefreshInfoStatePb(*st) + return &pb, nil +} + +func monitorRefreshInfoStateFromPb(pb *monitorRefreshInfoStatePb) (*MonitorRefreshInfoState, error) { + if pb == nil { + return nil, nil + } + st := MonitorRefreshInfoState(*pb) + return &st, nil +} + // The method by which the refresh was triggered. type MonitorRefreshInfoTrigger string +type monitorRefreshInfoTriggerPb string const MonitorRefreshInfoTriggerManual MonitorRefreshInfoTrigger = `MANUAL` @@ -4509,12 +10078,79 @@ func (f *MonitorRefreshInfoTrigger) Type() string { return "MonitorRefreshInfoTrigger" } +func monitorRefreshInfoTriggerToPb(st *MonitorRefreshInfoTrigger) (*monitorRefreshInfoTriggerPb, error) { + if st == nil { + return nil, nil + } + pb := monitorRefreshInfoTriggerPb(*st) + return &pb, nil +} + +func monitorRefreshInfoTriggerFromPb(pb *monitorRefreshInfoTriggerPb) (*MonitorRefreshInfoTrigger, error) { + if pb == nil { + return nil, nil + } + st := MonitorRefreshInfoTrigger(*pb) + return &st, nil +} + type MonitorRefreshListResponse struct { // List of refreshes. - Refreshes []MonitorRefreshInfo `json:"refreshes,omitempty"` + // Wire name: 'refreshes' + Refreshes []MonitorRefreshInfo +} + +func (st *MonitorRefreshListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorRefreshListResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorRefreshListResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorRefreshListResponse) MarshalJSON() ([]byte, error) { + pb, err := monitorRefreshListResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type MonitorSnapshot struct { +} + +func (st *MonitorSnapshot) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorSnapshotPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorSnapshotFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type MonitorSnapshot struct { +func (st MonitorSnapshot) MarshalJSON() ([]byte, error) { + pb, err := monitorSnapshotToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MonitorTimeSeries struct { @@ -4522,19 +10158,72 @@ type MonitorTimeSeries struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities []string `json:"granularities"` + // Wire name: 'granularities' + Granularities []string // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol string `json:"timestamp_col"` + // Wire name: 'timestamp_col' + TimestampCol string +} + +func (st *MonitorTimeSeries) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &monitorTimeSeriesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := monitorTimeSeriesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MonitorTimeSeries) MarshalJSON() ([]byte, error) { + pb, err := monitorTimeSeriesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NamedTableConstraint struct { // The name of the constraint. - Name string `json:"name"` + // Wire name: 'name' + Name string +} + +func (st *NamedTableConstraint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &namedTableConstraintPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := namedTableConstraintFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NamedTableConstraint) MarshalJSON() ([]byte, error) { + pb, err := namedTableConstraintToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Custom fields that user can set for pipeline while creating @@ -4544,48 +10233,89 @@ type NewPipelineSpec struct { // UC catalog for the pipeline to store intermediate files (checkpoints, // event logs etc). This needs to be a standard catalog where the user has // permissions to create Delta tables. - StorageCatalog string `json:"storage_catalog,omitempty"` + // Wire name: 'storage_catalog' + StorageCatalog string // UC schema for the pipeline to store intermediate files (checkpoints, // event logs etc). This needs to be in the standard catalog where the user // has permissions to create Delta tables. - StorageSchema string `json:"storage_schema,omitempty"` + // Wire name: 'storage_schema' + StorageSchema string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NewPipelineSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NewPipelineSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &newPipelineSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := newPipelineSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NewPipelineSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NewPipelineSpec) MarshalJSON() ([]byte, error) { + pb, err := newPipelineSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Online Table information. type OnlineTable struct { // Full three-part (catalog, schema, table) name of the table. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Specification of the online table. - Spec *OnlineTableSpec `json:"spec,omitempty"` + // Wire name: 'spec' + Spec *OnlineTableSpec // Online Table data synchronization status - Status *OnlineTableStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *OnlineTableStatus // Data serving REST API URL for this table - TableServingUrl string `json:"table_serving_url,omitempty"` + // Wire name: 'table_serving_url' + TableServingUrl string // The provisioning state of the online table entity in Unity Catalog. This // is distinct from the state of the data synchronization pipeline (i.e. the // table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it // runs asynchronously). - UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` + // Wire name: 'unity_catalog_provisioning_state' + UnityCatalogProvisioningState ProvisioningInfoState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OnlineTable) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OnlineTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &onlineTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := onlineTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OnlineTable) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OnlineTable) MarshalJSON() ([]byte, error) { + pb, err := onlineTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Specification of an online table. @@ -4597,42 +10327,117 @@ type OnlineTableSpec struct { // the source table and there are no incremental updates. This mode is // useful for syncing views or tables without CDFs to online tables. Note // that the full-copy pipeline only supports "triggered" scheduling policy. - PerformFullCopy bool `json:"perform_full_copy,omitempty"` + // Wire name: 'perform_full_copy' + PerformFullCopy bool // ID of the associated pipeline. Generated by the server - cannot be set by // the caller. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // Primary Key columns to be used for data insert/update in the destination. - PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + // Wire name: 'primary_key_columns' + PrimaryKeyColumns []string // Pipeline runs continuously after generating the initial data. - RunContinuously *OnlineTableSpecContinuousSchedulingPolicy `json:"run_continuously,omitempty"` + // Wire name: 'run_continuously' + RunContinuously *OnlineTableSpecContinuousSchedulingPolicy // Pipeline stops after generating the initial data and can be triggered // later (manually, through a cron job or through data triggers) - RunTriggered *OnlineTableSpecTriggeredSchedulingPolicy `json:"run_triggered,omitempty"` + // Wire name: 'run_triggered' + RunTriggered *OnlineTableSpecTriggeredSchedulingPolicy // Three-part (catalog, schema, table) name of the source Delta table. - SourceTableFullName string `json:"source_table_full_name,omitempty"` + // Wire name: 'source_table_full_name' + SourceTableFullName string // Time series key to deduplicate (tie-break) rows with the same primary // key. - TimeseriesKey string `json:"timeseries_key,omitempty"` + // Wire name: 'timeseries_key' + TimeseriesKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OnlineTableSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OnlineTableSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &onlineTableSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := onlineTableSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OnlineTableSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OnlineTableSpec) MarshalJSON() ([]byte, error) { + pb, err := onlineTableSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type OnlineTableSpecContinuousSchedulingPolicy struct { } +func (st *OnlineTableSpecContinuousSchedulingPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &onlineTableSpecContinuousSchedulingPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := onlineTableSpecContinuousSchedulingPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st OnlineTableSpecContinuousSchedulingPolicy) MarshalJSON() ([]byte, error) { + pb, err := onlineTableSpecContinuousSchedulingPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type OnlineTableSpecTriggeredSchedulingPolicy struct { } +func (st *OnlineTableSpecTriggeredSchedulingPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &onlineTableSpecTriggeredSchedulingPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := onlineTableSpecTriggeredSchedulingPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st OnlineTableSpecTriggeredSchedulingPolicy) MarshalJSON() ([]byte, error) { + pb, err := onlineTableSpecTriggeredSchedulingPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The state of an online table. type OnlineTableState string +type onlineTableStatePb string const OnlineTableStateOffline OnlineTableState = `OFFLINE` @@ -4677,97 +10482,233 @@ func (f *OnlineTableState) Type() string { return "OnlineTableState" } +func onlineTableStateToPb(st *OnlineTableState) (*onlineTableStatePb, error) { + if st == nil { + return nil, nil + } + pb := onlineTableStatePb(*st) + return &pb, nil +} + +func onlineTableStateFromPb(pb *onlineTableStatePb) (*OnlineTableState, error) { + if pb == nil { + return nil, nil + } + st := OnlineTableState(*pb) + return &st, nil +} + // Status of an online table. type OnlineTableStatus struct { // Detailed status of an online table. Shown if the online table is in the // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. - ContinuousUpdateStatus *ContinuousUpdateStatus `json:"continuous_update_status,omitempty"` + // Wire name: 'continuous_update_status' + ContinuousUpdateStatus *ContinuousUpdateStatus // The state of the online table. - DetailedState OnlineTableState `json:"detailed_state,omitempty"` + // Wire name: 'detailed_state' + DetailedState OnlineTableState // Detailed status of an online table. Shown if the online table is in the // OFFLINE_FAILED or the ONLINE_PIPELINE_FAILED state. - FailedStatus *FailedStatus `json:"failed_status,omitempty"` + // Wire name: 'failed_status' + FailedStatus *FailedStatus // A text description of the current state of the online table. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Detailed status of an online table. Shown if the online table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT // state. - ProvisioningStatus *ProvisioningStatus `json:"provisioning_status,omitempty"` + // Wire name: 'provisioning_status' + ProvisioningStatus *ProvisioningStatus // Detailed status of an online table. Shown if the online table is in the // ONLINE_TRIGGERED_UPDATE or the ONLINE_NO_PENDING_UPDATE state. - TriggeredUpdateStatus *TriggeredUpdateStatus `json:"triggered_update_status,omitempty"` + // Wire name: 'triggered_update_status' + TriggeredUpdateStatus *TriggeredUpdateStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OnlineTableStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OnlineTableStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &onlineTableStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := onlineTableStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OnlineTableStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OnlineTableStatus) MarshalJSON() ([]byte, error) { + pb, err := onlineTableStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PermissionsChange struct { // The set of privileges to add. - Add []Privilege `json:"add,omitempty"` + // Wire name: 'add' + Add []Privilege // The principal whose privileges we are changing. - Principal string `json:"principal,omitempty"` + // Wire name: 'principal' + Principal string // The set of privileges to remove. - Remove []Privilege `json:"remove,omitempty"` + // Wire name: 'remove' + Remove []Privilege - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PermissionsChange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PermissionsChange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionsChangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionsChangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PermissionsChange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermissionsChange) MarshalJSON() ([]byte, error) { + pb, err := permissionsChangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PermissionsList struct { // The privileges assigned to each principal - PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + // Wire name: 'privilege_assignments' + PrivilegeAssignments []PrivilegeAssignment +} + +func (st *PermissionsList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionsListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionsListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PermissionsList) MarshalJSON() ([]byte, error) { + pb, err := permissionsListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Progress information of the Online Table data synchronization pipeline. type PipelineProgress struct { // The estimated time remaining to complete this update in seconds. - EstimatedCompletionTimeSeconds float64 `json:"estimated_completion_time_seconds,omitempty"` + // Wire name: 'estimated_completion_time_seconds' + EstimatedCompletionTimeSeconds float64 // The source table Delta version that was last processed by the pipeline. // The pipeline may not have completely processed this version yet. - LatestVersionCurrentlyProcessing int64 `json:"latest_version_currently_processing,omitempty"` + // Wire name: 'latest_version_currently_processing' + LatestVersionCurrentlyProcessing int64 // The completion ratio of this update. This is a number between 0 and 1. - SyncProgressCompletion float64 `json:"sync_progress_completion,omitempty"` + // Wire name: 'sync_progress_completion' + SyncProgressCompletion float64 // The number of rows that have been synced in this update. - SyncedRowCount int64 `json:"synced_row_count,omitempty"` + // Wire name: 'synced_row_count' + SyncedRowCount int64 // The total number of rows that need to be synced in this update. This // number may be an estimate. - TotalRowCount int64 `json:"total_row_count,omitempty"` + // Wire name: 'total_row_count' + TotalRowCount int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineProgress) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineProgress) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineProgressPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineProgressFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineProgress) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineProgress) MarshalJSON() ([]byte, error) { + pb, err := pipelineProgressToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PrimaryKeyConstraint struct { // Column names for this constraint. - ChildColumns []string `json:"child_columns"` + // Wire name: 'child_columns' + ChildColumns []string // The name of the constraint. - Name string `json:"name"` + // Wire name: 'name' + Name string // Column names that represent a timeseries. - TimeseriesColumns []string `json:"timeseries_columns,omitempty"` + // Wire name: 'timeseries_columns' + TimeseriesColumns []string +} + +func (st *PrimaryKeyConstraint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &primaryKeyConstraintPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := primaryKeyConstraintFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PrimaryKeyConstraint) MarshalJSON() ([]byte, error) { + pb, err := primaryKeyConstraintToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Privilege string +type privilegePb string const PrivilegeAccess Privilege = `ACCESS` @@ -4888,33 +10829,112 @@ func (f *Privilege) Type() string { return "Privilege" } +func privilegeToPb(st *Privilege) (*privilegePb, error) { + if st == nil { + return nil, nil + } + pb := privilegePb(*st) + return &pb, nil +} + +func privilegeFromPb(pb *privilegePb) (*Privilege, error) { + if pb == nil { + return nil, nil + } + st := Privilege(*pb) + return &st, nil +} + type PrivilegeAssignment struct { // The principal (user email address or group name). - Principal string `json:"principal,omitempty"` + // Wire name: 'principal' + Principal string // The privileges assigned to the principal. - Privileges []Privilege `json:"privileges,omitempty"` + // Wire name: 'privileges' + Privileges []Privilege - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PrivilegeAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PrivilegeAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &privilegeAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := privilegeAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PrivilegeAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PrivilegeAssignment) MarshalJSON() ([]byte, error) { + pb, err := privilegeAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An object containing map of key-value properties attached to the connection. + type PropertiesKvPairs map[string]string +type propertiesKvPairsPb PropertiesKvPairs + +func propertiesKvPairsToPb(st *PropertiesKvPairs) (*propertiesKvPairsPb, error) { + if st == nil { + return nil, nil + } + stPb := propertiesKvPairsPb(*st) + return &stPb, nil +} +func propertiesKvPairsFromPb(stPb *propertiesKvPairsPb) (*PropertiesKvPairs, error) { + if stPb == nil { + return nil, nil + } + st := PropertiesKvPairs(*stPb) + return &st, nil +} // Status of an asynchronously provisioned resource. type ProvisioningInfo struct { // The provisioning state of the resource. - State ProvisioningInfoState `json:"state,omitempty"` + // Wire name: 'state' + State ProvisioningInfoState +} + +func (st *ProvisioningInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &provisioningInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := provisioningInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ProvisioningInfo) MarshalJSON() ([]byte, error) { + pb, err := provisioningInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ProvisioningInfoState string +type provisioningInfoStatePb string const ProvisioningInfoStateActive ProvisioningInfoState = `ACTIVE` @@ -4949,244 +10969,532 @@ func (f *ProvisioningInfoState) Type() string { return "ProvisioningInfoState" } +func provisioningInfoStateToPb(st *ProvisioningInfoState) (*provisioningInfoStatePb, error) { + if st == nil { + return nil, nil + } + pb := provisioningInfoStatePb(*st) + return &pb, nil +} + +func provisioningInfoStateFromPb(pb *provisioningInfoStatePb) (*ProvisioningInfoState, error) { + if pb == nil { + return nil, nil + } + st := ProvisioningInfoState(*pb) + return &st, nil +} + // Detailed status of an online table. Shown if the online table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state. type ProvisioningStatus struct { // Details about initial data synchronization. Only populated when in the // PROVISIONING_INITIAL_SNAPSHOT state. - InitialPipelineSyncProgress *PipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` + // Wire name: 'initial_pipeline_sync_progress' + InitialPipelineSyncProgress *PipelineProgress +} + +func (st *ProvisioningStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &provisioningStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := provisioningStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ProvisioningStatus) MarshalJSON() ([]byte, error) { + pb, err := provisioningStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QuotaInfo struct { // The timestamp that indicates when the quota count was last updated. - LastRefreshedAt int64 `json:"last_refreshed_at,omitempty"` + // Wire name: 'last_refreshed_at' + LastRefreshedAt int64 // Name of the parent resource. Returns metastore ID if the parent is a // metastore. - ParentFullName string `json:"parent_full_name,omitempty"` + // Wire name: 'parent_full_name' + ParentFullName string // The quota parent securable type. - ParentSecurableType SecurableType `json:"parent_securable_type,omitempty"` + // Wire name: 'parent_securable_type' + ParentSecurableType SecurableType // The current usage of the resource quota. - QuotaCount int `json:"quota_count,omitempty"` + // Wire name: 'quota_count' + QuotaCount int // The current limit of the resource quota. - QuotaLimit int `json:"quota_limit,omitempty"` + // Wire name: 'quota_limit' + QuotaLimit int // The name of the quota. - QuotaName string `json:"quota_name,omitempty"` + // Wire name: 'quota_name' + QuotaName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QuotaInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QuotaInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := "aInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := quotaInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QuotaInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QuotaInfo) MarshalJSON() ([]byte, error) { + pb, err := quotaInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // R2 temporary credentials for API authentication. Read more at // https://developers.cloudflare.com/r2/api/s3/tokens/. type R2Credentials struct { // The access key ID that identifies the temporary credentials. - AccessKeyId string `json:"access_key_id,omitempty"` + // Wire name: 'access_key_id' + AccessKeyId string // The secret access key associated with the access key. - SecretAccessKey string `json:"secret_access_key,omitempty"` + // Wire name: 'secret_access_key' + SecretAccessKey string // The generated JWT that users must pass to use the temporary credentials. - SessionToken string `json:"session_token,omitempty"` + // Wire name: 'session_token' + SessionToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *R2Credentials) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *R2Credentials) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &r2CredentialsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := r2CredentialsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s R2Credentials) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st R2Credentials) MarshalJSON() ([]byte, error) { + pb, err := r2CredentialsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a Volume type ReadVolumeRequest struct { // Whether to include volumes in the response for which the principal can // only access selective metadata for - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + // Wire name: 'include_browse' + IncludeBrowse bool `tf:"-"` // The three-level (fully qualified) name of the volume - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ReadVolumeRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ReadVolumeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &readVolumeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := readVolumeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ReadVolumeRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ReadVolumeRequest) MarshalJSON() ([]byte, error) { + pb, err := readVolumeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegenerateDashboardRequest struct { // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` // Optional argument to specify the warehouse for dashboard regeneration. If // not specified, the first running warehouse will be used. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegenerateDashboardRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegenerateDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®enerateDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := regenerateDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegenerateDashboardRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegenerateDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := regenerateDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegenerateDashboardResponse struct { // Id of the regenerated monitoring dashboard. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The directory where the regenerated dashboard is stored. - ParentFolder string `json:"parent_folder,omitempty"` + // Wire name: 'parent_folder' + ParentFolder string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegenerateDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegenerateDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®enerateDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := regenerateDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegenerateDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegenerateDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := regenerateDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Registered model alias. type RegisteredModelAlias struct { // Name of the alias, e.g. 'champion' or 'latest_stable' - AliasName string `json:"alias_name,omitempty"` + // Wire name: 'alias_name' + AliasName string // Integer version number of the model version to which this alias points. - VersionNum int `json:"version_num,omitempty"` + // Wire name: 'version_num' + VersionNum int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelAlias) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelAlias) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelAliasPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelAliasFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelAlias) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelAlias) MarshalJSON() ([]byte, error) { + pb, err := registeredModelAliasToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelInfo struct { // List of aliases associated with the registered model - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + // Wire name: 'aliases' + Aliases []RegisteredModelAlias // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // The name of the catalog where the schema and the registered model reside - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The comment attached to the registered model - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Creation timestamp of the registered model in milliseconds since the Unix // epoch - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // The identifier of the user who created the registered model - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The three-level (fully qualified) name of the registered model - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // The unique identifier of the metastore - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The name of the registered model - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The identifier of the user who owns the registered model - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // The name of the schema where the registered model resides - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // The storage location on the cloud under which model version data files // are stored - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // Last-update timestamp of the registered model in milliseconds since the // Unix epoch - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // The identifier of the user who updated the registered model last time - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelInfo) MarshalJSON() ([]byte, error) { + pb, err := registeredModelInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Queue a metric refresh for a monitor type RunRefreshRequest struct { // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` +} + +func (st *RunRefreshRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runRefreshRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runRefreshRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunRefreshRequest) MarshalJSON() ([]byte, error) { + pb, err := runRefreshRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SchemaInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // Name of parent catalog. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The type of the parent catalog. - CatalogType string `json:"catalog_type,omitempty"` + // Wire name: 'catalog_type' + CatalogType string // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this schema was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of schema creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string - EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + // Wire name: 'effective_predictive_optimization_flag' + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + // Wire name: 'enable_predictive_optimization' + EnablePredictiveOptimization EnablePredictiveOptimization // Full name of schema, in form of __catalog_name__.__schema_name__. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of schema, relative to parent catalog. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of current owner of schema. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string // The unique identifier of the schema. - SchemaId string `json:"schema_id,omitempty"` + // Wire name: 'schema_id' + SchemaId string // Storage location for managed tables within schema. - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // Storage root URL for managed tables within schema. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // Time at which this schema was created, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified schema. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SchemaInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SchemaInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &schemaInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := schemaInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SchemaInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SchemaInfo) MarshalJSON() ([]byte, error) { + pb, err := schemaInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A map of key-value properties attached to the securable. + type SecurableOptionsMap map[string]string +type securableOptionsMapPb SecurableOptionsMap + +func securableOptionsMapToPb(st *SecurableOptionsMap) (*securableOptionsMapPb, error) { + if st == nil { + return nil, nil + } + stPb := securableOptionsMapPb(*st) + return &stPb, nil +} +func securableOptionsMapFromPb(stPb *securableOptionsMapPb) (*SecurableOptionsMap, error) { + if stPb == nil { + return nil, nil + } + st := SecurableOptionsMap(*stPb) + return &st, nil +} // A map of key-value properties attached to the securable. + type SecurablePropertiesMap map[string]string +type securablePropertiesMapPb SecurablePropertiesMap + +func securablePropertiesMapToPb(st *SecurablePropertiesMap) (*securablePropertiesMapPb, error) { + if st == nil { + return nil, nil + } + stPb := securablePropertiesMapPb(*st) + return &stPb, nil +} +func securablePropertiesMapFromPb(stPb *securablePropertiesMapPb) (*SecurablePropertiesMap, error) { + if stPb == nil { + return nil, nil + } + st := SecurablePropertiesMap(*stPb) + return &st, nil +} // The type of Unity Catalog securable. type SecurableType string +type securableTypePb string const SecurableTypeCatalog SecurableType = `CATALOG` @@ -5245,60 +11553,146 @@ func (f *SecurableType) Type() string { return "SecurableType" } +func securableTypeToPb(st *SecurableType) (*securableTypePb, error) { + if st == nil { + return nil, nil + } + pb := securableTypePb(*st) + return &pb, nil +} + +func securableTypeFromPb(pb *securableTypePb) (*SecurableType, error) { + if pb == nil { + return nil, nil + } + st := SecurableType(*pb) + return &st, nil +} + type SetArtifactAllowlist struct { // A list of allowed artifact match patterns. - ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers"` + // Wire name: 'artifact_matchers' + ArtifactMatchers []ArtifactMatcher // The artifact type of the allowlist. - ArtifactType ArtifactType `json:"-" url:"-"` + // Wire name: 'artifact_type' + ArtifactType ArtifactType `tf:"-"` // Time at which this artifact allowlist was set, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of the user who set the artifact allowlist. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SetArtifactAllowlist) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SetArtifactAllowlist) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setArtifactAllowlistPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setArtifactAllowlistFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SetArtifactAllowlist) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SetArtifactAllowlist) MarshalJSON() ([]byte, error) { + pb, err := setArtifactAllowlistToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetRegisteredModelAliasRequest struct { // The name of the alias - Alias string `json:"alias" url:"-"` + // Wire name: 'alias' + Alias string // Full name of the registered model - FullName string `json:"full_name" url:"-"` + // Wire name: 'full_name' + FullName string // The version number of the model version to which the alias points - VersionNum int `json:"version_num"` + // Wire name: 'version_num' + VersionNum int +} + +func (st *SetRegisteredModelAliasRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setRegisteredModelAliasRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setRegisteredModelAliasRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetRegisteredModelAliasRequest) MarshalJSON() ([]byte, error) { + pb, err := setRegisteredModelAliasRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Server-Side Encryption properties for clients communicating with AWS s3. type SseEncryptionDetails struct { // Sets the value of the 'x-amz-server-side-encryption' header in S3 // request. - Algorithm SseEncryptionDetailsAlgorithm `json:"algorithm,omitempty"` + // Wire name: 'algorithm' + Algorithm SseEncryptionDetailsAlgorithm // Optional. The ARN of the SSE-KMS key used with the S3 location, when // algorithm = "SSE-KMS". Sets the value of the // 'x-amz-server-side-encryption-aws-kms-key-id' header. - AwsKmsKeyArn string `json:"aws_kms_key_arn,omitempty"` + // Wire name: 'aws_kms_key_arn' + AwsKmsKeyArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SseEncryptionDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SseEncryptionDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sseEncryptionDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sseEncryptionDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SseEncryptionDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SseEncryptionDetails) MarshalJSON() ([]byte, error) { + pb, err := sseEncryptionDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SseEncryptionDetailsAlgorithm string +type sseEncryptionDetailsAlgorithmPb string const SseEncryptionDetailsAlgorithmAwsSseKms SseEncryptionDetailsAlgorithm = `AWS_SSE_KMS` @@ -5325,67 +11719,120 @@ func (f *SseEncryptionDetailsAlgorithm) Type() string { return "SseEncryptionDetailsAlgorithm" } +func sseEncryptionDetailsAlgorithmToPb(st *SseEncryptionDetailsAlgorithm) (*sseEncryptionDetailsAlgorithmPb, error) { + if st == nil { + return nil, nil + } + pb := sseEncryptionDetailsAlgorithmPb(*st) + return &pb, nil +} + +func sseEncryptionDetailsAlgorithmFromPb(pb *sseEncryptionDetailsAlgorithmPb) (*SseEncryptionDetailsAlgorithm, error) { + if pb == nil { + return nil, nil + } + st := SseEncryptionDetailsAlgorithm(*pb) + return &st, nil +} + type StorageCredentialInfo struct { // The AWS IAM role configuration. - AwsIamRole *AwsIamRoleResponse `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRoleResponse // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentityResponse // The Azure service principal configuration. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // The Cloudflare API token configuration. - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + // Wire name: 'cloudflare_api_token' + CloudflareApiToken *CloudflareApiToken // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this Credential was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of credential creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccountResponse `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountResponse // The full name of the credential. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // The unique identifier of the credential. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The credential name. The name must be unique within the metastore. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of current owner of credential. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Whether the storage credential is only usable for read operations. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the credential. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // Whether this credential is the current metastore's root storage // credential. - UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + // Wire name: 'used_for_managed_storage' + UsedForManagedStorage bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StorageCredentialInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StorageCredentialInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &storageCredentialInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := storageCredentialInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StorageCredentialInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StorageCredentialInfo) MarshalJSON() ([]byte, error) { + pb, err := storageCredentialInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Next field marker: 10 type SyncedDatabaseTable struct { // Synced Table data synchronization status - DataSynchronizationStatus *OnlineTableStatus `json:"data_synchronization_status,omitempty"` + // Wire name: 'data_synchronization_status' + DataSynchronizationStatus *OnlineTableStatus // Name of the target database instance. This is required when creating // synced database tables in standard catalogs. This is optional when // creating synced database tables in registered catalogs. If this field is // specified when creating synced database tables in registered catalogs, // the database instance name MUST match that of the registered catalog (or // the request will be rejected). - DatabaseInstanceName string `json:"database_instance_name,omitempty"` + // Wire name: 'database_instance_name' + DatabaseInstanceName string // Target Postgres database object (logical database) name for this table. // This field is optional in all scenarios. // @@ -5399,31 +11846,54 @@ type SyncedDatabaseTable struct { // name is inferred to be that of the standard catalog. In this scenario, // specifying this field will allow targeting an arbitrary postgres // database. - LogicalDatabaseName string `json:"logical_database_name,omitempty"` + // Wire name: 'logical_database_name' + LogicalDatabaseName string // Full three-part (catalog, schema, table) name of the table. - Name string `json:"name"` + // Wire name: 'name' + Name string // Specification of a synced database table. - Spec *SyncedTableSpec `json:"spec,omitempty"` + // Wire name: 'spec' + Spec *SyncedTableSpec // Data serving REST API URL for this table - TableServingUrl string `json:"table_serving_url,omitempty"` + // Wire name: 'table_serving_url' + TableServingUrl string // The provisioning state of the synced table entity in Unity Catalog. This // is distinct from the state of the data synchronization pipeline (i.e. the // table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it // runs asynchronously). - UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` + // Wire name: 'unity_catalog_provisioning_state' + UnityCatalogProvisioningState ProvisioningInfoState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SyncedDatabaseTable) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SyncedDatabaseTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &syncedDatabaseTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := syncedDatabaseTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SyncedDatabaseTable) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SyncedDatabaseTable) MarshalJSON() ([]byte, error) { + pb, err := syncedDatabaseTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SyncedTableSchedulingPolicy string +type syncedTableSchedulingPolicyPb string const SyncedTableSchedulingPolicyContinuous SyncedTableSchedulingPolicy = `CONTINUOUS` @@ -5452,170 +11922,360 @@ func (f *SyncedTableSchedulingPolicy) Type() string { return "SyncedTableSchedulingPolicy" } +func syncedTableSchedulingPolicyToPb(st *SyncedTableSchedulingPolicy) (*syncedTableSchedulingPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := syncedTableSchedulingPolicyPb(*st) + return &pb, nil +} + +func syncedTableSchedulingPolicyFromPb(pb *syncedTableSchedulingPolicyPb) (*SyncedTableSchedulingPolicy, error) { + if pb == nil { + return nil, nil + } + st := SyncedTableSchedulingPolicy(*pb) + return &st, nil +} + // Specification of a synced database table. type SyncedTableSpec struct { // If true, the synced table's logical database and schema resources in PG // will be created if they do not already exist. - CreateDatabaseObjectsIfMissing bool `json:"create_database_objects_if_missing,omitempty"` + // Wire name: 'create_database_objects_if_missing' + CreateDatabaseObjectsIfMissing bool // Spec of new pipeline. Should be empty if pipeline_id is set - NewPipelineSpec *NewPipelineSpec `json:"new_pipeline_spec,omitempty"` + // Wire name: 'new_pipeline_spec' + NewPipelineSpec *NewPipelineSpec // ID of the associated pipeline. Should be empty if new_pipeline_spec is // set - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // Primary Key columns to be used for data insert/update in the destination. - PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + // Wire name: 'primary_key_columns' + PrimaryKeyColumns []string // Scheduling policy of the underlying pipeline. - SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` + // Wire name: 'scheduling_policy' + SchedulingPolicy SyncedTableSchedulingPolicy // Three-part (catalog, schema, table) name of the source Delta table. - SourceTableFullName string `json:"source_table_full_name,omitempty"` + // Wire name: 'source_table_full_name' + SourceTableFullName string // Time series key to deduplicate (tie-break) rows with the same primary // key. - TimeseriesKey string `json:"timeseries_key,omitempty"` + // Wire name: 'timeseries_key' + TimeseriesKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SyncedTableSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SyncedTableSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &syncedTableSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := syncedTableSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SyncedTableSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SyncedTableSpec) MarshalJSON() ([]byte, error) { + pb, err := syncedTableSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SystemSchemaInfo struct { // Name of the system schema. - Schema string `json:"schema"` + // Wire name: 'schema' + Schema string // The current state of enablement for the system schema. An empty string // means the system schema is available and ready for opt-in. Possible // values: AVAILABLE | ENABLE_INITIALIZED | ENABLE_COMPLETED | // DISABLE_INITIALIZED | UNAVAILABLE - State string `json:"state"` + // Wire name: 'state' + State string +} + +func (st *SystemSchemaInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &systemSchemaInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := systemSchemaInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SystemSchemaInfo) MarshalJSON() ([]byte, error) { + pb, err := systemSchemaInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A table constraint, as defined by *one* of the following fields being set: // __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. type TableConstraint struct { - ForeignKeyConstraint *ForeignKeyConstraint `json:"foreign_key_constraint,omitempty"` - NamedTableConstraint *NamedTableConstraint `json:"named_table_constraint,omitempty"` + // Wire name: 'foreign_key_constraint' + ForeignKeyConstraint *ForeignKeyConstraint + + // Wire name: 'named_table_constraint' + NamedTableConstraint *NamedTableConstraint + + // Wire name: 'primary_key_constraint' + PrimaryKeyConstraint *PrimaryKeyConstraint +} + +func (st *TableConstraint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableConstraintPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableConstraintFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - PrimaryKeyConstraint *PrimaryKeyConstraint `json:"primary_key_constraint,omitempty"` +func (st TableConstraint) MarshalJSON() ([]byte, error) { + pb, err := tableConstraintToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A table that is dependent on a SQL object. type TableDependency struct { // Full name of the dependent table, in the form of // __catalog_name__.__schema_name__.__table_name__. - TableFullName string `json:"table_full_name"` + // Wire name: 'table_full_name' + TableFullName string +} + +func (st *TableDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TableDependency) MarshalJSON() ([]byte, error) { + pb, err := tableDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableExistsResponse struct { // Whether the table exists or not. - TableExists bool `json:"table_exists,omitempty"` + // Wire name: 'table_exists' + TableExists bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableExistsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableExistsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableExistsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableExistsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableExistsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableExistsResponse) MarshalJSON() ([]byte, error) { + pb, err := tableExistsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableInfo struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint string `json:"access_point,omitempty"` + // Wire name: 'access_point' + AccessPoint string // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // Name of parent catalog. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The array of __ColumnInfo__ definitions of the table's columns. - Columns []ColumnInfo `json:"columns,omitempty"` + // Wire name: 'columns' + Columns []ColumnInfo // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this table was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of table creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Unique ID of the Data Access Configuration to use with the table data. - DataAccessConfigurationId string `json:"data_access_configuration_id,omitempty"` + // Wire name: 'data_access_configuration_id' + DataAccessConfigurationId string // Data source format - DataSourceFormat DataSourceFormat `json:"data_source_format,omitempty"` + // Wire name: 'data_source_format' + DataSourceFormat DataSourceFormat // Time at which this table was deleted, in epoch milliseconds. Field is // omitted if table is not deleted. - DeletedAt int64 `json:"deleted_at,omitempty"` + // Wire name: 'deleted_at' + DeletedAt int64 // Information pertaining to current state of the delta table. - DeltaRuntimePropertiesKvpairs *DeltaRuntimePropertiesKvPairs `json:"delta_runtime_properties_kvpairs,omitempty"` + // Wire name: 'delta_runtime_properties_kvpairs' + DeltaRuntimePropertiesKvpairs *DeltaRuntimePropertiesKvPairs - EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` + // Wire name: 'effective_predictive_optimization_flag' + EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + // Wire name: 'enable_predictive_optimization' + EnablePredictiveOptimization EnablePredictiveOptimization // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Wire name: 'encryption_details' + EncryptionDetails *EncryptionDetails // Full name of table, in form of // __catalog_name__.__schema_name__.__table_name__ - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // Unique identifier of parent metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of table, relative to parent schema. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of current owner of table. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // The pipeline ID of the table. Applicable for tables created by pipelines // (Materialized View, Streaming Table, etc.). - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string - RowFilter *TableRowFilter `json:"row_filter,omitempty"` + // Wire name: 'row_filter' + RowFilter *TableRowFilter // Name of parent schema relative to its parent catalog. - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // List of schemes whose objects can be referenced without qualification. - SqlPath string `json:"sql_path,omitempty"` + // Wire name: 'sql_path' + SqlPath string // Name of the storage credential, when a storage credential is configured // for use with this table. - StorageCredentialName string `json:"storage_credential_name,omitempty"` + // Wire name: 'storage_credential_name' + StorageCredentialName string // Storage root URL for table (for **MANAGED**, **EXTERNAL** tables) - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // List of table constraints. Note: this field is not set in the output of // the __listTables__ API. - TableConstraints []TableConstraint `json:"table_constraints,omitempty"` + // Wire name: 'table_constraints' + TableConstraints []TableConstraint // The unique identifier of the table. - TableId string `json:"table_id,omitempty"` + // Wire name: 'table_id' + TableId string - TableType TableType `json:"table_type,omitempty"` + // Wire name: 'table_type' + TableType TableType // Time at which this table was last modified, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified the table. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // View definition SQL (when __table_type__ is **VIEW**, // **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) - ViewDefinition string `json:"view_definition,omitempty"` + // Wire name: 'view_definition' + ViewDefinition string // View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, // **STREAMING_TABLE**) - when DependencyList is None, the dependency is not // provided; - when DependencyList is an empty list, the dependency is // provided but is empty; - when DependencyList is not an empty list, // dependencies are provided and recorded. - ViewDependencies *DependencyList `json:"view_dependencies,omitempty"` + // Wire name: 'view_dependencies' + ViewDependencies *DependencyList - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableInfo) MarshalJSON() ([]byte, error) { + pb, err := tableInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableOperation string +type tableOperationPb string const TableOperationRead TableOperation = `READ` @@ -5642,33 +12302,96 @@ func (f *TableOperation) Type() string { return "TableOperation" } +func tableOperationToPb(st *TableOperation) (*tableOperationPb, error) { + if st == nil { + return nil, nil + } + pb := tableOperationPb(*st) + return &pb, nil +} + +func tableOperationFromPb(pb *tableOperationPb) (*TableOperation, error) { + if pb == nil { + return nil, nil + } + st := TableOperation(*pb) + return &st, nil +} + type TableRowFilter struct { // The full name of the row filter SQL UDF. - FunctionName string `json:"function_name"` + // Wire name: 'function_name' + FunctionName string // The list of table columns to be passed as input to the row filter // function. The column types should match the types of the filter function // arguments. - InputColumnNames []string `json:"input_column_names"` + // Wire name: 'input_column_names' + InputColumnNames []string +} + +func (st *TableRowFilter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableRowFilterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableRowFilterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TableRowFilter) MarshalJSON() ([]byte, error) { + pb, err := tableRowFilterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableSummary struct { // The full name of the table. - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string - TableType TableType `json:"table_type,omitempty"` + // Wire name: 'table_type' + TableType TableType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableSummary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableSummary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableSummaryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableSummaryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableSummary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableSummary) MarshalJSON() ([]byte, error) { + pb, err := tableSummaryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableType string +type tableTypePb string const TableTypeExternal TableType = `EXTERNAL` @@ -5707,47 +12430,103 @@ func (f *TableType) Type() string { return "TableType" } +func tableTypeToPb(st *TableType) (*tableTypePb, error) { + if st == nil { + return nil, nil + } + pb := tableTypePb(*st) + return &pb, nil +} + +func tableTypeFromPb(pb *tableTypePb) (*TableType, error) { + if pb == nil { + return nil, nil + } + st := TableType(*pb) + return &st, nil +} + type TagKeyValue struct { // name of the tag - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // value of the tag associated with the key, could be optional - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TagKeyValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TagKeyValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tagKeyValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tagKeyValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TagKeyValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TagKeyValue) MarshalJSON() ([]byte, error) { + pb, err := tagKeyValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TemporaryCredentials struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + // Wire name: 'aws_temp_credentials' + AwsTempCredentials *AwsCredentials // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + // Wire name: 'azure_aad' + AzureAad *AzureActiveDirectoryToken // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account - GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + // Wire name: 'gcp_oauth_token' + GcpOauthToken *GcpOauthToken - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TemporaryCredentials) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TemporaryCredentials) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &temporaryCredentialsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := temporaryCredentialsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TemporaryCredentials) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TemporaryCredentials) MarshalJSON() ([]byte, error) { + pb, err := temporaryCredentialsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Detailed status of an online table. Shown if the online table is in the @@ -5756,268 +12535,590 @@ type TriggeredUpdateStatus struct { // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + // Wire name: 'last_processed_commit_version' + LastProcessedCommitVersion int64 // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp string `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp string // Progress of the active data synchronization pipeline. - TriggeredUpdateProgress *PipelineProgress `json:"triggered_update_progress,omitempty"` + // Wire name: 'triggered_update_progress' + TriggeredUpdateProgress *PipelineProgress - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TriggeredUpdateStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TriggeredUpdateStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &triggeredUpdateStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := triggeredUpdateStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TriggeredUpdateStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TriggeredUpdateStatus) MarshalJSON() ([]byte, error) { + pb, err := triggeredUpdateStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an assignment type UnassignRequest struct { // Query for the ID of the metastore to delete. - MetastoreId string `json:"-" url:"metastore_id"` + // Wire name: 'metastore_id' + MetastoreId string `tf:"-"` // A workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *UnassignRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unassignRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unassignRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnassignRequest) MarshalJSON() ([]byte, error) { + pb, err := unassignRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UnassignResponse struct { } +func (st *UnassignResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unassignResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unassignResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnassignResponse) MarshalJSON() ([]byte, error) { + pb, err := unassignResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateAssignmentResponse struct { } +func (st *UpdateAssignmentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAssignmentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAssignmentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateAssignmentResponse) MarshalJSON() ([]byte, error) { + pb, err := updateAssignmentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateCatalog struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + // Wire name: 'enable_predictive_optimization' + EnablePredictiveOptimization EnablePredictiveOptimization // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode CatalogIsolationMode // The name of the catalog. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the catalog. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options,omitempty"` + // Wire name: 'options' + Options map[string]string // Username of current owner of catalog. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateCatalog) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateCatalog) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCatalogPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCatalogFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateCatalog) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateCatalog) MarshalJSON() ([]byte, error) { + pb, err := updateCatalogToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCatalogWorkspaceBindingsResponse struct { // A list of workspace IDs - Workspaces []int64 `json:"workspaces,omitempty"` + // Wire name: 'workspaces' + Workspaces []int64 +} + +func (st *UpdateCatalogWorkspaceBindingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCatalogWorkspaceBindingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCatalogWorkspaceBindingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCatalogWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + pb, err := updateCatalogWorkspaceBindingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateConnection struct { // Name of the connection. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the connection. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // A map of key-value properties attached to the securable. - Options map[string]string `json:"options"` + // Wire name: 'options' + Options map[string]string // Username of current owner of the connection. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateConnection) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateConnection) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateConnectionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateConnectionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateConnection) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateConnection) MarshalJSON() ([]byte, error) { + pb, err := updateConnectionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRole // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentity // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when // purpose is **STORAGE**). - Force bool `json:"force,omitempty"` + // Wire name: 'force' + Force bool // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Name of the credential. - NameArg string `json:"-" url:"-"` + // Wire name: 'name_arg' + NameArg string `tf:"-"` // New name of credential. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of current owner of credential. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Supply true to this argument to skip validation of the updated // credential. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := updateCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update a Database Instance type UpdateDatabaseInstanceRequest struct { // A DatabaseInstance represents a logical Postgres instance, comprised of // both compute and storage. - DatabaseInstance DatabaseInstance `json:"database_instance"` + // Wire name: 'database_instance' + DatabaseInstance DatabaseInstance // The name of the instance. This is the unique identifier for the instance. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The list of fields to update. - UpdateMask string `json:"-" url:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` +} + +func (st *UpdateDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDatabaseInstanceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDatabaseInstanceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDatabaseInstanceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExternalLocation struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the storage credential used with this location. - CredentialName string `json:"credential_name,omitempty"` + // Wire name: 'credential_name' + CredentialName string // [Create:OPT Update:OPT] Whether to enable file events on this external // location. - EnableFileEvents bool `json:"enable_file_events,omitempty"` + // Wire name: 'enable_file_events' + EnableFileEvents bool // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Wire name: 'encryption_details' + EncryptionDetails *EncryptionDetails // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback bool `json:"fallback,omitempty"` + // Wire name: 'fallback' + Fallback bool // [Create:OPT Update:OPT] File event queue settings. - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + // Wire name: 'file_event_queue' + FileEventQueue *FileEventQueue // Force update even if changing url invalidates dependent external tables // or mounts. - Force bool `json:"force,omitempty"` + // Wire name: 'force' + Force bool - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Name of the external location. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the external location. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // The owner of the external location. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Indicates whether the external location is read-only. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Skips validation of the storage credential associated with the external // location. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool // Path URL of the external location. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateExternalLocation) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateExternalLocation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExternalLocationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExternalLocationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateExternalLocation) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateExternalLocation) MarshalJSON() ([]byte, error) { + pb, err := updateExternalLocationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateFunction struct { // The fully-qualified name of the function (of the form // __catalog_name__.__schema_name__.__function__name__). - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Username of current owner of function. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateFunction) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateFunction) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateFunctionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateFunctionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateFunction) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateFunction) MarshalJSON() ([]byte, error) { + pb, err := updateFunctionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateMetastore struct { // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + // Wire name: 'delta_sharing_organization_name' + DeltaSharingOrganizationName string // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + // Wire name: 'delta_sharing_recipient_token_lifetime_in_seconds' + DeltaSharingRecipientTokenLifetimeInSeconds int64 // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope UpdateMetastoreDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + // Wire name: 'delta_sharing_scope' + DeltaSharingScope UpdateMetastoreDeltaSharingScope // Unique ID of the metastore. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // New name for the metastore. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // The owner of the metastore. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + // Wire name: 'privilege_model_version' + PrivilegeModelVersion string // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + // Wire name: 'storage_root_credential_id' + StorageRootCredentialId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateMetastore) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateMetastore) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateMetastorePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateMetastoreFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateMetastore) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateMetastore) MarshalJSON() ([]byte, error) { + pb, err := updateMetastoreToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateMetastoreAssignment struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName string `json:"default_catalog_name,omitempty"` + // Wire name: 'default_catalog_name' + DefaultCatalogName string // The unique ID of the metastore. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // A workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateMetastoreAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateMetastoreAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateMetastoreAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateMetastoreAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateMetastoreAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateMetastoreAssignment) MarshalJSON() ([]byte, error) { + pb, err := updateMetastoreAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The scope of Delta Sharing enabled for the metastore. type UpdateMetastoreDeltaSharingScope string +type updateMetastoreDeltaSharingScopePb string const UpdateMetastoreDeltaSharingScopeInternal UpdateMetastoreDeltaSharingScope = `INTERNAL` @@ -6044,292 +13145,652 @@ func (f *UpdateMetastoreDeltaSharingScope) Type() string { return "UpdateMetastoreDeltaSharingScope" } +func updateMetastoreDeltaSharingScopeToPb(st *UpdateMetastoreDeltaSharingScope) (*updateMetastoreDeltaSharingScopePb, error) { + if st == nil { + return nil, nil + } + pb := updateMetastoreDeltaSharingScopePb(*st) + return &pb, nil +} + +func updateMetastoreDeltaSharingScopeFromPb(pb *updateMetastoreDeltaSharingScopePb) (*UpdateMetastoreDeltaSharingScope, error) { + if pb == nil { + return nil, nil + } + st := UpdateMetastoreDeltaSharingScope(*pb) + return &st, nil +} + type UpdateModelVersionRequest struct { // The comment attached to the model version - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The three-level (fully qualified) name of the model version - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // The integer version number of the model version - Version int `json:"-" url:"-"` + // Wire name: 'version' + Version int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateModelVersionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := updateModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateMonitor struct { // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName string `json:"baseline_table_name,omitempty"` + // Wire name: 'baseline_table_name' + BaselineTableName string // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + // Wire name: 'custom_metrics' + CustomMetrics []MonitorMetric // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The data classification config for the monitor. - DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + // Wire name: 'data_classification_config' + DataClassificationConfig *MonitorDataClassificationConfig // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + // Wire name: 'inference_log' + InferenceLog *MonitorInferenceLog // The notification settings for the monitor. - Notifications *MonitorNotifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications *MonitorNotifications // Schema where output metric tables are created. - OutputSchemaName string `json:"output_schema_name"` + // Wire name: 'output_schema_name' + OutputSchemaName string // The schedule for automatically updating and refreshing metric tables. - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *MonitorCronSchedule // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs []string `json:"slicing_exprs,omitempty"` + // Wire name: 'slicing_exprs' + SlicingExprs []string // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + // Wire name: 'snapshot' + Snapshot *MonitorSnapshot // Full name of the table. - TableName string `json:"-" url:"-"` + // Wire name: 'table_name' + TableName string `tf:"-"` // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + // Wire name: 'time_series' + TimeSeries *MonitorTimeSeries - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateMonitor) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateMonitor) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateMonitorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateMonitorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateMonitor) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateMonitor) MarshalJSON() ([]byte, error) { + pb, err := updateMonitorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdatePermissions struct { // Array of permissions change objects. - Changes []PermissionsChange `json:"changes,omitempty"` + // Wire name: 'changes' + Changes []PermissionsChange // Full name of securable. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // Type of securable. - SecurableType SecurableType `json:"-" url:"-"` + // Wire name: 'securable_type' + SecurableType SecurableType `tf:"-"` +} + +func (st *UpdatePermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdatePermissions) MarshalJSON() ([]byte, error) { + pb, err := updatePermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateRegisteredModelRequest struct { // The comment attached to the registered model - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The three-level (fully qualified) name of the registered model - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // New name for the registered model. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // The identifier of the user who owns the registered model - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateRegisteredModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateRegisteredModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRegisteredModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRegisteredModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateRegisteredModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + pb, err := updateRegisteredModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateSchema struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + // Wire name: 'enable_predictive_optimization' + EnablePredictiveOptimization EnablePredictiveOptimization // Full name of the schema. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` // New name for the schema. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of current owner of schema. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateSchema) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateSchema) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateSchemaPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateSchemaFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateSchema) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateSchema) MarshalJSON() ([]byte, error) { + pb, err := updateSchemaToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRoleRequest // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentityResponse // The Azure service principal configuration. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // The Cloudflare API token configuration. - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + // Wire name: 'cloudflare_api_token' + CloudflareApiToken *CloudflareApiToken // Comment associated with the credential. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest // Force update even if there are dependent external locations or external // tables. - Force bool `json:"force,omitempty"` + // Wire name: 'force' + Force bool - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + // Wire name: 'isolation_mode' + IsolationMode IsolationMode // Name of the storage credential. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the storage credential. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of current owner of credential. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Whether the storage credential is only usable for read operations. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // Supplying true to this argument skips validation of the updated // credential. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateStorageCredential) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateStorageCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateStorageCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateStorageCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateStorageCredential) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateStorageCredential) MarshalJSON() ([]byte, error) { + pb, err := updateStorageCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update a table owner. type UpdateTableRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + // Wire name: 'full_name' + FullName string `tf:"-"` - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateTableRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateTableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateTableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateTableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateTableRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateTableRequest) MarshalJSON() ([]byte, error) { + pb, err := updateTableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateVolumeRequestContent struct { // The comment attached to the volume - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The three-level (fully qualified) name of the volume - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the volume. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // The identifier of the user who owns the volume - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateVolumeRequestContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateVolumeRequestContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateVolumeRequestContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateVolumeRequestContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateVolumeRequestContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateVolumeRequestContent) MarshalJSON() ([]byte, error) { + pb, err := updateVolumeRequestContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateWorkspaceBindings struct { // A list of workspace IDs. - AssignWorkspaces []int64 `json:"assign_workspaces,omitempty"` + // Wire name: 'assign_workspaces' + AssignWorkspaces []int64 // The name of the catalog. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // A list of workspace IDs. - UnassignWorkspaces []int64 `json:"unassign_workspaces,omitempty"` + // Wire name: 'unassign_workspaces' + UnassignWorkspaces []int64 +} + +func (st *UpdateWorkspaceBindings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceBindingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceBindingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateWorkspaceBindings) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceBindingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateWorkspaceBindingsParameters struct { // List of workspace bindings. - Add []WorkspaceBinding `json:"add,omitempty"` + // Wire name: 'add' + Add []WorkspaceBinding // List of workspace bindings. - Remove []WorkspaceBinding `json:"remove,omitempty"` + // Wire name: 'remove' + Remove []WorkspaceBinding // The name of the securable. - SecurableName string `json:"-" url:"-"` + // Wire name: 'securable_name' + SecurableName string `tf:"-"` // The type of the securable to bind to a workspace (catalog, // storage_credential, credential, or external_location). - SecurableType string `json:"-" url:"-"` + // Wire name: 'securable_type' + SecurableType string `tf:"-"` +} + +func (st *UpdateWorkspaceBindingsParameters) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceBindingsParametersPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceBindingsParametersFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateWorkspaceBindingsParameters) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceBindingsParametersToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A list of workspace IDs that are bound to the securable type UpdateWorkspaceBindingsResponse struct { // List of workspace bindings. - Bindings []WorkspaceBinding `json:"bindings,omitempty"` + // Wire name: 'bindings' + Bindings []WorkspaceBinding +} + +func (st *UpdateWorkspaceBindingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceBindingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceBindingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceBindingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Next ID: 17 type ValidateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRole // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentity // Required. The name of an existing credential or long-lived cloud // credential to validate. - CredentialName string `json:"credential_name,omitempty"` + // Wire name: 'credential_name' + CredentialName string // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount // The name of an existing external location to validate. Only applicable // for storage credentials (purpose is **STORAGE**.) - ExternalLocationName string `json:"external_location_name,omitempty"` + // Wire name: 'external_location_name' + ExternalLocationName string // The purpose of the credential. This should only be used when the // credential is specified. - Purpose CredentialPurpose `json:"purpose,omitempty"` + // Wire name: 'purpose' + Purpose CredentialPurpose // Whether the credential is only usable for read operations. Only // applicable for storage credentials (purpose is **STORAGE**.) - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // The external location url to validate. Only applicable when purpose is // **STORAGE**. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ValidateCredentialRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ValidateCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &validateCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := validateCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ValidateCredentialRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ValidateCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := validateCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ValidateCredentialResponse struct { // Whether the tested location is a directory in cloud storage. Only // applicable for when purpose is **STORAGE**. - IsDir bool `json:"isDir,omitempty"` + // Wire name: 'isDir' + IsDir bool // The results of the validation check. - Results []CredentialValidationResult `json:"results,omitempty"` + // Wire name: 'results' + Results []CredentialValidationResult - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ValidateCredentialResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ValidateCredentialResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &validateCredentialResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := validateCredentialResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ValidateCredentialResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ValidateCredentialResponse) MarshalJSON() ([]byte, error) { + pb, err := validateCredentialResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A enum represents the result of the file operation type ValidateCredentialResult string +type validateCredentialResultPb string const ValidateCredentialResultFail ValidateCredentialResult = `FAIL` @@ -6358,75 +13819,157 @@ func (f *ValidateCredentialResult) Type() string { return "ValidateCredentialResult" } +func validateCredentialResultToPb(st *ValidateCredentialResult) (*validateCredentialResultPb, error) { + if st == nil { + return nil, nil + } + pb := validateCredentialResultPb(*st) + return &pb, nil +} + +func validateCredentialResultFromPb(pb *validateCredentialResultPb) (*ValidateCredentialResult, error) { + if pb == nil { + return nil, nil + } + st := ValidateCredentialResult(*pb) + return &st, nil +} + type ValidateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + // Wire name: 'aws_iam_role' + AwsIamRole *AwsIamRoleRequest // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + // Wire name: 'azure_managed_identity' + AzureManagedIdentity *AzureManagedIdentityRequest // The Azure service principal configuration. - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + // Wire name: 'azure_service_principal' + AzureServicePrincipal *AzureServicePrincipal // The Cloudflare API token configuration. - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + // Wire name: 'cloudflare_api_token' + CloudflareApiToken *CloudflareApiToken // The Databricks created GCP service account configuration. - DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` + // Wire name: 'databricks_gcp_service_account' + DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest // The name of an existing external location to validate. - ExternalLocationName string `json:"external_location_name,omitempty"` + // Wire name: 'external_location_name' + ExternalLocationName string // Whether the storage credential is only usable for read operations. - ReadOnly bool `json:"read_only,omitempty"` + // Wire name: 'read_only' + ReadOnly bool // The name of the storage credential to validate. - StorageCredentialName string `json:"storage_credential_name,omitempty"` + // Wire name: 'storage_credential_name' + StorageCredentialName string // The external location url to validate. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ValidateStorageCredential) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ValidateStorageCredential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &validateStorageCredentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := validateStorageCredentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ValidateStorageCredential) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ValidateStorageCredential) MarshalJSON() ([]byte, error) { + pb, err := validateStorageCredentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ValidateStorageCredentialResponse struct { // Whether the tested location is a directory in cloud storage. - IsDir bool `json:"isDir,omitempty"` + // Wire name: 'isDir' + IsDir bool // The results of the validation check. - Results []ValidationResult `json:"results,omitempty"` + // Wire name: 'results' + Results []ValidationResult - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ValidateStorageCredentialResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ValidateStorageCredentialResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &validateStorageCredentialResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := validateStorageCredentialResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ValidateStorageCredentialResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ValidateStorageCredentialResponse) MarshalJSON() ([]byte, error) { + pb, err := validateStorageCredentialResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ValidationResult struct { // Error message would exist when the result does not equal to **PASS**. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // The operation tested. - Operation ValidationResultOperation `json:"operation,omitempty"` + // Wire name: 'operation' + Operation ValidationResultOperation // The results of the tested operation. - Result ValidationResultResult `json:"result,omitempty"` + // Wire name: 'result' + Result ValidationResultResult - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ValidationResult) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ValidationResult) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &validationResultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := validationResultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ValidationResult) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ValidationResult) MarshalJSON() ([]byte, error) { + pb, err := validationResultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The operation tested. type ValidationResultOperation string +type validationResultOperationPb string const ValidationResultOperationDelete ValidationResultOperation = `DELETE` @@ -6459,8 +14002,25 @@ func (f *ValidationResultOperation) Type() string { return "ValidationResultOperation" } +func validationResultOperationToPb(st *ValidationResultOperation) (*validationResultOperationPb, error) { + if st == nil { + return nil, nil + } + pb := validationResultOperationPb(*st) + return &pb, nil +} + +func validationResultOperationFromPb(pb *validationResultOperationPb) (*ValidationResultOperation, error) { + if pb == nil { + return nil, nil + } + st := ValidationResultOperation(*pb) + return &st, nil +} + // The results of the tested operation. type ValidationResultResult string +type validationResultResultPb string const ValidationResultResultFail ValidationResultResult = `FAIL` @@ -6489,58 +14049,108 @@ func (f *ValidationResultResult) Type() string { return "ValidationResultResult" } +func validationResultResultToPb(st *ValidationResultResult) (*validationResultResultPb, error) { + if st == nil { + return nil, nil + } + pb := validationResultResultPb(*st) + return &pb, nil +} + +func validationResultResultFromPb(pb *validationResultResultPb) (*ValidationResultResult, error) { + if pb == nil { + return nil, nil + } + st := ValidationResultResult(*pb) + return &st, nil +} + type VolumeInfo struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint string `json:"access_point,omitempty"` + // Wire name: 'access_point' + AccessPoint string // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly bool `json:"browse_only,omitempty"` + // Wire name: 'browse_only' + BrowseOnly bool // The name of the catalog where the schema and the volume are - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // The comment attached to the volume - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // The identifier of the user who created the volume - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Wire name: 'encryption_details' + EncryptionDetails *EncryptionDetails // The three-level (fully qualified) name of the volume - FullName string `json:"full_name,omitempty"` + // Wire name: 'full_name' + FullName string // The unique identifier of the metastore - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The name of the volume - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The identifier of the user who owns the volume - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // The name of the schema where the volume is - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // The storage location on the cloud - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // The identifier of the user who updated the volume last time - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string // The unique identifier of the volume - VolumeId string `json:"volume_id,omitempty"` + // Wire name: 'volume_id' + VolumeId string // The type of the volume. An external volume is located in the specified // external location. A managed volume is located in the default location // which is specified by the parent schema, or the parent catalog, or the // Metastore. [Learn more] // // [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external - VolumeType VolumeType `json:"volume_type,omitempty"` + // Wire name: 'volume_type' + VolumeType VolumeType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *VolumeInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *VolumeInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &volumeInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := volumeInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s VolumeInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st VolumeInfo) MarshalJSON() ([]byte, error) { + pb, err := volumeInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of the volume. An external volume is located in the specified @@ -6550,6 +14160,7 @@ func (s VolumeInfo) MarshalJSON() ([]byte, error) { // // [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external type VolumeType string +type volumeTypePb string const VolumeTypeExternal VolumeType = `EXTERNAL` @@ -6576,16 +14187,60 @@ func (f *VolumeType) Type() string { return "VolumeType" } +func volumeTypeToPb(st *VolumeType) (*volumeTypePb, error) { + if st == nil { + return nil, nil + } + pb := volumeTypePb(*st) + return &pb, nil +} + +func volumeTypeFromPb(pb *volumeTypePb) (*VolumeType, error) { + if pb == nil { + return nil, nil + } + st := VolumeType(*pb) + return &st, nil +} + type WorkspaceBinding struct { // One of READ_WRITE/READ_ONLY. Default is READ_WRITE. - BindingType WorkspaceBindingBindingType `json:"binding_type,omitempty"` + // Wire name: 'binding_type' + BindingType WorkspaceBindingBindingType // Required - WorkspaceId int64 `json:"workspace_id"` + // Wire name: 'workspace_id' + WorkspaceId int64 +} + +func (st *WorkspaceBinding) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceBindingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceBindingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WorkspaceBinding) MarshalJSON() ([]byte, error) { + pb, err := workspaceBindingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` // enum in `credentials_common.proto`. type WorkspaceBindingBindingType string +type workspaceBindingBindingTypePb string const WorkspaceBindingBindingTypeBindingTypeReadOnly WorkspaceBindingBindingType = `BINDING_TYPE_READ_ONLY` @@ -6611,3 +14266,73 @@ func (f *WorkspaceBindingBindingType) Set(v string) error { func (f *WorkspaceBindingBindingType) Type() string { return "WorkspaceBindingBindingType" } + +func workspaceBindingBindingTypeToPb(st *WorkspaceBindingBindingType) (*workspaceBindingBindingTypePb, error) { + if st == nil { + return nil, nil + } + pb := workspaceBindingBindingTypePb(*st) + return &pb, nil +} + +func workspaceBindingBindingTypeFromPb(pb *workspaceBindingBindingTypePb) (*WorkspaceBindingBindingType, error) { + if pb == nil { + return nil, nil + } + st := WorkspaceBindingBindingType(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/cleanrooms/impl.go b/service/cleanrooms/impl.go index 9132d6140..2320de3aa 100755 --- a/service/cleanrooms/impl.go +++ b/service/cleanrooms/impl.go @@ -18,34 +18,96 @@ type cleanRoomAssetsImpl struct { } func (a *cleanRoomAssetsImpl) Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) { - var cleanRoomAsset CleanRoomAsset - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + + requestPb, pbErr := createCleanRoomAssetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomAssetPb cleanRoomAssetPb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", requestPb.CleanRoomName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Asset, &cleanRoomAsset) - return &cleanRoomAsset, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Asset, + &cleanRoomAssetPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomAssetFromPb(&cleanRoomAssetPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cleanRoomAssetsImpl) Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error { - var deleteCleanRoomAssetResponse DeleteCleanRoomAssetResponse - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + + requestPb, pbErr := deleteCleanRoomAssetRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteCleanRoomAssetResponsePb deleteCleanRoomAssetResponsePb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", requestPb.CleanRoomName, requestPb.AssetType, requestPb.AssetFullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCleanRoomAssetResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteCleanRoomAssetResponsePb, + ) + if err != nil { + return err + } + return err } func (a *cleanRoomAssetsImpl) Get(ctx context.Context, request GetCleanRoomAssetRequest) (*CleanRoomAsset, error) { - var cleanRoomAsset CleanRoomAsset - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + + requestPb, pbErr := getCleanRoomAssetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomAssetPb cleanRoomAssetPb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", requestPb.CleanRoomName, requestPb.AssetType, requestPb.AssetFullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cleanRoomAsset) - return &cleanRoomAsset, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &cleanRoomAssetPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomAssetFromPb(&cleanRoomAssetPb) + if err != nil { + return nil, err + } + + return resp, err } // List assets. @@ -80,24 +142,68 @@ func (a *cleanRoomAssetsImpl) ListAll(ctx context.Context, request ListCleanRoom } func (a *cleanRoomAssetsImpl) internalList(ctx context.Context, request ListCleanRoomAssetsRequest) (*ListCleanRoomAssetsResponse, error) { - var listCleanRoomAssetsResponse ListCleanRoomAssetsResponse - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + + requestPb, pbErr := listCleanRoomAssetsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listCleanRoomAssetsResponsePb listCleanRoomAssetsResponsePb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", requestPb.CleanRoomName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomAssetsResponse) - return &listCleanRoomAssetsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listCleanRoomAssetsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCleanRoomAssetsResponseFromPb(&listCleanRoomAssetsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cleanRoomAssetsImpl) Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) { - var cleanRoomAsset CleanRoomAsset - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.Name) + + requestPb, pbErr := updateCleanRoomAssetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomAssetPb cleanRoomAssetPb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", requestPb.CleanRoomName, requestPb.AssetType, requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Asset, &cleanRoomAsset) - return &cleanRoomAsset, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Asset, + &cleanRoomAssetPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomAssetFromPb(&cleanRoomAssetPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CleanRoomTaskRuns API methods @@ -141,13 +247,35 @@ func (a *cleanRoomTaskRunsImpl) ListAll(ctx context.Context, request ListCleanRo } func (a *cleanRoomTaskRunsImpl) internalList(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) (*ListCleanRoomNotebookTaskRunsResponse, error) { - var listCleanRoomNotebookTaskRunsResponse ListCleanRoomNotebookTaskRunsResponse - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/runs", request.CleanRoomName) + + requestPb, pbErr := listCleanRoomNotebookTaskRunsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listCleanRoomNotebookTaskRunsResponsePb listCleanRoomNotebookTaskRunsResponsePb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/runs", requestPb.CleanRoomName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomNotebookTaskRunsResponse) - return &listCleanRoomNotebookTaskRunsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listCleanRoomNotebookTaskRunsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCleanRoomNotebookTaskRunsResponseFromPb(&listCleanRoomNotebookTaskRunsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CleanRooms API methods @@ -156,45 +284,129 @@ type cleanRoomsImpl struct { } func (a *cleanRoomsImpl) Create(ctx context.Context, request CreateCleanRoomRequest) (*CleanRoom, error) { - var cleanRoom CleanRoom + + requestPb, pbErr := createCleanRoomRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomPb cleanRoomPb path := "/api/2.0/clean-rooms" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.CleanRoom, &cleanRoom) - return &cleanRoom, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).CleanRoom, + &cleanRoomPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomFromPb(&cleanRoomPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cleanRoomsImpl) CreateOutputCatalog(ctx context.Context, request CreateCleanRoomOutputCatalogRequest) (*CreateCleanRoomOutputCatalogResponse, error) { - var createCleanRoomOutputCatalogResponse CreateCleanRoomOutputCatalogResponse - path := fmt.Sprintf("/api/2.0/clean-rooms/%v/output-catalogs", request.CleanRoomName) + + requestPb, pbErr := createCleanRoomOutputCatalogRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createCleanRoomOutputCatalogResponsePb createCleanRoomOutputCatalogResponsePb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/output-catalogs", requestPb.CleanRoomName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.OutputCatalog, &createCleanRoomOutputCatalogResponse) - return &createCleanRoomOutputCatalogResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).OutputCatalog, + &createCleanRoomOutputCatalogResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createCleanRoomOutputCatalogResponseFromPb(&createCleanRoomOutputCatalogResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cleanRoomsImpl) Delete(ctx context.Context, request DeleteCleanRoomRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + + requestPb, pbErr := deleteCleanRoomRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *cleanRoomsImpl) Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoom, error) { - var cleanRoom CleanRoom - path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + + requestPb, pbErr := getCleanRoomRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomPb cleanRoomPb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cleanRoom) - return &cleanRoom, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &cleanRoomPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomFromPb(&cleanRoomPb) + if err != nil { + return nil, err + } + + return resp, err } // List clean rooms. @@ -235,22 +447,66 @@ func (a *cleanRoomsImpl) ListAll(ctx context.Context, request ListCleanRoomsRequ } func (a *cleanRoomsImpl) internalList(ctx context.Context, request ListCleanRoomsRequest) (*ListCleanRoomsResponse, error) { - var listCleanRoomsResponse ListCleanRoomsResponse + + requestPb, pbErr := listCleanRoomsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listCleanRoomsResponsePb listCleanRoomsResponsePb path := "/api/2.0/clean-rooms" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomsResponse) - return &listCleanRoomsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listCleanRoomsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCleanRoomsResponseFromPb(&listCleanRoomsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cleanRoomsImpl) Update(ctx context.Context, request UpdateCleanRoomRequest) (*CleanRoom, error) { - var cleanRoom CleanRoom - path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + + requestPb, pbErr := updateCleanRoomRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cleanRoomPb cleanRoomPb + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &cleanRoom) - return &cleanRoom, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &cleanRoomPb, + ) + if err != nil { + return nil, err + } + resp, err := cleanRoomFromPb(&cleanRoomPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/cleanrooms/internal.go b/service/cleanrooms/internal.go new file mode 100755 index 000000000..44e2592b9 --- /dev/null +++ b/service/cleanrooms/internal.go @@ -0,0 +1,1450 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package cleanrooms + +import ( + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/databricks/databricks-sdk-go/service/sharing" +) + +func cleanRoomToPb(st *CleanRoom) (*cleanRoomPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomPb{} + pb.AccessRestricted = st.AccessRestricted + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.LocalCollaboratorAlias = st.LocalCollaboratorAlias + + pb.Name = st.Name + + pb.OutputCatalog = st.OutputCatalog + + pb.Owner = st.Owner + + pb.RemoteDetailedInfo = st.RemoteDetailedInfo + + pb.Status = st.Status + + pb.UpdatedAt = st.UpdatedAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomPb struct { + AccessRestricted CleanRoomAccessRestricted `json:"access_restricted,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + LocalCollaboratorAlias string `json:"local_collaborator_alias,omitempty"` + + Name string `json:"name,omitempty"` + + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` + + Owner string `json:"owner,omitempty"` + + RemoteDetailedInfo *CleanRoomRemoteDetail `json:"remote_detailed_info,omitempty"` + + Status CleanRoomStatusEnum `json:"status,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomFromPb(pb *cleanRoomPb) (*CleanRoom, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoom{} + st.AccessRestricted = pb.AccessRestricted + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.LocalCollaboratorAlias = pb.LocalCollaboratorAlias + st.Name = pb.Name + st.OutputCatalog = pb.OutputCatalog + st.Owner = pb.Owner + st.RemoteDetailedInfo = pb.RemoteDetailedInfo + st.Status = pb.Status + st.UpdatedAt = pb.UpdatedAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetToPb(st *CleanRoomAsset) (*cleanRoomAssetPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetPb{} + pb.AddedAt = st.AddedAt + + pb.AssetType = st.AssetType + + pb.ForeignTable = st.ForeignTable + + pb.ForeignTableLocalDetails = st.ForeignTableLocalDetails + + pb.Name = st.Name + + pb.Notebook = st.Notebook + + pb.OwnerCollaboratorAlias = st.OwnerCollaboratorAlias + + pb.Status = st.Status + + pb.Table = st.Table + + pb.TableLocalDetails = st.TableLocalDetails + + pb.View = st.View + + pb.ViewLocalDetails = st.ViewLocalDetails + + pb.VolumeLocalDetails = st.VolumeLocalDetails + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetPb struct { + AddedAt int64 `json:"added_at,omitempty"` + + AssetType CleanRoomAssetAssetType `json:"asset_type,omitempty"` + + ForeignTable *CleanRoomAssetForeignTable `json:"foreign_table,omitempty"` + + ForeignTableLocalDetails *CleanRoomAssetForeignTableLocalDetails `json:"foreign_table_local_details,omitempty"` + + Name string `json:"name,omitempty"` + + Notebook *CleanRoomAssetNotebook `json:"notebook,omitempty"` + + OwnerCollaboratorAlias string `json:"owner_collaborator_alias,omitempty"` + + Status CleanRoomAssetStatusEnum `json:"status,omitempty"` + + Table *CleanRoomAssetTable `json:"table,omitempty"` + + TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` + + View *CleanRoomAssetView `json:"view,omitempty"` + + ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` + + VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails `json:"volume_local_details,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetFromPb(pb *cleanRoomAssetPb) (*CleanRoomAsset, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAsset{} + st.AddedAt = pb.AddedAt + st.AssetType = pb.AssetType + st.ForeignTable = pb.ForeignTable + st.ForeignTableLocalDetails = pb.ForeignTableLocalDetails + st.Name = pb.Name + st.Notebook = pb.Notebook + st.OwnerCollaboratorAlias = pb.OwnerCollaboratorAlias + st.Status = pb.Status + st.Table = pb.Table + st.TableLocalDetails = pb.TableLocalDetails + st.View = pb.View + st.ViewLocalDetails = pb.ViewLocalDetails + st.VolumeLocalDetails = pb.VolumeLocalDetails + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetForeignTableToPb(st *CleanRoomAssetForeignTable) (*cleanRoomAssetForeignTablePb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetForeignTablePb{} + pb.Columns = st.Columns + + return pb, nil +} + +type cleanRoomAssetForeignTablePb struct { + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +func cleanRoomAssetForeignTableFromPb(pb *cleanRoomAssetForeignTablePb) (*CleanRoomAssetForeignTable, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetForeignTable{} + st.Columns = pb.Columns + + return st, nil +} + +func cleanRoomAssetForeignTableLocalDetailsToPb(st *CleanRoomAssetForeignTableLocalDetails) (*cleanRoomAssetForeignTableLocalDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetForeignTableLocalDetailsPb{} + pb.LocalName = st.LocalName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetForeignTableLocalDetailsPb struct { + LocalName string `json:"local_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetForeignTableLocalDetailsFromPb(pb *cleanRoomAssetForeignTableLocalDetailsPb) (*CleanRoomAssetForeignTableLocalDetails, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetForeignTableLocalDetails{} + st.LocalName = pb.LocalName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetForeignTableLocalDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetForeignTableLocalDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetNotebookToPb(st *CleanRoomAssetNotebook) (*cleanRoomAssetNotebookPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetNotebookPb{} + pb.Etag = st.Etag + + pb.NotebookContent = st.NotebookContent + + pb.ReviewState = st.ReviewState + + pb.Reviews = st.Reviews + + pb.RunnerCollaboratorAliases = st.RunnerCollaboratorAliases + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetNotebookPb struct { + Etag string `json:"etag,omitempty"` + + NotebookContent string `json:"notebook_content,omitempty"` + + ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + + Reviews []CleanRoomNotebookReview `json:"reviews,omitempty"` + + RunnerCollaboratorAliases []string `json:"runner_collaborator_aliases,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetNotebookFromPb(pb *cleanRoomAssetNotebookPb) (*CleanRoomAssetNotebook, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetNotebook{} + st.Etag = pb.Etag + st.NotebookContent = pb.NotebookContent + st.ReviewState = pb.ReviewState + st.Reviews = pb.Reviews + st.RunnerCollaboratorAliases = pb.RunnerCollaboratorAliases + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetNotebookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetNotebookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetTableToPb(st *CleanRoomAssetTable) (*cleanRoomAssetTablePb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetTablePb{} + pb.Columns = st.Columns + + return pb, nil +} + +type cleanRoomAssetTablePb struct { + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +func cleanRoomAssetTableFromPb(pb *cleanRoomAssetTablePb) (*CleanRoomAssetTable, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetTable{} + st.Columns = pb.Columns + + return st, nil +} + +func cleanRoomAssetTableLocalDetailsToPb(st *CleanRoomAssetTableLocalDetails) (*cleanRoomAssetTableLocalDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetTableLocalDetailsPb{} + pb.LocalName = st.LocalName + + pb.Partitions = st.Partitions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetTableLocalDetailsPb struct { + LocalName string `json:"local_name,omitempty"` + + Partitions []sharing.Partition `json:"partitions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetTableLocalDetailsFromPb(pb *cleanRoomAssetTableLocalDetailsPb) (*CleanRoomAssetTableLocalDetails, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetTableLocalDetails{} + st.LocalName = pb.LocalName + st.Partitions = pb.Partitions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetTableLocalDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetTableLocalDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetViewToPb(st *CleanRoomAssetView) (*cleanRoomAssetViewPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetViewPb{} + pb.Columns = st.Columns + + return pb, nil +} + +type cleanRoomAssetViewPb struct { + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +func cleanRoomAssetViewFromPb(pb *cleanRoomAssetViewPb) (*CleanRoomAssetView, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetView{} + st.Columns = pb.Columns + + return st, nil +} + +func cleanRoomAssetViewLocalDetailsToPb(st *CleanRoomAssetViewLocalDetails) (*cleanRoomAssetViewLocalDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetViewLocalDetailsPb{} + pb.LocalName = st.LocalName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetViewLocalDetailsPb struct { + LocalName string `json:"local_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetViewLocalDetailsFromPb(pb *cleanRoomAssetViewLocalDetailsPb) (*CleanRoomAssetViewLocalDetails, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetViewLocalDetails{} + st.LocalName = pb.LocalName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetViewLocalDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetViewLocalDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomAssetVolumeLocalDetailsToPb(st *CleanRoomAssetVolumeLocalDetails) (*cleanRoomAssetVolumeLocalDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomAssetVolumeLocalDetailsPb{} + pb.LocalName = st.LocalName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomAssetVolumeLocalDetailsPb struct { + LocalName string `json:"local_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomAssetVolumeLocalDetailsFromPb(pb *cleanRoomAssetVolumeLocalDetailsPb) (*CleanRoomAssetVolumeLocalDetails, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomAssetVolumeLocalDetails{} + st.LocalName = pb.LocalName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomAssetVolumeLocalDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomAssetVolumeLocalDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomCollaboratorToPb(st *CleanRoomCollaborator) (*cleanRoomCollaboratorPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomCollaboratorPb{} + pb.CollaboratorAlias = st.CollaboratorAlias + + pb.DisplayName = st.DisplayName + + pb.GlobalMetastoreId = st.GlobalMetastoreId + + pb.InviteRecipientEmail = st.InviteRecipientEmail + + pb.InviteRecipientWorkspaceId = st.InviteRecipientWorkspaceId + + pb.OrganizationName = st.OrganizationName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomCollaboratorPb struct { + CollaboratorAlias string `json:"collaborator_alias"` + + DisplayName string `json:"display_name,omitempty"` + + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + + InviteRecipientEmail string `json:"invite_recipient_email,omitempty"` + + InviteRecipientWorkspaceId int64 `json:"invite_recipient_workspace_id,omitempty"` + + OrganizationName string `json:"organization_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomCollaboratorFromPb(pb *cleanRoomCollaboratorPb) (*CleanRoomCollaborator, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomCollaborator{} + st.CollaboratorAlias = pb.CollaboratorAlias + st.DisplayName = pb.DisplayName + st.GlobalMetastoreId = pb.GlobalMetastoreId + st.InviteRecipientEmail = pb.InviteRecipientEmail + st.InviteRecipientWorkspaceId = pb.InviteRecipientWorkspaceId + st.OrganizationName = pb.OrganizationName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomCollaboratorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomCollaboratorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomNotebookReviewToPb(st *CleanRoomNotebookReview) (*cleanRoomNotebookReviewPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomNotebookReviewPb{} + pb.Comment = st.Comment + + pb.CreatedAtMillis = st.CreatedAtMillis + + pb.ReviewState = st.ReviewState + + pb.ReviewSubReason = st.ReviewSubReason + + pb.ReviewerCollaboratorAlias = st.ReviewerCollaboratorAlias + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomNotebookReviewPb struct { + Comment string `json:"comment,omitempty"` + + CreatedAtMillis int64 `json:"created_at_millis,omitempty"` + + ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + + ReviewSubReason CleanRoomNotebookReviewNotebookReviewSubReason `json:"review_sub_reason,omitempty"` + + ReviewerCollaboratorAlias string `json:"reviewer_collaborator_alias,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomNotebookReviewFromPb(pb *cleanRoomNotebookReviewPb) (*CleanRoomNotebookReview, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomNotebookReview{} + st.Comment = pb.Comment + st.CreatedAtMillis = pb.CreatedAtMillis + st.ReviewState = pb.ReviewState + st.ReviewSubReason = pb.ReviewSubReason + st.ReviewerCollaboratorAlias = pb.ReviewerCollaboratorAlias + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomNotebookReviewPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomNotebookReviewPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomNotebookTaskRunToPb(st *CleanRoomNotebookTaskRun) (*cleanRoomNotebookTaskRunPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomNotebookTaskRunPb{} + pb.CollaboratorJobRunInfo = st.CollaboratorJobRunInfo + + pb.NotebookEtag = st.NotebookEtag + + pb.NotebookJobRunState = st.NotebookJobRunState + + pb.NotebookName = st.NotebookName + + pb.NotebookUpdatedAt = st.NotebookUpdatedAt + + pb.OutputSchemaExpirationTime = st.OutputSchemaExpirationTime + + pb.OutputSchemaName = st.OutputSchemaName + + pb.RunDuration = st.RunDuration + + pb.StartTime = st.StartTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomNotebookTaskRunPb struct { + CollaboratorJobRunInfo *CollaboratorJobRunInfo `json:"collaborator_job_run_info,omitempty"` + + NotebookEtag string `json:"notebook_etag,omitempty"` + + NotebookJobRunState *jobs.CleanRoomTaskRunState `json:"notebook_job_run_state,omitempty"` + + NotebookName string `json:"notebook_name,omitempty"` + + NotebookUpdatedAt int64 `json:"notebook_updated_at,omitempty"` + + OutputSchemaExpirationTime int64 `json:"output_schema_expiration_time,omitempty"` + + OutputSchemaName string `json:"output_schema_name,omitempty"` + + RunDuration int64 `json:"run_duration,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomNotebookTaskRunFromPb(pb *cleanRoomNotebookTaskRunPb) (*CleanRoomNotebookTaskRun, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomNotebookTaskRun{} + st.CollaboratorJobRunInfo = pb.CollaboratorJobRunInfo + st.NotebookEtag = pb.NotebookEtag + st.NotebookJobRunState = pb.NotebookJobRunState + st.NotebookName = pb.NotebookName + st.NotebookUpdatedAt = pb.NotebookUpdatedAt + st.OutputSchemaExpirationTime = pb.OutputSchemaExpirationTime + st.OutputSchemaName = pb.OutputSchemaName + st.RunDuration = pb.RunDuration + st.StartTime = pb.StartTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomNotebookTaskRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomNotebookTaskRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomOutputCatalogToPb(st *CleanRoomOutputCatalog) (*cleanRoomOutputCatalogPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomOutputCatalogPb{} + pb.CatalogName = st.CatalogName + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomOutputCatalogPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + Status CleanRoomOutputCatalogOutputCatalogStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomOutputCatalogFromPb(pb *cleanRoomOutputCatalogPb) (*CleanRoomOutputCatalog, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomOutputCatalog{} + st.CatalogName = pb.CatalogName + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomOutputCatalogPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomOutputCatalogPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomRemoteDetailToPb(st *CleanRoomRemoteDetail) (*cleanRoomRemoteDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomRemoteDetailPb{} + pb.CentralCleanRoomId = st.CentralCleanRoomId + + pb.CloudVendor = st.CloudVendor + + pb.Collaborators = st.Collaborators + + pb.ComplianceSecurityProfile = st.ComplianceSecurityProfile + + pb.Creator = st.Creator + + pb.EgressNetworkPolicy = st.EgressNetworkPolicy + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomRemoteDetailPb struct { + CentralCleanRoomId string `json:"central_clean_room_id,omitempty"` + + CloudVendor string `json:"cloud_vendor,omitempty"` + + Collaborators []CleanRoomCollaborator `json:"collaborators,omitempty"` + + ComplianceSecurityProfile *ComplianceSecurityProfile `json:"compliance_security_profile,omitempty"` + + Creator *CleanRoomCollaborator `json:"creator,omitempty"` + + EgressNetworkPolicy *settings.EgressNetworkPolicy `json:"egress_network_policy,omitempty"` + + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomRemoteDetailFromPb(pb *cleanRoomRemoteDetailPb) (*CleanRoomRemoteDetail, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomRemoteDetail{} + st.CentralCleanRoomId = pb.CentralCleanRoomId + st.CloudVendor = pb.CloudVendor + st.Collaborators = pb.Collaborators + st.ComplianceSecurityProfile = pb.ComplianceSecurityProfile + st.Creator = pb.Creator + st.EgressNetworkPolicy = pb.EgressNetworkPolicy + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomRemoteDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomRemoteDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func collaboratorJobRunInfoToPb(st *CollaboratorJobRunInfo) (*collaboratorJobRunInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &collaboratorJobRunInfoPb{} + pb.CollaboratorAlias = st.CollaboratorAlias + + pb.CollaboratorJobId = st.CollaboratorJobId + + pb.CollaboratorJobRunId = st.CollaboratorJobRunId + + pb.CollaboratorTaskRunId = st.CollaboratorTaskRunId + + pb.CollaboratorWorkspaceId = st.CollaboratorWorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type collaboratorJobRunInfoPb struct { + CollaboratorAlias string `json:"collaborator_alias,omitempty"` + + CollaboratorJobId int64 `json:"collaborator_job_id,omitempty"` + + CollaboratorJobRunId int64 `json:"collaborator_job_run_id,omitempty"` + + CollaboratorTaskRunId int64 `json:"collaborator_task_run_id,omitempty"` + + CollaboratorWorkspaceId int64 `json:"collaborator_workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func collaboratorJobRunInfoFromPb(pb *collaboratorJobRunInfoPb) (*CollaboratorJobRunInfo, error) { + if pb == nil { + return nil, nil + } + st := &CollaboratorJobRunInfo{} + st.CollaboratorAlias = pb.CollaboratorAlias + st.CollaboratorJobId = pb.CollaboratorJobId + st.CollaboratorJobRunId = pb.CollaboratorJobRunId + st.CollaboratorTaskRunId = pb.CollaboratorTaskRunId + st.CollaboratorWorkspaceId = pb.CollaboratorWorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *collaboratorJobRunInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st collaboratorJobRunInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSecurityProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &complianceSecurityProfilePb{} + pb.ComplianceStandards = st.ComplianceStandards + + pb.IsEnabled = st.IsEnabled + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type complianceSecurityProfilePb struct { + ComplianceStandards []settings.ComplianceStandard `json:"compliance_standards,omitempty"` + + IsEnabled bool `json:"is_enabled,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func complianceSecurityProfileFromPb(pb *complianceSecurityProfilePb) (*ComplianceSecurityProfile, error) { + if pb == nil { + return nil, nil + } + st := &ComplianceSecurityProfile{} + st.ComplianceStandards = pb.ComplianceStandards + st.IsEnabled = pb.IsEnabled + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *complianceSecurityProfilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st complianceSecurityProfilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCleanRoomAssetRequestToPb(st *CreateCleanRoomAssetRequest) (*createCleanRoomAssetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCleanRoomAssetRequestPb{} + pb.Asset = st.Asset + + pb.CleanRoomName = st.CleanRoomName + + return pb, nil +} + +type createCleanRoomAssetRequestPb struct { + Asset CleanRoomAsset `json:"asset"` + + CleanRoomName string `json:"-" url:"-"` +} + +func createCleanRoomAssetRequestFromPb(pb *createCleanRoomAssetRequestPb) (*CreateCleanRoomAssetRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCleanRoomAssetRequest{} + st.Asset = pb.Asset + st.CleanRoomName = pb.CleanRoomName + + return st, nil +} + +func createCleanRoomOutputCatalogRequestToPb(st *CreateCleanRoomOutputCatalogRequest) (*createCleanRoomOutputCatalogRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCleanRoomOutputCatalogRequestPb{} + pb.CleanRoomName = st.CleanRoomName + + pb.OutputCatalog = st.OutputCatalog + + return pb, nil +} + +type createCleanRoomOutputCatalogRequestPb struct { + CleanRoomName string `json:"-" url:"-"` + + OutputCatalog CleanRoomOutputCatalog `json:"output_catalog"` +} + +func createCleanRoomOutputCatalogRequestFromPb(pb *createCleanRoomOutputCatalogRequestPb) (*CreateCleanRoomOutputCatalogRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCleanRoomOutputCatalogRequest{} + st.CleanRoomName = pb.CleanRoomName + st.OutputCatalog = pb.OutputCatalog + + return st, nil +} + +func createCleanRoomOutputCatalogResponseToPb(st *CreateCleanRoomOutputCatalogResponse) (*createCleanRoomOutputCatalogResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createCleanRoomOutputCatalogResponsePb{} + pb.OutputCatalog = st.OutputCatalog + + return pb, nil +} + +type createCleanRoomOutputCatalogResponsePb struct { + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` +} + +func createCleanRoomOutputCatalogResponseFromPb(pb *createCleanRoomOutputCatalogResponsePb) (*CreateCleanRoomOutputCatalogResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateCleanRoomOutputCatalogResponse{} + st.OutputCatalog = pb.OutputCatalog + + return st, nil +} + +func createCleanRoomRequestToPb(st *CreateCleanRoomRequest) (*createCleanRoomRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCleanRoomRequestPb{} + pb.CleanRoom = st.CleanRoom + + return pb, nil +} + +type createCleanRoomRequestPb struct { + CleanRoom CleanRoom `json:"clean_room"` +} + +func createCleanRoomRequestFromPb(pb *createCleanRoomRequestPb) (*CreateCleanRoomRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCleanRoomRequest{} + st.CleanRoom = pb.CleanRoom + + return st, nil +} + +func deleteCleanRoomAssetRequestToPb(st *DeleteCleanRoomAssetRequest) (*deleteCleanRoomAssetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCleanRoomAssetRequestPb{} + pb.AssetFullName = st.AssetFullName + + pb.AssetType = st.AssetType + + pb.CleanRoomName = st.CleanRoomName + + return pb, nil +} + +type deleteCleanRoomAssetRequestPb struct { + AssetFullName string `json:"-" url:"-"` + + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + + CleanRoomName string `json:"-" url:"-"` +} + +func deleteCleanRoomAssetRequestFromPb(pb *deleteCleanRoomAssetRequestPb) (*DeleteCleanRoomAssetRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCleanRoomAssetRequest{} + st.AssetFullName = pb.AssetFullName + st.AssetType = pb.AssetType + st.CleanRoomName = pb.CleanRoomName + + return st, nil +} + +func deleteCleanRoomAssetResponseToPb(st *DeleteCleanRoomAssetResponse) (*deleteCleanRoomAssetResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCleanRoomAssetResponsePb{} + + return pb, nil +} + +type deleteCleanRoomAssetResponsePb struct { +} + +func deleteCleanRoomAssetResponseFromPb(pb *deleteCleanRoomAssetResponsePb) (*DeleteCleanRoomAssetResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCleanRoomAssetResponse{} + + return st, nil +} + +func deleteCleanRoomRequestToPb(st *DeleteCleanRoomRequest) (*deleteCleanRoomRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCleanRoomRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteCleanRoomRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteCleanRoomRequestFromPb(pb *deleteCleanRoomRequestPb) (*DeleteCleanRoomRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCleanRoomRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func getCleanRoomAssetRequestToPb(st *GetCleanRoomAssetRequest) (*getCleanRoomAssetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCleanRoomAssetRequestPb{} + pb.AssetFullName = st.AssetFullName + + pb.AssetType = st.AssetType + + pb.CleanRoomName = st.CleanRoomName + + return pb, nil +} + +type getCleanRoomAssetRequestPb struct { + AssetFullName string `json:"-" url:"-"` + + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + + CleanRoomName string `json:"-" url:"-"` +} + +func getCleanRoomAssetRequestFromPb(pb *getCleanRoomAssetRequestPb) (*GetCleanRoomAssetRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCleanRoomAssetRequest{} + st.AssetFullName = pb.AssetFullName + st.AssetType = pb.AssetType + st.CleanRoomName = pb.CleanRoomName + + return st, nil +} + +func getCleanRoomRequestToPb(st *GetCleanRoomRequest) (*getCleanRoomRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCleanRoomRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getCleanRoomRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getCleanRoomRequestFromPb(pb *getCleanRoomRequestPb) (*GetCleanRoomRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCleanRoomRequest{} + st.Name = pb.Name + + return st, nil +} + +func listCleanRoomAssetsRequestToPb(st *ListCleanRoomAssetsRequest) (*listCleanRoomAssetsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomAssetsRequestPb{} + pb.CleanRoomName = st.CleanRoomName + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomAssetsRequestPb struct { + CleanRoomName string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomAssetsRequestFromPb(pb *listCleanRoomAssetsRequestPb) (*ListCleanRoomAssetsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomAssetsRequest{} + st.CleanRoomName = pb.CleanRoomName + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomAssetsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomAssetsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCleanRoomAssetsResponseToPb(st *ListCleanRoomAssetsResponse) (*listCleanRoomAssetsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomAssetsResponsePb{} + pb.Assets = st.Assets + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomAssetsResponsePb struct { + Assets []CleanRoomAsset `json:"assets,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomAssetsResponseFromPb(pb *listCleanRoomAssetsResponsePb) (*ListCleanRoomAssetsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomAssetsResponse{} + st.Assets = pb.Assets + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomAssetsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomAssetsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCleanRoomNotebookTaskRunsRequestToPb(st *ListCleanRoomNotebookTaskRunsRequest) (*listCleanRoomNotebookTaskRunsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomNotebookTaskRunsRequestPb{} + pb.CleanRoomName = st.CleanRoomName + + pb.NotebookName = st.NotebookName + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomNotebookTaskRunsRequestPb struct { + CleanRoomName string `json:"-" url:"-"` + + NotebookName string `json:"-" url:"notebook_name,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomNotebookTaskRunsRequestFromPb(pb *listCleanRoomNotebookTaskRunsRequestPb) (*ListCleanRoomNotebookTaskRunsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomNotebookTaskRunsRequest{} + st.CleanRoomName = pb.CleanRoomName + st.NotebookName = pb.NotebookName + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomNotebookTaskRunsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomNotebookTaskRunsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCleanRoomNotebookTaskRunsResponseToPb(st *ListCleanRoomNotebookTaskRunsResponse) (*listCleanRoomNotebookTaskRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomNotebookTaskRunsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Runs = st.Runs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomNotebookTaskRunsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Runs []CleanRoomNotebookTaskRun `json:"runs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomNotebookTaskRunsResponseFromPb(pb *listCleanRoomNotebookTaskRunsResponsePb) (*ListCleanRoomNotebookTaskRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomNotebookTaskRunsResponse{} + st.NextPageToken = pb.NextPageToken + st.Runs = pb.Runs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomNotebookTaskRunsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomNotebookTaskRunsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCleanRoomsRequestToPb(st *ListCleanRoomsRequest) (*listCleanRoomsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomsRequestFromPb(pb *listCleanRoomsRequestPb) (*ListCleanRoomsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCleanRoomsResponseToPb(st *ListCleanRoomsResponse) (*listCleanRoomsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCleanRoomsResponsePb{} + pb.CleanRooms = st.CleanRooms + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCleanRoomsResponsePb struct { + CleanRooms []CleanRoom `json:"clean_rooms,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCleanRoomsResponseFromPb(pb *listCleanRoomsResponsePb) (*ListCleanRoomsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCleanRoomsResponse{} + st.CleanRooms = pb.CleanRooms + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCleanRoomsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCleanRoomsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateCleanRoomAssetRequestToPb(st *UpdateCleanRoomAssetRequest) (*updateCleanRoomAssetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCleanRoomAssetRequestPb{} + pb.Asset = st.Asset + + pb.AssetType = st.AssetType + + pb.CleanRoomName = st.CleanRoomName + + pb.Name = st.Name + + return pb, nil +} + +type updateCleanRoomAssetRequestPb struct { + Asset CleanRoomAsset `json:"asset"` + + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + + CleanRoomName string `json:"-" url:"-"` + + Name string `json:"-" url:"-"` +} + +func updateCleanRoomAssetRequestFromPb(pb *updateCleanRoomAssetRequestPb) (*UpdateCleanRoomAssetRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCleanRoomAssetRequest{} + st.Asset = pb.Asset + st.AssetType = pb.AssetType + st.CleanRoomName = pb.CleanRoomName + st.Name = pb.Name + + return st, nil +} + +func updateCleanRoomRequestToPb(st *UpdateCleanRoomRequest) (*updateCleanRoomRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCleanRoomRequestPb{} + pb.CleanRoom = st.CleanRoom + + pb.Name = st.Name + + return pb, nil +} + +type updateCleanRoomRequestPb struct { + CleanRoom *CleanRoom `json:"clean_room,omitempty"` + + Name string `json:"-" url:"-"` +} + +func updateCleanRoomRequestFromPb(pb *updateCleanRoomRequestPb) (*UpdateCleanRoomRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCleanRoomRequest{} + st.CleanRoom = pb.CleanRoom + st.Name = pb.Name + + return st, nil +} diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index b51d9d7c8..7cb5ca182 100755 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -3,9 +3,11 @@ package cleanrooms import ( + "encoding/json" "fmt" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/jobs" "github.com/databricks/databricks-sdk-go/service/settings" @@ -16,46 +18,74 @@ type CleanRoom struct { // Whether clean room access is restricted due to [CSP] // // [CSP]: https://docs.databricks.com/en/security/privacy/security-profile.html - AccessRestricted CleanRoomAccessRestricted `json:"access_restricted,omitempty"` + // Wire name: 'access_restricted' + AccessRestricted CleanRoomAccessRestricted - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // When the clean room was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // The alias of the collaborator tied to the local clean room. - LocalCollaboratorAlias string `json:"local_collaborator_alias,omitempty"` + // Wire name: 'local_collaborator_alias' + LocalCollaboratorAlias string // The name of the clean room. It should follow [UC securable naming // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Output catalog of the clean room. It is an output only field. Output // catalog is manipulated using the separate CreateCleanRoomOutputCatalog // API. - OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` + // Wire name: 'output_catalog' + OutputCatalog *CleanRoomOutputCatalog // This is Databricks username of the owner of the local clean room // securable for permission management. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Central clean room details. During creation, users need to specify // cloud_vendor, region, and collaborators.global_metastore_id. This field // will not be filled in the ListCleanRooms call. - RemoteDetailedInfo *CleanRoomRemoteDetail `json:"remote_detailed_info,omitempty"` + // Wire name: 'remote_detailed_info' + RemoteDetailedInfo *CleanRoomRemoteDetail // Clean room status. - Status CleanRoomStatusEnum `json:"status,omitempty"` + // Wire name: 'status' + Status CleanRoomStatusEnum // When the clean room was last updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoom) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoom) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoom) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoom) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAccessRestricted string +type cleanRoomAccessRestrictedPb string const CleanRoomAccessRestrictedCspMismatch CleanRoomAccessRestricted = `CSP_MISMATCH` @@ -82,18 +112,38 @@ func (f *CleanRoomAccessRestricted) Type() string { return "CleanRoomAccessRestricted" } +func cleanRoomAccessRestrictedToPb(st *CleanRoomAccessRestricted) (*cleanRoomAccessRestrictedPb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomAccessRestrictedPb(*st) + return &pb, nil +} + +func cleanRoomAccessRestrictedFromPb(pb *cleanRoomAccessRestrictedPb) (*CleanRoomAccessRestricted, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomAccessRestricted(*pb) + return &st, nil +} + // Metadata of the clean room asset type CleanRoomAsset struct { // When the asset is added to the clean room, in epoch milliseconds. - AddedAt int64 `json:"added_at,omitempty"` + // Wire name: 'added_at' + AddedAt int64 // The type of the asset. - AssetType CleanRoomAssetAssetType `json:"asset_type,omitempty"` + // Wire name: 'asset_type' + AssetType CleanRoomAssetAssetType // Foreign table details available to all collaborators of the clean room. // Present if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTable *CleanRoomAssetForeignTable `json:"foreign_table,omitempty"` + // Wire name: 'foreign_table' + ForeignTable *CleanRoomAssetForeignTable // Local details for a foreign that are only available to its owner. Present // if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTableLocalDetails *CleanRoomAssetForeignTableLocalDetails `json:"foreign_table_local_details,omitempty"` + // Wire name: 'foreign_table_local_details' + ForeignTableLocalDetails *CleanRoomAssetForeignTableLocalDetails // A fully qualified name that uniquely identifies the asset within the // clean room. This is also the name displayed in the clean room UI. // @@ -101,42 +151,69 @@ type CleanRoomAsset struct { // *shared_catalog*.*shared_schema*.*asset_name* // // For notebooks, the name is the notebook file name. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Notebook details available to all collaborators of the clean room. // Present if and only if **asset_type** is **NOTEBOOK_FILE** - Notebook *CleanRoomAssetNotebook `json:"notebook,omitempty"` + // Wire name: 'notebook' + Notebook *CleanRoomAssetNotebook // The alias of the collaborator who owns this asset - OwnerCollaboratorAlias string `json:"owner_collaborator_alias,omitempty"` + // Wire name: 'owner_collaborator_alias' + OwnerCollaboratorAlias string // Status of the asset - Status CleanRoomAssetStatusEnum `json:"status,omitempty"` + // Wire name: 'status' + Status CleanRoomAssetStatusEnum // Table details available to all collaborators of the clean room. Present // if and only if **asset_type** is **TABLE** - Table *CleanRoomAssetTable `json:"table,omitempty"` + // Wire name: 'table' + Table *CleanRoomAssetTable // Local details for a table that are only available to its owner. Present // if and only if **asset_type** is **TABLE** - TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` + // Wire name: 'table_local_details' + TableLocalDetails *CleanRoomAssetTableLocalDetails // View details available to all collaborators of the clean room. Present if // and only if **asset_type** is **VIEW** - View *CleanRoomAssetView `json:"view,omitempty"` + // Wire name: 'view' + View *CleanRoomAssetView // Local details for a view that are only available to its owner. Present if // and only if **asset_type** is **VIEW** - ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` + // Wire name: 'view_local_details' + ViewLocalDetails *CleanRoomAssetViewLocalDetails // Local details for a volume that are only available to its owner. Present // if and only if **asset_type** is **VOLUME** - VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails `json:"volume_local_details,omitempty"` + // Wire name: 'volume_local_details' + VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAsset) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAsset) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAsset) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAsset) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetAssetType string +type cleanRoomAssetAssetTypePb string const CleanRoomAssetAssetTypeForeignTable CleanRoomAssetAssetType = `FOREIGN_TABLE` @@ -169,52 +246,135 @@ func (f *CleanRoomAssetAssetType) Type() string { return "CleanRoomAssetAssetType" } +func cleanRoomAssetAssetTypeToPb(st *CleanRoomAssetAssetType) (*cleanRoomAssetAssetTypePb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomAssetAssetTypePb(*st) + return &pb, nil +} + +func cleanRoomAssetAssetTypeFromPb(pb *cleanRoomAssetAssetTypePb) (*CleanRoomAssetAssetType, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomAssetAssetType(*pb) + return &st, nil +} + type CleanRoomAssetForeignTable struct { // The metadata information of the columns in the foreign table - Columns []catalog.ColumnInfo `json:"columns,omitempty"` + // Wire name: 'columns' + Columns []catalog.ColumnInfo +} + +func (st *CleanRoomAssetForeignTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetForeignTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetForeignTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CleanRoomAssetForeignTable) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetForeignTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetForeignTableLocalDetails struct { // The fully qualified name of the foreign table in its owner's local // metastore, in the format of *catalog*.*schema*.*foreign_table_name* - LocalName string `json:"local_name,omitempty"` + // Wire name: 'local_name' + LocalName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAssetForeignTableLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAssetForeignTableLocalDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetForeignTableLocalDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetForeignTableLocalDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAssetForeignTableLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAssetForeignTableLocalDetails) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetForeignTableLocalDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetNotebook struct { // Server generated etag that represents the notebook version. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Base 64 representation of the notebook contents. This is the same format // as returned by :method:workspace/export with the format of **HTML**. - NotebookContent string `json:"notebook_content,omitempty"` + // Wire name: 'notebook_content' + NotebookContent string // top-level status derived from all reviews - ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + // Wire name: 'review_state' + ReviewState CleanRoomNotebookReviewNotebookReviewState // All existing approvals or rejections - Reviews []CleanRoomNotebookReview `json:"reviews,omitempty"` + // Wire name: 'reviews' + Reviews []CleanRoomNotebookReview // collaborators that can run the notebook - RunnerCollaboratorAliases []string `json:"runner_collaborator_aliases,omitempty"` + // Wire name: 'runner_collaborator_aliases' + RunnerCollaboratorAliases []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAssetNotebook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAssetNotebook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetNotebookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetNotebookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAssetNotebook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAssetNotebook) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetNotebookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetStatusEnum string +type cleanRoomAssetStatusEnumPb string const CleanRoomAssetStatusEnumActive CleanRoomAssetStatusEnum = `ACTIVE` @@ -243,64 +403,187 @@ func (f *CleanRoomAssetStatusEnum) Type() string { return "CleanRoomAssetStatusEnum" } +func cleanRoomAssetStatusEnumToPb(st *CleanRoomAssetStatusEnum) (*cleanRoomAssetStatusEnumPb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomAssetStatusEnumPb(*st) + return &pb, nil +} + +func cleanRoomAssetStatusEnumFromPb(pb *cleanRoomAssetStatusEnumPb) (*CleanRoomAssetStatusEnum, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomAssetStatusEnum(*pb) + return &st, nil +} + type CleanRoomAssetTable struct { // The metadata information of the columns in the table - Columns []catalog.ColumnInfo `json:"columns,omitempty"` + // Wire name: 'columns' + Columns []catalog.ColumnInfo +} + +func (st *CleanRoomAssetTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CleanRoomAssetTable) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetTableLocalDetails struct { // The fully qualified name of the table in its owner's local metastore, in // the format of *catalog*.*schema*.*table_name* - LocalName string `json:"local_name,omitempty"` + // Wire name: 'local_name' + LocalName string // Partition filtering specification for a shared table. - Partitions []sharing.Partition `json:"partitions,omitempty"` + // Wire name: 'partitions' + Partitions []sharing.Partition - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAssetTableLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAssetTableLocalDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetTableLocalDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetTableLocalDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAssetTableLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAssetTableLocalDetails) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetTableLocalDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetView struct { // The metadata information of the columns in the view - Columns []catalog.ColumnInfo `json:"columns,omitempty"` + // Wire name: 'columns' + Columns []catalog.ColumnInfo +} + +func (st *CleanRoomAssetView) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetViewPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetViewFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CleanRoomAssetView) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetViewToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetViewLocalDetails struct { // The fully qualified name of the view in its owner's local metastore, in // the format of *catalog*.*schema*.*view_name* - LocalName string `json:"local_name,omitempty"` + // Wire name: 'local_name' + LocalName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAssetViewLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAssetViewLocalDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetViewLocalDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetViewLocalDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAssetViewLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAssetViewLocalDetails) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetViewLocalDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomAssetVolumeLocalDetails struct { // The fully qualified name of the volume in its owner's local metastore, in // the format of *catalog*.*schema*.*volume_name* - LocalName string `json:"local_name,omitempty"` + // Wire name: 'local_name' + LocalName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomAssetVolumeLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomAssetVolumeLocalDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomAssetVolumeLocalDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomAssetVolumeLocalDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomAssetVolumeLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomAssetVolumeLocalDetails) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomAssetVolumeLocalDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Publicly visible clean room collaborator. @@ -312,64 +595,110 @@ type CleanRoomCollaborator struct { // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CollaboratorAlias string `json:"collaborator_alias"` + // Wire name: 'collaborator_alias' + CollaboratorAlias string // Generated display name for the collaborator. In the case of a single // metastore clean room, it is the clean room name. For x-metastore clean // rooms, it is the organization name of the metastore. It is not restricted // to these values and could change in the future - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // The global Unity Catalog metastore id of the collaborator. The identifier // is of format cloud:region:metastore-uuid. - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + // Wire name: 'global_metastore_id' + GlobalMetastoreId string // Email of the user who is receiving the clean room "invitation". It should // be empty for the creator of the clean room, and non-empty for the // invitees of the clean room. It is only returned in the output when clean // room creator calls GET - InviteRecipientEmail string `json:"invite_recipient_email,omitempty"` + // Wire name: 'invite_recipient_email' + InviteRecipientEmail string // Workspace ID of the user who is receiving the clean room "invitation". // Must be specified if invite_recipient_email is specified. It should be // empty when the collaborator is the creator of the clean room. - InviteRecipientWorkspaceId int64 `json:"invite_recipient_workspace_id,omitempty"` + // Wire name: 'invite_recipient_workspace_id' + InviteRecipientWorkspaceId int64 // [Organization // name](:method:metastores/list#metastores-delta_sharing_organization_name) // configured in the metastore - OrganizationName string `json:"organization_name,omitempty"` + // Wire name: 'organization_name' + OrganizationName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomCollaborator) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomCollaborator) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomCollaboratorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomCollaboratorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomCollaborator) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomCollaborator) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomCollaboratorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomNotebookReview struct { // review comment - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // timestamp of when the review was submitted - CreatedAtMillis int64 `json:"created_at_millis,omitempty"` + // Wire name: 'created_at_millis' + CreatedAtMillis int64 // review outcome - ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + // Wire name: 'review_state' + ReviewState CleanRoomNotebookReviewNotebookReviewState // specified when the review was not explicitly made by a user - ReviewSubReason CleanRoomNotebookReviewNotebookReviewSubReason `json:"review_sub_reason,omitempty"` + // Wire name: 'review_sub_reason' + ReviewSubReason CleanRoomNotebookReviewNotebookReviewSubReason // collaborator alias of the reviewer - ReviewerCollaboratorAlias string `json:"reviewer_collaborator_alias,omitempty"` + // Wire name: 'reviewer_collaborator_alias' + ReviewerCollaboratorAlias string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomNotebookReview) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomNotebookReview) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomNotebookReviewPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomNotebookReviewFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomNotebookReview) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomNotebookReview) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomNotebookReviewToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomNotebookReviewNotebookReviewState string +type cleanRoomNotebookReviewNotebookReviewStatePb string const CleanRoomNotebookReviewNotebookReviewStateApproved CleanRoomNotebookReviewNotebookReviewState = `APPROVED` @@ -398,7 +727,24 @@ func (f *CleanRoomNotebookReviewNotebookReviewState) Type() string { return "CleanRoomNotebookReviewNotebookReviewState" } +func cleanRoomNotebookReviewNotebookReviewStateToPb(st *CleanRoomNotebookReviewNotebookReviewState) (*cleanRoomNotebookReviewNotebookReviewStatePb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomNotebookReviewNotebookReviewStatePb(*st) + return &pb, nil +} + +func cleanRoomNotebookReviewNotebookReviewStateFromPb(pb *cleanRoomNotebookReviewNotebookReviewStatePb) (*CleanRoomNotebookReviewNotebookReviewState, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomNotebookReviewNotebookReviewState(*pb) + return &st, nil +} + type CleanRoomNotebookReviewNotebookReviewSubReason string +type cleanRoomNotebookReviewNotebookReviewSubReasonPb string const CleanRoomNotebookReviewNotebookReviewSubReasonAutoApproved CleanRoomNotebookReviewNotebookReviewSubReason = `AUTO_APPROVED` @@ -425,42 +771,84 @@ func (f *CleanRoomNotebookReviewNotebookReviewSubReason) Type() string { return "CleanRoomNotebookReviewNotebookReviewSubReason" } +func cleanRoomNotebookReviewNotebookReviewSubReasonToPb(st *CleanRoomNotebookReviewNotebookReviewSubReason) (*cleanRoomNotebookReviewNotebookReviewSubReasonPb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomNotebookReviewNotebookReviewSubReasonPb(*st) + return &pb, nil +} + +func cleanRoomNotebookReviewNotebookReviewSubReasonFromPb(pb *cleanRoomNotebookReviewNotebookReviewSubReasonPb) (*CleanRoomNotebookReviewNotebookReviewSubReason, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomNotebookReviewNotebookReviewSubReason(*pb) + return &st, nil +} + // Stores information about a single task run. type CleanRoomNotebookTaskRun struct { // Job run info of the task in the runner's local workspace. This field is // only included in the LIST API. if the task was run within the same // workspace the API is being called. If the task run was in a different // workspace under the same metastore, only the workspace_id is included. - CollaboratorJobRunInfo *CollaboratorJobRunInfo `json:"collaborator_job_run_info,omitempty"` + // Wire name: 'collaborator_job_run_info' + CollaboratorJobRunInfo *CollaboratorJobRunInfo // Etag of the notebook executed in this task run, used to identify the // notebook version. - NotebookEtag string `json:"notebook_etag,omitempty"` + // Wire name: 'notebook_etag' + NotebookEtag string // State of the task run. - NotebookJobRunState *jobs.CleanRoomTaskRunState `json:"notebook_job_run_state,omitempty"` + // Wire name: 'notebook_job_run_state' + NotebookJobRunState *jobs.CleanRoomTaskRunState // Asset name of the notebook executed in this task run. - NotebookName string `json:"notebook_name,omitempty"` + // Wire name: 'notebook_name' + NotebookName string // The timestamp of when the notebook was last updated. - NotebookUpdatedAt int64 `json:"notebook_updated_at,omitempty"` + // Wire name: 'notebook_updated_at' + NotebookUpdatedAt int64 // Expiration time of the output schema of the task run (if any), in epoch // milliseconds. - OutputSchemaExpirationTime int64 `json:"output_schema_expiration_time,omitempty"` + // Wire name: 'output_schema_expiration_time' + OutputSchemaExpirationTime int64 // Name of the output schema associated with the clean rooms notebook task // run. - OutputSchemaName string `json:"output_schema_name,omitempty"` + // Wire name: 'output_schema_name' + OutputSchemaName string // Duration of the task run, in milliseconds. - RunDuration int64 `json:"run_duration,omitempty"` + // Wire name: 'run_duration' + RunDuration int64 // When the task run started, in epoch milliseconds. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomNotebookTaskRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomNotebookTaskRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomNotebookTaskRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomNotebookTaskRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomNotebookTaskRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomNotebookTaskRun) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomNotebookTaskRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomOutputCatalog struct { @@ -468,22 +856,42 @@ type CleanRoomOutputCatalog struct { // naming requirements]. The field will always exist if status is CREATED. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string - Status CleanRoomOutputCatalogOutputCatalogStatus `json:"status,omitempty"` + // Wire name: 'status' + Status CleanRoomOutputCatalogOutputCatalogStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomOutputCatalog) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomOutputCatalog) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomOutputCatalogPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomOutputCatalogFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomOutputCatalog) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomOutputCatalog) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomOutputCatalogToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomOutputCatalogOutputCatalogStatus string +type cleanRoomOutputCatalogOutputCatalogStatusPb string const CleanRoomOutputCatalogOutputCatalogStatusCreated CleanRoomOutputCatalogOutputCatalogStatus = `CREATED` @@ -512,12 +920,30 @@ func (f *CleanRoomOutputCatalogOutputCatalogStatus) Type() string { return "CleanRoomOutputCatalogOutputCatalogStatus" } +func cleanRoomOutputCatalogOutputCatalogStatusToPb(st *CleanRoomOutputCatalogOutputCatalogStatus) (*cleanRoomOutputCatalogOutputCatalogStatusPb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomOutputCatalogOutputCatalogStatusPb(*st) + return &pb, nil +} + +func cleanRoomOutputCatalogOutputCatalogStatusFromPb(pb *cleanRoomOutputCatalogOutputCatalogStatusPb) (*CleanRoomOutputCatalogOutputCatalogStatus, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomOutputCatalogOutputCatalogStatus(*pb) + return &st, nil +} + // Publicly visible central clean room details. type CleanRoomRemoteDetail struct { // Central clean room ID. - CentralCleanRoomId string `json:"central_clean_room_id,omitempty"` + // Wire name: 'central_clean_room_id' + CentralCleanRoomId string // Cloud vendor (aws,azure,gcp) of the central clean room. - CloudVendor string `json:"cloud_vendor,omitempty"` + // Wire name: 'cloud_vendor' + CloudVendor string // Collaborators in the central clean room. There should one and only one // collaborator in the list that satisfies the owner condition: // @@ -525,29 +951,52 @@ type CleanRoomRemoteDetail struct { // CreateCleanRoom). // // 2. Its invite_recipient_email is empty. - Collaborators []CleanRoomCollaborator `json:"collaborators,omitempty"` + // Wire name: 'collaborators' + Collaborators []CleanRoomCollaborator // The compliance security profile used to process regulated data following // compliance standards. - ComplianceSecurityProfile *ComplianceSecurityProfile `json:"compliance_security_profile,omitempty"` + // Wire name: 'compliance_security_profile' + ComplianceSecurityProfile *ComplianceSecurityProfile // Collaborator who creates the clean room. - Creator *CleanRoomCollaborator `json:"creator,omitempty"` + // Wire name: 'creator' + Creator *CleanRoomCollaborator // Egress network policy to apply to the central clean room workspace. - EgressNetworkPolicy *settings.EgressNetworkPolicy `json:"egress_network_policy,omitempty"` + // Wire name: 'egress_network_policy' + EgressNetworkPolicy *settings.EgressNetworkPolicy // Region of the central clean room. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomRemoteDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomRemoteDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomRemoteDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomRemoteDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomRemoteDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomRemoteDetail) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomRemoteDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomStatusEnum string +type cleanRoomStatusEnumPb string const CleanRoomStatusEnumActive CleanRoomStatusEnum = `ACTIVE` @@ -578,27 +1027,65 @@ func (f *CleanRoomStatusEnum) Type() string { return "CleanRoomStatusEnum" } +func cleanRoomStatusEnumToPb(st *CleanRoomStatusEnum) (*cleanRoomStatusEnumPb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomStatusEnumPb(*st) + return &pb, nil +} + +func cleanRoomStatusEnumFromPb(pb *cleanRoomStatusEnumPb) (*CleanRoomStatusEnum, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomStatusEnum(*pb) + return &st, nil +} + type CollaboratorJobRunInfo struct { // Alias of the collaborator that triggered the task run. - CollaboratorAlias string `json:"collaborator_alias,omitempty"` + // Wire name: 'collaborator_alias' + CollaboratorAlias string // Job ID of the task run in the collaborator's workspace. - CollaboratorJobId int64 `json:"collaborator_job_id,omitempty"` + // Wire name: 'collaborator_job_id' + CollaboratorJobId int64 // Job run ID of the task run in the collaborator's workspace. - CollaboratorJobRunId int64 `json:"collaborator_job_run_id,omitempty"` + // Wire name: 'collaborator_job_run_id' + CollaboratorJobRunId int64 // Task run ID of the task run in the collaborator's workspace. - CollaboratorTaskRunId int64 `json:"collaborator_task_run_id,omitempty"` + // Wire name: 'collaborator_task_run_id' + CollaboratorTaskRunId int64 // ID of the collaborator's workspace that triggered the task run. - CollaboratorWorkspaceId int64 `json:"collaborator_workspace_id,omitempty"` + // Wire name: 'collaborator_workspace_id' + CollaboratorWorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CollaboratorJobRunInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CollaboratorJobRunInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &collaboratorJobRunInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := collaboratorJobRunInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CollaboratorJobRunInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CollaboratorJobRunInfo) MarshalJSON() ([]byte, error) { + pb, err := collaboratorJobRunInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The compliance security profile used to process regulated data following @@ -606,55 +1093,210 @@ func (s CollaboratorJobRunInfo) MarshalJSON() ([]byte, error) { type ComplianceSecurityProfile struct { // The list of compliance standards that the compliance security profile is // configured to enforce. - ComplianceStandards []settings.ComplianceStandard `json:"compliance_standards,omitempty"` + // Wire name: 'compliance_standards' + ComplianceStandards []settings.ComplianceStandard // Whether the compliance security profile is enabled. - IsEnabled bool `json:"is_enabled,omitempty"` + // Wire name: 'is_enabled' + IsEnabled bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &complianceSecurityProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := complianceSecurityProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { + pb, err := complianceSecurityProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an asset type CreateCleanRoomAssetRequest struct { // Metadata of the clean room asset - Asset CleanRoomAsset `json:"asset"` + // Wire name: 'asset' + Asset CleanRoomAsset // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` +} + +func (st *CreateCleanRoomAssetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCleanRoomAssetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCleanRoomAssetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + pb, err := createCleanRoomAssetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an output catalog type CreateCleanRoomOutputCatalogRequest struct { // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` - OutputCatalog CleanRoomOutputCatalog `json:"output_catalog"` + // Wire name: 'output_catalog' + OutputCatalog CleanRoomOutputCatalog +} + +func (st *CreateCleanRoomOutputCatalogRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCleanRoomOutputCatalogRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCleanRoomOutputCatalogRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCleanRoomOutputCatalogRequest) MarshalJSON() ([]byte, error) { + pb, err := createCleanRoomOutputCatalogRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCleanRoomOutputCatalogResponse struct { - OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` + + // Wire name: 'output_catalog' + OutputCatalog *CleanRoomOutputCatalog +} + +func (st *CreateCleanRoomOutputCatalogResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCleanRoomOutputCatalogResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCleanRoomOutputCatalogResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCleanRoomOutputCatalogResponse) MarshalJSON() ([]byte, error) { + pb, err := createCleanRoomOutputCatalogResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a clean room type CreateCleanRoomRequest struct { - CleanRoom CleanRoom `json:"clean_room"` + + // Wire name: 'clean_room' + CleanRoom CleanRoom +} + +func (st *CreateCleanRoomRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCleanRoomRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCleanRoomRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCleanRoomRequest) MarshalJSON() ([]byte, error) { + pb, err := createCleanRoomRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an asset type DeleteCleanRoomAssetRequest struct { // The fully qualified name of the asset, it is same as the name field in // CleanRoomAsset. - AssetFullName string `json:"-" url:"-"` + // Wire name: 'asset_full_name' + AssetFullName string `tf:"-"` // The type of the asset. - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Wire name: 'asset_type' + AssetType CleanRoomAssetAssetType `tf:"-"` // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` +} + +func (st *DeleteCleanRoomAssetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCleanRoomAssetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCleanRoomAssetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCleanRoomAssetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Response for delete clean room request. Using an empty message since the @@ -662,155 +1304,406 @@ type DeleteCleanRoomAssetRequest struct { type DeleteCleanRoomAssetResponse struct { } +func (st *DeleteCleanRoomAssetResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCleanRoomAssetResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCleanRoomAssetResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCleanRoomAssetResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteCleanRoomAssetResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a clean room type DeleteCleanRoomRequest struct { // Name of the clean room. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteCleanRoomRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCleanRoomRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCleanRoomRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCleanRoomRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCleanRoomRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get an asset type GetCleanRoomAssetRequest struct { // The fully qualified name of the asset, it is same as the name field in // CleanRoomAsset. - AssetFullName string `json:"-" url:"-"` + // Wire name: 'asset_full_name' + AssetFullName string `tf:"-"` // The type of the asset. - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Wire name: 'asset_type' + AssetType CleanRoomAssetAssetType `tf:"-"` // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` +} + +func (st *GetCleanRoomAssetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCleanRoomAssetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCleanRoomAssetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + pb, err := getCleanRoomAssetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a clean room type GetCleanRoomRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetCleanRoomRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCleanRoomRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCleanRoomRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCleanRoomRequest) MarshalJSON() ([]byte, error) { + pb, err := getCleanRoomRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List assets type ListCleanRoomAssetsRequest struct { // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomAssetsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomAssetsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomAssetsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomAssetsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomAssetsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomAssetsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomAssetsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListCleanRoomAssetsResponse struct { // Assets in the clean room. - Assets []CleanRoomAsset `json:"assets,omitempty"` + // Wire name: 'assets' + Assets []CleanRoomAsset // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomAssetsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomAssetsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomAssetsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomAssetsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomAssetsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomAssetsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomAssetsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List notebook task runs type ListCleanRoomNotebookTaskRunsRequest struct { // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` // Notebook name - NotebookName string `json:"-" url:"notebook_name,omitempty"` + // Wire name: 'notebook_name' + NotebookName string `tf:"-"` // The maximum number of task runs to return. Currently ignored - all runs // will be returned. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomNotebookTaskRunsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomNotebookTaskRunsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomNotebookTaskRunsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomNotebookTaskRunsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomNotebookTaskRunsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomNotebookTaskRunsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomNotebookTaskRunsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListCleanRoomNotebookTaskRunsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Name of the clean room. - Runs []CleanRoomNotebookTaskRun `json:"runs,omitempty"` + // Wire name: 'runs' + Runs []CleanRoomNotebookTaskRun - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomNotebookTaskRunsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomNotebookTaskRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomNotebookTaskRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomNotebookTaskRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomNotebookTaskRunsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomNotebookTaskRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomNotebookTaskRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List clean rooms type ListCleanRoomsRequest struct { // Maximum number of clean rooms to return (i.e., the page length). Defaults // to 100. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListCleanRoomsResponse struct { - CleanRooms []CleanRoom `json:"clean_rooms,omitempty"` + + // Wire name: 'clean_rooms' + CleanRooms []CleanRoom // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListCleanRoomsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCleanRoomsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCleanRoomsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCleanRoomsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCleanRoomsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCleanRoomsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCleanRoomsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update an asset type UpdateCleanRoomAssetRequest struct { // Metadata of the clean room asset - Asset CleanRoomAsset `json:"asset"` + // Wire name: 'asset' + Asset CleanRoomAsset // The type of the asset. - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Wire name: 'asset_type' + AssetType CleanRoomAssetAssetType `tf:"-"` // Name of the clean room. - CleanRoomName string `json:"-" url:"-"` + // Wire name: 'clean_room_name' + CleanRoomName string `tf:"-"` // A fully qualified name that uniquely identifies the asset within the // clean room. This is also the name displayed in the clean room UI. // @@ -818,11 +1711,119 @@ type UpdateCleanRoomAssetRequest struct { // *shared_catalog*.*shared_schema*.*asset_name* // // For notebooks, the name is the notebook file name. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *UpdateCleanRoomAssetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCleanRoomAssetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCleanRoomAssetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + pb, err := updateCleanRoomAssetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCleanRoomRequest struct { - CleanRoom *CleanRoom `json:"clean_room,omitempty"` + + // Wire name: 'clean_room' + CleanRoom *CleanRoom // Name of the clean room. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *UpdateCleanRoomRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCleanRoomRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCleanRoomRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCleanRoomRequest) MarshalJSON() ([]byte, error) { + pb, err := updateCleanRoomRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/compute/impl.go b/service/compute/impl.go index f81423ec6..d1a55f3b9 100755 --- a/service/compute/impl.go +++ b/service/compute/impl.go @@ -18,66 +18,190 @@ type clusterPoliciesImpl struct { } func (a *clusterPoliciesImpl) Create(ctx context.Context, request CreatePolicy) (*CreatePolicyResponse, error) { - var createPolicyResponse CreatePolicyResponse + + requestPb, pbErr := createPolicyToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createPolicyResponsePb createPolicyResponsePb path := "/api/2.0/policies/clusters/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPolicyResponse) - return &createPolicyResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createPolicyResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createPolicyResponseFromPb(&createPolicyResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clusterPoliciesImpl) Delete(ctx context.Context, request DeletePolicy) error { - var deletePolicyResponse DeletePolicyResponse + + requestPb, pbErr := deletePolicyToPb(&request) + if pbErr != nil { + return pbErr + } + + var deletePolicyResponsePb deletePolicyResponsePb path := "/api/2.0/policies/clusters/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deletePolicyResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deletePolicyResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clusterPoliciesImpl) Edit(ctx context.Context, request EditPolicy) error { - var editPolicyResponse EditPolicyResponse + + requestPb, pbErr := editPolicyToPb(&request) + if pbErr != nil { + return pbErr + } + + var editPolicyResponsePb editPolicyResponsePb path := "/api/2.0/policies/clusters/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editPolicyResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &editPolicyResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clusterPoliciesImpl) Get(ctx context.Context, request GetClusterPolicyRequest) (*Policy, error) { - var policy Policy + + requestPb, pbErr := getClusterPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var policyPb policyPb path := "/api/2.0/policies/clusters/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &policy) - return &policy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &policyPb, + ) + if err != nil { + return nil, err + } + resp, err := policyFromPb(&policyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clusterPoliciesImpl) GetPermissionLevels(ctx context.Context, request GetClusterPolicyPermissionLevelsRequest) (*GetClusterPolicyPermissionLevelsResponse, error) { - var getClusterPolicyPermissionLevelsResponse GetClusterPolicyPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v/permissionLevels", request.ClusterPolicyId) + + requestPb, pbErr := getClusterPolicyPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getClusterPolicyPermissionLevelsResponsePb getClusterPolicyPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v/permissionLevels", requestPb.ClusterPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterPolicyPermissionLevelsResponse) - return &getClusterPolicyPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getClusterPolicyPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getClusterPolicyPermissionLevelsResponseFromPb(&getClusterPolicyPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clusterPoliciesImpl) GetPermissions(ctx context.Context, request GetClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { - var clusterPolicyPermissions ClusterPolicyPermissions - path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + + requestPb, pbErr := getClusterPolicyPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPolicyPermissionsPb clusterPolicyPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", requestPb.ClusterPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterPolicyPermissions) - return &clusterPolicyPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &clusterPolicyPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPolicyPermissionsFromPb(&clusterPolicyPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List cluster policies. @@ -110,35 +234,101 @@ func (a *clusterPoliciesImpl) ListAll(ctx context.Context, request ListClusterPo } func (a *clusterPoliciesImpl) internalList(ctx context.Context, request ListClusterPoliciesRequest) (*ListPoliciesResponse, error) { - var listPoliciesResponse ListPoliciesResponse + + requestPb, pbErr := listClusterPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listPoliciesResponsePb listPoliciesResponsePb path := "/api/2.0/policies/clusters/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPoliciesResponse) - return &listPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listPoliciesResponseFromPb(&listPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clusterPoliciesImpl) SetPermissions(ctx context.Context, request ClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { - var clusterPolicyPermissions ClusterPolicyPermissions - path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + + requestPb, pbErr := clusterPolicyPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPolicyPermissionsPb clusterPolicyPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", requestPb.ClusterPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &clusterPolicyPermissions) - return &clusterPolicyPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &clusterPolicyPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPolicyPermissionsFromPb(&clusterPolicyPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clusterPoliciesImpl) UpdatePermissions(ctx context.Context, request ClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { - var clusterPolicyPermissions ClusterPolicyPermissions - path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + + requestPb, pbErr := clusterPolicyPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPolicyPermissionsPb clusterPolicyPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", requestPb.ClusterPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &clusterPolicyPermissions) - return &clusterPolicyPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &clusterPolicyPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPolicyPermissionsFromPb(&clusterPolicyPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Clusters API methods @@ -147,46 +337,122 @@ type clustersImpl struct { } func (a *clustersImpl) ChangeOwner(ctx context.Context, request ChangeClusterOwner) error { - var changeClusterOwnerResponse ChangeClusterOwnerResponse + + requestPb, pbErr := changeClusterOwnerToPb(&request) + if pbErr != nil { + return pbErr + } + + var changeClusterOwnerResponsePb changeClusterOwnerResponsePb path := "/api/2.1/clusters/change-owner" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &changeClusterOwnerResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &changeClusterOwnerResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Create(ctx context.Context, request CreateCluster) (*CreateClusterResponse, error) { - var createClusterResponse CreateClusterResponse + + requestPb, pbErr := createClusterToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createClusterResponsePb createClusterResponsePb path := "/api/2.1/clusters/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createClusterResponse) - return &createClusterResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createClusterResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createClusterResponseFromPb(&createClusterResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) Delete(ctx context.Context, request DeleteCluster) error { - var deleteClusterResponse DeleteClusterResponse + + requestPb, pbErr := deleteClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteClusterResponsePb deleteClusterResponsePb path := "/api/2.1/clusters/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Edit(ctx context.Context, request EditCluster) error { - var editClusterResponse EditClusterResponse + + requestPb, pbErr := editClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var editClusterResponsePb editClusterResponsePb path := "/api/2.1/clusters/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &editClusterResponsePb, + ) + if err != nil { + return err + } + return err } @@ -232,44 +498,132 @@ func (a *clustersImpl) EventsAll(ctx context.Context, request GetEvents) ([]Clus } func (a *clustersImpl) internalEvents(ctx context.Context, request GetEvents) (*GetEventsResponse, error) { - var getEventsResponse GetEventsResponse + + requestPb, pbErr := getEventsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getEventsResponsePb getEventsResponsePb path := "/api/2.1/clusters/events" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &getEventsResponse) - return &getEventsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &getEventsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getEventsResponseFromPb(&getEventsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) Get(ctx context.Context, request GetClusterRequest) (*ClusterDetails, error) { - var clusterDetails ClusterDetails + + requestPb, pbErr := getClusterRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterDetailsPb clusterDetailsPb path := "/api/2.1/clusters/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterDetails) - return &clusterDetails, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &clusterDetailsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterDetailsFromPb(&clusterDetailsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) GetPermissionLevels(ctx context.Context, request GetClusterPermissionLevelsRequest) (*GetClusterPermissionLevelsResponse, error) { - var getClusterPermissionLevelsResponse GetClusterPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/clusters/%v/permissionLevels", request.ClusterId) + + requestPb, pbErr := getClusterPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getClusterPermissionLevelsResponsePb getClusterPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/clusters/%v/permissionLevels", requestPb.ClusterId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterPermissionLevelsResponse) - return &getClusterPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getClusterPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getClusterPermissionLevelsResponseFromPb(&getClusterPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) GetPermissions(ctx context.Context, request GetClusterPermissionsRequest) (*ClusterPermissions, error) { - var clusterPermissions ClusterPermissions - path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + + requestPb, pbErr := getClusterPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPermissionsPb clusterPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", requestPb.ClusterId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterPermissions) - return &clusterPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &clusterPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPermissionsFromPb(&clusterPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List clusters. @@ -312,142 +666,385 @@ func (a *clustersImpl) ListAll(ctx context.Context, request ListClustersRequest) } func (a *clustersImpl) internalList(ctx context.Context, request ListClustersRequest) (*ListClustersResponse, error) { - var listClustersResponse ListClustersResponse + + requestPb, pbErr := listClustersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listClustersResponsePb listClustersResponsePb path := "/api/2.1/clusters/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listClustersResponse) - return &listClustersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listClustersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listClustersResponseFromPb(&listClustersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) ListNodeTypes(ctx context.Context) (*ListNodeTypesResponse, error) { - var listNodeTypesResponse ListNodeTypesResponse + + var listNodeTypesResponsePb listNodeTypesResponsePb path := "/api/2.1/clusters/list-node-types" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listNodeTypesResponse) - return &listNodeTypesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listNodeTypesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listNodeTypesResponseFromPb(&listNodeTypesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) ListZones(ctx context.Context) (*ListAvailableZonesResponse, error) { - var listAvailableZonesResponse ListAvailableZonesResponse + + var listAvailableZonesResponsePb listAvailableZonesResponsePb path := "/api/2.1/clusters/list-zones" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listAvailableZonesResponse) - return &listAvailableZonesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listAvailableZonesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAvailableZonesResponseFromPb(&listAvailableZonesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error { - var permanentDeleteClusterResponse PermanentDeleteClusterResponse + + requestPb, pbErr := permanentDeleteClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var permanentDeleteClusterResponsePb permanentDeleteClusterResponsePb path := "/api/2.1/clusters/permanent-delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &permanentDeleteClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &permanentDeleteClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Pin(ctx context.Context, request PinCluster) error { - var pinClusterResponse PinClusterResponse + + requestPb, pbErr := pinClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var pinClusterResponsePb pinClusterResponsePb path := "/api/2.1/clusters/pin" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &pinClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &pinClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Resize(ctx context.Context, request ResizeCluster) error { - var resizeClusterResponse ResizeClusterResponse + + requestPb, pbErr := resizeClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var resizeClusterResponsePb resizeClusterResponsePb path := "/api/2.1/clusters/resize" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resizeClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &resizeClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Restart(ctx context.Context, request RestartCluster) error { - var restartClusterResponse RestartClusterResponse + + requestPb, pbErr := restartClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var restartClusterResponsePb restartClusterResponsePb path := "/api/2.1/clusters/restart" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restartClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &restartClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) SetPermissions(ctx context.Context, request ClusterPermissionsRequest) (*ClusterPermissions, error) { - var clusterPermissions ClusterPermissions - path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + + requestPb, pbErr := clusterPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPermissionsPb clusterPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", requestPb.ClusterId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &clusterPermissions) - return &clusterPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &clusterPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPermissionsFromPb(&clusterPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) SparkVersions(ctx context.Context) (*GetSparkVersionsResponse, error) { - var getSparkVersionsResponse GetSparkVersionsResponse + + var getSparkVersionsResponsePb getSparkVersionsResponsePb path := "/api/2.1/clusters/spark-versions" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getSparkVersionsResponse) - return &getSparkVersionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getSparkVersionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getSparkVersionsResponseFromPb(&getSparkVersionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *clustersImpl) Start(ctx context.Context, request StartCluster) error { - var startClusterResponse StartClusterResponse + + requestPb, pbErr := startClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var startClusterResponsePb startClusterResponsePb path := "/api/2.1/clusters/start" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &startClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &startClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Unpin(ctx context.Context, request UnpinCluster) error { - var unpinClusterResponse UnpinClusterResponse + + requestPb, pbErr := unpinClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var unpinClusterResponsePb unpinClusterResponsePb path := "/api/2.1/clusters/unpin" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &unpinClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &unpinClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) Update(ctx context.Context, request UpdateCluster) error { - var updateClusterResponse UpdateClusterResponse + + requestPb, pbErr := updateClusterToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateClusterResponsePb updateClusterResponsePb path := "/api/2.1/clusters/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateClusterResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &updateClusterResponsePb, + ) + if err != nil { + return err + } + return err } func (a *clustersImpl) UpdatePermissions(ctx context.Context, request ClusterPermissionsRequest) (*ClusterPermissions, error) { - var clusterPermissions ClusterPermissions - path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + + requestPb, pbErr := clusterPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterPermissionsPb clusterPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", requestPb.ClusterId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &clusterPermissions) - return &clusterPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &clusterPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterPermissionsFromPb(&clusterPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CommandExecution API methods @@ -456,67 +1053,191 @@ type commandExecutionImpl struct { } func (a *commandExecutionImpl) Cancel(ctx context.Context, request CancelCommand) error { - var cancelResponse CancelResponse + + requestPb, pbErr := cancelCommandToPb(&request) + if pbErr != nil { + return pbErr + } + + var cancelResponsePb cancelResponsePb path := "/api/1.2/commands/cancel" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &cancelResponsePb, + ) + if err != nil { + return err + } + return err } func (a *commandExecutionImpl) CommandStatus(ctx context.Context, request CommandStatusRequest) (*CommandStatusResponse, error) { - var commandStatusResponse CommandStatusResponse + + requestPb, pbErr := commandStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var commandStatusResponsePb commandStatusResponsePb path := "/api/1.2/commands/status" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &commandStatusResponse) - return &commandStatusResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &commandStatusResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := commandStatusResponseFromPb(&commandStatusResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *commandExecutionImpl) ContextStatus(ctx context.Context, request ContextStatusRequest) (*ContextStatusResponse, error) { - var contextStatusResponse ContextStatusResponse + + requestPb, pbErr := contextStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var contextStatusResponsePb contextStatusResponsePb path := "/api/1.2/contexts/status" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &contextStatusResponse) - return &contextStatusResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &contextStatusResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := contextStatusResponseFromPb(&contextStatusResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *commandExecutionImpl) Create(ctx context.Context, request CreateContext) (*Created, error) { - var created Created + + requestPb, pbErr := createContextToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createdPb createdPb path := "/api/1.2/contexts/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &created) - return &created, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createdPb, + ) + if err != nil { + return nil, err + } + resp, err := createdFromPb(&createdPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *commandExecutionImpl) Destroy(ctx context.Context, request DestroyContext) error { - var destroyResponse DestroyResponse + + requestPb, pbErr := destroyContextToPb(&request) + if pbErr != nil { + return pbErr + } + + var destroyResponsePb destroyResponsePb path := "/api/1.2/contexts/destroy" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &destroyResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &destroyResponsePb, + ) + if err != nil { + return err + } + return err } func (a *commandExecutionImpl) Execute(ctx context.Context, request Command) (*Created, error) { - var created Created + + requestPb, pbErr := commandToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createdPb createdPb path := "/api/1.2/commands/execute" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &created) - return &created, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createdPb, + ) + if err != nil { + return nil, err + } + resp, err := createdFromPb(&createdPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just GlobalInitScripts API methods @@ -525,34 +1246,96 @@ type globalInitScriptsImpl struct { } func (a *globalInitScriptsImpl) Create(ctx context.Context, request GlobalInitScriptCreateRequest) (*CreateResponse, error) { - var createResponse CreateResponse + + requestPb, pbErr := globalInitScriptCreateRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createResponsePb createResponsePb path := "/api/2.0/global-init-scripts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) - return &createResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createResponseFromPb(&createResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *globalInitScriptsImpl) Delete(ctx context.Context, request DeleteGlobalInitScriptRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + + requestPb, pbErr := deleteGlobalInitScriptRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", requestPb.ScriptId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *globalInitScriptsImpl) Get(ctx context.Context, request GetGlobalInitScriptRequest) (*GlobalInitScriptDetailsWithContent, error) { - var globalInitScriptDetailsWithContent GlobalInitScriptDetailsWithContent - path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + + requestPb, pbErr := getGlobalInitScriptRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var globalInitScriptDetailsWithContentPb globalInitScriptDetailsWithContentPb + path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", requestPb.ScriptId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &globalInitScriptDetailsWithContent) - return &globalInitScriptDetailsWithContent, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &globalInitScriptDetailsWithContentPb, + ) + if err != nil { + return nil, err + } + resp, err := globalInitScriptDetailsWithContentFromPb(&globalInitScriptDetailsWithContentPb) + if err != nil { + return nil, err + } + + return resp, err } // Get init scripts. @@ -592,23 +1375,58 @@ func (a *globalInitScriptsImpl) ListAll(ctx context.Context) ([]GlobalInitScript } func (a *globalInitScriptsImpl) internalList(ctx context.Context) (*ListGlobalInitScriptsResponse, error) { - var listGlobalInitScriptsResponse ListGlobalInitScriptsResponse + + var listGlobalInitScriptsResponsePb listGlobalInitScriptsResponsePb path := "/api/2.0/global-init-scripts" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listGlobalInitScriptsResponse) - return &listGlobalInitScriptsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listGlobalInitScriptsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listGlobalInitScriptsResponseFromPb(&listGlobalInitScriptsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *globalInitScriptsImpl) Update(ctx context.Context, request GlobalInitScriptUpdateRequest) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + + requestPb, pbErr := globalInitScriptUpdateRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", requestPb.ScriptId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -618,66 +1436,190 @@ type instancePoolsImpl struct { } func (a *instancePoolsImpl) Create(ctx context.Context, request CreateInstancePool) (*CreateInstancePoolResponse, error) { - var createInstancePoolResponse CreateInstancePoolResponse + + requestPb, pbErr := createInstancePoolToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createInstancePoolResponsePb createInstancePoolResponsePb path := "/api/2.0/instance-pools/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createInstancePoolResponse) - return &createInstancePoolResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createInstancePoolResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createInstancePoolResponseFromPb(&createInstancePoolResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instancePoolsImpl) Delete(ctx context.Context, request DeleteInstancePool) error { - var deleteInstancePoolResponse DeleteInstancePoolResponse + + requestPb, pbErr := deleteInstancePoolToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteInstancePoolResponsePb deleteInstancePoolResponsePb path := "/api/2.0/instance-pools/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteInstancePoolResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteInstancePoolResponsePb, + ) + if err != nil { + return err + } + return err } func (a *instancePoolsImpl) Edit(ctx context.Context, request EditInstancePool) error { - var editInstancePoolResponse EditInstancePoolResponse + + requestPb, pbErr := editInstancePoolToPb(&request) + if pbErr != nil { + return pbErr + } + + var editInstancePoolResponsePb editInstancePoolResponsePb path := "/api/2.0/instance-pools/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editInstancePoolResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &editInstancePoolResponsePb, + ) + if err != nil { + return err + } + return err } func (a *instancePoolsImpl) Get(ctx context.Context, request GetInstancePoolRequest) (*GetInstancePool, error) { - var getInstancePool GetInstancePool + + requestPb, pbErr := getInstancePoolRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getInstancePoolPb getInstancePoolPb path := "/api/2.0/instance-pools/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getInstancePool) - return &getInstancePool, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getInstancePoolPb, + ) + if err != nil { + return nil, err + } + resp, err := getInstancePoolFromPb(&getInstancePoolPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instancePoolsImpl) GetPermissionLevels(ctx context.Context, request GetInstancePoolPermissionLevelsRequest) (*GetInstancePoolPermissionLevelsResponse, error) { - var getInstancePoolPermissionLevelsResponse GetInstancePoolPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v/permissionLevels", request.InstancePoolId) + + requestPb, pbErr := getInstancePoolPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getInstancePoolPermissionLevelsResponsePb getInstancePoolPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v/permissionLevels", requestPb.InstancePoolId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getInstancePoolPermissionLevelsResponse) - return &getInstancePoolPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getInstancePoolPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getInstancePoolPermissionLevelsResponseFromPb(&getInstancePoolPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instancePoolsImpl) GetPermissions(ctx context.Context, request GetInstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { - var instancePoolPermissions InstancePoolPermissions - path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + + requestPb, pbErr := getInstancePoolPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var instancePoolPermissionsPb instancePoolPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", requestPb.InstancePoolId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &instancePoolPermissions) - return &instancePoolPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &instancePoolPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := instancePoolPermissionsFromPb(&instancePoolPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List instance pool info. @@ -711,35 +1653,96 @@ func (a *instancePoolsImpl) ListAll(ctx context.Context) ([]InstancePoolAndStats } func (a *instancePoolsImpl) internalList(ctx context.Context) (*ListInstancePools, error) { - var listInstancePools ListInstancePools + + var listInstancePoolsPb listInstancePoolsPb path := "/api/2.0/instance-pools/list" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listInstancePools) - return &listInstancePools, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listInstancePoolsPb, + ) + if err != nil { + return nil, err + } + resp, err := listInstancePoolsFromPb(&listInstancePoolsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instancePoolsImpl) SetPermissions(ctx context.Context, request InstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { - var instancePoolPermissions InstancePoolPermissions - path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + + requestPb, pbErr := instancePoolPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var instancePoolPermissionsPb instancePoolPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", requestPb.InstancePoolId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &instancePoolPermissions) - return &instancePoolPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &instancePoolPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := instancePoolPermissionsFromPb(&instancePoolPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instancePoolsImpl) UpdatePermissions(ctx context.Context, request InstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { - var instancePoolPermissions InstancePoolPermissions - path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + + requestPb, pbErr := instancePoolPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var instancePoolPermissionsPb instancePoolPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", requestPb.InstancePoolId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &instancePoolPermissions) - return &instancePoolPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &instancePoolPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := instancePoolPermissionsFromPb(&instancePoolPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just InstanceProfiles API methods @@ -748,24 +1751,60 @@ type instanceProfilesImpl struct { } func (a *instanceProfilesImpl) Add(ctx context.Context, request AddInstanceProfile) error { - var addResponse AddResponse + + requestPb, pbErr := addInstanceProfileToPb(&request) + if pbErr != nil { + return pbErr + } + + var addResponsePb addResponsePb path := "/api/2.0/instance-profiles/add" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &addResponsePb, + ) + if err != nil { + return err + } + return err } func (a *instanceProfilesImpl) Edit(ctx context.Context, request InstanceProfile) error { - var editResponse EditResponse + + requestPb, pbErr := instanceProfileToPb(&request) + if pbErr != nil { + return pbErr + } + + var editResponsePb editResponsePb path := "/api/2.0/instance-profiles/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &editResponsePb, + ) + if err != nil { + return err + } + return err } @@ -804,23 +1843,58 @@ func (a *instanceProfilesImpl) ListAll(ctx context.Context) ([]InstanceProfile, } func (a *instanceProfilesImpl) internalList(ctx context.Context) (*ListInstanceProfilesResponse, error) { - var listInstanceProfilesResponse ListInstanceProfilesResponse + + var listInstanceProfilesResponsePb listInstanceProfilesResponsePb path := "/api/2.0/instance-profiles/list" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listInstanceProfilesResponse) - return &listInstanceProfilesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listInstanceProfilesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listInstanceProfilesResponseFromPb(&listInstanceProfilesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *instanceProfilesImpl) Remove(ctx context.Context, request RemoveInstanceProfile) error { - var removeResponse RemoveResponse + + requestPb, pbErr := removeInstanceProfileToPb(&request) + if pbErr != nil { + return pbErr + } + + var removeResponsePb removeResponsePb path := "/api/2.0/instance-profiles/remove" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &removeResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &removeResponsePb, + ) + if err != nil { + return err + } + return err } @@ -862,13 +1936,30 @@ func (a *librariesImpl) AllClusterStatusesAll(ctx context.Context) ([]ClusterLib } func (a *librariesImpl) internalAllClusterStatuses(ctx context.Context) (*ListAllClusterLibraryStatusesResponse, error) { - var listAllClusterLibraryStatusesResponse ListAllClusterLibraryStatusesResponse + + var listAllClusterLibraryStatusesResponsePb listAllClusterLibraryStatusesResponsePb path := "/api/2.0/libraries/all-cluster-statuses" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listAllClusterLibraryStatusesResponse) - return &listAllClusterLibraryStatusesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listAllClusterLibraryStatusesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAllClusterLibraryStatusesResponseFromPb(&listAllClusterLibraryStatusesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get status. @@ -913,34 +2004,92 @@ func (a *librariesImpl) ClusterStatusAll(ctx context.Context, request ClusterSta } func (a *librariesImpl) internalClusterStatus(ctx context.Context, request ClusterStatus) (*ClusterLibraryStatuses, error) { - var clusterLibraryStatuses ClusterLibraryStatuses + + requestPb, pbErr := clusterStatusToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var clusterLibraryStatusesPb clusterLibraryStatusesPb path := "/api/2.0/libraries/cluster-status" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterLibraryStatuses) - return &clusterLibraryStatuses, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &clusterLibraryStatusesPb, + ) + if err != nil { + return nil, err + } + resp, err := clusterLibraryStatusesFromPb(&clusterLibraryStatusesPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *librariesImpl) Install(ctx context.Context, request InstallLibraries) error { - var installLibrariesResponse InstallLibrariesResponse + + requestPb, pbErr := installLibrariesToPb(&request) + if pbErr != nil { + return pbErr + } + + var installLibrariesResponsePb installLibrariesResponsePb path := "/api/2.0/libraries/install" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &installLibrariesResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &installLibrariesResponsePb, + ) + if err != nil { + return err + } + return err } func (a *librariesImpl) Uninstall(ctx context.Context, request UninstallLibraries) error { - var uninstallLibrariesResponse UninstallLibrariesResponse + + requestPb, pbErr := uninstallLibrariesToPb(&request) + if pbErr != nil { + return pbErr + } + + var uninstallLibrariesResponsePb uninstallLibrariesResponsePb path := "/api/2.0/libraries/uninstall" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &uninstallLibrariesResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &uninstallLibrariesResponsePb, + ) + if err != nil { + return err + } + return err } @@ -950,24 +2099,68 @@ type policyComplianceForClustersImpl struct { } func (a *policyComplianceForClustersImpl) EnforceCompliance(ctx context.Context, request EnforceClusterComplianceRequest) (*EnforceClusterComplianceResponse, error) { - var enforceClusterComplianceResponse EnforceClusterComplianceResponse + + requestPb, pbErr := enforceClusterComplianceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enforceClusterComplianceResponsePb enforceClusterComplianceResponsePb path := "/api/2.0/policies/clusters/enforce-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &enforceClusterComplianceResponse) - return &enforceClusterComplianceResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &enforceClusterComplianceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := enforceClusterComplianceResponseFromPb(&enforceClusterComplianceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *policyComplianceForClustersImpl) GetCompliance(ctx context.Context, request GetClusterComplianceRequest) (*GetClusterComplianceResponse, error) { - var getClusterComplianceResponse GetClusterComplianceResponse + + requestPb, pbErr := getClusterComplianceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getClusterComplianceResponsePb getClusterComplianceResponsePb path := "/api/2.0/policies/clusters/get-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterComplianceResponse) - return &getClusterComplianceResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getClusterComplianceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getClusterComplianceResponseFromPb(&getClusterComplianceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List cluster policy compliance. @@ -1010,13 +2203,35 @@ func (a *policyComplianceForClustersImpl) ListComplianceAll(ctx context.Context, } func (a *policyComplianceForClustersImpl) internalListCompliance(ctx context.Context, request ListClusterCompliancesRequest) (*ListClusterCompliancesResponse, error) { - var listClusterCompliancesResponse ListClusterCompliancesResponse + + requestPb, pbErr := listClusterCompliancesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listClusterCompliancesResponsePb listClusterCompliancesResponsePb path := "/api/2.0/policies/clusters/list-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listClusterCompliancesResponse) - return &listClusterCompliancesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listClusterCompliancesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listClusterCompliancesResponseFromPb(&listClusterCompliancesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just PolicyFamilies API methods @@ -1025,13 +2240,35 @@ type policyFamiliesImpl struct { } func (a *policyFamiliesImpl) Get(ctx context.Context, request GetPolicyFamilyRequest) (*PolicyFamily, error) { - var policyFamily PolicyFamily - path := fmt.Sprintf("/api/2.0/policy-families/%v", request.PolicyFamilyId) + + requestPb, pbErr := getPolicyFamilyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var policyFamilyPb policyFamilyPb + path := fmt.Sprintf("/api/2.0/policy-families/%v", requestPb.PolicyFamilyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &policyFamily) - return &policyFamily, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &policyFamilyPb, + ) + if err != nil { + return nil, err + } + resp, err := policyFamilyFromPb(&policyFamilyPb) + if err != nil { + return nil, err + } + + return resp, err } // List policy families. @@ -1072,11 +2309,33 @@ func (a *policyFamiliesImpl) ListAll(ctx context.Context, request ListPolicyFami } func (a *policyFamiliesImpl) internalList(ctx context.Context, request ListPolicyFamiliesRequest) (*ListPolicyFamiliesResponse, error) { - var listPolicyFamiliesResponse ListPolicyFamiliesResponse + + requestPb, pbErr := listPolicyFamiliesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listPolicyFamiliesResponsePb listPolicyFamiliesResponsePb path := "/api/2.0/policy-families" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPolicyFamiliesResponse) - return &listPolicyFamiliesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listPolicyFamiliesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listPolicyFamiliesResponseFromPb(&listPolicyFamiliesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/compute/internal.go b/service/compute/internal.go new file mode 100755 index 000000000..fc0a41265 --- /dev/null +++ b/service/compute/internal.go @@ -0,0 +1,8163 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package compute + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func addInstanceProfileToPb(st *AddInstanceProfile) (*addInstanceProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &addInstanceProfilePb{} + pb.IamRoleArn = st.IamRoleArn + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.IsMetaInstanceProfile = st.IsMetaInstanceProfile + + pb.SkipValidation = st.SkipValidation + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type addInstanceProfilePb struct { + IamRoleArn string `json:"iam_role_arn,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn"` + + IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + + SkipValidation bool `json:"skip_validation,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func addInstanceProfileFromPb(pb *addInstanceProfilePb) (*AddInstanceProfile, error) { + if pb == nil { + return nil, nil + } + st := &AddInstanceProfile{} + st.IamRoleArn = pb.IamRoleArn + st.InstanceProfileArn = pb.InstanceProfileArn + st.IsMetaInstanceProfile = pb.IsMetaInstanceProfile + st.SkipValidation = pb.SkipValidation + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *addInstanceProfilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st addInstanceProfilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func addResponseToPb(st *AddResponse) (*addResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &addResponsePb{} + + return pb, nil +} + +type addResponsePb struct { +} + +func addResponseFromPb(pb *addResponsePb) (*AddResponse, error) { + if pb == nil { + return nil, nil + } + st := &AddResponse{} + + return st, nil +} + +func adlsgen2InfoToPb(st *Adlsgen2Info) (*adlsgen2InfoPb, error) { + if st == nil { + return nil, nil + } + pb := &adlsgen2InfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type adlsgen2InfoPb struct { + Destination string `json:"destination"` +} + +func adlsgen2InfoFromPb(pb *adlsgen2InfoPb) (*Adlsgen2Info, error) { + if pb == nil { + return nil, nil + } + st := &Adlsgen2Info{} + st.Destination = pb.Destination + + return st, nil +} + +func autoScaleToPb(st *AutoScale) (*autoScalePb, error) { + if st == nil { + return nil, nil + } + pb := &autoScalePb{} + pb.MaxWorkers = st.MaxWorkers + + pb.MinWorkers = st.MinWorkers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type autoScalePb struct { + MaxWorkers int `json:"max_workers,omitempty"` + + MinWorkers int `json:"min_workers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func autoScaleFromPb(pb *autoScalePb) (*AutoScale, error) { + if pb == nil { + return nil, nil + } + st := &AutoScale{} + st.MaxWorkers = pb.MaxWorkers + st.MinWorkers = pb.MinWorkers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *autoScalePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st autoScalePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func awsAttributesToPb(st *AwsAttributes) (*awsAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &awsAttributesPb{} + pb.Availability = st.Availability + + pb.EbsVolumeCount = st.EbsVolumeCount + + pb.EbsVolumeIops = st.EbsVolumeIops + + pb.EbsVolumeSize = st.EbsVolumeSize + + pb.EbsVolumeThroughput = st.EbsVolumeThroughput + + pb.EbsVolumeType = st.EbsVolumeType + + pb.FirstOnDemand = st.FirstOnDemand + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.SpotBidPricePercent = st.SpotBidPricePercent + + pb.ZoneId = st.ZoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsAttributesPb struct { + Availability AwsAvailability `json:"availability,omitempty"` + + EbsVolumeCount int `json:"ebs_volume_count,omitempty"` + + EbsVolumeIops int `json:"ebs_volume_iops,omitempty"` + + EbsVolumeSize int `json:"ebs_volume_size,omitempty"` + + EbsVolumeThroughput int `json:"ebs_volume_throughput,omitempty"` + + EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` + + FirstOnDemand int `json:"first_on_demand,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + + ZoneId string `json:"zone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsAttributesFromPb(pb *awsAttributesPb) (*AwsAttributes, error) { + if pb == nil { + return nil, nil + } + st := &AwsAttributes{} + st.Availability = pb.Availability + st.EbsVolumeCount = pb.EbsVolumeCount + st.EbsVolumeIops = pb.EbsVolumeIops + st.EbsVolumeSize = pb.EbsVolumeSize + st.EbsVolumeThroughput = pb.EbsVolumeThroughput + st.EbsVolumeType = pb.EbsVolumeType + st.FirstOnDemand = pb.FirstOnDemand + st.InstanceProfileArn = pb.InstanceProfileArn + st.SpotBidPricePercent = pb.SpotBidPricePercent + st.ZoneId = pb.ZoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureAttributesToPb(st *AzureAttributes) (*azureAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &azureAttributesPb{} + pb.Availability = st.Availability + + pb.FirstOnDemand = st.FirstOnDemand + + pb.LogAnalyticsInfo = st.LogAnalyticsInfo + + pb.SpotBidMaxPrice = st.SpotBidMaxPrice + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureAttributesPb struct { + Availability AzureAvailability `json:"availability,omitempty"` + + FirstOnDemand int `json:"first_on_demand,omitempty"` + + LogAnalyticsInfo *LogAnalyticsInfo `json:"log_analytics_info,omitempty"` + + SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureAttributesFromPb(pb *azureAttributesPb) (*AzureAttributes, error) { + if pb == nil { + return nil, nil + } + st := &AzureAttributes{} + st.Availability = pb.Availability + st.FirstOnDemand = pb.FirstOnDemand + st.LogAnalyticsInfo = pb.LogAnalyticsInfo + st.SpotBidMaxPrice = pb.SpotBidMaxPrice + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelCommandToPb(st *CancelCommand) (*cancelCommandPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelCommandPb{} + pb.ClusterId = st.ClusterId + + pb.CommandId = st.CommandId + + pb.ContextId = st.ContextId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cancelCommandPb struct { + ClusterId string `json:"clusterId,omitempty"` + + CommandId string `json:"commandId,omitempty"` + + ContextId string `json:"contextId,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cancelCommandFromPb(pb *cancelCommandPb) (*CancelCommand, error) { + if pb == nil { + return nil, nil + } + st := &CancelCommand{} + st.ClusterId = pb.ClusterId + st.CommandId = pb.CommandId + st.ContextId = pb.ContextId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cancelCommandPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cancelCommandPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelResponseToPb(st *CancelResponse) (*cancelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelResponsePb{} + + return pb, nil +} + +type cancelResponsePb struct { +} + +func cancelResponseFromPb(pb *cancelResponsePb) (*CancelResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelResponse{} + + return st, nil +} + +func changeClusterOwnerToPb(st *ChangeClusterOwner) (*changeClusterOwnerPb, error) { + if st == nil { + return nil, nil + } + pb := &changeClusterOwnerPb{} + pb.ClusterId = st.ClusterId + + pb.OwnerUsername = st.OwnerUsername + + return pb, nil +} + +type changeClusterOwnerPb struct { + ClusterId string `json:"cluster_id"` + + OwnerUsername string `json:"owner_username"` +} + +func changeClusterOwnerFromPb(pb *changeClusterOwnerPb) (*ChangeClusterOwner, error) { + if pb == nil { + return nil, nil + } + st := &ChangeClusterOwner{} + st.ClusterId = pb.ClusterId + st.OwnerUsername = pb.OwnerUsername + + return st, nil +} + +func changeClusterOwnerResponseToPb(st *ChangeClusterOwnerResponse) (*changeClusterOwnerResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &changeClusterOwnerResponsePb{} + + return pb, nil +} + +type changeClusterOwnerResponsePb struct { +} + +func changeClusterOwnerResponseFromPb(pb *changeClusterOwnerResponsePb) (*ChangeClusterOwnerResponse, error) { + if pb == nil { + return nil, nil + } + st := &ChangeClusterOwnerResponse{} + + return st, nil +} + +func clientsTypesToPb(st *ClientsTypes) (*clientsTypesPb, error) { + if st == nil { + return nil, nil + } + pb := &clientsTypesPb{} + pb.Jobs = st.Jobs + + pb.Notebooks = st.Notebooks + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clientsTypesPb struct { + Jobs bool `json:"jobs,omitempty"` + + Notebooks bool `json:"notebooks,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clientsTypesFromPb(pb *clientsTypesPb) (*ClientsTypes, error) { + if pb == nil { + return nil, nil + } + st := &ClientsTypes{} + st.Jobs = pb.Jobs + st.Notebooks = pb.Notebooks + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clientsTypesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clientsTypesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cloneClusterToPb(st *CloneCluster) (*cloneClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &cloneClusterPb{} + pb.SourceClusterId = st.SourceClusterId + + return pb, nil +} + +type cloneClusterPb struct { + SourceClusterId string `json:"source_cluster_id"` +} + +func cloneClusterFromPb(pb *cloneClusterPb) (*CloneCluster, error) { + if pb == nil { + return nil, nil + } + st := &CloneCluster{} + st.SourceClusterId = pb.SourceClusterId + + return st, nil +} + +func cloudProviderNodeInfoToPb(st *CloudProviderNodeInfo) (*cloudProviderNodeInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &cloudProviderNodeInfoPb{} + pb.Status = st.Status + + return pb, nil +} + +type cloudProviderNodeInfoPb struct { + Status []CloudProviderNodeStatus `json:"status,omitempty"` +} + +func cloudProviderNodeInfoFromPb(pb *cloudProviderNodeInfoPb) (*CloudProviderNodeInfo, error) { + if pb == nil { + return nil, nil + } + st := &CloudProviderNodeInfo{} + st.Status = pb.Status + + return st, nil +} + +func clusterAccessControlRequestToPb(st *ClusterAccessControlRequest) (*clusterAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAccessControlRequestFromPb(pb *clusterAccessControlRequestPb) (*ClusterAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterAccessControlResponseToPb(st *ClusterAccessControlResponse) (*clusterAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAccessControlResponsePb struct { + AllPermissions []ClusterPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAccessControlResponseFromPb(pb *clusterAccessControlResponsePb) (*ClusterAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterAttributesToPb(st *ClusterAttributes) (*clusterAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAttributesPb{} + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterName = st.ClusterName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DockerImage = st.DockerImage + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.Kind = st.Kind + + pb.NodeTypeId = st.NodeTypeId + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.SshPublicKeys = st.SshPublicKeys + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAttributesPb struct { + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAttributesFromPb(pb *clusterAttributesPb) (*ClusterAttributes, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAttributes{} + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterName = pb.ClusterName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DockerImage = pb.DockerImage + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.Kind = pb.Kind + st.NodeTypeId = pb.NodeTypeId + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.SshPublicKeys = pb.SshPublicKeys + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterComplianceToPb(st *ClusterCompliance) (*clusterCompliancePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterCompliancePb{} + pb.ClusterId = st.ClusterId + + pb.IsCompliant = st.IsCompliant + + pb.Violations = st.Violations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterCompliancePb struct { + ClusterId string `json:"cluster_id"` + + IsCompliant bool `json:"is_compliant,omitempty"` + + Violations map[string]string `json:"violations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterComplianceFromPb(pb *clusterCompliancePb) (*ClusterCompliance, error) { + if pb == nil { + return nil, nil + } + st := &ClusterCompliance{} + st.ClusterId = pb.ClusterId + st.IsCompliant = pb.IsCompliant + st.Violations = pb.Violations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterCompliancePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterCompliancePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterDetailsToPb(st *ClusterDetails) (*clusterDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterDetailsPb{} + pb.Autoscale = st.Autoscale + + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterCores = st.ClusterCores + + pb.ClusterId = st.ClusterId + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterLogStatus = st.ClusterLogStatus + + pb.ClusterMemoryMb = st.ClusterMemoryMb + + pb.ClusterName = st.ClusterName + + pb.ClusterSource = st.ClusterSource + + pb.CreatorUserName = st.CreatorUserName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DefaultTags = st.DefaultTags + + pb.DockerImage = st.DockerImage + + pb.Driver = st.Driver + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.Executors = st.Executors + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.JdbcPort = st.JdbcPort + + pb.Kind = st.Kind + + pb.LastRestartedTime = st.LastRestartedTime + + pb.LastStateLossTime = st.LastStateLossTime + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkContextId = st.SparkContextId + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.Spec = st.Spec + + pb.SshPublicKeys = st.SshPublicKeys + + pb.StartTime = st.StartTime + + pb.State = st.State + + pb.StateMessage = st.StateMessage + + pb.TerminatedTime = st.TerminatedTime + + pb.TerminationReason = st.TerminationReason + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterDetailsPb struct { + Autoscale *AutoScale `json:"autoscale,omitempty"` + + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterCores float64 `json:"cluster_cores,omitempty"` + + ClusterId string `json:"cluster_id,omitempty"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterLogStatus *LogSyncStatus `json:"cluster_log_status,omitempty"` + + ClusterMemoryMb int64 `json:"cluster_memory_mb,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + ClusterSource ClusterSource `json:"cluster_source,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DefaultTags map[string]string `json:"default_tags,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + Driver *SparkNode `json:"driver,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + Executors []SparkNode `json:"executors,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + JdbcPort int `json:"jdbc_port,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + LastRestartedTime int64 `json:"last_restarted_time,omitempty"` + + LastStateLossTime int64 `json:"last_state_loss_time,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkContextId int64 `json:"spark_context_id,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version,omitempty"` + + Spec *ClusterSpec `json:"spec,omitempty"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + State State `json:"state,omitempty"` + + StateMessage string `json:"state_message,omitempty"` + + TerminatedTime int64 `json:"terminated_time,omitempty"` + + TerminationReason *TerminationReason `json:"termination_reason,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterDetailsFromPb(pb *clusterDetailsPb) (*ClusterDetails, error) { + if pb == nil { + return nil, nil + } + st := &ClusterDetails{} + st.Autoscale = pb.Autoscale + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterCores = pb.ClusterCores + st.ClusterId = pb.ClusterId + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterLogStatus = pb.ClusterLogStatus + st.ClusterMemoryMb = pb.ClusterMemoryMb + st.ClusterName = pb.ClusterName + st.ClusterSource = pb.ClusterSource + st.CreatorUserName = pb.CreatorUserName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DefaultTags = pb.DefaultTags + st.DockerImage = pb.DockerImage + st.Driver = pb.Driver + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.Executors = pb.Executors + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.JdbcPort = pb.JdbcPort + st.Kind = pb.Kind + st.LastRestartedTime = pb.LastRestartedTime + st.LastStateLossTime = pb.LastStateLossTime + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkContextId = pb.SparkContextId + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.Spec = pb.Spec + st.SshPublicKeys = pb.SshPublicKeys + st.StartTime = pb.StartTime + st.State = pb.State + st.StateMessage = pb.StateMessage + st.TerminatedTime = pb.TerminatedTime + st.TerminationReason = pb.TerminationReason + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterEventToPb(st *ClusterEvent) (*clusterEventPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterEventPb{} + pb.ClusterId = st.ClusterId + + pb.DataPlaneEventDetails = st.DataPlaneEventDetails + + pb.Details = st.Details + + pb.Timestamp = st.Timestamp + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterEventPb struct { + ClusterId string `json:"cluster_id"` + + DataPlaneEventDetails *DataPlaneEventDetails `json:"data_plane_event_details,omitempty"` + + Details *EventDetails `json:"details,omitempty"` + + Timestamp int64 `json:"timestamp,omitempty"` + + Type EventType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterEventFromPb(pb *clusterEventPb) (*ClusterEvent, error) { + if pb == nil { + return nil, nil + } + st := &ClusterEvent{} + st.ClusterId = pb.ClusterId + st.DataPlaneEventDetails = pb.DataPlaneEventDetails + st.Details = pb.Details + st.Timestamp = pb.Timestamp + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterEventPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterEventPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterLibraryStatusesToPb(st *ClusterLibraryStatuses) (*clusterLibraryStatusesPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterLibraryStatusesPb{} + pb.ClusterId = st.ClusterId + + pb.LibraryStatuses = st.LibraryStatuses + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterLibraryStatusesPb struct { + ClusterId string `json:"cluster_id,omitempty"` + + LibraryStatuses []LibraryFullStatus `json:"library_statuses,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterLibraryStatusesFromPb(pb *clusterLibraryStatusesPb) (*ClusterLibraryStatuses, error) { + if pb == nil { + return nil, nil + } + st := &ClusterLibraryStatuses{} + st.ClusterId = pb.ClusterId + st.LibraryStatuses = pb.LibraryStatuses + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterLibraryStatusesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterLibraryStatusesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterLogConfToPb(st *ClusterLogConf) (*clusterLogConfPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterLogConfPb{} + pb.Dbfs = st.Dbfs + + pb.S3 = st.S3 + + pb.Volumes = st.Volumes + + return pb, nil +} + +type clusterLogConfPb struct { + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + + S3 *S3StorageInfo `json:"s3,omitempty"` + + Volumes *VolumesStorageInfo `json:"volumes,omitempty"` +} + +func clusterLogConfFromPb(pb *clusterLogConfPb) (*ClusterLogConf, error) { + if pb == nil { + return nil, nil + } + st := &ClusterLogConf{} + st.Dbfs = pb.Dbfs + st.S3 = pb.S3 + st.Volumes = pb.Volumes + + return st, nil +} + +func clusterPermissionToPb(st *ClusterPermission) (*clusterPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPermissionFromPb(pb *clusterPermissionPb) (*ClusterPermission, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPermissionsToPb(st *ClusterPermissions) (*clusterPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPermissionsPb struct { + AccessControlList []ClusterAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPermissionsFromPb(pb *clusterPermissionsPb) (*ClusterPermissions, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPermissionsDescriptionToPb(st *ClusterPermissionsDescription) (*clusterPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPermissionsDescriptionFromPb(pb *clusterPermissionsDescriptionPb) (*ClusterPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPermissionsRequestToPb(st *ClusterPermissionsRequest) (*clusterPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type clusterPermissionsRequestPb struct { + AccessControlList []ClusterAccessControlRequest `json:"access_control_list,omitempty"` + + ClusterId string `json:"-" url:"-"` +} + +func clusterPermissionsRequestFromPb(pb *clusterPermissionsRequestPb) (*ClusterPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.ClusterId = pb.ClusterId + + return st, nil +} + +func clusterPolicyAccessControlRequestToPb(st *ClusterPolicyAccessControlRequest) (*clusterPolicyAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPolicyAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPolicyAccessControlRequestFromPb(pb *clusterPolicyAccessControlRequestPb) (*ClusterPolicyAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPolicyAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPolicyAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPolicyAccessControlResponseToPb(st *ClusterPolicyAccessControlResponse) (*clusterPolicyAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPolicyAccessControlResponsePb struct { + AllPermissions []ClusterPolicyPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPolicyAccessControlResponseFromPb(pb *clusterPolicyAccessControlResponsePb) (*ClusterPolicyAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPolicyAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPolicyAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPolicyPermissionToPb(st *ClusterPolicyPermission) (*clusterPolicyPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPolicyPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPolicyPermissionFromPb(pb *clusterPolicyPermissionPb) (*ClusterPolicyPermission, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPolicyPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPolicyPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPolicyPermissionsToPb(st *ClusterPolicyPermissions) (*clusterPolicyPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPolicyPermissionsPb struct { + AccessControlList []ClusterPolicyAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPolicyPermissionsFromPb(pb *clusterPolicyPermissionsPb) (*ClusterPolicyPermissions, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPolicyPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPolicyPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPolicyPermissionsDescriptionToPb(st *ClusterPolicyPermissionsDescription) (*clusterPolicyPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterPolicyPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterPolicyPermissionsDescriptionFromPb(pb *clusterPolicyPermissionsDescriptionPb) (*ClusterPolicyPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterPolicyPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterPolicyPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterPolicyPermissionsRequestToPb(st *ClusterPolicyPermissionsRequest) (*clusterPolicyPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterPolicyPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.ClusterPolicyId = st.ClusterPolicyId + + return pb, nil +} + +type clusterPolicyPermissionsRequestPb struct { + AccessControlList []ClusterPolicyAccessControlRequest `json:"access_control_list,omitempty"` + + ClusterPolicyId string `json:"-" url:"-"` +} + +func clusterPolicyPermissionsRequestFromPb(pb *clusterPolicyPermissionsRequestPb) (*ClusterPolicyPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ClusterPolicyPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.ClusterPolicyId = pb.ClusterPolicyId + + return st, nil +} + +func clusterSettingsChangeToPb(st *ClusterSettingsChange) (*clusterSettingsChangePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterSettingsChangePb{} + pb.Field = st.Field + + pb.NewValue = st.NewValue + + pb.PreviousValue = st.PreviousValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterSettingsChangePb struct { + Field string `json:"field,omitempty"` + + NewValue string `json:"new_value,omitempty"` + + PreviousValue string `json:"previous_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterSettingsChangeFromPb(pb *clusterSettingsChangePb) (*ClusterSettingsChange, error) { + if pb == nil { + return nil, nil + } + st := &ClusterSettingsChange{} + st.Field = pb.Field + st.NewValue = pb.NewValue + st.PreviousValue = pb.PreviousValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterSettingsChangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterSettingsChangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterSizeToPb(st *ClusterSize) (*clusterSizePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterSizePb{} + pb.Autoscale = st.Autoscale + + pb.NumWorkers = st.NumWorkers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterSizePb struct { + Autoscale *AutoScale `json:"autoscale,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterSizeFromPb(pb *clusterSizePb) (*ClusterSize, error) { + if pb == nil { + return nil, nil + } + st := &ClusterSize{} + st.Autoscale = pb.Autoscale + st.NumWorkers = pb.NumWorkers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterSizePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterSizePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterSpecPb{} + pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues + + pb.Autoscale = st.Autoscale + + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterName = st.ClusterName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DockerImage = st.DockerImage + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.Kind = st.Kind + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.SshPublicKeys = st.SshPublicKeys + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterSpecPb struct { + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + + Autoscale *AutoScale `json:"autoscale,omitempty"` + + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version,omitempty"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterSpecFromPb(pb *clusterSpecPb) (*ClusterSpec, error) { + if pb == nil { + return nil, nil + } + st := &ClusterSpec{} + st.ApplyPolicyDefaultValues = pb.ApplyPolicyDefaultValues + st.Autoscale = pb.Autoscale + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterName = pb.ClusterName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DockerImage = pb.DockerImage + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.Kind = pb.Kind + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.SshPublicKeys = pb.SshPublicKeys + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterStatusToPb(st *ClusterStatus) (*clusterStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterStatusPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type clusterStatusPb struct { + ClusterId string `json:"-" url:"cluster_id"` +} + +func clusterStatusFromPb(pb *clusterStatusPb) (*ClusterStatus, error) { + if pb == nil { + return nil, nil + } + st := &ClusterStatus{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func commandToPb(st *Command) (*commandPb, error) { + if st == nil { + return nil, nil + } + pb := &commandPb{} + pb.ClusterId = st.ClusterId + + pb.Command = st.Command + + pb.ContextId = st.ContextId + + pb.Language = st.Language + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type commandPb struct { + ClusterId string `json:"clusterId,omitempty"` + + Command string `json:"command,omitempty"` + + ContextId string `json:"contextId,omitempty"` + + Language Language `json:"language,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func commandFromPb(pb *commandPb) (*Command, error) { + if pb == nil { + return nil, nil + } + st := &Command{} + st.ClusterId = pb.ClusterId + st.Command = pb.Command + st.ContextId = pb.ContextId + st.Language = pb.Language + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *commandPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st commandPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func commandStatusRequestToPb(st *CommandStatusRequest) (*commandStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &commandStatusRequestPb{} + pb.ClusterId = st.ClusterId + + pb.CommandId = st.CommandId + + pb.ContextId = st.ContextId + + return pb, nil +} + +type commandStatusRequestPb struct { + ClusterId string `json:"-" url:"clusterId"` + + CommandId string `json:"-" url:"commandId"` + + ContextId string `json:"-" url:"contextId"` +} + +func commandStatusRequestFromPb(pb *commandStatusRequestPb) (*CommandStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &CommandStatusRequest{} + st.ClusterId = pb.ClusterId + st.CommandId = pb.CommandId + st.ContextId = pb.ContextId + + return st, nil +} + +func commandStatusResponseToPb(st *CommandStatusResponse) (*commandStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &commandStatusResponsePb{} + pb.Id = st.Id + + pb.Results = st.Results + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type commandStatusResponsePb struct { + Id string `json:"id,omitempty"` + + Results *Results `json:"results,omitempty"` + + Status CommandStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func commandStatusResponseFromPb(pb *commandStatusResponsePb) (*CommandStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &CommandStatusResponse{} + st.Id = pb.Id + st.Results = pb.Results + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *commandStatusResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st commandStatusResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func contextStatusRequestToPb(st *ContextStatusRequest) (*contextStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &contextStatusRequestPb{} + pb.ClusterId = st.ClusterId + + pb.ContextId = st.ContextId + + return pb, nil +} + +type contextStatusRequestPb struct { + ClusterId string `json:"-" url:"clusterId"` + + ContextId string `json:"-" url:"contextId"` +} + +func contextStatusRequestFromPb(pb *contextStatusRequestPb) (*ContextStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &ContextStatusRequest{} + st.ClusterId = pb.ClusterId + st.ContextId = pb.ContextId + + return st, nil +} + +func contextStatusResponseToPb(st *ContextStatusResponse) (*contextStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &contextStatusResponsePb{} + pb.Id = st.Id + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type contextStatusResponsePb struct { + Id string `json:"id,omitempty"` + + Status ContextStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func contextStatusResponseFromPb(pb *contextStatusResponsePb) (*ContextStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &ContextStatusResponse{} + st.Id = pb.Id + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *contextStatusResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st contextStatusResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createClusterToPb(st *CreateCluster) (*createClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &createClusterPb{} + pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues + + pb.Autoscale = st.Autoscale + + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.CloneFrom = st.CloneFrom + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterName = st.ClusterName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DockerImage = st.DockerImage + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.Kind = st.Kind + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.SshPublicKeys = st.SshPublicKeys + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createClusterPb struct { + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + + Autoscale *AutoScale `json:"autoscale,omitempty"` + + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + CloneFrom *CloneCluster `json:"clone_from,omitempty"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createClusterFromPb(pb *createClusterPb) (*CreateCluster, error) { + if pb == nil { + return nil, nil + } + st := &CreateCluster{} + st.ApplyPolicyDefaultValues = pb.ApplyPolicyDefaultValues + st.Autoscale = pb.Autoscale + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.CloneFrom = pb.CloneFrom + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterName = pb.ClusterName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DockerImage = pb.DockerImage + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.Kind = pb.Kind + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.SshPublicKeys = pb.SshPublicKeys + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createClusterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createClusterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createClusterResponseToPb(st *CreateClusterResponse) (*createClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createClusterResponsePb{} + pb.ClusterId = st.ClusterId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createClusterResponsePb struct { + ClusterId string `json:"cluster_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createClusterResponseFromPb(pb *createClusterResponsePb) (*CreateClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateClusterResponse{} + st.ClusterId = pb.ClusterId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createClusterResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createClusterResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createContextToPb(st *CreateContext) (*createContextPb, error) { + if st == nil { + return nil, nil + } + pb := &createContextPb{} + pb.ClusterId = st.ClusterId + + pb.Language = st.Language + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createContextPb struct { + ClusterId string `json:"clusterId,omitempty"` + + Language Language `json:"language,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createContextFromPb(pb *createContextPb) (*CreateContext, error) { + if pb == nil { + return nil, nil + } + st := &CreateContext{} + st.ClusterId = pb.ClusterId + st.Language = pb.Language + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createContextPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createContextPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createInstancePoolToPb(st *CreateInstancePool) (*createInstancePoolPb, error) { + if st == nil { + return nil, nil + } + pb := &createInstancePoolPb{} + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.CustomTags = st.CustomTags + + pb.DiskSpec = st.DiskSpec + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.GcpAttributes = st.GcpAttributes + + pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes + + pb.InstancePoolName = st.InstancePoolName + + pb.MaxCapacity = st.MaxCapacity + + pb.MinIdleInstances = st.MinIdleInstances + + pb.NodeTypeFlexibility = st.NodeTypeFlexibility + + pb.NodeTypeId = st.NodeTypeId + + pb.PreloadedDockerImages = st.PreloadedDockerImages + + pb.PreloadedSparkVersions = st.PreloadedSparkVersions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createInstancePoolPb struct { + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + + InstancePoolName string `json:"instance_pool_name"` + + MaxCapacity int `json:"max_capacity,omitempty"` + + MinIdleInstances int `json:"min_idle_instances,omitempty"` + + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + + NodeTypeId string `json:"node_type_id"` + + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createInstancePoolFromPb(pb *createInstancePoolPb) (*CreateInstancePool, error) { + if pb == nil { + return nil, nil + } + st := &CreateInstancePool{} + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.CustomTags = pb.CustomTags + st.DiskSpec = pb.DiskSpec + st.EnableElasticDisk = pb.EnableElasticDisk + st.GcpAttributes = pb.GcpAttributes + st.IdleInstanceAutoterminationMinutes = pb.IdleInstanceAutoterminationMinutes + st.InstancePoolName = pb.InstancePoolName + st.MaxCapacity = pb.MaxCapacity + st.MinIdleInstances = pb.MinIdleInstances + st.NodeTypeFlexibility = pb.NodeTypeFlexibility + st.NodeTypeId = pb.NodeTypeId + st.PreloadedDockerImages = pb.PreloadedDockerImages + st.PreloadedSparkVersions = pb.PreloadedSparkVersions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createInstancePoolPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createInstancePoolPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createInstancePoolResponseToPb(st *CreateInstancePoolResponse) (*createInstancePoolResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createInstancePoolResponsePb{} + pb.InstancePoolId = st.InstancePoolId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createInstancePoolResponsePb struct { + InstancePoolId string `json:"instance_pool_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createInstancePoolResponseFromPb(pb *createInstancePoolResponsePb) (*CreateInstancePoolResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateInstancePoolResponse{} + st.InstancePoolId = pb.InstancePoolId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createInstancePoolResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createInstancePoolResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPolicyToPb(st *CreatePolicy) (*createPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &createPolicyPb{} + pb.Definition = st.Definition + + pb.Description = st.Description + + pb.Libraries = st.Libraries + + pb.MaxClustersPerUser = st.MaxClustersPerUser + + pb.Name = st.Name + + pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides + + pb.PolicyFamilyId = st.PolicyFamilyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPolicyPb struct { + Definition string `json:"definition,omitempty"` + + Description string `json:"description,omitempty"` + + Libraries []Library `json:"libraries,omitempty"` + + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + + Name string `json:"name,omitempty"` + + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + + PolicyFamilyId string `json:"policy_family_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPolicyFromPb(pb *createPolicyPb) (*CreatePolicy, error) { + if pb == nil { + return nil, nil + } + st := &CreatePolicy{} + st.Definition = pb.Definition + st.Description = pb.Description + st.Libraries = pb.Libraries + st.MaxClustersPerUser = pb.MaxClustersPerUser + st.Name = pb.Name + st.PolicyFamilyDefinitionOverrides = pb.PolicyFamilyDefinitionOverrides + st.PolicyFamilyId = pb.PolicyFamilyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPolicyResponseToPb(st *CreatePolicyResponse) (*createPolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createPolicyResponsePb{} + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPolicyResponsePb struct { + PolicyId string `json:"policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPolicyResponseFromPb(pb *createPolicyResponsePb) (*CreatePolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreatePolicyResponse{} + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPolicyResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPolicyResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createResponseToPb(st *CreateResponse) (*createResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createResponsePb{} + pb.ScriptId = st.ScriptId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createResponsePb struct { + ScriptId string `json:"script_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createResponseFromPb(pb *createResponsePb) (*CreateResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateResponse{} + st.ScriptId = pb.ScriptId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createdToPb(st *Created) (*createdPb, error) { + if st == nil { + return nil, nil + } + pb := &createdPb{} + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createdPb struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createdFromPb(pb *createdPb) (*Created, error) { + if pb == nil { + return nil, nil + } + st := &Created{} + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createdPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createdPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func customPolicyTagToPb(st *CustomPolicyTag) (*customPolicyTagPb, error) { + if st == nil { + return nil, nil + } + pb := &customPolicyTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type customPolicyTagPb struct { + Key string `json:"key"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func customPolicyTagFromPb(pb *customPolicyTagPb) (*CustomPolicyTag, error) { + if pb == nil { + return nil, nil + } + st := &CustomPolicyTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *customPolicyTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st customPolicyTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dataPlaneEventDetailsToPb(st *DataPlaneEventDetails) (*dataPlaneEventDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &dataPlaneEventDetailsPb{} + pb.EventType = st.EventType + + pb.ExecutorFailures = st.ExecutorFailures + + pb.HostId = st.HostId + + pb.Timestamp = st.Timestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dataPlaneEventDetailsPb struct { + EventType DataPlaneEventDetailsEventType `json:"event_type,omitempty"` + + ExecutorFailures int `json:"executor_failures,omitempty"` + + HostId string `json:"host_id,omitempty"` + + Timestamp int64 `json:"timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dataPlaneEventDetailsFromPb(pb *dataPlaneEventDetailsPb) (*DataPlaneEventDetails, error) { + if pb == nil { + return nil, nil + } + st := &DataPlaneEventDetails{} + st.EventType = pb.EventType + st.ExecutorFailures = pb.ExecutorFailures + st.HostId = pb.HostId + st.Timestamp = pb.Timestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dataPlaneEventDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dataPlaneEventDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dbfsStorageInfoToPb(st *DbfsStorageInfo) (*dbfsStorageInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &dbfsStorageInfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type dbfsStorageInfoPb struct { + Destination string `json:"destination"` +} + +func dbfsStorageInfoFromPb(pb *dbfsStorageInfoPb) (*DbfsStorageInfo, error) { + if pb == nil { + return nil, nil + } + st := &DbfsStorageInfo{} + st.Destination = pb.Destination + + return st, nil +} + +func deleteClusterToPb(st *DeleteCluster) (*deleteClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteClusterPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type deleteClusterPb struct { + ClusterId string `json:"cluster_id"` +} + +func deleteClusterFromPb(pb *deleteClusterPb) (*DeleteCluster, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCluster{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func deleteClusterResponseToPb(st *DeleteClusterResponse) (*deleteClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteClusterResponsePb{} + + return pb, nil +} + +type deleteClusterResponsePb struct { +} + +func deleteClusterResponseFromPb(pb *deleteClusterResponsePb) (*DeleteClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteClusterResponse{} + + return st, nil +} + +func deleteGlobalInitScriptRequestToPb(st *DeleteGlobalInitScriptRequest) (*deleteGlobalInitScriptRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteGlobalInitScriptRequestPb{} + pb.ScriptId = st.ScriptId + + return pb, nil +} + +type deleteGlobalInitScriptRequestPb struct { + ScriptId string `json:"-" url:"-"` +} + +func deleteGlobalInitScriptRequestFromPb(pb *deleteGlobalInitScriptRequestPb) (*DeleteGlobalInitScriptRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteGlobalInitScriptRequest{} + st.ScriptId = pb.ScriptId + + return st, nil +} + +func deleteInstancePoolToPb(st *DeleteInstancePool) (*deleteInstancePoolPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteInstancePoolPb{} + pb.InstancePoolId = st.InstancePoolId + + return pb, nil +} + +type deleteInstancePoolPb struct { + InstancePoolId string `json:"instance_pool_id"` +} + +func deleteInstancePoolFromPb(pb *deleteInstancePoolPb) (*DeleteInstancePool, error) { + if pb == nil { + return nil, nil + } + st := &DeleteInstancePool{} + st.InstancePoolId = pb.InstancePoolId + + return st, nil +} + +func deleteInstancePoolResponseToPb(st *DeleteInstancePoolResponse) (*deleteInstancePoolResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteInstancePoolResponsePb{} + + return pb, nil +} + +type deleteInstancePoolResponsePb struct { +} + +func deleteInstancePoolResponseFromPb(pb *deleteInstancePoolResponsePb) (*DeleteInstancePoolResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteInstancePoolResponse{} + + return st, nil +} + +func deletePolicyToPb(st *DeletePolicy) (*deletePolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePolicyPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type deletePolicyPb struct { + PolicyId string `json:"policy_id"` +} + +func deletePolicyFromPb(pb *deletePolicyPb) (*DeletePolicy, error) { + if pb == nil { + return nil, nil + } + st := &DeletePolicy{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func deletePolicyResponseToPb(st *DeletePolicyResponse) (*deletePolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deletePolicyResponsePb{} + + return pb, nil +} + +type deletePolicyResponsePb struct { +} + +func deletePolicyResponseFromPb(pb *deletePolicyResponsePb) (*DeletePolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeletePolicyResponse{} + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func destroyContextToPb(st *DestroyContext) (*destroyContextPb, error) { + if st == nil { + return nil, nil + } + pb := &destroyContextPb{} + pb.ClusterId = st.ClusterId + + pb.ContextId = st.ContextId + + return pb, nil +} + +type destroyContextPb struct { + ClusterId string `json:"clusterId"` + + ContextId string `json:"contextId"` +} + +func destroyContextFromPb(pb *destroyContextPb) (*DestroyContext, error) { + if pb == nil { + return nil, nil + } + st := &DestroyContext{} + st.ClusterId = pb.ClusterId + st.ContextId = pb.ContextId + + return st, nil +} + +func destroyResponseToPb(st *DestroyResponse) (*destroyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &destroyResponsePb{} + + return pb, nil +} + +type destroyResponsePb struct { +} + +func destroyResponseFromPb(pb *destroyResponsePb) (*DestroyResponse, error) { + if pb == nil { + return nil, nil + } + st := &DestroyResponse{} + + return st, nil +} + +func diskSpecToPb(st *DiskSpec) (*diskSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &diskSpecPb{} + pb.DiskCount = st.DiskCount + + pb.DiskIops = st.DiskIops + + pb.DiskSize = st.DiskSize + + pb.DiskThroughput = st.DiskThroughput + + pb.DiskType = st.DiskType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type diskSpecPb struct { + DiskCount int `json:"disk_count,omitempty"` + + DiskIops int `json:"disk_iops,omitempty"` + + DiskSize int `json:"disk_size,omitempty"` + + DiskThroughput int `json:"disk_throughput,omitempty"` + + DiskType *DiskType `json:"disk_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func diskSpecFromPb(pb *diskSpecPb) (*DiskSpec, error) { + if pb == nil { + return nil, nil + } + st := &DiskSpec{} + st.DiskCount = pb.DiskCount + st.DiskIops = pb.DiskIops + st.DiskSize = pb.DiskSize + st.DiskThroughput = pb.DiskThroughput + st.DiskType = pb.DiskType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *diskSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st diskSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func diskTypeToPb(st *DiskType) (*diskTypePb, error) { + if st == nil { + return nil, nil + } + pb := &diskTypePb{} + pb.AzureDiskVolumeType = st.AzureDiskVolumeType + + pb.EbsVolumeType = st.EbsVolumeType + + return pb, nil +} + +type diskTypePb struct { + AzureDiskVolumeType DiskTypeAzureDiskVolumeType `json:"azure_disk_volume_type,omitempty"` + + EbsVolumeType DiskTypeEbsVolumeType `json:"ebs_volume_type,omitempty"` +} + +func diskTypeFromPb(pb *diskTypePb) (*DiskType, error) { + if pb == nil { + return nil, nil + } + st := &DiskType{} + st.AzureDiskVolumeType = pb.AzureDiskVolumeType + st.EbsVolumeType = pb.EbsVolumeType + + return st, nil +} + +func dockerBasicAuthToPb(st *DockerBasicAuth) (*dockerBasicAuthPb, error) { + if st == nil { + return nil, nil + } + pb := &dockerBasicAuthPb{} + pb.Password = st.Password + + pb.Username = st.Username + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dockerBasicAuthPb struct { + Password string `json:"password,omitempty"` + + Username string `json:"username,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dockerBasicAuthFromPb(pb *dockerBasicAuthPb) (*DockerBasicAuth, error) { + if pb == nil { + return nil, nil + } + st := &DockerBasicAuth{} + st.Password = pb.Password + st.Username = pb.Username + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dockerBasicAuthPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dockerBasicAuthPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dockerImageToPb(st *DockerImage) (*dockerImagePb, error) { + if st == nil { + return nil, nil + } + pb := &dockerImagePb{} + pb.BasicAuth = st.BasicAuth + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dockerImagePb struct { + BasicAuth *DockerBasicAuth `json:"basic_auth,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dockerImageFromPb(pb *dockerImagePb) (*DockerImage, error) { + if pb == nil { + return nil, nil + } + st := &DockerImage{} + st.BasicAuth = pb.BasicAuth + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dockerImagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dockerImagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editClusterToPb(st *EditCluster) (*editClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &editClusterPb{} + pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues + + pb.Autoscale = st.Autoscale + + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterId = st.ClusterId + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterName = st.ClusterName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DockerImage = st.DockerImage + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.Kind = st.Kind + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.SshPublicKeys = st.SshPublicKeys + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editClusterPb struct { + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + + Autoscale *AutoScale `json:"autoscale,omitempty"` + + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterId string `json:"cluster_id"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editClusterFromPb(pb *editClusterPb) (*EditCluster, error) { + if pb == nil { + return nil, nil + } + st := &EditCluster{} + st.ApplyPolicyDefaultValues = pb.ApplyPolicyDefaultValues + st.Autoscale = pb.Autoscale + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterId = pb.ClusterId + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterName = pb.ClusterName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DockerImage = pb.DockerImage + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.Kind = pb.Kind + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.SshPublicKeys = pb.SshPublicKeys + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editClusterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editClusterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editClusterResponseToPb(st *EditClusterResponse) (*editClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editClusterResponsePb{} + + return pb, nil +} + +type editClusterResponsePb struct { +} + +func editClusterResponseFromPb(pb *editClusterResponsePb) (*EditClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditClusterResponse{} + + return st, nil +} + +func editInstancePoolToPb(st *EditInstancePool) (*editInstancePoolPb, error) { + if st == nil { + return nil, nil + } + pb := &editInstancePoolPb{} + pb.CustomTags = st.CustomTags + + pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes + + pb.InstancePoolId = st.InstancePoolId + + pb.InstancePoolName = st.InstancePoolName + + pb.MaxCapacity = st.MaxCapacity + + pb.MinIdleInstances = st.MinIdleInstances + + pb.NodeTypeFlexibility = st.NodeTypeFlexibility + + pb.NodeTypeId = st.NodeTypeId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editInstancePoolPb struct { + CustomTags map[string]string `json:"custom_tags,omitempty"` + + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + + InstancePoolId string `json:"instance_pool_id"` + + InstancePoolName string `json:"instance_pool_name"` + + MaxCapacity int `json:"max_capacity,omitempty"` + + MinIdleInstances int `json:"min_idle_instances,omitempty"` + + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + + NodeTypeId string `json:"node_type_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editInstancePoolFromPb(pb *editInstancePoolPb) (*EditInstancePool, error) { + if pb == nil { + return nil, nil + } + st := &EditInstancePool{} + st.CustomTags = pb.CustomTags + st.IdleInstanceAutoterminationMinutes = pb.IdleInstanceAutoterminationMinutes + st.InstancePoolId = pb.InstancePoolId + st.InstancePoolName = pb.InstancePoolName + st.MaxCapacity = pb.MaxCapacity + st.MinIdleInstances = pb.MinIdleInstances + st.NodeTypeFlexibility = pb.NodeTypeFlexibility + st.NodeTypeId = pb.NodeTypeId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editInstancePoolPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editInstancePoolPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editInstancePoolResponseToPb(st *EditInstancePoolResponse) (*editInstancePoolResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editInstancePoolResponsePb{} + + return pb, nil +} + +type editInstancePoolResponsePb struct { +} + +func editInstancePoolResponseFromPb(pb *editInstancePoolResponsePb) (*EditInstancePoolResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditInstancePoolResponse{} + + return st, nil +} + +func editPolicyToPb(st *EditPolicy) (*editPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &editPolicyPb{} + pb.Definition = st.Definition + + pb.Description = st.Description + + pb.Libraries = st.Libraries + + pb.MaxClustersPerUser = st.MaxClustersPerUser + + pb.Name = st.Name + + pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides + + pb.PolicyFamilyId = st.PolicyFamilyId + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editPolicyPb struct { + Definition string `json:"definition,omitempty"` + + Description string `json:"description,omitempty"` + + Libraries []Library `json:"libraries,omitempty"` + + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + + Name string `json:"name,omitempty"` + + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + + PolicyFamilyId string `json:"policy_family_id,omitempty"` + + PolicyId string `json:"policy_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editPolicyFromPb(pb *editPolicyPb) (*EditPolicy, error) { + if pb == nil { + return nil, nil + } + st := &EditPolicy{} + st.Definition = pb.Definition + st.Description = pb.Description + st.Libraries = pb.Libraries + st.MaxClustersPerUser = pb.MaxClustersPerUser + st.Name = pb.Name + st.PolicyFamilyDefinitionOverrides = pb.PolicyFamilyDefinitionOverrides + st.PolicyFamilyId = pb.PolicyFamilyId + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editPolicyResponseToPb(st *EditPolicyResponse) (*editPolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editPolicyResponsePb{} + + return pb, nil +} + +type editPolicyResponsePb struct { +} + +func editPolicyResponseFromPb(pb *editPolicyResponsePb) (*EditPolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditPolicyResponse{} + + return st, nil +} + +func editResponseToPb(st *EditResponse) (*editResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editResponsePb{} + + return pb, nil +} + +type editResponsePb struct { +} + +func editResponseFromPb(pb *editResponsePb) (*EditResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditResponse{} + + return st, nil +} + +func enforceClusterComplianceRequestToPb(st *EnforceClusterComplianceRequest) (*enforceClusterComplianceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &enforceClusterComplianceRequestPb{} + pb.ClusterId = st.ClusterId + + pb.ValidateOnly = st.ValidateOnly + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enforceClusterComplianceRequestPb struct { + ClusterId string `json:"cluster_id"` + + ValidateOnly bool `json:"validate_only,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enforceClusterComplianceRequestFromPb(pb *enforceClusterComplianceRequestPb) (*EnforceClusterComplianceRequest, error) { + if pb == nil { + return nil, nil + } + st := &EnforceClusterComplianceRequest{} + st.ClusterId = pb.ClusterId + st.ValidateOnly = pb.ValidateOnly + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enforceClusterComplianceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enforceClusterComplianceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enforceClusterComplianceResponseToPb(st *EnforceClusterComplianceResponse) (*enforceClusterComplianceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &enforceClusterComplianceResponsePb{} + pb.Changes = st.Changes + + pb.HasChanges = st.HasChanges + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enforceClusterComplianceResponsePb struct { + Changes []ClusterSettingsChange `json:"changes,omitempty"` + + HasChanges bool `json:"has_changes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enforceClusterComplianceResponseFromPb(pb *enforceClusterComplianceResponsePb) (*EnforceClusterComplianceResponse, error) { + if pb == nil { + return nil, nil + } + st := &EnforceClusterComplianceResponse{} + st.Changes = pb.Changes + st.HasChanges = pb.HasChanges + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enforceClusterComplianceResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enforceClusterComplianceResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func environmentToPb(st *Environment) (*environmentPb, error) { + if st == nil { + return nil, nil + } + pb := &environmentPb{} + pb.Client = st.Client + + pb.Dependencies = st.Dependencies + + pb.EnvironmentVersion = st.EnvironmentVersion + + pb.JarDependencies = st.JarDependencies + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type environmentPb struct { + Client string `json:"client"` + + Dependencies []string `json:"dependencies,omitempty"` + + EnvironmentVersion string `json:"environment_version,omitempty"` + + JarDependencies []string `json:"jar_dependencies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func environmentFromPb(pb *environmentPb) (*Environment, error) { + if pb == nil { + return nil, nil + } + st := &Environment{} + st.Client = pb.Client + st.Dependencies = pb.Dependencies + st.EnvironmentVersion = pb.EnvironmentVersion + st.JarDependencies = pb.JarDependencies + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *environmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st environmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func eventDetailsToPb(st *EventDetails) (*eventDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &eventDetailsPb{} + pb.Attributes = st.Attributes + + pb.Cause = st.Cause + + pb.ClusterSize = st.ClusterSize + + pb.CurrentNumVcpus = st.CurrentNumVcpus + + pb.CurrentNumWorkers = st.CurrentNumWorkers + + pb.DidNotExpandReason = st.DidNotExpandReason + + pb.DiskSize = st.DiskSize + + pb.DriverStateMessage = st.DriverStateMessage + + pb.EnableTerminationForNodeBlocklisted = st.EnableTerminationForNodeBlocklisted + + pb.FreeSpace = st.FreeSpace + + pb.InitScripts = st.InitScripts + + pb.InstanceId = st.InstanceId + + pb.JobRunName = st.JobRunName + + pb.PreviousAttributes = st.PreviousAttributes + + pb.PreviousClusterSize = st.PreviousClusterSize + + pb.PreviousDiskSize = st.PreviousDiskSize + + pb.Reason = st.Reason + + pb.TargetNumVcpus = st.TargetNumVcpus + + pb.TargetNumWorkers = st.TargetNumWorkers + + pb.User = st.User + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type eventDetailsPb struct { + Attributes *ClusterAttributes `json:"attributes,omitempty"` + + Cause EventDetailsCause `json:"cause,omitempty"` + + ClusterSize *ClusterSize `json:"cluster_size,omitempty"` + + CurrentNumVcpus int `json:"current_num_vcpus,omitempty"` + + CurrentNumWorkers int `json:"current_num_workers,omitempty"` + + DidNotExpandReason string `json:"did_not_expand_reason,omitempty"` + + DiskSize int64 `json:"disk_size,omitempty"` + + DriverStateMessage string `json:"driver_state_message,omitempty"` + + EnableTerminationForNodeBlocklisted bool `json:"enable_termination_for_node_blocklisted,omitempty"` + + FreeSpace int64 `json:"free_space,omitempty"` + + InitScripts *InitScriptEventDetails `json:"init_scripts,omitempty"` + + InstanceId string `json:"instance_id,omitempty"` + + JobRunName string `json:"job_run_name,omitempty"` + + PreviousAttributes *ClusterAttributes `json:"previous_attributes,omitempty"` + + PreviousClusterSize *ClusterSize `json:"previous_cluster_size,omitempty"` + + PreviousDiskSize int64 `json:"previous_disk_size,omitempty"` + + Reason *TerminationReason `json:"reason,omitempty"` + + TargetNumVcpus int `json:"target_num_vcpus,omitempty"` + + TargetNumWorkers int `json:"target_num_workers,omitempty"` + + User string `json:"user,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func eventDetailsFromPb(pb *eventDetailsPb) (*EventDetails, error) { + if pb == nil { + return nil, nil + } + st := &EventDetails{} + st.Attributes = pb.Attributes + st.Cause = pb.Cause + st.ClusterSize = pb.ClusterSize + st.CurrentNumVcpus = pb.CurrentNumVcpus + st.CurrentNumWorkers = pb.CurrentNumWorkers + st.DidNotExpandReason = pb.DidNotExpandReason + st.DiskSize = pb.DiskSize + st.DriverStateMessage = pb.DriverStateMessage + st.EnableTerminationForNodeBlocklisted = pb.EnableTerminationForNodeBlocklisted + st.FreeSpace = pb.FreeSpace + st.InitScripts = pb.InitScripts + st.InstanceId = pb.InstanceId + st.JobRunName = pb.JobRunName + st.PreviousAttributes = pb.PreviousAttributes + st.PreviousClusterSize = pb.PreviousClusterSize + st.PreviousDiskSize = pb.PreviousDiskSize + st.Reason = pb.Reason + st.TargetNumVcpus = pb.TargetNumVcpus + st.TargetNumWorkers = pb.TargetNumWorkers + st.User = pb.User + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *eventDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st eventDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gcpAttributesToPb(st *GcpAttributes) (*gcpAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpAttributesPb{} + pb.Availability = st.Availability + + pb.BootDiskSize = st.BootDiskSize + + pb.GoogleServiceAccount = st.GoogleServiceAccount + + pb.LocalSsdCount = st.LocalSsdCount + + pb.UsePreemptibleExecutors = st.UsePreemptibleExecutors + + pb.ZoneId = st.ZoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gcpAttributesPb struct { + Availability GcpAvailability `json:"availability,omitempty"` + + BootDiskSize int `json:"boot_disk_size,omitempty"` + + GoogleServiceAccount string `json:"google_service_account,omitempty"` + + LocalSsdCount int `json:"local_ssd_count,omitempty"` + + UsePreemptibleExecutors bool `json:"use_preemptible_executors,omitempty"` + + ZoneId string `json:"zone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gcpAttributesFromPb(pb *gcpAttributesPb) (*GcpAttributes, error) { + if pb == nil { + return nil, nil + } + st := &GcpAttributes{} + st.Availability = pb.Availability + st.BootDiskSize = pb.BootDiskSize + st.GoogleServiceAccount = pb.GoogleServiceAccount + st.LocalSsdCount = pb.LocalSsdCount + st.UsePreemptibleExecutors = pb.UsePreemptibleExecutors + st.ZoneId = pb.ZoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gcpAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gcpAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gcsStorageInfoToPb(st *GcsStorageInfo) (*gcsStorageInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &gcsStorageInfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type gcsStorageInfoPb struct { + Destination string `json:"destination"` +} + +func gcsStorageInfoFromPb(pb *gcsStorageInfoPb) (*GcsStorageInfo, error) { + if pb == nil { + return nil, nil + } + st := &GcsStorageInfo{} + st.Destination = pb.Destination + + return st, nil +} + +func getClusterComplianceRequestToPb(st *GetClusterComplianceRequest) (*getClusterComplianceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterComplianceRequestPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type getClusterComplianceRequestPb struct { + ClusterId string `json:"-" url:"cluster_id"` +} + +func getClusterComplianceRequestFromPb(pb *getClusterComplianceRequestPb) (*GetClusterComplianceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterComplianceRequest{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func getClusterComplianceResponseToPb(st *GetClusterComplianceResponse) (*getClusterComplianceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterComplianceResponsePb{} + pb.IsCompliant = st.IsCompliant + + pb.Violations = st.Violations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getClusterComplianceResponsePb struct { + IsCompliant bool `json:"is_compliant,omitempty"` + + Violations map[string]string `json:"violations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getClusterComplianceResponseFromPb(pb *getClusterComplianceResponsePb) (*GetClusterComplianceResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterComplianceResponse{} + st.IsCompliant = pb.IsCompliant + st.Violations = pb.Violations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getClusterComplianceResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getClusterComplianceResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getClusterPermissionLevelsRequestToPb(st *GetClusterPermissionLevelsRequest) (*getClusterPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPermissionLevelsRequestPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type getClusterPermissionLevelsRequestPb struct { + ClusterId string `json:"-" url:"-"` +} + +func getClusterPermissionLevelsRequestFromPb(pb *getClusterPermissionLevelsRequestPb) (*GetClusterPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPermissionLevelsRequest{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func getClusterPermissionLevelsResponseToPb(st *GetClusterPermissionLevelsResponse) (*getClusterPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getClusterPermissionLevelsResponsePb struct { + PermissionLevels []ClusterPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getClusterPermissionLevelsResponseFromPb(pb *getClusterPermissionLevelsResponsePb) (*GetClusterPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getClusterPermissionsRequestToPb(st *GetClusterPermissionsRequest) (*getClusterPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPermissionsRequestPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type getClusterPermissionsRequestPb struct { + ClusterId string `json:"-" url:"-"` +} + +func getClusterPermissionsRequestFromPb(pb *getClusterPermissionsRequestPb) (*GetClusterPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPermissionsRequest{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func getClusterPolicyPermissionLevelsRequestToPb(st *GetClusterPolicyPermissionLevelsRequest) (*getClusterPolicyPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPolicyPermissionLevelsRequestPb{} + pb.ClusterPolicyId = st.ClusterPolicyId + + return pb, nil +} + +type getClusterPolicyPermissionLevelsRequestPb struct { + ClusterPolicyId string `json:"-" url:"-"` +} + +func getClusterPolicyPermissionLevelsRequestFromPb(pb *getClusterPolicyPermissionLevelsRequestPb) (*GetClusterPolicyPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPolicyPermissionLevelsRequest{} + st.ClusterPolicyId = pb.ClusterPolicyId + + return st, nil +} + +func getClusterPolicyPermissionLevelsResponseToPb(st *GetClusterPolicyPermissionLevelsResponse) (*getClusterPolicyPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPolicyPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getClusterPolicyPermissionLevelsResponsePb struct { + PermissionLevels []ClusterPolicyPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getClusterPolicyPermissionLevelsResponseFromPb(pb *getClusterPolicyPermissionLevelsResponsePb) (*GetClusterPolicyPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPolicyPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getClusterPolicyPermissionsRequestToPb(st *GetClusterPolicyPermissionsRequest) (*getClusterPolicyPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPolicyPermissionsRequestPb{} + pb.ClusterPolicyId = st.ClusterPolicyId + + return pb, nil +} + +type getClusterPolicyPermissionsRequestPb struct { + ClusterPolicyId string `json:"-" url:"-"` +} + +func getClusterPolicyPermissionsRequestFromPb(pb *getClusterPolicyPermissionsRequestPb) (*GetClusterPolicyPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPolicyPermissionsRequest{} + st.ClusterPolicyId = pb.ClusterPolicyId + + return st, nil +} + +func getClusterPolicyRequestToPb(st *GetClusterPolicyRequest) (*getClusterPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type getClusterPolicyRequestPb struct { + PolicyId string `json:"-" url:"policy_id"` +} + +func getClusterPolicyRequestFromPb(pb *getClusterPolicyRequestPb) (*GetClusterPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterPolicyRequest{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func getClusterRequestToPb(st *GetClusterRequest) (*getClusterRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getClusterRequestPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type getClusterRequestPb struct { + ClusterId string `json:"-" url:"cluster_id"` +} + +func getClusterRequestFromPb(pb *getClusterRequestPb) (*GetClusterRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetClusterRequest{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func getEventsToPb(st *GetEvents) (*getEventsPb, error) { + if st == nil { + return nil, nil + } + pb := &getEventsPb{} + pb.ClusterId = st.ClusterId + + pb.EndTime = st.EndTime + + pb.EventTypes = st.EventTypes + + pb.Limit = st.Limit + + pb.Offset = st.Offset + + pb.Order = st.Order + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.StartTime = st.StartTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getEventsPb struct { + ClusterId string `json:"cluster_id"` + + EndTime int64 `json:"end_time,omitempty"` + + EventTypes []EventType `json:"event_types,omitempty"` + + Limit int64 `json:"limit,omitempty"` + + Offset int64 `json:"offset,omitempty"` + + Order GetEventsOrder `json:"order,omitempty"` + + PageSize int `json:"page_size,omitempty"` + + PageToken string `json:"page_token,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getEventsFromPb(pb *getEventsPb) (*GetEvents, error) { + if pb == nil { + return nil, nil + } + st := &GetEvents{} + st.ClusterId = pb.ClusterId + st.EndTime = pb.EndTime + st.EventTypes = pb.EventTypes + st.Limit = pb.Limit + st.Offset = pb.Offset + st.Order = pb.Order + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.StartTime = pb.StartTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getEventsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getEventsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getEventsResponseToPb(st *GetEventsResponse) (*getEventsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getEventsResponsePb{} + pb.Events = st.Events + + pb.NextPage = st.NextPage + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.TotalCount = st.TotalCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getEventsResponsePb struct { + Events []ClusterEvent `json:"events,omitempty"` + + NextPage *GetEvents `json:"next_page,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + TotalCount int64 `json:"total_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getEventsResponseFromPb(pb *getEventsResponsePb) (*GetEventsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetEventsResponse{} + st.Events = pb.Events + st.NextPage = pb.NextPage + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + st.TotalCount = pb.TotalCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getEventsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getEventsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getGlobalInitScriptRequestToPb(st *GetGlobalInitScriptRequest) (*getGlobalInitScriptRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getGlobalInitScriptRequestPb{} + pb.ScriptId = st.ScriptId + + return pb, nil +} + +type getGlobalInitScriptRequestPb struct { + ScriptId string `json:"-" url:"-"` +} + +func getGlobalInitScriptRequestFromPb(pb *getGlobalInitScriptRequestPb) (*GetGlobalInitScriptRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetGlobalInitScriptRequest{} + st.ScriptId = pb.ScriptId + + return st, nil +} + +func getInstancePoolToPb(st *GetInstancePool) (*getInstancePoolPb, error) { + if st == nil { + return nil, nil + } + pb := &getInstancePoolPb{} + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.CustomTags = st.CustomTags + + pb.DefaultTags = st.DefaultTags + + pb.DiskSpec = st.DiskSpec + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.GcpAttributes = st.GcpAttributes + + pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes + + pb.InstancePoolId = st.InstancePoolId + + pb.InstancePoolName = st.InstancePoolName + + pb.MaxCapacity = st.MaxCapacity + + pb.MinIdleInstances = st.MinIdleInstances + + pb.NodeTypeFlexibility = st.NodeTypeFlexibility + + pb.NodeTypeId = st.NodeTypeId + + pb.PreloadedDockerImages = st.PreloadedDockerImages + + pb.PreloadedSparkVersions = st.PreloadedSparkVersions + + pb.State = st.State + + pb.Stats = st.Stats + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getInstancePoolPb struct { + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DefaultTags map[string]string `json:"default_tags,omitempty"` + + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + + InstancePoolId string `json:"instance_pool_id"` + + InstancePoolName string `json:"instance_pool_name,omitempty"` + + MaxCapacity int `json:"max_capacity,omitempty"` + + MinIdleInstances int `json:"min_idle_instances,omitempty"` + + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + + State InstancePoolState `json:"state,omitempty"` + + Stats *InstancePoolStats `json:"stats,omitempty"` + + Status *InstancePoolStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getInstancePoolFromPb(pb *getInstancePoolPb) (*GetInstancePool, error) { + if pb == nil { + return nil, nil + } + st := &GetInstancePool{} + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.CustomTags = pb.CustomTags + st.DefaultTags = pb.DefaultTags + st.DiskSpec = pb.DiskSpec + st.EnableElasticDisk = pb.EnableElasticDisk + st.GcpAttributes = pb.GcpAttributes + st.IdleInstanceAutoterminationMinutes = pb.IdleInstanceAutoterminationMinutes + st.InstancePoolId = pb.InstancePoolId + st.InstancePoolName = pb.InstancePoolName + st.MaxCapacity = pb.MaxCapacity + st.MinIdleInstances = pb.MinIdleInstances + st.NodeTypeFlexibility = pb.NodeTypeFlexibility + st.NodeTypeId = pb.NodeTypeId + st.PreloadedDockerImages = pb.PreloadedDockerImages + st.PreloadedSparkVersions = pb.PreloadedSparkVersions + st.State = pb.State + st.Stats = pb.Stats + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getInstancePoolPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getInstancePoolPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getInstancePoolPermissionLevelsRequestToPb(st *GetInstancePoolPermissionLevelsRequest) (*getInstancePoolPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getInstancePoolPermissionLevelsRequestPb{} + pb.InstancePoolId = st.InstancePoolId + + return pb, nil +} + +type getInstancePoolPermissionLevelsRequestPb struct { + InstancePoolId string `json:"-" url:"-"` +} + +func getInstancePoolPermissionLevelsRequestFromPb(pb *getInstancePoolPermissionLevelsRequestPb) (*GetInstancePoolPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetInstancePoolPermissionLevelsRequest{} + st.InstancePoolId = pb.InstancePoolId + + return st, nil +} + +func getInstancePoolPermissionLevelsResponseToPb(st *GetInstancePoolPermissionLevelsResponse) (*getInstancePoolPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getInstancePoolPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getInstancePoolPermissionLevelsResponsePb struct { + PermissionLevels []InstancePoolPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getInstancePoolPermissionLevelsResponseFromPb(pb *getInstancePoolPermissionLevelsResponsePb) (*GetInstancePoolPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetInstancePoolPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getInstancePoolPermissionsRequestToPb(st *GetInstancePoolPermissionsRequest) (*getInstancePoolPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getInstancePoolPermissionsRequestPb{} + pb.InstancePoolId = st.InstancePoolId + + return pb, nil +} + +type getInstancePoolPermissionsRequestPb struct { + InstancePoolId string `json:"-" url:"-"` +} + +func getInstancePoolPermissionsRequestFromPb(pb *getInstancePoolPermissionsRequestPb) (*GetInstancePoolPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetInstancePoolPermissionsRequest{} + st.InstancePoolId = pb.InstancePoolId + + return st, nil +} + +func getInstancePoolRequestToPb(st *GetInstancePoolRequest) (*getInstancePoolRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getInstancePoolRequestPb{} + pb.InstancePoolId = st.InstancePoolId + + return pb, nil +} + +type getInstancePoolRequestPb struct { + InstancePoolId string `json:"-" url:"instance_pool_id"` +} + +func getInstancePoolRequestFromPb(pb *getInstancePoolRequestPb) (*GetInstancePoolRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetInstancePoolRequest{} + st.InstancePoolId = pb.InstancePoolId + + return st, nil +} + +func getPolicyFamilyRequestToPb(st *GetPolicyFamilyRequest) (*getPolicyFamilyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPolicyFamilyRequestPb{} + pb.PolicyFamilyId = st.PolicyFamilyId + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPolicyFamilyRequestPb struct { + PolicyFamilyId string `json:"-" url:"-"` + + Version int64 `json:"-" url:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPolicyFamilyRequestFromPb(pb *getPolicyFamilyRequestPb) (*GetPolicyFamilyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPolicyFamilyRequest{} + st.PolicyFamilyId = pb.PolicyFamilyId + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPolicyFamilyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPolicyFamilyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getSparkVersionsResponseToPb(st *GetSparkVersionsResponse) (*getSparkVersionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getSparkVersionsResponsePb{} + pb.Versions = st.Versions + + return pb, nil +} + +type getSparkVersionsResponsePb struct { + Versions []SparkVersion `json:"versions,omitempty"` +} + +func getSparkVersionsResponseFromPb(pb *getSparkVersionsResponsePb) (*GetSparkVersionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetSparkVersionsResponse{} + st.Versions = pb.Versions + + return st, nil +} + +func globalInitScriptCreateRequestToPb(st *GlobalInitScriptCreateRequest) (*globalInitScriptCreateRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &globalInitScriptCreateRequestPb{} + pb.Enabled = st.Enabled + + pb.Name = st.Name + + pb.Position = st.Position + + pb.Script = st.Script + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type globalInitScriptCreateRequestPb struct { + Enabled bool `json:"enabled,omitempty"` + + Name string `json:"name"` + + Position int `json:"position,omitempty"` + + Script string `json:"script"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func globalInitScriptCreateRequestFromPb(pb *globalInitScriptCreateRequestPb) (*GlobalInitScriptCreateRequest, error) { + if pb == nil { + return nil, nil + } + st := &GlobalInitScriptCreateRequest{} + st.Enabled = pb.Enabled + st.Name = pb.Name + st.Position = pb.Position + st.Script = pb.Script + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *globalInitScriptCreateRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st globalInitScriptCreateRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func globalInitScriptDetailsToPb(st *GlobalInitScriptDetails) (*globalInitScriptDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &globalInitScriptDetailsPb{} + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Enabled = st.Enabled + + pb.Name = st.Name + + pb.Position = st.Position + + pb.ScriptId = st.ScriptId + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type globalInitScriptDetailsPb struct { + CreatedAt int `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + Name string `json:"name,omitempty"` + + Position int `json:"position,omitempty"` + + ScriptId string `json:"script_id,omitempty"` + + UpdatedAt int `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func globalInitScriptDetailsFromPb(pb *globalInitScriptDetailsPb) (*GlobalInitScriptDetails, error) { + if pb == nil { + return nil, nil + } + st := &GlobalInitScriptDetails{} + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Enabled = pb.Enabled + st.Name = pb.Name + st.Position = pb.Position + st.ScriptId = pb.ScriptId + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *globalInitScriptDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st globalInitScriptDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func globalInitScriptDetailsWithContentToPb(st *GlobalInitScriptDetailsWithContent) (*globalInitScriptDetailsWithContentPb, error) { + if st == nil { + return nil, nil + } + pb := &globalInitScriptDetailsWithContentPb{} + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Enabled = st.Enabled + + pb.Name = st.Name + + pb.Position = st.Position + + pb.Script = st.Script + + pb.ScriptId = st.ScriptId + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type globalInitScriptDetailsWithContentPb struct { + CreatedAt int `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + Name string `json:"name,omitempty"` + + Position int `json:"position,omitempty"` + + Script string `json:"script,omitempty"` + + ScriptId string `json:"script_id,omitempty"` + + UpdatedAt int `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func globalInitScriptDetailsWithContentFromPb(pb *globalInitScriptDetailsWithContentPb) (*GlobalInitScriptDetailsWithContent, error) { + if pb == nil { + return nil, nil + } + st := &GlobalInitScriptDetailsWithContent{} + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Enabled = pb.Enabled + st.Name = pb.Name + st.Position = pb.Position + st.Script = pb.Script + st.ScriptId = pb.ScriptId + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *globalInitScriptDetailsWithContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st globalInitScriptDetailsWithContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func globalInitScriptUpdateRequestToPb(st *GlobalInitScriptUpdateRequest) (*globalInitScriptUpdateRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &globalInitScriptUpdateRequestPb{} + pb.Enabled = st.Enabled + + pb.Name = st.Name + + pb.Position = st.Position + + pb.Script = st.Script + + pb.ScriptId = st.ScriptId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type globalInitScriptUpdateRequestPb struct { + Enabled bool `json:"enabled,omitempty"` + + Name string `json:"name"` + + Position int `json:"position,omitempty"` + + Script string `json:"script"` + + ScriptId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func globalInitScriptUpdateRequestFromPb(pb *globalInitScriptUpdateRequestPb) (*GlobalInitScriptUpdateRequest, error) { + if pb == nil { + return nil, nil + } + st := &GlobalInitScriptUpdateRequest{} + st.Enabled = pb.Enabled + st.Name = pb.Name + st.Position = pb.Position + st.Script = pb.Script + st.ScriptId = pb.ScriptId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *globalInitScriptUpdateRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st globalInitScriptUpdateRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func initScriptEventDetailsToPb(st *InitScriptEventDetails) (*initScriptEventDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &initScriptEventDetailsPb{} + pb.Cluster = st.Cluster + + pb.Global = st.Global + + pb.ReportedForNode = st.ReportedForNode + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type initScriptEventDetailsPb struct { + Cluster []InitScriptInfoAndExecutionDetails `json:"cluster,omitempty"` + + Global []InitScriptInfoAndExecutionDetails `json:"global,omitempty"` + + ReportedForNode string `json:"reported_for_node,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func initScriptEventDetailsFromPb(pb *initScriptEventDetailsPb) (*InitScriptEventDetails, error) { + if pb == nil { + return nil, nil + } + st := &InitScriptEventDetails{} + st.Cluster = pb.Cluster + st.Global = pb.Global + st.ReportedForNode = pb.ReportedForNode + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *initScriptEventDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st initScriptEventDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func initScriptInfoToPb(st *InitScriptInfo) (*initScriptInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &initScriptInfoPb{} + pb.Abfss = st.Abfss + + pb.Dbfs = st.Dbfs + + pb.File = st.File + + pb.Gcs = st.Gcs + + pb.S3 = st.S3 + + pb.Volumes = st.Volumes + + pb.Workspace = st.Workspace + + return pb, nil +} + +type initScriptInfoPb struct { + Abfss *Adlsgen2Info `json:"abfss,omitempty"` + + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + + File *LocalFileInfo `json:"file,omitempty"` + + Gcs *GcsStorageInfo `json:"gcs,omitempty"` + + S3 *S3StorageInfo `json:"s3,omitempty"` + + Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + + Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` +} + +func initScriptInfoFromPb(pb *initScriptInfoPb) (*InitScriptInfo, error) { + if pb == nil { + return nil, nil + } + st := &InitScriptInfo{} + st.Abfss = pb.Abfss + st.Dbfs = pb.Dbfs + st.File = pb.File + st.Gcs = pb.Gcs + st.S3 = pb.S3 + st.Volumes = pb.Volumes + st.Workspace = pb.Workspace + + return st, nil +} + +func initScriptInfoAndExecutionDetailsToPb(st *InitScriptInfoAndExecutionDetails) (*initScriptInfoAndExecutionDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &initScriptInfoAndExecutionDetailsPb{} + pb.Abfss = st.Abfss + + pb.Dbfs = st.Dbfs + + pb.ErrorMessage = st.ErrorMessage + + pb.ExecutionDurationSeconds = st.ExecutionDurationSeconds + + pb.File = st.File + + pb.Gcs = st.Gcs + + pb.S3 = st.S3 + + pb.Status = st.Status + + pb.Volumes = st.Volumes + + pb.Workspace = st.Workspace + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type initScriptInfoAndExecutionDetailsPb struct { + Abfss *Adlsgen2Info `json:"abfss,omitempty"` + + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + + ErrorMessage string `json:"error_message,omitempty"` + + ExecutionDurationSeconds int `json:"execution_duration_seconds,omitempty"` + + File *LocalFileInfo `json:"file,omitempty"` + + Gcs *GcsStorageInfo `json:"gcs,omitempty"` + + S3 *S3StorageInfo `json:"s3,omitempty"` + + Status InitScriptExecutionDetailsInitScriptExecutionStatus `json:"status,omitempty"` + + Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + + Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func initScriptInfoAndExecutionDetailsFromPb(pb *initScriptInfoAndExecutionDetailsPb) (*InitScriptInfoAndExecutionDetails, error) { + if pb == nil { + return nil, nil + } + st := &InitScriptInfoAndExecutionDetails{} + st.Abfss = pb.Abfss + st.Dbfs = pb.Dbfs + st.ErrorMessage = pb.ErrorMessage + st.ExecutionDurationSeconds = pb.ExecutionDurationSeconds + st.File = pb.File + st.Gcs = pb.Gcs + st.S3 = pb.S3 + st.Status = pb.Status + st.Volumes = pb.Volumes + st.Workspace = pb.Workspace + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *initScriptInfoAndExecutionDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st initScriptInfoAndExecutionDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func installLibrariesToPb(st *InstallLibraries) (*installLibrariesPb, error) { + if st == nil { + return nil, nil + } + pb := &installLibrariesPb{} + pb.ClusterId = st.ClusterId + + pb.Libraries = st.Libraries + + return pb, nil +} + +type installLibrariesPb struct { + ClusterId string `json:"cluster_id"` + + Libraries []Library `json:"libraries"` +} + +func installLibrariesFromPb(pb *installLibrariesPb) (*InstallLibraries, error) { + if pb == nil { + return nil, nil + } + st := &InstallLibraries{} + st.ClusterId = pb.ClusterId + st.Libraries = pb.Libraries + + return st, nil +} + +func installLibrariesResponseToPb(st *InstallLibrariesResponse) (*installLibrariesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &installLibrariesResponsePb{} + + return pb, nil +} + +type installLibrariesResponsePb struct { +} + +func installLibrariesResponseFromPb(pb *installLibrariesResponsePb) (*InstallLibrariesResponse, error) { + if pb == nil { + return nil, nil + } + st := &InstallLibrariesResponse{} + + return st, nil +} + +func instancePoolAccessControlRequestToPb(st *InstancePoolAccessControlRequest) (*instancePoolAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolAccessControlRequestFromPb(pb *instancePoolAccessControlRequestPb) (*InstancePoolAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolAccessControlResponseToPb(st *InstancePoolAccessControlResponse) (*instancePoolAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolAccessControlResponsePb struct { + AllPermissions []InstancePoolPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolAccessControlResponseFromPb(pb *instancePoolAccessControlResponsePb) (*InstancePoolAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolAndStatsToPb(st *InstancePoolAndStats) (*instancePoolAndStatsPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolAndStatsPb{} + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.CustomTags = st.CustomTags + + pb.DefaultTags = st.DefaultTags + + pb.DiskSpec = st.DiskSpec + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.GcpAttributes = st.GcpAttributes + + pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes + + pb.InstancePoolId = st.InstancePoolId + + pb.InstancePoolName = st.InstancePoolName + + pb.MaxCapacity = st.MaxCapacity + + pb.MinIdleInstances = st.MinIdleInstances + + pb.NodeTypeFlexibility = st.NodeTypeFlexibility + + pb.NodeTypeId = st.NodeTypeId + + pb.PreloadedDockerImages = st.PreloadedDockerImages + + pb.PreloadedSparkVersions = st.PreloadedSparkVersions + + pb.State = st.State + + pb.Stats = st.Stats + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolAndStatsPb struct { + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DefaultTags map[string]string `json:"default_tags,omitempty"` + + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + InstancePoolName string `json:"instance_pool_name,omitempty"` + + MaxCapacity int `json:"max_capacity,omitempty"` + + MinIdleInstances int `json:"min_idle_instances,omitempty"` + + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + + State InstancePoolState `json:"state,omitempty"` + + Stats *InstancePoolStats `json:"stats,omitempty"` + + Status *InstancePoolStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolAndStatsFromPb(pb *instancePoolAndStatsPb) (*InstancePoolAndStats, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolAndStats{} + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.CustomTags = pb.CustomTags + st.DefaultTags = pb.DefaultTags + st.DiskSpec = pb.DiskSpec + st.EnableElasticDisk = pb.EnableElasticDisk + st.GcpAttributes = pb.GcpAttributes + st.IdleInstanceAutoterminationMinutes = pb.IdleInstanceAutoterminationMinutes + st.InstancePoolId = pb.InstancePoolId + st.InstancePoolName = pb.InstancePoolName + st.MaxCapacity = pb.MaxCapacity + st.MinIdleInstances = pb.MinIdleInstances + st.NodeTypeFlexibility = pb.NodeTypeFlexibility + st.NodeTypeId = pb.NodeTypeId + st.PreloadedDockerImages = pb.PreloadedDockerImages + st.PreloadedSparkVersions = pb.PreloadedSparkVersions + st.State = pb.State + st.Stats = pb.Stats + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolAndStatsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolAndStatsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolAwsAttributesToPb(st *InstancePoolAwsAttributes) (*instancePoolAwsAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolAwsAttributesPb{} + pb.Availability = st.Availability + + pb.SpotBidPricePercent = st.SpotBidPricePercent + + pb.ZoneId = st.ZoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolAwsAttributesPb struct { + Availability InstancePoolAwsAttributesAvailability `json:"availability,omitempty"` + + SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + + ZoneId string `json:"zone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolAwsAttributesFromPb(pb *instancePoolAwsAttributesPb) (*InstancePoolAwsAttributes, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolAwsAttributes{} + st.Availability = pb.Availability + st.SpotBidPricePercent = pb.SpotBidPricePercent + st.ZoneId = pb.ZoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolAwsAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolAwsAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolAzureAttributesToPb(st *InstancePoolAzureAttributes) (*instancePoolAzureAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolAzureAttributesPb{} + pb.Availability = st.Availability + + pb.SpotBidMaxPrice = st.SpotBidMaxPrice + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolAzureAttributesPb struct { + Availability InstancePoolAzureAttributesAvailability `json:"availability,omitempty"` + + SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolAzureAttributesFromPb(pb *instancePoolAzureAttributesPb) (*InstancePoolAzureAttributes, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolAzureAttributes{} + st.Availability = pb.Availability + st.SpotBidMaxPrice = pb.SpotBidMaxPrice + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolAzureAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolAzureAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolGcpAttributesToPb(st *InstancePoolGcpAttributes) (*instancePoolGcpAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolGcpAttributesPb{} + pb.GcpAvailability = st.GcpAvailability + + pb.LocalSsdCount = st.LocalSsdCount + + pb.ZoneId = st.ZoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolGcpAttributesPb struct { + GcpAvailability GcpAvailability `json:"gcp_availability,omitempty"` + + LocalSsdCount int `json:"local_ssd_count,omitempty"` + + ZoneId string `json:"zone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolGcpAttributesFromPb(pb *instancePoolGcpAttributesPb) (*InstancePoolGcpAttributes, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolGcpAttributes{} + st.GcpAvailability = pb.GcpAvailability + st.LocalSsdCount = pb.LocalSsdCount + st.ZoneId = pb.ZoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolGcpAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolGcpAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolPermissionToPb(st *InstancePoolPermission) (*instancePoolPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolPermissionFromPb(pb *instancePoolPermissionPb) (*InstancePoolPermission, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolPermissionsToPb(st *InstancePoolPermissions) (*instancePoolPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolPermissionsPb struct { + AccessControlList []InstancePoolAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolPermissionsFromPb(pb *instancePoolPermissionsPb) (*InstancePoolPermissions, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolPermissionsDescriptionToPb(st *InstancePoolPermissionsDescription) (*instancePoolPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolPermissionsDescriptionFromPb(pb *instancePoolPermissionsDescriptionPb) (*InstancePoolPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolPermissionsRequestToPb(st *InstancePoolPermissionsRequest) (*instancePoolPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.InstancePoolId = st.InstancePoolId + + return pb, nil +} + +type instancePoolPermissionsRequestPb struct { + AccessControlList []InstancePoolAccessControlRequest `json:"access_control_list,omitempty"` + + InstancePoolId string `json:"-" url:"-"` +} + +func instancePoolPermissionsRequestFromPb(pb *instancePoolPermissionsRequestPb) (*InstancePoolPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.InstancePoolId = pb.InstancePoolId + + return st, nil +} + +func instancePoolStatsToPb(st *InstancePoolStats) (*instancePoolStatsPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolStatsPb{} + pb.IdleCount = st.IdleCount + + pb.PendingIdleCount = st.PendingIdleCount + + pb.PendingUsedCount = st.PendingUsedCount + + pb.UsedCount = st.UsedCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instancePoolStatsPb struct { + IdleCount int `json:"idle_count,omitempty"` + + PendingIdleCount int `json:"pending_idle_count,omitempty"` + + PendingUsedCount int `json:"pending_used_count,omitempty"` + + UsedCount int `json:"used_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instancePoolStatsFromPb(pb *instancePoolStatsPb) (*InstancePoolStats, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolStats{} + st.IdleCount = pb.IdleCount + st.PendingIdleCount = pb.PendingIdleCount + st.PendingUsedCount = pb.PendingUsedCount + st.UsedCount = pb.UsedCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instancePoolStatsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instancePoolStatsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func instancePoolStatusToPb(st *InstancePoolStatus) (*instancePoolStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &instancePoolStatusPb{} + pb.PendingInstanceErrors = st.PendingInstanceErrors + + return pb, nil +} + +type instancePoolStatusPb struct { + PendingInstanceErrors []PendingInstanceError `json:"pending_instance_errors,omitempty"` +} + +func instancePoolStatusFromPb(pb *instancePoolStatusPb) (*InstancePoolStatus, error) { + if pb == nil { + return nil, nil + } + st := &InstancePoolStatus{} + st.PendingInstanceErrors = pb.PendingInstanceErrors + + return st, nil +} + +func instanceProfileToPb(st *InstanceProfile) (*instanceProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &instanceProfilePb{} + pb.IamRoleArn = st.IamRoleArn + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.IsMetaInstanceProfile = st.IsMetaInstanceProfile + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type instanceProfilePb struct { + IamRoleArn string `json:"iam_role_arn,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn"` + + IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func instanceProfileFromPb(pb *instanceProfilePb) (*InstanceProfile, error) { + if pb == nil { + return nil, nil + } + st := &InstanceProfile{} + st.IamRoleArn = pb.IamRoleArn + st.InstanceProfileArn = pb.InstanceProfileArn + st.IsMetaInstanceProfile = pb.IsMetaInstanceProfile + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *instanceProfilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st instanceProfilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func libraryToPb(st *Library) (*libraryPb, error) { + if st == nil { + return nil, nil + } + pb := &libraryPb{} + pb.Cran = st.Cran + + pb.Egg = st.Egg + + pb.Jar = st.Jar + + pb.Maven = st.Maven + + pb.Pypi = st.Pypi + + pb.Requirements = st.Requirements + + pb.Whl = st.Whl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type libraryPb struct { + Cran *RCranLibrary `json:"cran,omitempty"` + + Egg string `json:"egg,omitempty"` + + Jar string `json:"jar,omitempty"` + + Maven *MavenLibrary `json:"maven,omitempty"` + + Pypi *PythonPyPiLibrary `json:"pypi,omitempty"` + + Requirements string `json:"requirements,omitempty"` + + Whl string `json:"whl,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func libraryFromPb(pb *libraryPb) (*Library, error) { + if pb == nil { + return nil, nil + } + st := &Library{} + st.Cran = pb.Cran + st.Egg = pb.Egg + st.Jar = pb.Jar + st.Maven = pb.Maven + st.Pypi = pb.Pypi + st.Requirements = pb.Requirements + st.Whl = pb.Whl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *libraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st libraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func libraryFullStatusToPb(st *LibraryFullStatus) (*libraryFullStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &libraryFullStatusPb{} + pb.IsLibraryForAllClusters = st.IsLibraryForAllClusters + + pb.Library = st.Library + + pb.Messages = st.Messages + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type libraryFullStatusPb struct { + IsLibraryForAllClusters bool `json:"is_library_for_all_clusters,omitempty"` + + Library *Library `json:"library,omitempty"` + + Messages []string `json:"messages,omitempty"` + + Status LibraryInstallStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func libraryFullStatusFromPb(pb *libraryFullStatusPb) (*LibraryFullStatus, error) { + if pb == nil { + return nil, nil + } + st := &LibraryFullStatus{} + st.IsLibraryForAllClusters = pb.IsLibraryForAllClusters + st.Library = pb.Library + st.Messages = pb.Messages + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *libraryFullStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st libraryFullStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAllClusterLibraryStatusesResponseToPb(st *ListAllClusterLibraryStatusesResponse) (*listAllClusterLibraryStatusesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAllClusterLibraryStatusesResponsePb{} + pb.Statuses = st.Statuses + + return pb, nil +} + +type listAllClusterLibraryStatusesResponsePb struct { + Statuses []ClusterLibraryStatuses `json:"statuses,omitempty"` +} + +func listAllClusterLibraryStatusesResponseFromPb(pb *listAllClusterLibraryStatusesResponsePb) (*ListAllClusterLibraryStatusesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAllClusterLibraryStatusesResponse{} + st.Statuses = pb.Statuses + + return st, nil +} + +func listAvailableZonesResponseToPb(st *ListAvailableZonesResponse) (*listAvailableZonesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAvailableZonesResponsePb{} + pb.DefaultZone = st.DefaultZone + + pb.Zones = st.Zones + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAvailableZonesResponsePb struct { + DefaultZone string `json:"default_zone,omitempty"` + + Zones []string `json:"zones,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAvailableZonesResponseFromPb(pb *listAvailableZonesResponsePb) (*ListAvailableZonesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAvailableZonesResponse{} + st.DefaultZone = pb.DefaultZone + st.Zones = pb.Zones + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAvailableZonesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAvailableZonesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClusterCompliancesRequestToPb(st *ListClusterCompliancesRequest) (*listClusterCompliancesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listClusterCompliancesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listClusterCompliancesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + PolicyId string `json:"-" url:"policy_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listClusterCompliancesRequestFromPb(pb *listClusterCompliancesRequestPb) (*ListClusterCompliancesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListClusterCompliancesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listClusterCompliancesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listClusterCompliancesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClusterCompliancesResponseToPb(st *ListClusterCompliancesResponse) (*listClusterCompliancesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listClusterCompliancesResponsePb{} + pb.Clusters = st.Clusters + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listClusterCompliancesResponsePb struct { + Clusters []ClusterCompliance `json:"clusters,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listClusterCompliancesResponseFromPb(pb *listClusterCompliancesResponsePb) (*ListClusterCompliancesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListClusterCompliancesResponse{} + st.Clusters = pb.Clusters + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listClusterCompliancesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listClusterCompliancesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClusterPoliciesRequestToPb(st *ListClusterPoliciesRequest) (*listClusterPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listClusterPoliciesRequestPb{} + pb.SortColumn = st.SortColumn + + pb.SortOrder = st.SortOrder + + return pb, nil +} + +type listClusterPoliciesRequestPb struct { + SortColumn ListSortColumn `json:"-" url:"sort_column,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sort_order,omitempty"` +} + +func listClusterPoliciesRequestFromPb(pb *listClusterPoliciesRequestPb) (*ListClusterPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListClusterPoliciesRequest{} + st.SortColumn = pb.SortColumn + st.SortOrder = pb.SortOrder + + return st, nil +} + +func listClustersFilterByToPb(st *ListClustersFilterBy) (*listClustersFilterByPb, error) { + if st == nil { + return nil, nil + } + pb := &listClustersFilterByPb{} + pb.ClusterSources = st.ClusterSources + + pb.ClusterStates = st.ClusterStates + + pb.IsPinned = st.IsPinned + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listClustersFilterByPb struct { + ClusterSources []ClusterSource `json:"cluster_sources,omitempty" url:"cluster_sources,omitempty"` + + ClusterStates []State `json:"cluster_states,omitempty" url:"cluster_states,omitempty"` + + IsPinned bool `json:"is_pinned,omitempty" url:"is_pinned,omitempty"` + + PolicyId string `json:"policy_id,omitempty" url:"policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listClustersFilterByFromPb(pb *listClustersFilterByPb) (*ListClustersFilterBy, error) { + if pb == nil { + return nil, nil + } + st := &ListClustersFilterBy{} + st.ClusterSources = pb.ClusterSources + st.ClusterStates = pb.ClusterStates + st.IsPinned = pb.IsPinned + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listClustersFilterByPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listClustersFilterByPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClustersRequestToPb(st *ListClustersRequest) (*listClustersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listClustersRequestPb{} + pb.FilterBy = st.FilterBy + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.SortBy = st.SortBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listClustersRequestPb struct { + FilterBy *ListClustersFilterBy `json:"-" url:"filter_by,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + SortBy *ListClustersSortBy `json:"-" url:"sort_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listClustersRequestFromPb(pb *listClustersRequestPb) (*ListClustersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListClustersRequest{} + st.FilterBy = pb.FilterBy + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.SortBy = pb.SortBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listClustersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listClustersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClustersResponseToPb(st *ListClustersResponse) (*listClustersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listClustersResponsePb{} + pb.Clusters = st.Clusters + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listClustersResponsePb struct { + Clusters []ClusterDetails `json:"clusters,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listClustersResponseFromPb(pb *listClustersResponsePb) (*ListClustersResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListClustersResponse{} + st.Clusters = pb.Clusters + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listClustersResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listClustersResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listClustersSortByToPb(st *ListClustersSortBy) (*listClustersSortByPb, error) { + if st == nil { + return nil, nil + } + pb := &listClustersSortByPb{} + pb.Direction = st.Direction + + pb.Field = st.Field + + return pb, nil +} + +type listClustersSortByPb struct { + Direction ListClustersSortByDirection `json:"direction,omitempty" url:"direction,omitempty"` + + Field ListClustersSortByField `json:"field,omitempty" url:"field,omitempty"` +} + +func listClustersSortByFromPb(pb *listClustersSortByPb) (*ListClustersSortBy, error) { + if pb == nil { + return nil, nil + } + st := &ListClustersSortBy{} + st.Direction = pb.Direction + st.Field = pb.Field + + return st, nil +} + +func listGlobalInitScriptsResponseToPb(st *ListGlobalInitScriptsResponse) (*listGlobalInitScriptsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listGlobalInitScriptsResponsePb{} + pb.Scripts = st.Scripts + + return pb, nil +} + +type listGlobalInitScriptsResponsePb struct { + Scripts []GlobalInitScriptDetails `json:"scripts,omitempty"` +} + +func listGlobalInitScriptsResponseFromPb(pb *listGlobalInitScriptsResponsePb) (*ListGlobalInitScriptsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListGlobalInitScriptsResponse{} + st.Scripts = pb.Scripts + + return st, nil +} + +func listInstancePoolsToPb(st *ListInstancePools) (*listInstancePoolsPb, error) { + if st == nil { + return nil, nil + } + pb := &listInstancePoolsPb{} + pb.InstancePools = st.InstancePools + + return pb, nil +} + +type listInstancePoolsPb struct { + InstancePools []InstancePoolAndStats `json:"instance_pools,omitempty"` +} + +func listInstancePoolsFromPb(pb *listInstancePoolsPb) (*ListInstancePools, error) { + if pb == nil { + return nil, nil + } + st := &ListInstancePools{} + st.InstancePools = pb.InstancePools + + return st, nil +} + +func listInstanceProfilesResponseToPb(st *ListInstanceProfilesResponse) (*listInstanceProfilesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listInstanceProfilesResponsePb{} + pb.InstanceProfiles = st.InstanceProfiles + + return pb, nil +} + +type listInstanceProfilesResponsePb struct { + InstanceProfiles []InstanceProfile `json:"instance_profiles,omitempty"` +} + +func listInstanceProfilesResponseFromPb(pb *listInstanceProfilesResponsePb) (*ListInstanceProfilesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListInstanceProfilesResponse{} + st.InstanceProfiles = pb.InstanceProfiles + + return st, nil +} + +func listNodeTypesResponseToPb(st *ListNodeTypesResponse) (*listNodeTypesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listNodeTypesResponsePb{} + pb.NodeTypes = st.NodeTypes + + return pb, nil +} + +type listNodeTypesResponsePb struct { + NodeTypes []NodeType `json:"node_types,omitempty"` +} + +func listNodeTypesResponseFromPb(pb *listNodeTypesResponsePb) (*ListNodeTypesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListNodeTypesResponse{} + st.NodeTypes = pb.NodeTypes + + return st, nil +} + +func listPoliciesResponseToPb(st *ListPoliciesResponse) (*listPoliciesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listPoliciesResponsePb{} + pb.Policies = st.Policies + + return pb, nil +} + +type listPoliciesResponsePb struct { + Policies []Policy `json:"policies,omitempty"` +} + +func listPoliciesResponseFromPb(pb *listPoliciesResponsePb) (*ListPoliciesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListPoliciesResponse{} + st.Policies = pb.Policies + + return st, nil +} + +func listPolicyFamiliesRequestToPb(st *ListPolicyFamiliesRequest) (*listPolicyFamiliesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listPolicyFamiliesRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPolicyFamiliesRequestPb struct { + MaxResults int64 `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPolicyFamiliesRequestFromPb(pb *listPolicyFamiliesRequestPb) (*ListPolicyFamiliesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListPolicyFamiliesRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPolicyFamiliesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPolicyFamiliesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPolicyFamiliesResponseToPb(st *ListPolicyFamiliesResponse) (*listPolicyFamiliesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listPolicyFamiliesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.PolicyFamilies = st.PolicyFamilies + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPolicyFamiliesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PolicyFamilies []PolicyFamily `json:"policy_families,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPolicyFamiliesResponseFromPb(pb *listPolicyFamiliesResponsePb) (*ListPolicyFamiliesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListPolicyFamiliesResponse{} + st.NextPageToken = pb.NextPageToken + st.PolicyFamilies = pb.PolicyFamilies + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPolicyFamiliesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPolicyFamiliesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func localFileInfoToPb(st *LocalFileInfo) (*localFileInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &localFileInfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type localFileInfoPb struct { + Destination string `json:"destination"` +} + +func localFileInfoFromPb(pb *localFileInfoPb) (*LocalFileInfo, error) { + if pb == nil { + return nil, nil + } + st := &LocalFileInfo{} + st.Destination = pb.Destination + + return st, nil +} + +func logAnalyticsInfoToPb(st *LogAnalyticsInfo) (*logAnalyticsInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &logAnalyticsInfoPb{} + pb.LogAnalyticsPrimaryKey = st.LogAnalyticsPrimaryKey + + pb.LogAnalyticsWorkspaceId = st.LogAnalyticsWorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logAnalyticsInfoPb struct { + LogAnalyticsPrimaryKey string `json:"log_analytics_primary_key,omitempty"` + + LogAnalyticsWorkspaceId string `json:"log_analytics_workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logAnalyticsInfoFromPb(pb *logAnalyticsInfoPb) (*LogAnalyticsInfo, error) { + if pb == nil { + return nil, nil + } + st := &LogAnalyticsInfo{} + st.LogAnalyticsPrimaryKey = pb.LogAnalyticsPrimaryKey + st.LogAnalyticsWorkspaceId = pb.LogAnalyticsWorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logAnalyticsInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logAnalyticsInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logSyncStatusToPb(st *LogSyncStatus) (*logSyncStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &logSyncStatusPb{} + pb.LastAttempted = st.LastAttempted + + pb.LastException = st.LastException + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logSyncStatusPb struct { + LastAttempted int64 `json:"last_attempted,omitempty"` + + LastException string `json:"last_exception,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logSyncStatusFromPb(pb *logSyncStatusPb) (*LogSyncStatus, error) { + if pb == nil { + return nil, nil + } + st := &LogSyncStatus{} + st.LastAttempted = pb.LastAttempted + st.LastException = pb.LastException + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logSyncStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logSyncStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func mavenLibraryToPb(st *MavenLibrary) (*mavenLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := &mavenLibraryPb{} + pb.Coordinates = st.Coordinates + + pb.Exclusions = st.Exclusions + + pb.Repo = st.Repo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type mavenLibraryPb struct { + Coordinates string `json:"coordinates"` + + Exclusions []string `json:"exclusions,omitempty"` + + Repo string `json:"repo,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func mavenLibraryFromPb(pb *mavenLibraryPb) (*MavenLibrary, error) { + if pb == nil { + return nil, nil + } + st := &MavenLibrary{} + st.Coordinates = pb.Coordinates + st.Exclusions = pb.Exclusions + st.Repo = pb.Repo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *mavenLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st mavenLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nodeInstanceTypeToPb(st *NodeInstanceType) (*nodeInstanceTypePb, error) { + if st == nil { + return nil, nil + } + pb := &nodeInstanceTypePb{} + pb.InstanceTypeId = st.InstanceTypeId + + pb.LocalDiskSizeGb = st.LocalDiskSizeGb + + pb.LocalDisks = st.LocalDisks + + pb.LocalNvmeDiskSizeGb = st.LocalNvmeDiskSizeGb + + pb.LocalNvmeDisks = st.LocalNvmeDisks + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type nodeInstanceTypePb struct { + InstanceTypeId string `json:"instance_type_id"` + + LocalDiskSizeGb int `json:"local_disk_size_gb,omitempty"` + + LocalDisks int `json:"local_disks,omitempty"` + + LocalNvmeDiskSizeGb int `json:"local_nvme_disk_size_gb,omitempty"` + + LocalNvmeDisks int `json:"local_nvme_disks,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func nodeInstanceTypeFromPb(pb *nodeInstanceTypePb) (*NodeInstanceType, error) { + if pb == nil { + return nil, nil + } + st := &NodeInstanceType{} + st.InstanceTypeId = pb.InstanceTypeId + st.LocalDiskSizeGb = pb.LocalDiskSizeGb + st.LocalDisks = pb.LocalDisks + st.LocalNvmeDiskSizeGb = pb.LocalNvmeDiskSizeGb + st.LocalNvmeDisks = pb.LocalNvmeDisks + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *nodeInstanceTypePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st nodeInstanceTypePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nodeTypeToPb(st *NodeType) (*nodeTypePb, error) { + if st == nil { + return nil, nil + } + pb := &nodeTypePb{} + pb.Category = st.Category + + pb.Description = st.Description + + pb.DisplayOrder = st.DisplayOrder + + pb.InstanceTypeId = st.InstanceTypeId + + pb.IsDeprecated = st.IsDeprecated + + pb.IsEncryptedInTransit = st.IsEncryptedInTransit + + pb.IsGraviton = st.IsGraviton + + pb.IsHidden = st.IsHidden + + pb.IsIoCacheEnabled = st.IsIoCacheEnabled + + pb.MemoryMb = st.MemoryMb + + pb.NodeInfo = st.NodeInfo + + pb.NodeInstanceType = st.NodeInstanceType + + pb.NodeTypeId = st.NodeTypeId + + pb.NumCores = st.NumCores + + pb.NumGpus = st.NumGpus + + pb.PhotonDriverCapable = st.PhotonDriverCapable + + pb.PhotonWorkerCapable = st.PhotonWorkerCapable + + pb.SupportClusterTags = st.SupportClusterTags + + pb.SupportEbsVolumes = st.SupportEbsVolumes + + pb.SupportPortForwarding = st.SupportPortForwarding + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type nodeTypePb struct { + Category string `json:"category"` + + Description string `json:"description"` + + DisplayOrder int `json:"display_order,omitempty"` + + InstanceTypeId string `json:"instance_type_id"` + + IsDeprecated bool `json:"is_deprecated,omitempty"` + + IsEncryptedInTransit bool `json:"is_encrypted_in_transit,omitempty"` + + IsGraviton bool `json:"is_graviton,omitempty"` + + IsHidden bool `json:"is_hidden,omitempty"` + + IsIoCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` + + MemoryMb int `json:"memory_mb"` + + NodeInfo *CloudProviderNodeInfo `json:"node_info,omitempty"` + + NodeInstanceType *NodeInstanceType `json:"node_instance_type,omitempty"` + + NodeTypeId string `json:"node_type_id"` + + NumCores float64 `json:"num_cores"` + + NumGpus int `json:"num_gpus,omitempty"` + + PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` + + PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` + + SupportClusterTags bool `json:"support_cluster_tags,omitempty"` + + SupportEbsVolumes bool `json:"support_ebs_volumes,omitempty"` + + SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func nodeTypeFromPb(pb *nodeTypePb) (*NodeType, error) { + if pb == nil { + return nil, nil + } + st := &NodeType{} + st.Category = pb.Category + st.Description = pb.Description + st.DisplayOrder = pb.DisplayOrder + st.InstanceTypeId = pb.InstanceTypeId + st.IsDeprecated = pb.IsDeprecated + st.IsEncryptedInTransit = pb.IsEncryptedInTransit + st.IsGraviton = pb.IsGraviton + st.IsHidden = pb.IsHidden + st.IsIoCacheEnabled = pb.IsIoCacheEnabled + st.MemoryMb = pb.MemoryMb + st.NodeInfo = pb.NodeInfo + st.NodeInstanceType = pb.NodeInstanceType + st.NodeTypeId = pb.NodeTypeId + st.NumCores = pb.NumCores + st.NumGpus = pb.NumGpus + st.PhotonDriverCapable = pb.PhotonDriverCapable + st.PhotonWorkerCapable = pb.PhotonWorkerCapable + st.SupportClusterTags = pb.SupportClusterTags + st.SupportEbsVolumes = pb.SupportEbsVolumes + st.SupportPortForwarding = pb.SupportPortForwarding + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *nodeTypePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st nodeTypePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nodeTypeFlexibilityToPb(st *NodeTypeFlexibility) (*nodeTypeFlexibilityPb, error) { + if st == nil { + return nil, nil + } + pb := &nodeTypeFlexibilityPb{} + + return pb, nil +} + +type nodeTypeFlexibilityPb struct { +} + +func nodeTypeFlexibilityFromPb(pb *nodeTypeFlexibilityPb) (*NodeTypeFlexibility, error) { + if pb == nil { + return nil, nil + } + st := &NodeTypeFlexibility{} + + return st, nil +} + +func pendingInstanceErrorToPb(st *PendingInstanceError) (*pendingInstanceErrorPb, error) { + if st == nil { + return nil, nil + } + pb := &pendingInstanceErrorPb{} + pb.InstanceId = st.InstanceId + + pb.Message = st.Message + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pendingInstanceErrorPb struct { + InstanceId string `json:"instance_id,omitempty"` + + Message string `json:"message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pendingInstanceErrorFromPb(pb *pendingInstanceErrorPb) (*PendingInstanceError, error) { + if pb == nil { + return nil, nil + } + st := &PendingInstanceError{} + st.InstanceId = pb.InstanceId + st.Message = pb.Message + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pendingInstanceErrorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pendingInstanceErrorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permanentDeleteClusterToPb(st *PermanentDeleteCluster) (*permanentDeleteClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &permanentDeleteClusterPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type permanentDeleteClusterPb struct { + ClusterId string `json:"cluster_id"` +} + +func permanentDeleteClusterFromPb(pb *permanentDeleteClusterPb) (*PermanentDeleteCluster, error) { + if pb == nil { + return nil, nil + } + st := &PermanentDeleteCluster{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func permanentDeleteClusterResponseToPb(st *PermanentDeleteClusterResponse) (*permanentDeleteClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &permanentDeleteClusterResponsePb{} + + return pb, nil +} + +type permanentDeleteClusterResponsePb struct { +} + +func permanentDeleteClusterResponseFromPb(pb *permanentDeleteClusterResponsePb) (*PermanentDeleteClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &PermanentDeleteClusterResponse{} + + return st, nil +} + +func pinClusterToPb(st *PinCluster) (*pinClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &pinClusterPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type pinClusterPb struct { + ClusterId string `json:"cluster_id"` +} + +func pinClusterFromPb(pb *pinClusterPb) (*PinCluster, error) { + if pb == nil { + return nil, nil + } + st := &PinCluster{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func pinClusterResponseToPb(st *PinClusterResponse) (*pinClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &pinClusterResponsePb{} + + return pb, nil +} + +type pinClusterResponsePb struct { +} + +func pinClusterResponseFromPb(pb *pinClusterResponsePb) (*PinClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &PinClusterResponse{} + + return st, nil +} + +func policyToPb(st *Policy) (*policyPb, error) { + if st == nil { + return nil, nil + } + pb := &policyPb{} + pb.CreatedAtTimestamp = st.CreatedAtTimestamp + + pb.CreatorUserName = st.CreatorUserName + + pb.Definition = st.Definition + + pb.Description = st.Description + + pb.IsDefault = st.IsDefault + + pb.Libraries = st.Libraries + + pb.MaxClustersPerUser = st.MaxClustersPerUser + + pb.Name = st.Name + + pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides + + pb.PolicyFamilyId = st.PolicyFamilyId + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type policyPb struct { + CreatedAtTimestamp int64 `json:"created_at_timestamp,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + Definition string `json:"definition,omitempty"` + + Description string `json:"description,omitempty"` + + IsDefault bool `json:"is_default,omitempty"` + + Libraries []Library `json:"libraries,omitempty"` + + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + + Name string `json:"name,omitempty"` + + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + + PolicyFamilyId string `json:"policy_family_id,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func policyFromPb(pb *policyPb) (*Policy, error) { + if pb == nil { + return nil, nil + } + st := &Policy{} + st.CreatedAtTimestamp = pb.CreatedAtTimestamp + st.CreatorUserName = pb.CreatorUserName + st.Definition = pb.Definition + st.Description = pb.Description + st.IsDefault = pb.IsDefault + st.Libraries = pb.Libraries + st.MaxClustersPerUser = pb.MaxClustersPerUser + st.Name = pb.Name + st.PolicyFamilyDefinitionOverrides = pb.PolicyFamilyDefinitionOverrides + st.PolicyFamilyId = pb.PolicyFamilyId + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *policyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st policyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func policyFamilyToPb(st *PolicyFamily) (*policyFamilyPb, error) { + if st == nil { + return nil, nil + } + pb := &policyFamilyPb{} + pb.Definition = st.Definition + + pb.Description = st.Description + + pb.Name = st.Name + + pb.PolicyFamilyId = st.PolicyFamilyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type policyFamilyPb struct { + Definition string `json:"definition,omitempty"` + + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + PolicyFamilyId string `json:"policy_family_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func policyFamilyFromPb(pb *policyFamilyPb) (*PolicyFamily, error) { + if pb == nil { + return nil, nil + } + st := &PolicyFamily{} + st.Definition = pb.Definition + st.Description = pb.Description + st.Name = pb.Name + st.PolicyFamilyId = pb.PolicyFamilyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *policyFamilyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st policyFamilyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pythonPyPiLibraryToPb(st *PythonPyPiLibrary) (*pythonPyPiLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := &pythonPyPiLibraryPb{} + pb.Package = st.Package + + pb.Repo = st.Repo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pythonPyPiLibraryPb struct { + Package string `json:"package"` + + Repo string `json:"repo,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pythonPyPiLibraryFromPb(pb *pythonPyPiLibraryPb) (*PythonPyPiLibrary, error) { + if pb == nil { + return nil, nil + } + st := &PythonPyPiLibrary{} + st.Package = pb.Package + st.Repo = pb.Repo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pythonPyPiLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pythonPyPiLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func rCranLibraryToPb(st *RCranLibrary) (*rCranLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := &rCranLibraryPb{} + pb.Package = st.Package + + pb.Repo = st.Repo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type rCranLibraryPb struct { + Package string `json:"package"` + + Repo string `json:"repo,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func rCranLibraryFromPb(pb *rCranLibraryPb) (*RCranLibrary, error) { + if pb == nil { + return nil, nil + } + st := &RCranLibrary{} + st.Package = pb.Package + st.Repo = pb.Repo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *rCranLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st rCranLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func removeInstanceProfileToPb(st *RemoveInstanceProfile) (*removeInstanceProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &removeInstanceProfilePb{} + pb.InstanceProfileArn = st.InstanceProfileArn + + return pb, nil +} + +type removeInstanceProfilePb struct { + InstanceProfileArn string `json:"instance_profile_arn"` +} + +func removeInstanceProfileFromPb(pb *removeInstanceProfilePb) (*RemoveInstanceProfile, error) { + if pb == nil { + return nil, nil + } + st := &RemoveInstanceProfile{} + st.InstanceProfileArn = pb.InstanceProfileArn + + return st, nil +} + +func removeResponseToPb(st *RemoveResponse) (*removeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &removeResponsePb{} + + return pb, nil +} + +type removeResponsePb struct { +} + +func removeResponseFromPb(pb *removeResponsePb) (*RemoveResponse, error) { + if pb == nil { + return nil, nil + } + st := &RemoveResponse{} + + return st, nil +} + +func resizeClusterToPb(st *ResizeCluster) (*resizeClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &resizeClusterPb{} + pb.Autoscale = st.Autoscale + + pb.ClusterId = st.ClusterId + + pb.NumWorkers = st.NumWorkers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resizeClusterPb struct { + Autoscale *AutoScale `json:"autoscale,omitempty"` + + ClusterId string `json:"cluster_id"` + + NumWorkers int `json:"num_workers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resizeClusterFromPb(pb *resizeClusterPb) (*ResizeCluster, error) { + if pb == nil { + return nil, nil + } + st := &ResizeCluster{} + st.Autoscale = pb.Autoscale + st.ClusterId = pb.ClusterId + st.NumWorkers = pb.NumWorkers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resizeClusterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resizeClusterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resizeClusterResponseToPb(st *ResizeClusterResponse) (*resizeClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &resizeClusterResponsePb{} + + return pb, nil +} + +type resizeClusterResponsePb struct { +} + +func resizeClusterResponseFromPb(pb *resizeClusterResponsePb) (*ResizeClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &ResizeClusterResponse{} + + return st, nil +} + +func restartClusterToPb(st *RestartCluster) (*restartClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &restartClusterPb{} + pb.ClusterId = st.ClusterId + + pb.RestartUser = st.RestartUser + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type restartClusterPb struct { + ClusterId string `json:"cluster_id"` + + RestartUser string `json:"restart_user,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func restartClusterFromPb(pb *restartClusterPb) (*RestartCluster, error) { + if pb == nil { + return nil, nil + } + st := &RestartCluster{} + st.ClusterId = pb.ClusterId + st.RestartUser = pb.RestartUser + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *restartClusterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st restartClusterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func restartClusterResponseToPb(st *RestartClusterResponse) (*restartClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &restartClusterResponsePb{} + + return pb, nil +} + +type restartClusterResponsePb struct { +} + +func restartClusterResponseFromPb(pb *restartClusterResponsePb) (*RestartClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &RestartClusterResponse{} + + return st, nil +} + +func resultsToPb(st *Results) (*resultsPb, error) { + if st == nil { + return nil, nil + } + pb := &resultsPb{} + pb.Cause = st.Cause + + pb.Data = st.Data + + pb.FileName = st.FileName + + pb.FileNames = st.FileNames + + pb.IsJsonSchema = st.IsJsonSchema + + pb.Pos = st.Pos + + pb.ResultType = st.ResultType + + pb.Schema = st.Schema + + pb.Summary = st.Summary + + pb.Truncated = st.Truncated + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultsPb struct { + Cause string `json:"cause,omitempty"` + + Data any `json:"data,omitempty"` + + FileName string `json:"fileName,omitempty"` + + FileNames []string `json:"fileNames,omitempty"` + + IsJsonSchema bool `json:"isJsonSchema,omitempty"` + + Pos int `json:"pos,omitempty"` + + ResultType ResultType `json:"resultType,omitempty"` + + Schema []map[string]any `json:"schema,omitempty"` + + Summary string `json:"summary,omitempty"` + + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultsFromPb(pb *resultsPb) (*Results, error) { + if pb == nil { + return nil, nil + } + st := &Results{} + st.Cause = pb.Cause + st.Data = pb.Data + st.FileName = pb.FileName + st.FileNames = pb.FileNames + st.IsJsonSchema = pb.IsJsonSchema + st.Pos = pb.Pos + st.ResultType = pb.ResultType + st.Schema = pb.Schema + st.Summary = pb.Summary + st.Truncated = pb.Truncated + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func s3StorageInfoToPb(st *S3StorageInfo) (*s3StorageInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &s3StorageInfoPb{} + pb.CannedAcl = st.CannedAcl + + pb.Destination = st.Destination + + pb.EnableEncryption = st.EnableEncryption + + pb.EncryptionType = st.EncryptionType + + pb.Endpoint = st.Endpoint + + pb.KmsKey = st.KmsKey + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type s3StorageInfoPb struct { + CannedAcl string `json:"canned_acl,omitempty"` + + Destination string `json:"destination"` + + EnableEncryption bool `json:"enable_encryption,omitempty"` + + EncryptionType string `json:"encryption_type,omitempty"` + + Endpoint string `json:"endpoint,omitempty"` + + KmsKey string `json:"kms_key,omitempty"` + + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func s3StorageInfoFromPb(pb *s3StorageInfoPb) (*S3StorageInfo, error) { + if pb == nil { + return nil, nil + } + st := &S3StorageInfo{} + st.CannedAcl = pb.CannedAcl + st.Destination = pb.Destination + st.EnableEncryption = pb.EnableEncryption + st.EncryptionType = pb.EncryptionType + st.Endpoint = pb.Endpoint + st.KmsKey = pb.KmsKey + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *s3StorageInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st s3StorageInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparkNodeToPb(st *SparkNode) (*sparkNodePb, error) { + if st == nil { + return nil, nil + } + pb := &sparkNodePb{} + pb.HostPrivateIp = st.HostPrivateIp + + pb.InstanceId = st.InstanceId + + pb.NodeAwsAttributes = st.NodeAwsAttributes + + pb.NodeId = st.NodeId + + pb.PrivateIp = st.PrivateIp + + pb.PublicDns = st.PublicDns + + pb.StartTimestamp = st.StartTimestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sparkNodePb struct { + HostPrivateIp string `json:"host_private_ip,omitempty"` + + InstanceId string `json:"instance_id,omitempty"` + + NodeAwsAttributes *SparkNodeAwsAttributes `json:"node_aws_attributes,omitempty"` + + NodeId string `json:"node_id,omitempty"` + + PrivateIp string `json:"private_ip,omitempty"` + + PublicDns string `json:"public_dns,omitempty"` + + StartTimestamp int64 `json:"start_timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sparkNodeFromPb(pb *sparkNodePb) (*SparkNode, error) { + if pb == nil { + return nil, nil + } + st := &SparkNode{} + st.HostPrivateIp = pb.HostPrivateIp + st.InstanceId = pb.InstanceId + st.NodeAwsAttributes = pb.NodeAwsAttributes + st.NodeId = pb.NodeId + st.PrivateIp = pb.PrivateIp + st.PublicDns = pb.PublicDns + st.StartTimestamp = pb.StartTimestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sparkNodePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sparkNodePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparkNodeAwsAttributesToPb(st *SparkNodeAwsAttributes) (*sparkNodeAwsAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &sparkNodeAwsAttributesPb{} + pb.IsSpot = st.IsSpot + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sparkNodeAwsAttributesPb struct { + IsSpot bool `json:"is_spot,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sparkNodeAwsAttributesFromPb(pb *sparkNodeAwsAttributesPb) (*SparkNodeAwsAttributes, error) { + if pb == nil { + return nil, nil + } + st := &SparkNodeAwsAttributes{} + st.IsSpot = pb.IsSpot + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sparkNodeAwsAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sparkNodeAwsAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparkVersionToPb(st *SparkVersion) (*sparkVersionPb, error) { + if st == nil { + return nil, nil + } + pb := &sparkVersionPb{} + pb.Key = st.Key + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sparkVersionPb struct { + Key string `json:"key,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sparkVersionFromPb(pb *sparkVersionPb) (*SparkVersion, error) { + if pb == nil { + return nil, nil + } + st := &SparkVersion{} + st.Key = pb.Key + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sparkVersionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sparkVersionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func startClusterToPb(st *StartCluster) (*startClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &startClusterPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type startClusterPb struct { + ClusterId string `json:"cluster_id"` +} + +func startClusterFromPb(pb *startClusterPb) (*StartCluster, error) { + if pb == nil { + return nil, nil + } + st := &StartCluster{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func startClusterResponseToPb(st *StartClusterResponse) (*startClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &startClusterResponsePb{} + + return pb, nil +} + +type startClusterResponsePb struct { +} + +func startClusterResponseFromPb(pb *startClusterResponsePb) (*StartClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &StartClusterResponse{} + + return st, nil +} + +func terminationReasonToPb(st *TerminationReason) (*terminationReasonPb, error) { + if st == nil { + return nil, nil + } + pb := &terminationReasonPb{} + pb.Code = st.Code + + pb.Parameters = st.Parameters + + pb.Type = st.Type + + return pb, nil +} + +type terminationReasonPb struct { + Code TerminationReasonCode `json:"code,omitempty"` + + Parameters map[string]string `json:"parameters,omitempty"` + + Type TerminationReasonType `json:"type,omitempty"` +} + +func terminationReasonFromPb(pb *terminationReasonPb) (*TerminationReason, error) { + if pb == nil { + return nil, nil + } + st := &TerminationReason{} + st.Code = pb.Code + st.Parameters = pb.Parameters + st.Type = pb.Type + + return st, nil +} + +func uninstallLibrariesToPb(st *UninstallLibraries) (*uninstallLibrariesPb, error) { + if st == nil { + return nil, nil + } + pb := &uninstallLibrariesPb{} + pb.ClusterId = st.ClusterId + + pb.Libraries = st.Libraries + + return pb, nil +} + +type uninstallLibrariesPb struct { + ClusterId string `json:"cluster_id"` + + Libraries []Library `json:"libraries"` +} + +func uninstallLibrariesFromPb(pb *uninstallLibrariesPb) (*UninstallLibraries, error) { + if pb == nil { + return nil, nil + } + st := &UninstallLibraries{} + st.ClusterId = pb.ClusterId + st.Libraries = pb.Libraries + + return st, nil +} + +func uninstallLibrariesResponseToPb(st *UninstallLibrariesResponse) (*uninstallLibrariesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &uninstallLibrariesResponsePb{} + + return pb, nil +} + +type uninstallLibrariesResponsePb struct { +} + +func uninstallLibrariesResponseFromPb(pb *uninstallLibrariesResponsePb) (*UninstallLibrariesResponse, error) { + if pb == nil { + return nil, nil + } + st := &UninstallLibrariesResponse{} + + return st, nil +} + +func unpinClusterToPb(st *UnpinCluster) (*unpinClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &unpinClusterPb{} + pb.ClusterId = st.ClusterId + + return pb, nil +} + +type unpinClusterPb struct { + ClusterId string `json:"cluster_id"` +} + +func unpinClusterFromPb(pb *unpinClusterPb) (*UnpinCluster, error) { + if pb == nil { + return nil, nil + } + st := &UnpinCluster{} + st.ClusterId = pb.ClusterId + + return st, nil +} + +func unpinClusterResponseToPb(st *UnpinClusterResponse) (*unpinClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &unpinClusterResponsePb{} + + return pb, nil +} + +type unpinClusterResponsePb struct { +} + +func unpinClusterResponseFromPb(pb *unpinClusterResponsePb) (*UnpinClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &UnpinClusterResponse{} + + return st, nil +} + +func updateClusterToPb(st *UpdateCluster) (*updateClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &updateClusterPb{} + pb.Cluster = st.Cluster + + pb.ClusterId = st.ClusterId + + pb.UpdateMask = st.UpdateMask + + return pb, nil +} + +type updateClusterPb struct { + Cluster *UpdateClusterResource `json:"cluster,omitempty"` + + ClusterId string `json:"cluster_id"` + + UpdateMask string `json:"update_mask"` +} + +func updateClusterFromPb(pb *updateClusterPb) (*UpdateCluster, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCluster{} + st.Cluster = pb.Cluster + st.ClusterId = pb.ClusterId + st.UpdateMask = pb.UpdateMask + + return st, nil +} + +func updateClusterResourceToPb(st *UpdateClusterResource) (*updateClusterResourcePb, error) { + if st == nil { + return nil, nil + } + pb := &updateClusterResourcePb{} + pb.Autoscale = st.Autoscale + + pb.AutoterminationMinutes = st.AutoterminationMinutes + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterLogConf = st.ClusterLogConf + + pb.ClusterName = st.ClusterName + + pb.CustomTags = st.CustomTags + + pb.DataSecurityMode = st.DataSecurityMode + + pb.DockerImage = st.DockerImage + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableElasticDisk = st.EnableElasticDisk + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.IsSingleNode = st.IsSingleNode + + pb.Kind = st.Kind + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.RuntimeEngine = st.RuntimeEngine + + pb.SingleUserName = st.SingleUserName + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SparkVersion = st.SparkVersion + + pb.SshPublicKeys = st.SshPublicKeys + + pb.UseMlRuntime = st.UseMlRuntime + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateClusterResourcePb struct { + Autoscale *AutoScale `json:"autoscale,omitempty"` + + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + + ClusterName string `json:"cluster_name,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + + DockerImage *DockerImage `json:"docker_image,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + IsSingleNode bool `json:"is_single_node,omitempty"` + + Kind Kind `json:"kind,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + + SingleUserName string `json:"single_user_name,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SparkVersion string `json:"spark_version,omitempty"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + + WorkloadType *WorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateClusterResourceFromPb(pb *updateClusterResourcePb) (*UpdateClusterResource, error) { + if pb == nil { + return nil, nil + } + st := &UpdateClusterResource{} + st.Autoscale = pb.Autoscale + st.AutoterminationMinutes = pb.AutoterminationMinutes + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterLogConf = pb.ClusterLogConf + st.ClusterName = pb.ClusterName + st.CustomTags = pb.CustomTags + st.DataSecurityMode = pb.DataSecurityMode + st.DockerImage = pb.DockerImage + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableElasticDisk = pb.EnableElasticDisk + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.IsSingleNode = pb.IsSingleNode + st.Kind = pb.Kind + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.RuntimeEngine = pb.RuntimeEngine + st.SingleUserName = pb.SingleUserName + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SparkVersion = pb.SparkVersion + st.SshPublicKeys = pb.SshPublicKeys + st.UseMlRuntime = pb.UseMlRuntime + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateClusterResourcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateClusterResourcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateClusterResponseToPb(st *UpdateClusterResponse) (*updateClusterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateClusterResponsePb{} + + return pb, nil +} + +type updateClusterResponsePb struct { +} + +func updateClusterResponseFromPb(pb *updateClusterResponsePb) (*UpdateClusterResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateClusterResponse{} + + return st, nil +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func volumesStorageInfoToPb(st *VolumesStorageInfo) (*volumesStorageInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &volumesStorageInfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type volumesStorageInfoPb struct { + Destination string `json:"destination"` +} + +func volumesStorageInfoFromPb(pb *volumesStorageInfoPb) (*VolumesStorageInfo, error) { + if pb == nil { + return nil, nil + } + st := &VolumesStorageInfo{} + st.Destination = pb.Destination + + return st, nil +} + +func workloadTypeToPb(st *WorkloadType) (*workloadTypePb, error) { + if st == nil { + return nil, nil + } + pb := &workloadTypePb{} + pb.Clients = st.Clients + + return pb, nil +} + +type workloadTypePb struct { + Clients ClientsTypes `json:"clients"` +} + +func workloadTypeFromPb(pb *workloadTypePb) (*WorkloadType, error) { + if pb == nil { + return nil, nil + } + st := &WorkloadType{} + st.Clients = pb.Clients + + return st, nil +} + +func workspaceStorageInfoToPb(st *WorkspaceStorageInfo) (*workspaceStorageInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceStorageInfoPb{} + pb.Destination = st.Destination + + return pb, nil +} + +type workspaceStorageInfoPb struct { + Destination string `json:"destination"` +} + +func workspaceStorageInfoFromPb(pb *workspaceStorageInfoPb) (*WorkspaceStorageInfo, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceStorageInfo{} + st.Destination = pb.Destination + + return st, nil +} diff --git a/service/compute/model.go b/service/compute/model.go index 86cc5d944..d1afe38f5 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -3,9 +3,10 @@ package compute import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AddInstanceProfile struct { @@ -17,16 +18,19 @@ type AddInstanceProfile struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn string `json:"iam_role_arn,omitempty"` + // Wire name: 'iam_role_arn' + IamRoleArn string // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn string `json:"instance_profile_arn"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + // Wire name: 'is_meta_instance_profile' + IsMetaInstanceProfile bool // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error @@ -34,48 +38,136 @@ type AddInstanceProfile struct { // “Your requested instance type is not supported in your requested // availability zone”), you can pass this flag to skip the validation and // forcibly add the instance profile. - SkipValidation bool `json:"skip_validation,omitempty"` + // Wire name: 'skip_validation' + SkipValidation bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AddInstanceProfile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AddInstanceProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addInstanceProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addInstanceProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AddInstanceProfile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AddInstanceProfile) MarshalJSON() ([]byte, error) { + pb, err := addInstanceProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AddResponse struct { } +func (st *AddResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AddResponse) MarshalJSON() ([]byte, error) { + pb, err := addResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // A storage location in Adls Gen2 type Adlsgen2Info struct { // abfss destination, e.g. // `abfss://@.dfs.core.windows.net/`. - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *Adlsgen2Info) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &adlsgen2InfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := adlsgen2InfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Adlsgen2Info) MarshalJSON() ([]byte, error) { + pb, err := adlsgen2InfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AutoScale struct { // The maximum number of workers to which the cluster can scale up when // overloaded. Note that `max_workers` must be strictly greater than // `min_workers`. - MaxWorkers int `json:"max_workers,omitempty"` + // Wire name: 'max_workers' + MaxWorkers int // The minimum number of workers to which the cluster can scale down when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers int `json:"min_workers,omitempty"` + // Wire name: 'min_workers' + MinWorkers int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AutoScale) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AutoScale) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &autoScalePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := autoScaleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AutoScale) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AutoScale) MarshalJSON() ([]byte, error) { + pb, err := autoScaleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Attributes set during cluster creation which are related to Amazon Web @@ -86,7 +178,8 @@ type AwsAttributes struct { // // Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. - Availability AwsAvailability `json:"availability,omitempty"` + // Wire name: 'availability' + Availability AwsAvailability // The number of volumes launched for each instance. Users can choose up to // 10 volumes. This feature is only enabled for supported node types. Legacy // node types cannot specify custom EBS volumes. For node types with no @@ -103,21 +196,26 @@ type AwsAttributes struct { // // Please note that if EBS volumes are specified, then the Spark // configuration `spark.local.dir` will be overridden. - EbsVolumeCount int `json:"ebs_volume_count,omitempty"` + // Wire name: 'ebs_volume_count' + EbsVolumeCount int // If using gp3 volumes, what IOPS to use for the disk. If this is not set, // the maximum performance of a gp2 volume with the same volume size will be // used. - EbsVolumeIops int `json:"ebs_volume_iops,omitempty"` + // Wire name: 'ebs_volume_iops' + EbsVolumeIops int // The size of each EBS volume (in GiB) launched for each instance. For // general purpose SSD, this value must be within the range 100 - 4096. For // throughput optimized HDD, this value must be within the range 500 - 4096. - EbsVolumeSize int `json:"ebs_volume_size,omitempty"` + // Wire name: 'ebs_volume_size' + EbsVolumeSize int // If using gp3 volumes, what throughput to use for the disk. If this is not // set, the maximum performance of a gp2 volume with the same volume size // will be used. - EbsVolumeThroughput int `json:"ebs_volume_throughput,omitempty"` + // Wire name: 'ebs_volume_throughput' + EbsVolumeThroughput int // The type of EBS volumes that will be launched with this cluster. - EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` + // Wire name: 'ebs_volume_type' + EbsVolumeType EbsVolumeType // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. If this value is greater than 0, the cluster driver // node in particular will be placed on an on-demand instance. If this value @@ -127,14 +225,16 @@ type AwsAttributes struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand int `json:"first_on_demand,omitempty"` + // Wire name: 'first_on_demand' + FirstOnDemand int // Nodes for this cluster will only be placed on AWS instances with this // instance profile. If ommitted, nodes will be placed on instances without // an IAM instance profile. The instance profile must have previously been // added to the Databricks environment by an account administrator. // // This feature may only be available to certain customer plans. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // The bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -145,7 +245,8 @@ type AwsAttributes struct { // instances whose bid price percentage matches this field will be // considered. Note that, for safety, we enforce this field to be no more // than 10000. - SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + // Wire name: 'spot_bid_price_percent' + SpotBidPricePercent int // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -158,17 +259,35 @@ type AwsAttributes struct { // // The list of available zones as well as the default value can be found by // using the `List Zones` method. - ZoneId string `json:"zone_id,omitempty"` + // Wire name: 'zone_id' + ZoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsAttributes) MarshalJSON() ([]byte, error) { + pb, err := awsAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Availability type used for all subsequent nodes past the `first_on_demand` @@ -177,6 +296,7 @@ func (s AwsAttributes) MarshalJSON() ([]byte, error) { // Note: If `first_on_demand` is zero, this availability type will be used for // the entire cluster. type AwsAvailability string +type awsAvailabilityPb string const AwsAvailabilityOnDemand AwsAvailability = `ON_DEMAND` @@ -205,12 +325,29 @@ func (f *AwsAvailability) Type() string { return "AwsAvailability" } +func awsAvailabilityToPb(st *AwsAvailability) (*awsAvailabilityPb, error) { + if st == nil { + return nil, nil + } + pb := awsAvailabilityPb(*st) + return &pb, nil +} + +func awsAvailabilityFromPb(pb *awsAvailabilityPb) (*AwsAvailability, error) { + if pb == nil { + return nil, nil + } + st := AwsAvailability(*pb) + return &st, nil +} + // Attributes set during cluster creation which are related to Microsoft Azure. type AzureAttributes struct { // Availability type used for all subsequent nodes past the // `first_on_demand` ones. Note: If `first_on_demand` is zero, this // availability type will be used for the entire cluster. - Availability AzureAvailability `json:"availability,omitempty"` + // Wire name: 'availability' + Availability AzureAvailability // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. This value should be greater than 0, to make sure // the cluster driver node is placed on an on-demand instance. If this value @@ -220,31 +357,52 @@ type AzureAttributes struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand int `json:"first_on_demand,omitempty"` + // Wire name: 'first_on_demand' + FirstOnDemand int // Defines values necessary to configure and run Azure Log Analytics agent - LogAnalyticsInfo *LogAnalyticsInfo `json:"log_analytics_info,omitempty"` + // Wire name: 'log_analytics_info' + LogAnalyticsInfo *LogAnalyticsInfo // The max bid price to be used for Azure spot instances. The Max price for // the bid cannot be higher than the on-demand price of the instance. If not // specified, the default value is -1, which specifies that the instance // cannot be evicted on the basis of price, and only on the basis of // availability. Further, the value should > 0 or -1. - SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + // Wire name: 'spot_bid_max_price' + SpotBidMaxPrice float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureAttributes) MarshalJSON() ([]byte, error) { + pb, err := azureAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Availability type used for all subsequent nodes past the `first_on_demand` // ones. Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. type AzureAvailability string +type azureAvailabilityPb string const AzureAvailabilityOnDemandAzure AzureAvailability = `ON_DEMAND_AZURE` @@ -273,64 +431,251 @@ func (f *AzureAvailability) Type() string { return "AzureAvailability" } +func azureAvailabilityToPb(st *AzureAvailability) (*azureAvailabilityPb, error) { + if st == nil { + return nil, nil + } + pb := azureAvailabilityPb(*st) + return &pb, nil +} + +func azureAvailabilityFromPb(pb *azureAvailabilityPb) (*AzureAvailability, error) { + if pb == nil { + return nil, nil + } + st := AzureAvailability(*pb) + return &st, nil +} + type CancelCommand struct { - ClusterId string `json:"clusterId,omitempty"` - CommandId string `json:"commandId,omitempty"` + // Wire name: 'clusterId' + ClusterId string + + // Wire name: 'commandId' + CommandId string - ContextId string `json:"contextId,omitempty"` + // Wire name: 'contextId' + ContextId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CancelCommand) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CancelCommand) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelCommandPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelCommandFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CancelCommand) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CancelCommand) MarshalJSON() ([]byte, error) { + pb, err := cancelCommandToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelResponse struct { } +func (st *CancelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ChangeClusterOwner struct { - ClusterId string `json:"cluster_id"` + + // Wire name: 'cluster_id' + ClusterId string // New owner of the cluster_id after this RPC. - OwnerUsername string `json:"owner_username"` + // Wire name: 'owner_username' + OwnerUsername string +} + +func (st *ChangeClusterOwner) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &changeClusterOwnerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := changeClusterOwnerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ChangeClusterOwner) MarshalJSON() ([]byte, error) { + pb, err := changeClusterOwnerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ChangeClusterOwnerResponse struct { } +func (st *ChangeClusterOwnerResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &changeClusterOwnerResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := changeClusterOwnerResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ChangeClusterOwnerResponse) MarshalJSON() ([]byte, error) { + pb, err := changeClusterOwnerResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ClientsTypes struct { // With jobs set, the cluster can be used for jobs - Jobs bool `json:"jobs,omitempty"` + // Wire name: 'jobs' + Jobs bool // With notebooks set, this cluster can be used for notebooks - Notebooks bool `json:"notebooks,omitempty"` + // Wire name: 'notebooks' + Notebooks bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClientsTypes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClientsTypes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clientsTypesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clientsTypesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClientsTypes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClientsTypes) MarshalJSON() ([]byte, error) { + pb, err := clientsTypesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CloneCluster struct { // The cluster that is being cloned. - SourceClusterId string `json:"source_cluster_id"` + // Wire name: 'source_cluster_id' + SourceClusterId string +} + +func (st *CloneCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cloneClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cloneClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CloneCluster) MarshalJSON() ([]byte, error) { + pb, err := cloneClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CloudProviderNodeInfo struct { // Status as reported by the cloud provider - Status []CloudProviderNodeStatus `json:"status,omitempty"` + // Wire name: 'status' + Status []CloudProviderNodeStatus +} + +func (st *CloudProviderNodeInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cloudProviderNodeInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cloudProviderNodeInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CloudProviderNodeInfo) MarshalJSON() ([]byte, error) { + pb, err := cloudProviderNodeInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CloudProviderNodeStatus string +type cloudProviderNodeStatusPb string const CloudProviderNodeStatusNotAvailableInRegion CloudProviderNodeStatus = `NotAvailableInRegion` @@ -357,48 +702,107 @@ func (f *CloudProviderNodeStatus) Type() string { return "CloudProviderNodeStatus" } +func cloudProviderNodeStatusToPb(st *CloudProviderNodeStatus) (*cloudProviderNodeStatusPb, error) { + if st == nil { + return nil, nil + } + pb := cloudProviderNodeStatusPb(*st) + return &pb, nil +} + +func cloudProviderNodeStatusFromPb(pb *cloudProviderNodeStatusPb) (*CloudProviderNodeStatus, error) { + if pb == nil { + return nil, nil + } + st := CloudProviderNodeStatus(*pb) + return &st, nil +} + type ClusterAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := clusterAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterAccessControlResponse struct { // All permissions. - AllPermissions []ClusterPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []ClusterPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := clusterAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Common set of attributes set during cluster creation. These attributes cannot @@ -409,13 +813,16 @@ type ClusterAttributes struct { // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -423,12 +830,14 @@ type ClusterAttributes struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -437,7 +846,8 @@ type ClusterAttributes struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -467,13 +877,16 @@ type ClusterAttributes struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -482,29 +895,36 @@ type ClusterAttributes struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -522,15 +942,18 @@ type ClusterAttributes struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -539,15 +962,18 @@ type ClusterAttributes struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -561,56 +987,98 @@ type ClusterAttributes struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version"` + // Wire name: 'spark_version' + SparkVersion string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAttributes) MarshalJSON() ([]byte, error) { + pb, err := clusterAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterCompliance struct { // Canonical unique identifier for a cluster. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // Whether this cluster is in compliance with the latest version of its // policy. - IsCompliant bool `json:"is_compliant,omitempty"` + // Wire name: 'is_compliant' + IsCompliant bool // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations map[string]string `json:"violations,omitempty"` + // Wire name: 'violations' + Violations map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterCompliance) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterCompliance) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterCompliancePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterComplianceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterCompliance) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterCompliance) MarshalJSON() ([]byte, error) { + pb, err := clusterComplianceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Describes all of the metadata about a single Spark cluster in Databricks. @@ -618,26 +1086,32 @@ type ClusterDetails struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // Number of CPU cores available for this cluster. Note that this can be // fractional, e.g. 7.5 cores, since certain node types are configured to // share cores between Spark nodes on the same instance. - ClusterCores float64 `json:"cluster_cores,omitempty"` + // Wire name: 'cluster_cores' + ClusterCores float64 // Canonical identifier for the cluster. This id is retained during cluster // restarts and resizes, while each new cluster has a globally unique id. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -645,22 +1119,28 @@ type ClusterDetails struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster log delivery status. - ClusterLogStatus *LogSyncStatus `json:"cluster_log_status,omitempty"` + // Wire name: 'cluster_log_status' + ClusterLogStatus *LogSyncStatus // Total amount of cluster memory, in megabytes - ClusterMemoryMb int64 `json:"cluster_memory_mb,omitempty"` + // Wire name: 'cluster_memory_mb' + ClusterMemoryMb int64 // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. - ClusterSource ClusterSource `json:"cluster_source,omitempty"` + // Wire name: 'cluster_source' + ClusterSource ClusterSource // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -669,7 +1149,8 @@ type ClusterDetails struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -699,7 +1180,8 @@ type ClusterDetails struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -712,17 +1194,21 @@ type ClusterDetails struct { // - ClusterId: // // - Name: - DefaultTags map[string]string `json:"default_tags,omitempty"` + // Wire name: 'default_tags' + DefaultTags map[string]string // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // Node on which the Spark driver resides. The driver node contains the // Spark master and the Databricks application that manages the per-notebook // Spark REPLs. - Driver *SparkNode `json:"driver,omitempty"` + // Wire name: 'driver' + Driver *SparkNode // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -731,34 +1217,43 @@ type ClusterDetails struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Nodes on which the Spark executors reside. - Executors []SparkNode `json:"executors,omitempty"` + // Wire name: 'executors' + Executors []SparkNode // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // Port on which Spark JDBC server is listening, in the driver nod. No // service will be listeningon on this port in executor nodes. - JdbcPort int `json:"jdbc_port,omitempty"` + // Wire name: 'jdbc_port' + JdbcPort int // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -776,18 +1271,22 @@ type ClusterDetails struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // the timestamp that the cluster was started/restarted - LastRestartedTime int64 `json:"last_restarted_time,omitempty"` + // Wire name: 'last_restarted_time' + LastRestartedTime int64 // Time when the cluster driver last lost its state (due to a restart or // driver failure). - LastStateLossTime int64 `json:"last_state_loss_time,omitempty"` + // Wire name: 'last_state_loss_time' + LastStateLossTime int64 // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -798,9 +1297,11 @@ type ClusterDetails struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -809,19 +1310,23 @@ type ClusterDetails struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // A canonical SparkContext identifier. This value *does* change when the // Spark driver restarts. The pair `(cluster_id, spark_context_id)` is a // globally unique identifier over all Spark contexts. - SparkContextId int64 `json:"spark_context_id,omitempty"` + // Wire name: 'spark_context_id' + SparkContextId int64 // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -835,130 +1340,250 @@ type ClusterDetails struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version,omitempty"` + // Wire name: 'spark_version' + SparkVersion string // The spec contains a snapshot of the latest user specified settings that // were used to create/edit the cluster. Note: not included in the response // of the ListClusters API. - Spec *ClusterSpec `json:"spec,omitempty"` + // Wire name: 'spec' + Spec *ClusterSpec // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // Time (in epoch milliseconds) when the cluster creation request was // received (when the cluster entered a `PENDING` state). - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Current state of the cluster. - State State `json:"state,omitempty"` + // Wire name: 'state' + State State // A message associated with the most recent state transition (e.g., the // reason why the cluster entered a `TERMINATED` state). - StateMessage string `json:"state_message,omitempty"` + // Wire name: 'state_message' + StateMessage string // Time (in epoch milliseconds) when the cluster was terminated, if // applicable. - TerminatedTime int64 `json:"terminated_time,omitempty"` + // Wire name: 'terminated_time' + TerminatedTime int64 // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. - TerminationReason *TerminationReason `json:"termination_reason,omitempty"` + // Wire name: 'termination_reason' + TerminationReason *TerminationReason // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterDetails) MarshalJSON() ([]byte, error) { + pb, err := clusterDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterEvent struct { - ClusterId string `json:"cluster_id"` - DataPlaneEventDetails *DataPlaneEventDetails `json:"data_plane_event_details,omitempty"` + // Wire name: 'cluster_id' + ClusterId string + + // Wire name: 'data_plane_event_details' + DataPlaneEventDetails *DataPlaneEventDetails - Details *EventDetails `json:"details,omitempty"` + // Wire name: 'details' + Details *EventDetails // The timestamp when the event occurred, stored as the number of // milliseconds since the Unix epoch. If not provided, this will be assigned // by the Timeline service. - Timestamp int64 `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp int64 - Type EventType `json:"type,omitempty"` + // Wire name: 'type' + Type EventType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterEvent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterEvent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterEventPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterEventFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterEvent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterEvent) MarshalJSON() ([]byte, error) { + pb, err := clusterEventToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterLibraryStatuses struct { // Unique identifier for the cluster. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // Status of all libraries on the cluster. - LibraryStatuses []LibraryFullStatus `json:"library_statuses,omitempty"` + // Wire name: 'library_statuses' + LibraryStatuses []LibraryFullStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterLibraryStatuses) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterLibraryStatuses) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterLibraryStatusesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterLibraryStatusesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterLibraryStatuses) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterLibraryStatuses) MarshalJSON() ([]byte, error) { + pb, err := clusterLibraryStatusesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Cluster log delivery config type ClusterLogConf struct { // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + // Wire name: 'dbfs' + Dbfs *DbfsStorageInfo // destination and either the region or endpoint need to be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. - S3 *S3StorageInfo `json:"s3,omitempty"` + // Wire name: 's3' + S3 *S3StorageInfo // destination needs to be provided, e.g. `{ "volumes": { "destination": // "/Volumes/catalog/schema/volume/cluster_log" } }` - Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + // Wire name: 'volumes' + Volumes *VolumesStorageInfo +} + +func (st *ClusterLogConf) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterLogConfPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterLogConfFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ClusterLogConf) MarshalJSON() ([]byte, error) { + pb, err := clusterLogConfToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPermission) MarshalJSON() ([]byte, error) { + pb, err := clusterPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type ClusterPermissionLevel string +type clusterPermissionLevelPb string const ClusterPermissionLevelCanAttachTo ClusterPermissionLevel = `CAN_ATTACH_TO` @@ -987,110 +1612,260 @@ func (f *ClusterPermissionLevel) Type() string { return "ClusterPermissionLevel" } +func clusterPermissionLevelToPb(st *ClusterPermissionLevel) (*clusterPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := clusterPermissionLevelPb(*st) + return &pb, nil +} + +func clusterPermissionLevelFromPb(pb *clusterPermissionLevelPb) (*ClusterPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := ClusterPermissionLevel(*pb) + return &st, nil +} + type ClusterPermissions struct { - AccessControlList []ClusterAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []ClusterAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPermissions) MarshalJSON() ([]byte, error) { + pb, err := clusterPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := clusterPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPermissionsRequest struct { - AccessControlList []ClusterAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []ClusterAccessControlRequest // The cluster for which to get or manage permissions. - ClusterId string `json:"-" url:"-"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *ClusterPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ClusterPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := clusterPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPolicyAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPolicyPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPolicyAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPolicyAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPolicyAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPolicyAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPolicyAccessControlResponse struct { // All permissions. - AllPermissions []ClusterPolicyPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []ClusterPolicyPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPolicyAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPolicyAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPolicyAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPolicyAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPolicyPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPolicyPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPolicyPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPolicyPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPolicyPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPolicyPermission) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type ClusterPolicyPermissionLevel string +type clusterPolicyPermissionLevelPb string const ClusterPolicyPermissionLevelCanUse ClusterPolicyPermissionLevel = `CAN_USE` @@ -1115,78 +1890,184 @@ func (f *ClusterPolicyPermissionLevel) Type() string { return "ClusterPolicyPermissionLevel" } +func clusterPolicyPermissionLevelToPb(st *ClusterPolicyPermissionLevel) (*clusterPolicyPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := clusterPolicyPermissionLevelPb(*st) + return &pb, nil +} + +func clusterPolicyPermissionLevelFromPb(pb *clusterPolicyPermissionLevelPb) (*ClusterPolicyPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := ClusterPolicyPermissionLevel(*pb) + return &st, nil +} + type ClusterPolicyPermissions struct { - AccessControlList []ClusterPolicyAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []ClusterPolicyAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPolicyPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPolicyPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPolicyPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPolicyPermissions) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPolicyPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ClusterPolicyPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterPolicyPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterPolicyPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterPolicyPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterPolicyPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterPolicyPermissionsRequest struct { - AccessControlList []ClusterPolicyAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []ClusterPolicyAccessControlRequest // The cluster policy for which to get or manage permissions. - ClusterPolicyId string `json:"-" url:"-"` + // Wire name: 'cluster_policy_id' + ClusterPolicyId string `tf:"-"` +} + +func (st *ClusterPolicyPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterPolicyPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterPolicyPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ClusterPolicyPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := clusterPolicyPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a change to the cluster settings required for the cluster to // become compliant with its policy. type ClusterSettingsChange struct { // The field where this change would be made. - Field string `json:"field,omitempty"` + // Wire name: 'field' + Field string // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue string `json:"new_value,omitempty"` + // Wire name: 'new_value' + NewValue string // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue string `json:"previous_value,omitempty"` + // Wire name: 'previous_value' + PreviousValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterSettingsChange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterSettingsChange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterSettingsChangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterSettingsChangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterSettingsChange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterSettingsChange) MarshalJSON() ([]byte, error) { + pb, err := clusterSettingsChangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterSize struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1197,23 +2078,42 @@ type ClusterSize struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterSize) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterSize) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterSizePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterSizeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterSize) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterSize) MarshalJSON() ([]byte, error) { + pb, err := clusterSizeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Determines whether the cluster was created by a user through the UI, created // by the Databricks Jobs Scheduler, or through an API request. This is the same // as cluster_creator, but read only. type ClusterSource string +type clusterSourcePb string const ClusterSourceApi ClusterSource = `API` @@ -1250,29 +2150,50 @@ func (f *ClusterSource) Type() string { return "ClusterSource" } +func clusterSourceToPb(st *ClusterSource) (*clusterSourcePb, error) { + if st == nil { + return nil, nil + } + pb := clusterSourcePb(*st) + return &pb, nil +} + +func clusterSourceFromPb(pb *clusterSourcePb) (*ClusterSource, error) { + if pb == nil { + return nil, nil + } + st := ClusterSource(*pb) + return &st, nil +} + // Contains a snapshot of the latest user specified settings that were used to // create/edit the cluster. type ClusterSpec struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + // Wire name: 'apply_policy_default_values' + ApplyPolicyDefaultValues bool // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -1280,12 +2201,14 @@ type ClusterSpec struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1294,7 +2217,8 @@ type ClusterSpec struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1324,13 +2248,16 @@ type ClusterSpec struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -1339,29 +2266,36 @@ type ClusterSpec struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1379,13 +2313,15 @@ type ClusterSpec struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1396,9 +2332,11 @@ type ClusterSpec struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1407,15 +2345,18 @@ type ClusterSpec struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1429,63 +2370,133 @@ type ClusterSpec struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version,omitempty"` + // Wire name: 'spark_version' + SparkVersion string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterSpec) MarshalJSON() ([]byte, error) { + pb, err := clusterSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get status type ClusterStatus struct { // Unique identifier of the cluster whose status should be retrieved. - ClusterId string `json:"-" url:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *ClusterStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ClusterStatus) MarshalJSON() ([]byte, error) { + pb, err := clusterStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Command struct { // Running cluster id - ClusterId string `json:"clusterId,omitempty"` + // Wire name: 'clusterId' + ClusterId string // Executable code - Command string `json:"command,omitempty"` + // Wire name: 'command' + Command string // Running context id - ContextId string `json:"contextId,omitempty"` + // Wire name: 'contextId' + ContextId string - Language Language `json:"language,omitempty"` + // Wire name: 'language' + Language Language - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Command) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Command) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &commandPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := commandFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Command) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Command) MarshalJSON() ([]byte, error) { + pb, err := commandToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CommandStatus string +type commandStatusPb string const CommandStatusCancelled CommandStatus = `Cancelled` @@ -1520,34 +2531,101 @@ func (f *CommandStatus) Type() string { return "CommandStatus" } +func commandStatusToPb(st *CommandStatus) (*commandStatusPb, error) { + if st == nil { + return nil, nil + } + pb := commandStatusPb(*st) + return &pb, nil +} + +func commandStatusFromPb(pb *commandStatusPb) (*CommandStatus, error) { + if pb == nil { + return nil, nil + } + st := CommandStatus(*pb) + return &st, nil +} + // Get command info type CommandStatusRequest struct { - ClusterId string `json:"-" url:"clusterId"` - CommandId string `json:"-" url:"commandId"` + // Wire name: 'clusterId' + ClusterId string `tf:"-"` + + // Wire name: 'commandId' + CommandId string `tf:"-"` + + // Wire name: 'contextId' + ContextId string `tf:"-"` +} + +func (st *CommandStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &commandStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := commandStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - ContextId string `json:"-" url:"contextId"` +func (st CommandStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := commandStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CommandStatusResponse struct { - Id string `json:"id,omitempty"` - Results *Results `json:"results,omitempty"` + // Wire name: 'id' + Id string + + // Wire name: 'results' + Results *Results - Status CommandStatus `json:"status,omitempty"` + // Wire name: 'status' + Status CommandStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CommandStatusResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CommandStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &commandStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := commandStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CommandStatusResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CommandStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := commandStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ContextStatus string +type contextStatusPb string const ContextStatusError ContextStatus = `Error` @@ -1576,53 +2654,123 @@ func (f *ContextStatus) Type() string { return "ContextStatus" } +func contextStatusToPb(st *ContextStatus) (*contextStatusPb, error) { + if st == nil { + return nil, nil + } + pb := contextStatusPb(*st) + return &pb, nil +} + +func contextStatusFromPb(pb *contextStatusPb) (*ContextStatus, error) { + if pb == nil { + return nil, nil + } + st := ContextStatus(*pb) + return &st, nil +} + // Get status type ContextStatusRequest struct { - ClusterId string `json:"-" url:"clusterId"` - ContextId string `json:"-" url:"contextId"` + // Wire name: 'clusterId' + ClusterId string `tf:"-"` + + // Wire name: 'contextId' + ContextId string `tf:"-"` +} + +func (st *ContextStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &contextStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := contextStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ContextStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := contextStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ContextStatusResponse struct { - Id string `json:"id,omitempty"` - Status ContextStatus `json:"status,omitempty"` + // Wire name: 'id' + Id string + + // Wire name: 'status' + Status ContextStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ContextStatusResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ContextStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &contextStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := contextStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ContextStatusResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ContextStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := contextStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCluster struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + // Wire name: 'apply_policy_default_values' + ApplyPolicyDefaultValues bool // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // When specified, this clones libraries from a source cluster during the // creation of a new cluster. - CloneFrom *CloneCluster `json:"clone_from,omitempty"` + // Wire name: 'clone_from' + CloneFrom *CloneCluster // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -1630,12 +2778,14 @@ type CreateCluster struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1644,7 +2794,8 @@ type CreateCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1674,13 +2825,16 @@ type CreateCluster struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -1689,29 +2843,36 @@ type CreateCluster struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1729,13 +2890,15 @@ type CreateCluster struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1746,9 +2909,11 @@ type CreateCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1757,15 +2922,18 @@ type CreateCluster struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1779,91 +2947,157 @@ type CreateCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version"` + // Wire name: 'spark_version' + SparkVersion string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCluster) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCluster) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCluster) MarshalJSON() ([]byte, error) { + pb, err := createClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateClusterResponse struct { - ClusterId string `json:"cluster_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'cluster_id' + ClusterId string + + ForceSendFields []string `tf:"-"` } -func (s *CreateClusterResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateClusterResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := createClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateContext struct { // Running cluster id - ClusterId string `json:"clusterId,omitempty"` + // Wire name: 'clusterId' + ClusterId string - Language Language `json:"language,omitempty"` + // Wire name: 'language' + Language Language - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateContext) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateContext) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createContextPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createContextFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateContext) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateContext) MarshalJSON() ([]byte, error) { + pb, err := createContextToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *InstancePoolAwsAttributes // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *InstancePoolAzureAttributes // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // Wire name: 'disk_spec' + DiskSpec *DiskSpec // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *InstancePoolGcpAttributes // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -1871,54 +3105,101 @@ type CreateInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + // Wire name: 'idle_instance_autotermination_minutes' + IdleInstanceAutoterminationMinutes int // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName string `json:"instance_pool_name"` + // Wire name: 'instance_pool_name' + InstancePoolName string // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity int `json:"max_capacity,omitempty"` + // Wire name: 'max_capacity' + MaxCapacity int // Minimum number of idle instances to keep in the instance pool - MinIdleInstances int `json:"min_idle_instances,omitempty"` + // Wire name: 'min_idle_instances' + MinIdleInstances int + // For Fleet-pool V2, this object contains the information about the + // alternate node type ids to use when attempting to launch a cluster if the + // node type id is not available. + // Wire name: 'node_type_flexibility' + NodeTypeFlexibility *NodeTypeFlexibility // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id"` + // Wire name: 'node_type_id' + NodeTypeId string // Custom Docker Image BYOC - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + // Wire name: 'preloaded_docker_images' + PreloadedDockerImages []DockerImage // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + // Wire name: 'preloaded_spark_versions' + PreloadedSparkVersions []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateInstancePool) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateInstancePool) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createInstancePoolPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createInstancePoolFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateInstancePool) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateInstancePool) MarshalJSON() ([]byte, error) { + pb, err := createInstancePoolToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateInstancePoolResponse struct { // The ID of the created instance pool. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateInstancePoolResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateInstancePoolResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createInstancePoolResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createInstancePoolResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateInstancePoolResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateInstancePoolResponse) MarshalJSON() ([]byte, error) { + pb, err := createInstancePoolResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePolicy struct { @@ -1926,18 +3207,23 @@ type CreatePolicy struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition string `json:"definition,omitempty"` + // Wire name: 'definition' + Definition string // Additional human-readable description of the cluster policy. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries []Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []Library // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + // Wire name: 'max_clusters_per_user' + MaxClustersPerUser int64 // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -1947,68 +3233,142 @@ type CreatePolicy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + // Wire name: 'policy_family_definition_overrides' + PolicyFamilyDefinitionOverrides string // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId string `json:"policy_family_id,omitempty"` + // Wire name: 'policy_family_id' + PolicyFamilyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePolicy) MarshalJSON() ([]byte, error) { + pb, err := createPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePolicyResponse struct { // Canonical unique identifier for the cluster policy. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePolicyResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePolicyResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := createPolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateResponse struct { // The global init script ID. - ScriptId string `json:"script_id,omitempty"` + // Wire name: 'script_id' + ScriptId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateResponse) MarshalJSON() ([]byte, error) { + pb, err := createResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Created struct { - Id string `json:"id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'id' + Id string + + ForceSendFields []string `tf:"-"` } -func (s *Created) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Created) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createdPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createdFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Created) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Created) MarshalJSON() ([]byte, error) { + pb, err := createdToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CustomPolicyTag struct { @@ -2019,46 +3379,88 @@ type CustomPolicyTag struct { // - Follows the regex pattern defined in // cluster-common/conf/src/ClusterTagConstraints.scala // (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L17) - Key string `json:"key"` + // Wire name: 'key' + Key string // The value of the tag. // // - Follows the regex pattern defined in // cluster-common/conf/src/ClusterTagConstraints.scala // (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L24) - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CustomPolicyTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CustomPolicyTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &customPolicyTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := customPolicyTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CustomPolicyTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CustomPolicyTag) MarshalJSON() ([]byte, error) { + pb, err := customPolicyTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DataPlaneEventDetails struct { - EventType DataPlaneEventDetailsEventType `json:"event_type,omitempty"` - ExecutorFailures int `json:"executor_failures,omitempty"` + // Wire name: 'event_type' + EventType DataPlaneEventDetailsEventType - HostId string `json:"host_id,omitempty"` + // Wire name: 'executor_failures' + ExecutorFailures int - Timestamp int64 `json:"timestamp,omitempty"` + // Wire name: 'host_id' + HostId string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'timestamp' + Timestamp int64 + + ForceSendFields []string `tf:"-"` } -func (s *DataPlaneEventDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DataPlaneEventDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataPlaneEventDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataPlaneEventDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DataPlaneEventDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DataPlaneEventDetails) MarshalJSON() ([]byte, error) { + pb, err := dataPlaneEventDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DataPlaneEventDetailsEventType string +type dataPlaneEventDetailsEventTypePb string const DataPlaneEventDetailsEventTypeNodeBlacklisted DataPlaneEventDetailsEventType = `NODE_BLACKLISTED` @@ -2085,6 +3487,22 @@ func (f *DataPlaneEventDetailsEventType) Type() string { return "DataPlaneEventDetailsEventType" } +func dataPlaneEventDetailsEventTypeToPb(st *DataPlaneEventDetailsEventType) (*dataPlaneEventDetailsEventTypePb, error) { + if st == nil { + return nil, nil + } + pb := dataPlaneEventDetailsEventTypePb(*st) + return &pb, nil +} + +func dataPlaneEventDetailsEventTypeFromPb(pb *dataPlaneEventDetailsEventTypePb) (*DataPlaneEventDetailsEventType, error) { + if pb == nil { + return nil, nil + } + st := DataPlaneEventDetailsEventType(*pb) + return &st, nil +} + // Data security mode decides what data governance model to use when accessing // data from a cluster. // @@ -2115,6 +3533,7 @@ func (f *DataPlaneEventDetailsEventType) Type() string { // `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have // UC nor passthrough enabled. type DataSecurityMode string +type dataSecurityModePb string // will choose the most appropriate access mode depending on your // compute configuration. @@ -2176,54 +3595,353 @@ func (f *DataSecurityMode) Type() string { return "DataSecurityMode" } +func dataSecurityModeToPb(st *DataSecurityMode) (*dataSecurityModePb, error) { + if st == nil { + return nil, nil + } + pb := dataSecurityModePb(*st) + return &pb, nil +} + +func dataSecurityModeFromPb(pb *dataSecurityModePb) (*DataSecurityMode, error) { + if pb == nil { + return nil, nil + } + st := DataSecurityMode(*pb) + return &st, nil +} + // A storage location in DBFS type DbfsStorageInfo struct { // dbfs destination, e.g. `dbfs:/my/path` - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *DbfsStorageInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dbfsStorageInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dbfsStorageInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DbfsStorageInfo) MarshalJSON() ([]byte, error) { + pb, err := dbfsStorageInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteCluster struct { // The cluster to be terminated. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string +} + +func (st *DeleteCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCluster) MarshalJSON() ([]byte, error) { + pb, err := deleteClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteClusterResponse struct { } +func (st *DeleteClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete init script type DeleteGlobalInitScriptRequest struct { // The ID of the global init script. - ScriptId string `json:"-" url:"-"` + // Wire name: 'script_id' + ScriptId string `tf:"-"` +} + +func (st *DeleteGlobalInitScriptRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteGlobalInitScriptRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteGlobalInitScriptRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteGlobalInitScriptRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteInstancePool struct { // The instance pool to be terminated. - InstancePoolId string `json:"instance_pool_id"` + // Wire name: 'instance_pool_id' + InstancePoolId string +} + +func (st *DeleteInstancePool) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteInstancePoolPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteInstancePoolFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteInstancePool) MarshalJSON() ([]byte, error) { + pb, err := deleteInstancePoolToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteInstancePoolResponse struct { } +func (st *DeleteInstancePoolResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteInstancePoolResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteInstancePoolResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteInstancePoolResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteInstancePoolResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeletePolicy struct { // The ID of the policy to delete. - PolicyId string `json:"policy_id"` + // Wire name: 'policy_id' + PolicyId string +} + +func (st *DeletePolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePolicy) MarshalJSON() ([]byte, error) { + pb, err := deletePolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeletePolicyResponse struct { } +func (st *DeletePolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := deletePolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DestroyContext struct { - ClusterId string `json:"clusterId"` - ContextId string `json:"contextId"` + // Wire name: 'clusterId' + ClusterId string + + // Wire name: 'contextId' + ContextId string +} + +func (st *DestroyContext) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &destroyContextPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := destroyContextFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DestroyContext) MarshalJSON() ([]byte, error) { + pb, err := destroyContextToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DestroyResponse struct { } +func (st *DestroyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &destroyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := destroyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DestroyResponse) MarshalJSON() ([]byte, error) { + pb, err := destroyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Describes the disks that are launched for each instance in the spark cluster. // For example, if the cluster has 3 instances, each instance is configured to // launch 2 disks, 100 GiB each, then Databricks will launch a total of 6 disks, @@ -2245,9 +3963,11 @@ type DiskSpec struct { // // Disks will be mounted at: - For AWS: `/ebs0`, `/ebs1`, and etc. - For // Azure: `/remote_volume0`, `/remote_volume1`, and etc. - DiskCount int `json:"disk_count,omitempty"` + // Wire name: 'disk_count' + DiskCount int - DiskIops int `json:"disk_iops,omitempty"` + // Wire name: 'disk_iops' + DiskIops int // The size of each disk (in GiB) launched for each instance. Values must // fall into the supported range for a particular instance type. // @@ -2256,36 +3976,84 @@ type DiskSpec struct { // // For Azure: - Premium LRS (SSD): 1 - 1023 GiB - Standard LRS (HDD): 1- // 1023 GiB - DiskSize int `json:"disk_size,omitempty"` + // Wire name: 'disk_size' + DiskSize int - DiskThroughput int `json:"disk_throughput,omitempty"` + // Wire name: 'disk_throughput' + DiskThroughput int // The type of disks that will be launched with this cluster. - DiskType *DiskType `json:"disk_type,omitempty"` + // Wire name: 'disk_type' + DiskType *DiskType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DiskSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DiskSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &diskSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := diskSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DiskSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DiskSpec) MarshalJSON() ([]byte, error) { + pb, err := diskSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Describes the disk type. type DiskType struct { // All Azure Disk types that Databricks supports. See // https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks - AzureDiskVolumeType DiskTypeAzureDiskVolumeType `json:"azure_disk_volume_type,omitempty"` + // Wire name: 'azure_disk_volume_type' + AzureDiskVolumeType DiskTypeAzureDiskVolumeType // All EBS volume types that Databricks supports. See // https://aws.amazon.com/ebs/details/ for details. - EbsVolumeType DiskTypeEbsVolumeType `json:"ebs_volume_type,omitempty"` + // Wire name: 'ebs_volume_type' + EbsVolumeType DiskTypeEbsVolumeType +} + +func (st *DiskType) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &diskTypePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := diskTypeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DiskType) MarshalJSON() ([]byte, error) { + pb, err := diskTypeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // All Azure Disk types that Databricks supports. See // https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks type DiskTypeAzureDiskVolumeType string +type diskTypeAzureDiskVolumeTypePb string const DiskTypeAzureDiskVolumeTypePremiumLrs DiskTypeAzureDiskVolumeType = `PREMIUM_LRS` @@ -2312,9 +4080,26 @@ func (f *DiskTypeAzureDiskVolumeType) Type() string { return "DiskTypeAzureDiskVolumeType" } +func diskTypeAzureDiskVolumeTypeToPb(st *DiskTypeAzureDiskVolumeType) (*diskTypeAzureDiskVolumeTypePb, error) { + if st == nil { + return nil, nil + } + pb := diskTypeAzureDiskVolumeTypePb(*st) + return &pb, nil +} + +func diskTypeAzureDiskVolumeTypeFromPb(pb *diskTypeAzureDiskVolumeTypePb) (*DiskTypeAzureDiskVolumeType, error) { + if pb == nil { + return nil, nil + } + st := DiskTypeAzureDiskVolumeType(*pb) + return &st, nil +} + // All EBS volume types that Databricks supports. See // https://aws.amazon.com/ebs/details/ for details. type DiskTypeEbsVolumeType string +type diskTypeEbsVolumeTypePb string const DiskTypeEbsVolumeTypeGeneralPurposeSsd DiskTypeEbsVolumeType = `GENERAL_PURPOSE_SSD` @@ -2341,43 +4126,98 @@ func (f *DiskTypeEbsVolumeType) Type() string { return "DiskTypeEbsVolumeType" } +func diskTypeEbsVolumeTypeToPb(st *DiskTypeEbsVolumeType) (*diskTypeEbsVolumeTypePb, error) { + if st == nil { + return nil, nil + } + pb := diskTypeEbsVolumeTypePb(*st) + return &pb, nil +} + +func diskTypeEbsVolumeTypeFromPb(pb *diskTypeEbsVolumeTypePb) (*DiskTypeEbsVolumeType, error) { + if pb == nil { + return nil, nil + } + st := DiskTypeEbsVolumeType(*pb) + return &st, nil +} + type DockerBasicAuth struct { // Password of the user - Password string `json:"password,omitempty"` + // Wire name: 'password' + Password string // Name of the user - Username string `json:"username,omitempty"` + // Wire name: 'username' + Username string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DockerBasicAuth) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DockerBasicAuth) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dockerBasicAuthPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dockerBasicAuthFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DockerBasicAuth) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DockerBasicAuth) MarshalJSON() ([]byte, error) { + pb, err := dockerBasicAuthToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DockerImage struct { // Basic auth with username and password - BasicAuth *DockerBasicAuth `json:"basic_auth,omitempty"` + // Wire name: 'basic_auth' + BasicAuth *DockerBasicAuth // URL of the docker image. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DockerImage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DockerImage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dockerImagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dockerImageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DockerImage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DockerImage) MarshalJSON() ([]byte, error) { + pb, err := dockerImageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // All EBS volume types that Databricks supports. See // https://aws.amazon.com/ebs/details/ for details. type EbsVolumeType string +type ebsVolumeTypePb string const EbsVolumeTypeGeneralPurposeSsd EbsVolumeType = `GENERAL_PURPOSE_SSD` @@ -2404,29 +4244,51 @@ func (f *EbsVolumeType) Type() string { return "EbsVolumeType" } +func ebsVolumeTypeToPb(st *EbsVolumeType) (*ebsVolumeTypePb, error) { + if st == nil { + return nil, nil + } + pb := ebsVolumeTypePb(*st) + return &pb, nil +} + +func ebsVolumeTypeFromPb(pb *ebsVolumeTypePb) (*EbsVolumeType, error) { + if pb == nil { + return nil, nil + } + st := EbsVolumeType(*pb) + return &st, nil +} + type EditCluster struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + // Wire name: 'apply_policy_default_values' + ApplyPolicyDefaultValues bool // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // ID of the cluster - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -2434,12 +4296,14 @@ type EditCluster struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -2448,7 +4312,8 @@ type EditCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -2478,13 +4343,16 @@ type EditCluster struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -2493,29 +4361,36 @@ type EditCluster struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -2533,13 +4408,15 @@ type EditCluster struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -2550,9 +4427,11 @@ type EditCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -2561,15 +4440,18 @@ type EditCluster struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -2583,45 +4465,93 @@ type EditCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version"` + // Wire name: 'spark_version' + SparkVersion string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditCluster) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditCluster) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditCluster) MarshalJSON() ([]byte, error) { + pb, err := editClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EditClusterResponse struct { } +func (st *EditClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := editClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EditInstancePool struct { // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -2629,56 +4559,114 @@ type EditInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + // Wire name: 'idle_instance_autotermination_minutes' + IdleInstanceAutoterminationMinutes int // Instance pool ID - InstancePoolId string `json:"instance_pool_id"` + // Wire name: 'instance_pool_id' + InstancePoolId string // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName string `json:"instance_pool_name"` + // Wire name: 'instance_pool_name' + InstancePoolName string // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity int `json:"max_capacity,omitempty"` + // Wire name: 'max_capacity' + MaxCapacity int // Minimum number of idle instances to keep in the instance pool - MinIdleInstances int `json:"min_idle_instances,omitempty"` + // Wire name: 'min_idle_instances' + MinIdleInstances int + // For Fleet-pool V2, this object contains the information about the + // alternate node type ids to use when attempting to launch a cluster if the + // node type id is not available. + // Wire name: 'node_type_flexibility' + NodeTypeFlexibility *NodeTypeFlexibility // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id"` + // Wire name: 'node_type_id' + NodeTypeId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditInstancePool) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditInstancePool) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editInstancePoolPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editInstancePoolFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditInstancePool) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditInstancePool) MarshalJSON() ([]byte, error) { + pb, err := editInstancePoolToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EditInstancePoolResponse struct { } +func (st *EditInstancePoolResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editInstancePoolResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editInstancePoolResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditInstancePoolResponse) MarshalJSON() ([]byte, error) { + pb, err := editInstancePoolResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EditPolicy struct { // Policy definition document expressed in [Databricks Cluster Policy // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition string `json:"definition,omitempty"` + // Wire name: 'definition' + Definition string // Additional human-readable description of the cluster policy. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries []Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []Library // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + // Wire name: 'max_clusters_per_user' + MaxClustersPerUser int64 // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -2688,69 +4676,177 @@ type EditPolicy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + // Wire name: 'policy_family_definition_overrides' + PolicyFamilyDefinitionOverrides string // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId string `json:"policy_family_id,omitempty"` + // Wire name: 'policy_family_id' + PolicyFamilyId string // The ID of the policy to update. - PolicyId string `json:"policy_id"` + // Wire name: 'policy_id' + PolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditPolicy) MarshalJSON() ([]byte, error) { + pb, err := editPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EditPolicyResponse struct { } +func (st *EditPolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editPolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editPolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditPolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := editPolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EditResponse struct { } +func (st *EditResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditResponse) MarshalJSON() ([]byte, error) { + pb, err := editResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EnforceClusterComplianceRequest struct { // The ID of the cluster you want to enforce policy compliance on. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // If set, previews the changes that would be made to a cluster to enforce // compliance but does not update the cluster. - ValidateOnly bool `json:"validate_only,omitempty"` + // Wire name: 'validate_only' + ValidateOnly bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnforceClusterComplianceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnforceClusterComplianceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enforceClusterComplianceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enforceClusterComplianceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnforceClusterComplianceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnforceClusterComplianceRequest) MarshalJSON() ([]byte, error) { + pb, err := enforceClusterComplianceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnforceClusterComplianceResponse struct { // A list of changes that have been made to the cluster settings for the // cluster to become compliant with its policy. - Changes []ClusterSettingsChange `json:"changes,omitempty"` + // Wire name: 'changes' + Changes []ClusterSettingsChange // Whether any changes have been made to the cluster settings for the // cluster to become compliant with its policy. - HasChanges bool `json:"has_changes,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} + // Wire name: 'has_changes' + HasChanges bool -func (s *EnforceClusterComplianceResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) + ForceSendFields []string `tf:"-"` } -func (s EnforceClusterComplianceResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *EnforceClusterComplianceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enforceClusterComplianceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enforceClusterComplianceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EnforceClusterComplianceResponse) MarshalJSON() ([]byte, error) { + pb, err := enforceClusterComplianceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The environment entity used to preserve serverless environment side panel, @@ -2762,14 +4858,16 @@ type Environment struct { // environment of the runtime. Each client comes with a specific set of // pre-installed libraries. The version is a string, consisting of the major // client version. - Client string `json:"client"` + // Wire name: 'client' + Client string // List of pip dependencies, as supported by the version of pip in this // environment. Each dependency is a pip requirement file line // https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed // dependency could be , , (WSFS or Volumes in Databricks), E.g. // dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] - Dependencies []string `json:"dependencies,omitempty"` + // Wire name: 'dependencies' + Dependencies []string // We renamed `client` to `environment_version` in notebook exports. This // field is meant solely so that imported notebooks with // `environment_version` can be deserialized correctly, in a @@ -2777,85 +4875,142 @@ type Environment struct { // `environment_version`, it will be deserialized correctly). Do NOT use // this field for any other purpose, e.g. notebook storage. This field is // not yet exposed to customers (e.g. in the jobs API). - EnvironmentVersion string `json:"environment_version,omitempty"` + // Wire name: 'environment_version' + EnvironmentVersion string // List of jar dependencies, should be string representing volume paths. For // example: `/Volumes/path/to/test.jar`. - JarDependencies []string `json:"jar_dependencies,omitempty"` + // Wire name: 'jar_dependencies' + JarDependencies []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Environment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Environment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &environmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := environmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Environment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Environment) MarshalJSON() ([]byte, error) { + pb, err := environmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EventDetails struct { // * For created clusters, the attributes of the cluster. * For edited // clusters, the new attributes of the cluster. - Attributes *ClusterAttributes `json:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes *ClusterAttributes // The cause of a change in target size. - Cause EventDetailsCause `json:"cause,omitempty"` + // Wire name: 'cause' + Cause EventDetailsCause // The actual cluster size that was set in the cluster creation or edit. - ClusterSize *ClusterSize `json:"cluster_size,omitempty"` + // Wire name: 'cluster_size' + ClusterSize *ClusterSize // The current number of vCPUs in the cluster. - CurrentNumVcpus int `json:"current_num_vcpus,omitempty"` + // Wire name: 'current_num_vcpus' + CurrentNumVcpus int // The current number of nodes in the cluster. - CurrentNumWorkers int `json:"current_num_workers,omitempty"` + // Wire name: 'current_num_workers' + CurrentNumWorkers int - DidNotExpandReason string `json:"did_not_expand_reason,omitempty"` + // Wire name: 'did_not_expand_reason' + DidNotExpandReason string // Current disk size in bytes - DiskSize int64 `json:"disk_size,omitempty"` + // Wire name: 'disk_size' + DiskSize int64 // More details about the change in driver's state - DriverStateMessage string `json:"driver_state_message,omitempty"` + // Wire name: 'driver_state_message' + DriverStateMessage string // Whether or not a blocklisted node should be terminated. For // ClusterEventType NODE_BLACKLISTED. - EnableTerminationForNodeBlocklisted bool `json:"enable_termination_for_node_blocklisted,omitempty"` + // Wire name: 'enable_termination_for_node_blocklisted' + EnableTerminationForNodeBlocklisted bool - FreeSpace int64 `json:"free_space,omitempty"` + // Wire name: 'free_space' + FreeSpace int64 // List of global and cluster init scripts associated with this cluster // event. - InitScripts *InitScriptEventDetails `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts *InitScriptEventDetails // Instance Id where the event originated from - InstanceId string `json:"instance_id,omitempty"` + // Wire name: 'instance_id' + InstanceId string // Unique identifier of the specific job run associated with this cluster // event * For clusters created for jobs, this will be the same as the // cluster name - JobRunName string `json:"job_run_name,omitempty"` + // Wire name: 'job_run_name' + JobRunName string // The cluster attributes before a cluster was edited. - PreviousAttributes *ClusterAttributes `json:"previous_attributes,omitempty"` + // Wire name: 'previous_attributes' + PreviousAttributes *ClusterAttributes // The size of the cluster before an edit or resize. - PreviousClusterSize *ClusterSize `json:"previous_cluster_size,omitempty"` + // Wire name: 'previous_cluster_size' + PreviousClusterSize *ClusterSize // Previous disk size in bytes - PreviousDiskSize int64 `json:"previous_disk_size,omitempty"` + // Wire name: 'previous_disk_size' + PreviousDiskSize int64 // A termination reason: * On a TERMINATED event, this is the reason of the // termination. * On a RESIZE_COMPLETE event, this indicates the reason that // we failed to acquire some nodes. - Reason *TerminationReason `json:"reason,omitempty"` + // Wire name: 'reason' + Reason *TerminationReason // The targeted number of vCPUs in the cluster. - TargetNumVcpus int `json:"target_num_vcpus,omitempty"` + // Wire name: 'target_num_vcpus' + TargetNumVcpus int // The targeted number of nodes in the cluster. - TargetNumWorkers int `json:"target_num_workers,omitempty"` + // Wire name: 'target_num_workers' + TargetNumWorkers int // The user that caused the event to occur. (Empty if it was done by the // control plane.) - User string `json:"user,omitempty"` + // Wire name: 'user' + User string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EventDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EventDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &eventDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := eventDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EventDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EventDetails) MarshalJSON() ([]byte, error) { + pb, err := eventDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The cause of a change in target size. type EventDetailsCause string +type eventDetailsCausePb string const EventDetailsCauseAutorecovery EventDetailsCause = `AUTORECOVERY` @@ -2886,7 +5041,24 @@ func (f *EventDetailsCause) Type() string { return "EventDetailsCause" } +func eventDetailsCauseToPb(st *EventDetailsCause) (*eventDetailsCausePb, error) { + if st == nil { + return nil, nil + } + pb := eventDetailsCausePb(*st) + return &pb, nil +} + +func eventDetailsCauseFromPb(pb *eventDetailsCausePb) (*EventDetailsCause, error) { + if pb == nil { + return nil, nil + } + st := EventDetailsCause(*pb) + return &st, nil +} + type EventType string +type eventTypePb string const EventTypeAddNodesFailed EventType = `ADD_NODES_FAILED` @@ -2967,31 +5139,52 @@ func (f *EventType) Type() string { return "EventType" } +func eventTypeToPb(st *EventType) (*eventTypePb, error) { + if st == nil { + return nil, nil + } + pb := eventTypePb(*st) + return &pb, nil +} + +func eventTypeFromPb(pb *eventTypePb) (*EventType, error) { + if pb == nil { + return nil, nil + } + st := EventType(*pb) + return &st, nil +} + // Attributes set during cluster creation which are related to GCP. type GcpAttributes struct { // This field determines whether the spark executors will be scheduled to // run on preemptible VMs, on-demand VMs, or preemptible VMs with a fallback // to on-demand VMs if the former is unavailable. - Availability GcpAvailability `json:"availability,omitempty"` + // Wire name: 'availability' + Availability GcpAvailability // Boot disk size in GB - BootDiskSize int `json:"boot_disk_size,omitempty"` + // Wire name: 'boot_disk_size' + BootDiskSize int // If provided, the cluster will impersonate the google service account when // accessing gcloud services (like GCS). The google service account must // have previously been added to the Databricks environment by an account // administrator. - GoogleServiceAccount string `json:"google_service_account,omitempty"` + // Wire name: 'google_service_account' + GoogleServiceAccount string // If provided, each node (workers and driver) in the cluster will have this // number of local SSDs attached. Each local SSD is 375GB in size. Refer to // [GCP documentation] for the supported number of local SSDs for each // instance type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount int `json:"local_ssd_count,omitempty"` + // Wire name: 'local_ssd_count' + LocalSsdCount int // This field determines whether the spark executors will be scheduled to // run on preemptible VMs (when set to true) versus standard compute engine // VMs (when set to false; default). Note: Soon to be deprecated, use the // 'availability' field instead. - UsePreemptibleExecutors bool `json:"use_preemptible_executors,omitempty"` + // Wire name: 'use_preemptible_executors' + UsePreemptibleExecutors bool // Identifier for the availability zone in which the cluster resides. This // can be one of the following: - "HA" => High availability, spread nodes // across availability zones for a Databricks deployment region [default]. - @@ -2999,23 +5192,42 @@ type GcpAttributes struct { // on. - A GCP availability zone => Pick One of the available zones for // (machine type + region) from // https://cloud.google.com/compute/docs/regions-zones. - ZoneId string `json:"zone_id,omitempty"` + // Wire name: 'zone_id' + ZoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GcpAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GcpAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GcpAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GcpAttributes) MarshalJSON() ([]byte, error) { + pb, err := gcpAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // This field determines whether the instance pool will contain preemptible VMs, // on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the // former is unavailable. type GcpAvailability string +type gcpAvailabilityPb string const GcpAvailabilityOnDemandGcp GcpAvailability = `ON_DEMAND_GCP` @@ -3044,134 +5256,456 @@ func (f *GcpAvailability) Type() string { return "GcpAvailability" } +func gcpAvailabilityToPb(st *GcpAvailability) (*gcpAvailabilityPb, error) { + if st == nil { + return nil, nil + } + pb := gcpAvailabilityPb(*st) + return &pb, nil +} + +func gcpAvailabilityFromPb(pb *gcpAvailabilityPb) (*GcpAvailability, error) { + if pb == nil { + return nil, nil + } + st := GcpAvailability(*pb) + return &st, nil +} + // A storage location in Google Cloud Platform's GCS type GcsStorageInfo struct { // GCS destination/URI, e.g. `gs://my-bucket/some-prefix` - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *GcsStorageInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcsStorageInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcsStorageInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GcsStorageInfo) MarshalJSON() ([]byte, error) { + pb, err := gcsStorageInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster policy compliance type GetClusterComplianceRequest struct { // The ID of the cluster to get the compliance status - ClusterId string `json:"-" url:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *GetClusterComplianceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterComplianceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterComplianceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterComplianceRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterComplianceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetClusterComplianceResponse struct { // Whether the cluster is compliant with its policy or not. Clusters could // be out of compliance if the policy was updated after the cluster was last // edited. - IsCompliant bool `json:"is_compliant,omitempty"` + // Wire name: 'is_compliant' + IsCompliant bool // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations map[string]string `json:"violations,omitempty"` + // Wire name: 'violations' + Violations map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetClusterComplianceResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetClusterComplianceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterComplianceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterComplianceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetClusterComplianceResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetClusterComplianceResponse) MarshalJSON() ([]byte, error) { + pb, err := getClusterComplianceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster permission levels type GetClusterPermissionLevelsRequest struct { // The cluster for which to get or manage permissions. - ClusterId string `json:"-" url:"-"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *GetClusterPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetClusterPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []ClusterPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []ClusterPermissionsDescription +} + +func (st *GetClusterPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getClusterPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster permissions type GetClusterPermissionsRequest struct { // The cluster for which to get or manage permissions. - ClusterId string `json:"-" url:"-"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *GetClusterPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster policy permission levels type GetClusterPolicyPermissionLevelsRequest struct { // The cluster policy for which to get or manage permissions. - ClusterPolicyId string `json:"-" url:"-"` + // Wire name: 'cluster_policy_id' + ClusterPolicyId string `tf:"-"` +} + +func (st *GetClusterPolicyPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPolicyPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPolicyPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPolicyPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterPolicyPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetClusterPolicyPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []ClusterPolicyPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []ClusterPolicyPermissionsDescription +} + +func (st *GetClusterPolicyPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPolicyPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPolicyPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPolicyPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getClusterPolicyPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster policy permissions type GetClusterPolicyPermissionsRequest struct { // The cluster policy for which to get or manage permissions. - ClusterPolicyId string `json:"-" url:"-"` + // Wire name: 'cluster_policy_id' + ClusterPolicyId string `tf:"-"` +} + +func (st *GetClusterPolicyPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPolicyPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPolicyPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPolicyPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterPolicyPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a cluster policy type GetClusterPolicyRequest struct { // Canonical unique identifier for the Cluster Policy. - PolicyId string `json:"-" url:"policy_id"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *GetClusterPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get cluster info type GetClusterRequest struct { // The cluster about which to retrieve information. - ClusterId string `json:"-" url:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string `tf:"-"` +} + +func (st *GetClusterRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getClusterRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getClusterRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetClusterRequest) MarshalJSON() ([]byte, error) { + pb, err := getClusterRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetEvents struct { // The ID of the cluster to retrieve events about. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // The end time in epoch milliseconds. If empty, returns events up to the // current time. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // An optional set of event types to filter on. If empty, all event types // are returned. - EventTypes []EventType `json:"event_types,omitempty"` + // Wire name: 'event_types' + EventTypes []EventType // Deprecated: use page_token in combination with page_size instead. // // The maximum number of events to include in a page of events. Defaults to // 50, and maximum allowed value is 500. - Limit int64 `json:"limit,omitempty"` + // Wire name: 'limit' + Limit int64 // Deprecated: use page_token in combination with page_size instead. // // The offset in the result set. Defaults to 0 (no offset). When an offset // is specified and the results are requested in descending order, the // end_time field is required. - Offset int64 `json:"offset,omitempty"` + // Wire name: 'offset' + Offset int64 // The order to list events in; either "ASC" or "DESC". Defaults to "DESC". - Order GetEventsOrder `json:"order,omitempty"` + // Wire name: 'order' + Order GetEventsOrder // The maximum number of events to include in a page of events. The server // may further constrain the maximum number of results returned in a single // page. If the page_size is empty or 0, the server will decide the number // of results to be returned. The field has to be in the range [0,500]. If // the value is outside the range, the server enforces 0 or 500. - PageSize int `json:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int // Use next_page_token or prev_page_token returned from the previous request // to list the next or previous page of events respectively. If page_token // is empty, the first page is returned. - PageToken string `json:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string // The start time in epoch milliseconds. If empty, returns events starting // from the beginning of time. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetEvents) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetEvents) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEventsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEventsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetEvents) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetEvents) MarshalJSON() ([]byte, error) { + pb, err := getEventsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetEventsOrder string +type getEventsOrderPb string const GetEventsOrderAsc GetEventsOrder = `ASC` @@ -3198,57 +5732,125 @@ func (f *GetEventsOrder) Type() string { return "GetEventsOrder" } +func getEventsOrderToPb(st *GetEventsOrder) (*getEventsOrderPb, error) { + if st == nil { + return nil, nil + } + pb := getEventsOrderPb(*st) + return &pb, nil +} + +func getEventsOrderFromPb(pb *getEventsOrderPb) (*GetEventsOrder, error) { + if pb == nil { + return nil, nil + } + st := GetEventsOrder(*pb) + return &st, nil +} + type GetEventsResponse struct { - Events []ClusterEvent `json:"events,omitempty"` + + // Wire name: 'events' + Events []ClusterEvent // Deprecated: use next_page_token or prev_page_token instead. // // The parameters required to retrieve the next page of events. Omitted if // there are no more events to read. - NextPage *GetEvents `json:"next_page,omitempty"` + // Wire name: 'next_page' + NextPage *GetEvents // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string // Deprecated: Returns 0 when request uses page_token. Will start returning // zero when request uses offset/limit soon. // // The total number of events filtered by the start_time, end_time, and // event_types. - TotalCount int64 `json:"total_count,omitempty"` + // Wire name: 'total_count' + TotalCount int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetEventsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetEventsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEventsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEventsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetEventsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetEventsResponse) MarshalJSON() ([]byte, error) { + pb, err := getEventsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an init script type GetGlobalInitScriptRequest struct { // The ID of the global init script. - ScriptId string `json:"-" url:"-"` + // Wire name: 'script_id' + ScriptId string `tf:"-"` +} + +func (st *GetGlobalInitScriptRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getGlobalInitScriptRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getGlobalInitScriptRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + pb, err := getGlobalInitScriptRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *InstancePoolAwsAttributes // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *InstancePoolAzureAttributes // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Tags that are added by Databricks regardless of any ``custom_tags``, // including: // @@ -3259,19 +5861,23 @@ type GetInstancePool struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags map[string]string `json:"default_tags,omitempty"` + // Wire name: 'default_tags' + DefaultTags map[string]string // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // Wire name: 'disk_spec' + DiskSpec *DiskSpec // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *InstancePoolGcpAttributes // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -3279,101 +5885,285 @@ type GetInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + // Wire name: 'idle_instance_autotermination_minutes' + IdleInstanceAutoterminationMinutes int // Canonical unique identifier for the pool. - InstancePoolId string `json:"instance_pool_id"` + // Wire name: 'instance_pool_id' + InstancePoolId string // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName string `json:"instance_pool_name,omitempty"` + // Wire name: 'instance_pool_name' + InstancePoolName string // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity int `json:"max_capacity,omitempty"` + // Wire name: 'max_capacity' + MaxCapacity int // Minimum number of idle instances to keep in the instance pool - MinIdleInstances int `json:"min_idle_instances,omitempty"` + // Wire name: 'min_idle_instances' + MinIdleInstances int + // For Fleet-pool V2, this object contains the information about the + // alternate node type ids to use when attempting to launch a cluster if the + // node type id is not available. + // Wire name: 'node_type_flexibility' + NodeTypeFlexibility *NodeTypeFlexibility // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Custom Docker Image BYOC - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + // Wire name: 'preloaded_docker_images' + PreloadedDockerImages []DockerImage // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + // Wire name: 'preloaded_spark_versions' + PreloadedSparkVersions []string // Current state of the instance pool. - State InstancePoolState `json:"state,omitempty"` + // Wire name: 'state' + State InstancePoolState // Usage statistics about the instance pool. - Stats *InstancePoolStats `json:"stats,omitempty"` + // Wire name: 'stats' + Stats *InstancePoolStats // Status of failed pending instances in the pool. - Status *InstancePoolStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *InstancePoolStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetInstancePool) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetInstancePool) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getInstancePoolPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getInstancePoolFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetInstancePool) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetInstancePool) MarshalJSON() ([]byte, error) { + pb, err := getInstancePoolToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get instance pool permission levels type GetInstancePoolPermissionLevelsRequest struct { // The instance pool for which to get or manage permissions. - InstancePoolId string `json:"-" url:"-"` + // Wire name: 'instance_pool_id' + InstancePoolId string `tf:"-"` +} + +func (st *GetInstancePoolPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getInstancePoolPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getInstancePoolPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetInstancePoolPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getInstancePoolPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetInstancePoolPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []InstancePoolPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []InstancePoolPermissionsDescription +} + +func (st *GetInstancePoolPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getInstancePoolPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getInstancePoolPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetInstancePoolPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getInstancePoolPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get instance pool permissions type GetInstancePoolPermissionsRequest struct { // The instance pool for which to get or manage permissions. - InstancePoolId string `json:"-" url:"-"` + // Wire name: 'instance_pool_id' + InstancePoolId string `tf:"-"` +} + +func (st *GetInstancePoolPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getInstancePoolPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getInstancePoolPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetInstancePoolPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getInstancePoolPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get instance pool information type GetInstancePoolRequest struct { // The canonical unique identifier for the instance pool. - InstancePoolId string `json:"-" url:"instance_pool_id"` + // Wire name: 'instance_pool_id' + InstancePoolId string `tf:"-"` +} + +func (st *GetInstancePoolRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getInstancePoolRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getInstancePoolRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetInstancePoolRequest) MarshalJSON() ([]byte, error) { + pb, err := getInstancePoolRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get policy family information type GetPolicyFamilyRequest struct { // The family ID about which to retrieve information. - PolicyFamilyId string `json:"-" url:"-"` + // Wire name: 'policy_family_id' + PolicyFamilyId string `tf:"-"` // The version number for the family to fetch. Defaults to the latest // version. - Version int64 `json:"-" url:"version,omitempty"` + // Wire name: 'version' + Version int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPolicyFamilyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPolicyFamilyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPolicyFamilyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPolicyFamilyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPolicyFamilyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPolicyFamilyRequest) MarshalJSON() ([]byte, error) { + pb, err := getPolicyFamilyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetSparkVersionsResponse struct { // All the available Spark versions. - Versions []SparkVersion `json:"versions,omitempty"` + // Wire name: 'versions' + Versions []SparkVersion +} + +func (st *GetSparkVersionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSparkVersionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSparkVersionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetSparkVersionsResponse) MarshalJSON() ([]byte, error) { + pb, err := getSparkVersionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GlobalInitScriptCreateRequest struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the script - Name string `json:"name"` + // Wire name: 'name' + Name string // The position of a global init script, where 0 represents the first script // to run, 1 is the second script to run, in ascending order. // @@ -3385,92 +6175,164 @@ type GlobalInitScriptCreateRequest struct { // position. If an explicit position value conflicts with an existing script // value, your request succeeds, but the original script at that position // and all later scripts have their positions incremented by 1. - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The Base64-encoded content of the script. - Script string `json:"script"` + // Wire name: 'script' + Script string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GlobalInitScriptCreateRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GlobalInitScriptCreateRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &globalInitScriptCreateRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := globalInitScriptCreateRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GlobalInitScriptCreateRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GlobalInitScriptCreateRequest) MarshalJSON() ([]byte, error) { + pb, err := globalInitScriptCreateRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GlobalInitScriptDetails struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt int `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int // The username of the user who created the script. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Specifies whether the script is enabled. The script runs only if enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the script - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The global init script ID. - ScriptId string `json:"script_id,omitempty"` + // Wire name: 'script_id' + ScriptId string // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt int `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int // The username of the user who last updated the script - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GlobalInitScriptDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GlobalInitScriptDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &globalInitScriptDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := globalInitScriptDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GlobalInitScriptDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GlobalInitScriptDetails) MarshalJSON() ([]byte, error) { + pb, err := globalInitScriptDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GlobalInitScriptDetailsWithContent struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt int `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int // The username of the user who created the script. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Specifies whether the script is enabled. The script runs only if enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the script - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The Base64-encoded content of the script. - Script string `json:"script,omitempty"` + // Wire name: 'script' + Script string // The global init script ID. - ScriptId string `json:"script_id,omitempty"` + // Wire name: 'script_id' + ScriptId string // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt int `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int // The username of the user who last updated the script - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GlobalInitScriptDetailsWithContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GlobalInitScriptDetailsWithContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &globalInitScriptDetailsWithContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := globalInitScriptDetailsWithContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GlobalInitScriptDetailsWithContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GlobalInitScriptDetailsWithContent) MarshalJSON() ([]byte, error) { + pb, err := globalInitScriptDetailsWithContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GlobalInitScriptUpdateRequest struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the script - Name string `json:"name"` + // Wire name: 'name' + Name string // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. To move the script to // run first, set its position to 0. @@ -3483,49 +6345,90 @@ type GlobalInitScriptUpdateRequest struct { // If an explicit position value conflicts with an existing script, your // request succeeds, but the original script at that position and all later // scripts have their positions incremented by 1. - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The Base64-encoded content of the script. - Script string `json:"script"` + // Wire name: 'script' + Script string // The ID of the global init script. - ScriptId string `json:"-" url:"-"` + // Wire name: 'script_id' + ScriptId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GlobalInitScriptUpdateRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GlobalInitScriptUpdateRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &globalInitScriptUpdateRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := globalInitScriptUpdateRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GlobalInitScriptUpdateRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GlobalInitScriptUpdateRequest) MarshalJSON() ([]byte, error) { + pb, err := globalInitScriptUpdateRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InitScriptEventDetails struct { // The cluster scoped init scripts associated with this cluster event. - Cluster []InitScriptInfoAndExecutionDetails `json:"cluster,omitempty"` + // Wire name: 'cluster' + Cluster []InitScriptInfoAndExecutionDetails // The global init scripts associated with this cluster event. - Global []InitScriptInfoAndExecutionDetails `json:"global,omitempty"` + // Wire name: 'global' + Global []InitScriptInfoAndExecutionDetails // The private ip of the node we are reporting init script execution details // for (we will select the execution details from only one node rather than // reporting the execution details from every node to keep these event // details small) // // This should only be defined for the INIT_SCRIPTS_FINISHED event - ReportedForNode string `json:"reported_for_node,omitempty"` + // Wire name: 'reported_for_node' + ReportedForNode string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InitScriptEventDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InitScriptEventDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &initScriptEventDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := initScriptEventDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InitScriptEventDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InitScriptEventDetails) MarshalJSON() ([]byte, error) { + pb, err := initScriptEventDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Result of attempted script execution type InitScriptExecutionDetailsInitScriptExecutionStatus string +type initScriptExecutionDetailsInitScriptExecutionStatusPb string const InitScriptExecutionDetailsInitScriptExecutionStatusFailedExecution InitScriptExecutionDetailsInitScriptExecutionStatus = `FAILED_EXECUTION` @@ -3562,146 +6465,319 @@ func (f *InitScriptExecutionDetailsInitScriptExecutionStatus) Type() string { return "InitScriptExecutionDetailsInitScriptExecutionStatus" } +func initScriptExecutionDetailsInitScriptExecutionStatusToPb(st *InitScriptExecutionDetailsInitScriptExecutionStatus) (*initScriptExecutionDetailsInitScriptExecutionStatusPb, error) { + if st == nil { + return nil, nil + } + pb := initScriptExecutionDetailsInitScriptExecutionStatusPb(*st) + return &pb, nil +} + +func initScriptExecutionDetailsInitScriptExecutionStatusFromPb(pb *initScriptExecutionDetailsInitScriptExecutionStatusPb) (*InitScriptExecutionDetailsInitScriptExecutionStatus, error) { + if pb == nil { + return nil, nil + } + st := InitScriptExecutionDetailsInitScriptExecutionStatus(*pb) + return &st, nil +} + // Config for an individual init script Next ID: 11 type InitScriptInfo struct { // destination needs to be provided, e.g. // `abfss://@.dfs.core.windows.net/` - Abfss *Adlsgen2Info `json:"abfss,omitempty"` + // Wire name: 'abfss' + Abfss *Adlsgen2Info // destination needs to be provided. e.g. `{ "dbfs": { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + // Wire name: 'dbfs' + Dbfs *DbfsStorageInfo // destination needs to be provided, e.g. `{ "file": { "destination": // "file:/my/local/file.sh" } }` - File *LocalFileInfo `json:"file,omitempty"` + // Wire name: 'file' + File *LocalFileInfo // destination needs to be provided, e.g. `{ "gcs": { "destination": // "gs://my-bucket/file.sh" } }` - Gcs *GcsStorageInfo `json:"gcs,omitempty"` + // Wire name: 'gcs' + Gcs *GcsStorageInfo // destination and either the region or endpoint need to be provided. e.g. // `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", // \"region\": \"us-west-2\" } }` Cluster iam role is used to access s3, // please make sure the cluster iam role in `instance_profile_arn` has // permission to write data to the s3 destination. - S3 *S3StorageInfo `json:"s3,omitempty"` + // Wire name: 's3' + S3 *S3StorageInfo // destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" // : \"/Volumes/my-init.sh\" } }` - Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + // Wire name: 'volumes' + Volumes *VolumesStorageInfo // destination needs to be provided, e.g. `{ "workspace": { "destination": // "/cluster-init-scripts/setup-datadog.sh" } }` - Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` + // Wire name: 'workspace' + Workspace *WorkspaceStorageInfo +} + +func (st *InitScriptInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &initScriptInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := initScriptInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InitScriptInfo) MarshalJSON() ([]byte, error) { + pb, err := initScriptInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InitScriptInfoAndExecutionDetails struct { // destination needs to be provided, e.g. // `abfss://@.dfs.core.windows.net/` - Abfss *Adlsgen2Info `json:"abfss,omitempty"` + // Wire name: 'abfss' + Abfss *Adlsgen2Info // destination needs to be provided. e.g. `{ "dbfs": { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + // Wire name: 'dbfs' + Dbfs *DbfsStorageInfo // Additional details regarding errors (such as a file not found message if // the status is FAILED_FETCH). This field should only be used to provide // *additional* information to the status field, not duplicate it. - ErrorMessage string `json:"error_message,omitempty"` + // Wire name: 'error_message' + ErrorMessage string // The number duration of the script execution in seconds - ExecutionDurationSeconds int `json:"execution_duration_seconds,omitempty"` + // Wire name: 'execution_duration_seconds' + ExecutionDurationSeconds int // destination needs to be provided, e.g. `{ "file": { "destination": // "file:/my/local/file.sh" } }` - File *LocalFileInfo `json:"file,omitempty"` + // Wire name: 'file' + File *LocalFileInfo // destination needs to be provided, e.g. `{ "gcs": { "destination": // "gs://my-bucket/file.sh" } }` - Gcs *GcsStorageInfo `json:"gcs,omitempty"` + // Wire name: 'gcs' + Gcs *GcsStorageInfo // destination and either the region or endpoint need to be provided. e.g. // `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", // \"region\": \"us-west-2\" } }` Cluster iam role is used to access s3, // please make sure the cluster iam role in `instance_profile_arn` has // permission to write data to the s3 destination. - S3 *S3StorageInfo `json:"s3,omitempty"` + // Wire name: 's3' + S3 *S3StorageInfo // The current status of the script - Status InitScriptExecutionDetailsInitScriptExecutionStatus `json:"status,omitempty"` + // Wire name: 'status' + Status InitScriptExecutionDetailsInitScriptExecutionStatus // destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" // : \"/Volumes/my-init.sh\" } }` - Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + // Wire name: 'volumes' + Volumes *VolumesStorageInfo // destination needs to be provided, e.g. `{ "workspace": { "destination": // "/cluster-init-scripts/setup-datadog.sh" } }` - Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` + // Wire name: 'workspace' + Workspace *WorkspaceStorageInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InitScriptInfoAndExecutionDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InitScriptInfoAndExecutionDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &initScriptInfoAndExecutionDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := initScriptInfoAndExecutionDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InitScriptInfoAndExecutionDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InitScriptInfoAndExecutionDetails) MarshalJSON() ([]byte, error) { + pb, err := initScriptInfoAndExecutionDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstallLibraries struct { // Unique identifier for the cluster on which to install these libraries. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // The libraries to install. - Libraries []Library `json:"libraries"` + // Wire name: 'libraries' + Libraries []Library +} + +func (st *InstallLibraries) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &installLibrariesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := installLibrariesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InstallLibraries) MarshalJSON() ([]byte, error) { + pb, err := installLibrariesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstallLibrariesResponse struct { } +func (st *InstallLibrariesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &installLibrariesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := installLibrariesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InstallLibrariesResponse) MarshalJSON() ([]byte, error) { + pb, err := installLibrariesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type InstancePoolAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel InstancePoolPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := instancePoolAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolAccessControlResponse struct { // All permissions. - AllPermissions []InstancePoolPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []InstancePoolPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := instancePoolAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolAndStats struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *InstancePoolAwsAttributes // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *InstancePoolAzureAttributes // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Tags that are added by Databricks regardless of any ``custom_tags``, // including: // @@ -3712,19 +6788,23 @@ type InstancePoolAndStats struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags map[string]string `json:"default_tags,omitempty"` + // Wire name: 'default_tags' + DefaultTags map[string]string // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // Wire name: 'disk_spec' + DiskSpec *DiskSpec // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *InstancePoolGcpAttributes // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -3732,54 +6812,88 @@ type InstancePoolAndStats struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + // Wire name: 'idle_instance_autotermination_minutes' + IdleInstanceAutoterminationMinutes int // Canonical unique identifier for the pool. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName string `json:"instance_pool_name,omitempty"` + // Wire name: 'instance_pool_name' + InstancePoolName string // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity int `json:"max_capacity,omitempty"` + // Wire name: 'max_capacity' + MaxCapacity int // Minimum number of idle instances to keep in the instance pool - MinIdleInstances int `json:"min_idle_instances,omitempty"` + // Wire name: 'min_idle_instances' + MinIdleInstances int + // For Fleet-pool V2, this object contains the information about the + // alternate node type ids to use when attempting to launch a cluster if the + // node type id is not available. + // Wire name: 'node_type_flexibility' + NodeTypeFlexibility *NodeTypeFlexibility // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Custom Docker Image BYOC - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + // Wire name: 'preloaded_docker_images' + PreloadedDockerImages []DockerImage // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + // Wire name: 'preloaded_spark_versions' + PreloadedSparkVersions []string // Current state of the instance pool. - State InstancePoolState `json:"state,omitempty"` + // Wire name: 'state' + State InstancePoolState // Usage statistics about the instance pool. - Stats *InstancePoolStats `json:"stats,omitempty"` + // Wire name: 'stats' + Stats *InstancePoolStats // Status of failed pending instances in the pool. - Status *InstancePoolStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *InstancePoolStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolAndStats) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolAndStats) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolAndStatsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolAndStatsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolAndStats) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolAndStats) MarshalJSON() ([]byte, error) { + pb, err := instancePoolAndStatsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Attributes set during instance pool creation which are related to Amazon Web // Services. type InstancePoolAwsAttributes struct { // Availability type used for the spot nodes. - Availability InstancePoolAwsAttributesAvailability `json:"availability,omitempty"` + // Wire name: 'availability' + Availability InstancePoolAwsAttributesAvailability // Calculates the bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -3790,7 +6904,8 @@ type InstancePoolAwsAttributes struct { // instances whose bid price percentage matches this field will be // considered. Note that, for safety, we enforce this field to be no more // than 10000. - SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + // Wire name: 'spot_bid_price_percent' + SpotBidPricePercent int // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -3799,22 +6914,41 @@ type InstancePoolAwsAttributes struct { // optional field at cluster creation, and if not specified, a default zone // will be used. The list of available zones as well as the default value // can be found by using the `List Zones` method. - ZoneId string `json:"zone_id,omitempty"` + // Wire name: 'zone_id' + ZoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolAwsAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolAwsAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolAwsAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolAwsAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolAwsAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolAwsAttributes) MarshalJSON() ([]byte, error) { + pb, err := instancePoolAwsAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The set of AWS availability types supported when setting up nodes for a // cluster. type InstancePoolAwsAttributesAvailability string +type instancePoolAwsAttributesAvailabilityPb string const InstancePoolAwsAttributesAvailabilityOnDemand InstancePoolAwsAttributesAvailability = `ON_DEMAND` @@ -3841,32 +6975,68 @@ func (f *InstancePoolAwsAttributesAvailability) Type() string { return "InstancePoolAwsAttributesAvailability" } +func instancePoolAwsAttributesAvailabilityToPb(st *InstancePoolAwsAttributesAvailability) (*instancePoolAwsAttributesAvailabilityPb, error) { + if st == nil { + return nil, nil + } + pb := instancePoolAwsAttributesAvailabilityPb(*st) + return &pb, nil +} + +func instancePoolAwsAttributesAvailabilityFromPb(pb *instancePoolAwsAttributesAvailabilityPb) (*InstancePoolAwsAttributesAvailability, error) { + if pb == nil { + return nil, nil + } + st := InstancePoolAwsAttributesAvailability(*pb) + return &st, nil +} + // Attributes set during instance pool creation which are related to Azure. type InstancePoolAzureAttributes struct { // Availability type used for the spot nodes. - Availability InstancePoolAzureAttributesAvailability `json:"availability,omitempty"` + // Wire name: 'availability' + Availability InstancePoolAzureAttributesAvailability // With variable pricing, you have option to set a max price, in US dollars // (USD) For example, the value 2 would be a max price of $2.00 USD per // hour. If you set the max price to be -1, the VM won't be evicted based on // price. The price for the VM will be the current price for spot or the // price for a standard VM, which ever is less, as long as there is capacity // and quota available. - SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + // Wire name: 'spot_bid_max_price' + SpotBidMaxPrice float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolAzureAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolAzureAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolAzureAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolAzureAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolAzureAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolAzureAttributes) MarshalJSON() ([]byte, error) { + pb, err := instancePoolAzureAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The set of Azure availability types supported when setting up nodes for a // cluster. type InstancePoolAzureAttributesAvailability string +type instancePoolAzureAttributesAvailabilityPb string const InstancePoolAzureAttributesAvailabilityOnDemandAzure InstancePoolAzureAttributesAvailability = `ON_DEMAND_AZURE` @@ -3893,19 +7063,37 @@ func (f *InstancePoolAzureAttributesAvailability) Type() string { return "InstancePoolAzureAttributesAvailability" } +func instancePoolAzureAttributesAvailabilityToPb(st *InstancePoolAzureAttributesAvailability) (*instancePoolAzureAttributesAvailabilityPb, error) { + if st == nil { + return nil, nil + } + pb := instancePoolAzureAttributesAvailabilityPb(*st) + return &pb, nil +} + +func instancePoolAzureAttributesAvailabilityFromPb(pb *instancePoolAzureAttributesAvailabilityPb) (*InstancePoolAzureAttributesAvailability, error) { + if pb == nil { + return nil, nil + } + st := InstancePoolAzureAttributesAvailability(*pb) + return &st, nil +} + // Attributes set during instance pool creation which are related to GCP. type InstancePoolGcpAttributes struct { // This field determines whether the instance pool will contain preemptible // VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs // if the former is unavailable. - GcpAvailability GcpAvailability `json:"gcp_availability,omitempty"` + // Wire name: 'gcp_availability' + GcpAvailability GcpAvailability // If provided, each node in the instance pool will have this number of // local SSDs attached. Each local SSD is 375GB in size. Refer to [GCP // documentation] for the supported number of local SSDs for each instance // type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount int `json:"local_ssd_count,omitempty"` + // Wire name: 'local_ssd_count' + LocalSsdCount int // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west1-a". The provided // availability zone must be in the same region as the Databricks workspace. @@ -3922,39 +7110,79 @@ type InstancePoolGcpAttributes struct { // // If empty, Databricks picks an availability zone to schedule the cluster // on. - ZoneId string `json:"zone_id,omitempty"` + // Wire name: 'zone_id' + ZoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolGcpAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolGcpAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolGcpAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolGcpAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolGcpAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolGcpAttributes) MarshalJSON() ([]byte, error) { + pb, err := instancePoolGcpAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel InstancePoolPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolPermission) MarshalJSON() ([]byte, error) { + pb, err := instancePoolPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type InstancePoolPermissionLevel string +type instancePoolPermissionLevelPb string const InstancePoolPermissionLevelCanAttachTo InstancePoolPermissionLevel = `CAN_ATTACH_TO` @@ -3981,44 +7209,129 @@ func (f *InstancePoolPermissionLevel) Type() string { return "InstancePoolPermissionLevel" } +func instancePoolPermissionLevelToPb(st *InstancePoolPermissionLevel) (*instancePoolPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := instancePoolPermissionLevelPb(*st) + return &pb, nil +} + +func instancePoolPermissionLevelFromPb(pb *instancePoolPermissionLevelPb) (*InstancePoolPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := InstancePoolPermissionLevel(*pb) + return &st, nil +} + type InstancePoolPermissions struct { - AccessControlList []InstancePoolAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []InstancePoolAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolPermissions) MarshalJSON() ([]byte, error) { + pb, err := instancePoolPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel InstancePoolPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := instancePoolPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolPermissionsRequest struct { - AccessControlList []InstancePoolAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []InstancePoolAccessControlRequest // The instance pool for which to get or manage permissions. - InstancePoolId string `json:"-" url:"-"` + // Wire name: 'instance_pool_id' + InstancePoolId string `tf:"-"` +} + +func (st *InstancePoolPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InstancePoolPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := instancePoolPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The state of a Cluster. The current allowable state transitions are as @@ -4027,6 +7340,7 @@ type InstancePoolPermissionsRequest struct { // - “ACTIVE“ -> “STOPPED“ - “ACTIVE“ -> “DELETED“ - “STOPPED“ -> // “ACTIVE“ - “STOPPED“ -> “DELETED“ type InstancePoolState string +type instancePoolStatePb string const InstancePoolStateActive InstancePoolState = `ACTIVE` @@ -4055,25 +7369,62 @@ func (f *InstancePoolState) Type() string { return "InstancePoolState" } +func instancePoolStateToPb(st *InstancePoolState) (*instancePoolStatePb, error) { + if st == nil { + return nil, nil + } + pb := instancePoolStatePb(*st) + return &pb, nil +} + +func instancePoolStateFromPb(pb *instancePoolStatePb) (*InstancePoolState, error) { + if pb == nil { + return nil, nil + } + st := InstancePoolState(*pb) + return &st, nil +} + type InstancePoolStats struct { // Number of active instances in the pool that are NOT part of a cluster. - IdleCount int `json:"idle_count,omitempty"` + // Wire name: 'idle_count' + IdleCount int // Number of pending instances in the pool that are NOT part of a cluster. - PendingIdleCount int `json:"pending_idle_count,omitempty"` + // Wire name: 'pending_idle_count' + PendingIdleCount int // Number of pending instances in the pool that are part of a cluster. - PendingUsedCount int `json:"pending_used_count,omitempty"` + // Wire name: 'pending_used_count' + PendingUsedCount int // Number of active instances in the pool that are part of a cluster. - UsedCount int `json:"used_count,omitempty"` + // Wire name: 'used_count' + UsedCount int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstancePoolStats) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstancePoolStats) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolStatsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolStatsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstancePoolStats) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstancePoolStats) MarshalJSON() ([]byte, error) { + pb, err := instancePoolStatsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstancePoolStatus struct { @@ -4081,7 +7432,33 @@ type InstancePoolStatus struct { // pending_instance_errors follows FIFO with maximum length of the min_idle // of the pool. The pending_instance_errors is emptied once the number of // exiting available instances reaches the min_idle of the pool. - PendingInstanceErrors []PendingInstanceError `json:"pending_instance_errors,omitempty"` + // Wire name: 'pending_instance_errors' + PendingInstanceErrors []PendingInstanceError +} + +func (st *InstancePoolStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instancePoolStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instancePoolStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InstancePoolStatus) MarshalJSON() ([]byte, error) { + pb, err := instancePoolStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstanceProfile struct { @@ -4093,26 +7470,46 @@ type InstanceProfile struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn string `json:"iam_role_arn,omitempty"` + // Wire name: 'iam_role_arn' + IamRoleArn string // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn string `json:"instance_profile_arn"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + // Wire name: 'is_meta_instance_profile' + IsMetaInstanceProfile bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *InstanceProfile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstanceProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &instanceProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := instanceProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstanceProfile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstanceProfile) MarshalJSON() ([]byte, error) { + pb, err := instanceProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The kind of compute described by this compute specification. @@ -4133,6 +7530,7 @@ func (s InstanceProfile) MarshalJSON() ([]byte, error) { // // [simple form]: https://docs.databricks.com/compute/simple-form.html type Kind string +type kindPb string const KindClassicPreview Kind = `CLASSIC_PREVIEW` @@ -4157,7 +7555,24 @@ func (f *Kind) Type() string { return "Kind" } +func kindToPb(st *Kind) (*kindPb, error) { + if st == nil { + return nil, nil + } + pb := kindPb(*st) + return &pb, nil +} + +func kindFromPb(pb *kindPb) (*Kind, error) { + if pb == nil { + return nil, nil + } + st := Kind(*pb) + return &st, nil +} + type Language string +type languagePb string const LanguagePython Language = `python` @@ -4186,13 +7601,31 @@ func (f *Language) Type() string { return "Language" } +func languageToPb(st *Language) (*languagePb, error) { + if st == nil { + return nil, nil + } + pb := languagePb(*st) + return &pb, nil +} + +func languageFromPb(pb *languagePb) (*Language, error) { + if pb == nil { + return nil, nil + } + st := Language(*pb) + return &st, nil +} + type Library struct { // Specification of a CRAN library to be installed as part of the library - Cran *RCranLibrary `json:"cran,omitempty"` + // Wire name: 'cran' + Cran *RCranLibrary // Deprecated. URI of the egg library to install. Installing Python egg // files is deprecated and is not supported in Databricks Runtime 14.0 and // above. - Egg string `json:"egg,omitempty"` + // Wire name: 'egg' + Egg string // URI of the JAR library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "jar": // "/Workspace/path/to/library.jar" }`, `{ "jar" : @@ -4200,18 +7633,22 @@ type Library struct { // "s3://my-bucket/library.jar" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Jar string `json:"jar,omitempty"` + // Wire name: 'jar' + Jar string // Specification of a maven library to be installed. For example: `{ // "coordinates": "org.jsoup:jsoup:1.7.2" }` - Maven *MavenLibrary `json:"maven,omitempty"` + // Wire name: 'maven' + Maven *MavenLibrary // Specification of a PyPi library to be installed. For example: `{ // "package": "simplejson" }` - Pypi *PythonPyPiLibrary `json:"pypi,omitempty"` + // Wire name: 'pypi' + Pypi *PythonPyPiLibrary // URI of the requirements.txt file to install. Only Workspace paths and // Unity Catalog Volumes paths are supported. For example: `{ // "requirements": "/Workspace/path/to/requirements.txt" }` or `{ // "requirements" : "/Volumes/path/to/requirements.txt" }` - Requirements string `json:"requirements,omitempty"` + // Wire name: 'requirements' + Requirements string // URI of the wheel library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "whl": // "/Workspace/path/to/library.whl" }`, `{ "whl" : @@ -4219,45 +7656,85 @@ type Library struct { // "s3://my-bucket/library.whl" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Whl string `json:"whl,omitempty"` + // Wire name: 'whl' + Whl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Library) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Library) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &libraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := libraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Library) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Library) MarshalJSON() ([]byte, error) { + pb, err := libraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status of the library on a specific cluster. type LibraryFullStatus struct { // Whether the library was set to be installed on all clusters via the // libraries UI. - IsLibraryForAllClusters bool `json:"is_library_for_all_clusters,omitempty"` + // Wire name: 'is_library_for_all_clusters' + IsLibraryForAllClusters bool // Unique identifier for the library. - Library *Library `json:"library,omitempty"` + // Wire name: 'library' + Library *Library // All the info and warning messages that have occurred so far for this // library. - Messages []string `json:"messages,omitempty"` + // Wire name: 'messages' + Messages []string // Status of installing the library on the cluster. - Status LibraryInstallStatus `json:"status,omitempty"` + // Wire name: 'status' + Status LibraryInstallStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LibraryFullStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LibraryFullStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &libraryFullStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := libraryFullStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LibraryFullStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LibraryFullStatus) MarshalJSON() ([]byte, error) { + pb, err := libraryFullStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status of a library on a specific cluster. type LibraryInstallStatus string +type libraryInstallStatusPb string const LibraryInstallStatusFailed LibraryInstallStatus = `FAILED` @@ -4296,27 +7773,88 @@ func (f *LibraryInstallStatus) Type() string { return "LibraryInstallStatus" } +func libraryInstallStatusToPb(st *LibraryInstallStatus) (*libraryInstallStatusPb, error) { + if st == nil { + return nil, nil + } + pb := libraryInstallStatusPb(*st) + return &pb, nil +} + +func libraryInstallStatusFromPb(pb *libraryInstallStatusPb) (*LibraryInstallStatus, error) { + if pb == nil { + return nil, nil + } + st := LibraryInstallStatus(*pb) + return &st, nil +} + type ListAllClusterLibraryStatusesResponse struct { // A list of cluster statuses. - Statuses []ClusterLibraryStatuses `json:"statuses,omitempty"` + // Wire name: 'statuses' + Statuses []ClusterLibraryStatuses +} + +func (st *ListAllClusterLibraryStatusesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAllClusterLibraryStatusesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAllClusterLibraryStatusesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAllClusterLibraryStatusesResponse) MarshalJSON() ([]byte, error) { + pb, err := listAllClusterLibraryStatusesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAvailableZonesResponse struct { // The availability zone if no ``zone_id`` is provided in the cluster // creation request. - DefaultZone string `json:"default_zone,omitempty"` + // Wire name: 'default_zone' + DefaultZone string // The list of available zones (e.g., ['us-west-2c', 'us-east-2']). - Zones []string `json:"zones,omitempty"` + // Wire name: 'zones' + Zones []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAvailableZonesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAvailableZonesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAvailableZonesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAvailableZonesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAvailableZonesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAvailableZonesResponse) MarshalJSON() ([]byte, error) { + pb, err := listAvailableZonesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List cluster policy compliance @@ -4324,44 +7862,84 @@ type ListClusterCompliancesRequest struct { // Use this field to specify the maximum number of results to be returned by // the server. The server may further constrain the maximum number of // results returned in a single page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token that can be used to navigate to the next page or previous // page as returned by `next_page_token` or `prev_page_token`. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Canonical unique identifier for the cluster policy. - PolicyId string `json:"-" url:"policy_id"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListClusterCompliancesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListClusterCompliancesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClusterCompliancesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClusterCompliancesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListClusterCompliancesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListClusterCompliancesRequest) MarshalJSON() ([]byte, error) { + pb, err := listClusterCompliancesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListClusterCompliancesResponse struct { // A list of clusters and their policy compliance statuses. - Clusters []ClusterCompliance `json:"clusters,omitempty"` + // Wire name: 'clusters' + Clusters []ClusterCompliance // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListClusterCompliancesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListClusterCompliancesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClusterCompliancesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClusterCompliancesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListClusterCompliancesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListClusterCompliancesResponse) MarshalJSON() ([]byte, error) { + pb, err := listClusterCompliancesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List cluster policies @@ -4369,89 +7947,207 @@ type ListClusterPoliciesRequest struct { // The cluster policy attribute to sort by. * `POLICY_CREATION_TIME` - Sort // result list by policy creation time. * `POLICY_NAME` - Sort result list // by policy name. - SortColumn ListSortColumn `json:"-" url:"sort_column,omitempty"` + // Wire name: 'sort_column' + SortColumn ListSortColumn `tf:"-"` // The order in which the policies get listed. * `DESC` - Sort result list // in descending order. * `ASC` - Sort result list in ascending order. - SortOrder ListSortOrder `json:"-" url:"sort_order,omitempty"` + // Wire name: 'sort_order' + SortOrder ListSortOrder `tf:"-"` +} + +func (st *ListClusterPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClusterPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClusterPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListClusterPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listClusterPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListClustersFilterBy struct { // The source of cluster creation. - ClusterSources []ClusterSource `json:"cluster_sources,omitempty" url:"cluster_sources,omitempty"` + // Wire name: 'cluster_sources' + ClusterSources []ClusterSource // The current state of the clusters. - ClusterStates []State `json:"cluster_states,omitempty" url:"cluster_states,omitempty"` + // Wire name: 'cluster_states' + ClusterStates []State // Whether the clusters are pinned or not. - IsPinned bool `json:"is_pinned,omitempty" url:"is_pinned,omitempty"` + // Wire name: 'is_pinned' + IsPinned bool // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty" url:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListClustersFilterBy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListClustersFilterBy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClustersFilterByPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClustersFilterByFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListClustersFilterBy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListClustersFilterBy) MarshalJSON() ([]byte, error) { + pb, err := listClustersFilterByToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List clusters type ListClustersRequest struct { // Filters to apply to the list of clusters. - FilterBy *ListClustersFilterBy `json:"-" url:"filter_by,omitempty"` + // Wire name: 'filter_by' + FilterBy *ListClustersFilterBy `tf:"-"` // Use this field to specify the maximum number of results to be returned by // the server. The server may further constrain the maximum number of // results returned in a single page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Use next_page_token or prev_page_token returned from the previous request // to list the next or previous page of clusters respectively. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Sort the list of clusters by a specific criteria. - SortBy *ListClustersSortBy `json:"-" url:"sort_by,omitempty"` + // Wire name: 'sort_by' + SortBy *ListClustersSortBy `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListClustersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListClustersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClustersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClustersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListClustersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListClustersRequest) MarshalJSON() ([]byte, error) { + pb, err := listClustersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListClustersResponse struct { - Clusters []ClusterDetails `json:"clusters,omitempty"` + + // Wire name: 'clusters' + Clusters []ClusterDetails // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListClustersResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListClustersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClustersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClustersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListClustersResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListClustersResponse) MarshalJSON() ([]byte, error) { + pb, err := listClustersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListClustersSortBy struct { // The direction to sort by. - Direction ListClustersSortByDirection `json:"direction,omitempty" url:"direction,omitempty"` + // Wire name: 'direction' + Direction ListClustersSortByDirection // The sorting criteria. By default, clusters are sorted by 3 columns from // highest to lowest precedence: cluster state, pinned or unpinned, then // cluster name. - Field ListClustersSortByField `json:"field,omitempty" url:"field,omitempty"` + // Wire name: 'field' + Field ListClustersSortByField +} + +func (st *ListClustersSortBy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listClustersSortByPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listClustersSortByFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListClustersSortBy) MarshalJSON() ([]byte, error) { + pb, err := listClustersSortByToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListClustersSortByDirection string +type listClustersSortByDirectionPb string const ListClustersSortByDirectionAsc ListClustersSortByDirection = `ASC` @@ -4478,7 +8174,24 @@ func (f *ListClustersSortByDirection) Type() string { return "ListClustersSortByDirection" } +func listClustersSortByDirectionToPb(st *ListClustersSortByDirection) (*listClustersSortByDirectionPb, error) { + if st == nil { + return nil, nil + } + pb := listClustersSortByDirectionPb(*st) + return &pb, nil +} + +func listClustersSortByDirectionFromPb(pb *listClustersSortByDirectionPb) (*ListClustersSortByDirection, error) { + if pb == nil { + return nil, nil + } + st := ListClustersSortByDirection(*pb) + return &st, nil +} + type ListClustersSortByField string +type listClustersSortByFieldPb string const ListClustersSortByFieldClusterName ListClustersSortByField = `CLUSTER_NAME` @@ -4505,66 +8218,253 @@ func (f *ListClustersSortByField) Type() string { return "ListClustersSortByField" } +func listClustersSortByFieldToPb(st *ListClustersSortByField) (*listClustersSortByFieldPb, error) { + if st == nil { + return nil, nil + } + pb := listClustersSortByFieldPb(*st) + return &pb, nil +} + +func listClustersSortByFieldFromPb(pb *listClustersSortByFieldPb) (*ListClustersSortByField, error) { + if pb == nil { + return nil, nil + } + st := ListClustersSortByField(*pb) + return &st, nil +} + type ListGlobalInitScriptsResponse struct { - Scripts []GlobalInitScriptDetails `json:"scripts,omitempty"` + + // Wire name: 'scripts' + Scripts []GlobalInitScriptDetails +} + +func (st *ListGlobalInitScriptsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listGlobalInitScriptsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listGlobalInitScriptsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListGlobalInitScriptsResponse) MarshalJSON() ([]byte, error) { + pb, err := listGlobalInitScriptsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListInstancePools struct { - InstancePools []InstancePoolAndStats `json:"instance_pools,omitempty"` + + // Wire name: 'instance_pools' + InstancePools []InstancePoolAndStats +} + +func (st *ListInstancePools) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listInstancePoolsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listInstancePoolsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListInstancePools) MarshalJSON() ([]byte, error) { + pb, err := listInstancePoolsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListInstanceProfilesResponse struct { // A list of instance profiles that the user can access. - InstanceProfiles []InstanceProfile `json:"instance_profiles,omitempty"` + // Wire name: 'instance_profiles' + InstanceProfiles []InstanceProfile +} + +func (st *ListInstanceProfilesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listInstanceProfilesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listInstanceProfilesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListInstanceProfilesResponse) MarshalJSON() ([]byte, error) { + pb, err := listInstanceProfilesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListNodeTypesResponse struct { // The list of available Spark node types. - NodeTypes []NodeType `json:"node_types,omitempty"` + // Wire name: 'node_types' + NodeTypes []NodeType +} + +func (st *ListNodeTypesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNodeTypesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNodeTypesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListNodeTypesResponse) MarshalJSON() ([]byte, error) { + pb, err := listNodeTypesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListPoliciesResponse struct { // List of policies. - Policies []Policy `json:"policies,omitempty"` + // Wire name: 'policies' + Policies []Policy +} + +func (st *ListPoliciesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPoliciesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPoliciesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListPoliciesResponse) MarshalJSON() ([]byte, error) { + pb, err := listPoliciesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List policy families type ListPolicyFamiliesRequest struct { // Maximum number of policy families to return. - MaxResults int64 `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int64 `tf:"-"` // A token that can be used to get the next page of results. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPolicyFamiliesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPolicyFamiliesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPolicyFamiliesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPolicyFamiliesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPolicyFamiliesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPolicyFamiliesRequest) MarshalJSON() ([]byte, error) { + pb, err := listPolicyFamiliesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListPolicyFamiliesResponse struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // List of policy families. - PolicyFamilies []PolicyFamily `json:"policy_families,omitempty"` + // Wire name: 'policy_families' + PolicyFamilies []PolicyFamily - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPolicyFamiliesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPolicyFamiliesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPolicyFamiliesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPolicyFamiliesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPolicyFamiliesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPolicyFamiliesResponse) MarshalJSON() ([]byte, error) { + pb, err := listPolicyFamiliesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSortColumn string +type listSortColumnPb string const ListSortColumnPolicyCreationTime ListSortColumn = `POLICY_CREATION_TIME` @@ -4591,7 +8491,24 @@ func (f *ListSortColumn) Type() string { return "ListSortColumn" } +func listSortColumnToPb(st *ListSortColumn) (*listSortColumnPb, error) { + if st == nil { + return nil, nil + } + pb := listSortColumnPb(*st) + return &pb, nil +} + +func listSortColumnFromPb(pb *listSortColumnPb) (*ListSortColumn, error) { + if pb == nil { + return nil, nil + } + st := ListSortColumn(*pb) + return &st, nil +} + type ListSortOrder string +type listSortOrderPb string const ListSortOrderAsc ListSortOrder = `ASC` @@ -4618,71 +8535,188 @@ func (f *ListSortOrder) Type() string { return "ListSortOrder" } +func listSortOrderToPb(st *ListSortOrder) (*listSortOrderPb, error) { + if st == nil { + return nil, nil + } + pb := listSortOrderPb(*st) + return &pb, nil +} + +func listSortOrderFromPb(pb *listSortOrderPb) (*ListSortOrder, error) { + if pb == nil { + return nil, nil + } + st := ListSortOrder(*pb) + return &st, nil +} + type LocalFileInfo struct { // local file destination, e.g. `file:/my/local/file.sh` - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *LocalFileInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &localFileInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := localFileInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LocalFileInfo) MarshalJSON() ([]byte, error) { + pb, err := localFileInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogAnalyticsInfo struct { - LogAnalyticsPrimaryKey string `json:"log_analytics_primary_key,omitempty"` - LogAnalyticsWorkspaceId string `json:"log_analytics_workspace_id,omitempty"` + // Wire name: 'log_analytics_primary_key' + LogAnalyticsPrimaryKey string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'log_analytics_workspace_id' + LogAnalyticsWorkspaceId string + + ForceSendFields []string `tf:"-"` } -func (s *LogAnalyticsInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogAnalyticsInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logAnalyticsInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logAnalyticsInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogAnalyticsInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogAnalyticsInfo) MarshalJSON() ([]byte, error) { + pb, err := logAnalyticsInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The log delivery status type LogSyncStatus struct { // The timestamp of last attempt. If the last attempt fails, // `last_exception` will contain the exception in the last attempt. - LastAttempted int64 `json:"last_attempted,omitempty"` + // Wire name: 'last_attempted' + LastAttempted int64 // The exception thrown in the last attempt, it would be null (omitted in // the response) if there is no exception in last attempted. - LastException string `json:"last_exception,omitempty"` + // Wire name: 'last_exception' + LastException string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogSyncStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogSyncStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logSyncStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logSyncStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogSyncStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogSyncStatus) MarshalJSON() ([]byte, error) { + pb, err := logSyncStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MapAny map[string]any +type mapAnyPb MapAny + +func mapAnyToPb(st *MapAny) (*mapAnyPb, error) { + if st == nil { + return nil, nil + } + stPb := mapAnyPb(*st) + return &stPb, nil +} +func mapAnyFromPb(stPb *mapAnyPb) (*MapAny, error) { + if stPb == nil { + return nil, nil + } + st := MapAny(*stPb) + return &st, nil +} type MavenLibrary struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". - Coordinates string `json:"coordinates"` + // Wire name: 'coordinates' + Coordinates string // List of dependences to exclude. For example: `["slf4j:slf4j", // "*:hadoop-client"]`. // // Maven dependency exclusions: // https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. - Exclusions []string `json:"exclusions,omitempty"` + // Wire name: 'exclusions' + Exclusions []string // Maven repo to install the Maven package from. If omitted, both Maven // Central Repository and Spark Packages are searched. - Repo string `json:"repo,omitempty"` + // Wire name: 'repo' + Repo string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MavenLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MavenLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mavenLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mavenLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MavenLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MavenLibrary) MarshalJSON() ([]byte, error) { + pb, err := mavenLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // This structure embodies the machine type that hosts spark containers Note: @@ -4690,27 +8724,49 @@ func (s MavenLibrary) MarshalJSON() ([]byte, error) { // case we want to send it over the wire in the future (which is likely) type NodeInstanceType struct { // Unique identifier across instance types - InstanceTypeId string `json:"instance_type_id"` + // Wire name: 'instance_type_id' + InstanceTypeId string // Size of the individual local disks attached to this instance (i.e. per // local disk). - LocalDiskSizeGb int `json:"local_disk_size_gb,omitempty"` + // Wire name: 'local_disk_size_gb' + LocalDiskSizeGb int // Number of local disks that are present on this instance. - LocalDisks int `json:"local_disks,omitempty"` + // Wire name: 'local_disks' + LocalDisks int // Size of the individual local nvme disks attached to this instance (i.e. // per local disk). - LocalNvmeDiskSizeGb int `json:"local_nvme_disk_size_gb,omitempty"` + // Wire name: 'local_nvme_disk_size_gb' + LocalNvmeDiskSizeGb int // Number of local nvme disks that are present on this instance. - LocalNvmeDisks int `json:"local_nvme_disks,omitempty"` + // Wire name: 'local_nvme_disks' + LocalNvmeDisks int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NodeInstanceType) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NodeInstanceType) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nodeInstanceTypePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nodeInstanceTypeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NodeInstanceType) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NodeInstanceType) MarshalJSON() ([]byte, error) { + pb, err := nodeInstanceTypeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A description of a Spark node type including both the dimensions of the node @@ -4718,125 +8774,324 @@ func (s NodeInstanceType) MarshalJSON() ([]byte, error) { type NodeType struct { // A descriptive category for this node type. Examples include "Memory // Optimized" and "Compute Optimized". - Category string `json:"category"` + // Wire name: 'category' + Category string // A string description associated with this node type, e.g., "r3.xlarge". - Description string `json:"description"` + // Wire name: 'description' + Description string // An optional hint at the display order of node types in the UI. Within a // node type category, lowest numbers come first. - DisplayOrder int `json:"display_order,omitempty"` + // Wire name: 'display_order' + DisplayOrder int // An identifier for the type of hardware that this node runs on, e.g., // "r3.2xlarge" in AWS. - InstanceTypeId string `json:"instance_type_id"` + // Wire name: 'instance_type_id' + InstanceTypeId string // Whether the node type is deprecated. Non-deprecated node types offer // greater performance. - IsDeprecated bool `json:"is_deprecated,omitempty"` + // Wire name: 'is_deprecated' + IsDeprecated bool // AWS specific, whether this instance supports encryption in transit, used // for hipaa and pci workloads. - IsEncryptedInTransit bool `json:"is_encrypted_in_transit,omitempty"` + // Wire name: 'is_encrypted_in_transit' + IsEncryptedInTransit bool // Whether this is an Arm-based instance. - IsGraviton bool `json:"is_graviton,omitempty"` + // Wire name: 'is_graviton' + IsGraviton bool // Whether this node is hidden from presentation in the UI. - IsHidden bool `json:"is_hidden,omitempty"` + // Wire name: 'is_hidden' + IsHidden bool // Whether this node comes with IO cache enabled by default. - IsIoCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` + // Wire name: 'is_io_cache_enabled' + IsIoCacheEnabled bool // Memory (in MB) available for this node type. - MemoryMb int `json:"memory_mb"` + // Wire name: 'memory_mb' + MemoryMb int // A collection of node type info reported by the cloud provider - NodeInfo *CloudProviderNodeInfo `json:"node_info,omitempty"` + // Wire name: 'node_info' + NodeInfo *CloudProviderNodeInfo // The NodeInstanceType object corresponding to instance_type_id - NodeInstanceType *NodeInstanceType `json:"node_instance_type,omitempty"` + // Wire name: 'node_instance_type' + NodeInstanceType *NodeInstanceType // Unique identifier for this node type. - NodeTypeId string `json:"node_type_id"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of CPU cores available for this node type. Note that this can be // fractional, e.g., 2.5 cores, if the the number of cores on a machine // instance is not divisible by the number of Spark nodes on that machine. - NumCores float64 `json:"num_cores"` + // Wire name: 'num_cores' + NumCores float64 // Number of GPUs available for this node type. - NumGpus int `json:"num_gpus,omitempty"` + // Wire name: 'num_gpus' + NumGpus int - PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` + // Wire name: 'photon_driver_capable' + PhotonDriverCapable bool - PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` + // Wire name: 'photon_worker_capable' + PhotonWorkerCapable bool // Whether this node type support cluster tags. - SupportClusterTags bool `json:"support_cluster_tags,omitempty"` + // Wire name: 'support_cluster_tags' + SupportClusterTags bool // Whether this node type support EBS volumes. EBS volumes is disabled for // node types that we could place multiple corresponding containers on the // same hosting instance. - SupportEbsVolumes bool `json:"support_ebs_volumes,omitempty"` + // Wire name: 'support_ebs_volumes' + SupportEbsVolumes bool // Whether this node type supports port forwarding. - SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` + // Wire name: 'support_port_forwarding' + SupportPortForwarding bool + + ForceSendFields []string `tf:"-"` +} + +func (st *NodeType) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nodeTypePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nodeTypeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NodeType) MarshalJSON() ([]byte, error) { + pb, err := nodeTypeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// For Fleet-V2 using classic clusters, this object contains the information +// about the alternate node type ids to use when attempting to launch a cluster. +// It can be used with both the driver and worker node types. +type NodeTypeFlexibility struct { +} + +func (st *NodeTypeFlexibility) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nodeTypeFlexibilityPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nodeTypeFlexibilityFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NodeTypeFlexibility) MarshalJSON() ([]byte, error) { + pb, err := nodeTypeFlexibilityToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Error message of a failed pending instances +type PendingInstanceError struct { + + // Wire name: 'instance_id' + InstanceId string + + // Wire name: 'message' + Message string + + ForceSendFields []string `tf:"-"` +} + +func (st *PendingInstanceError) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pendingInstanceErrorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pendingInstanceErrorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - ForceSendFields []string `json:"-" url:"-"` +func (st PendingInstanceError) MarshalJSON() ([]byte, error) { + pb, err := pendingInstanceErrorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type PermanentDeleteCluster struct { + // The cluster to be deleted. + // Wire name: 'cluster_id' + ClusterId string +} + +func (st *PermanentDeleteCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permanentDeleteClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permanentDeleteClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s *NodeType) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st PermanentDeleteCluster) MarshalJSON() ([]byte, error) { + pb, err := permanentDeleteClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type PermanentDeleteClusterResponse struct { +} + +func (st *PermanentDeleteClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permanentDeleteClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permanentDeleteClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NodeType) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermanentDeleteClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := permanentDeleteClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } -// Error message of a failed pending instances -type PendingInstanceError struct { - InstanceId string `json:"instance_id,omitempty"` - - Message string `json:"message,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} +type PinCluster struct { -func (s *PendingInstanceError) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) + // Wire name: 'cluster_id' + ClusterId string } -func (s PendingInstanceError) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *PinCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pinClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pinClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type PermanentDeleteCluster struct { - // The cluster to be deleted. - ClusterId string `json:"cluster_id"` +func (st PinCluster) MarshalJSON() ([]byte, error) { + pb, err := pinClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } -type PermanentDeleteClusterResponse struct { +type PinClusterResponse struct { } -type PinCluster struct { - ClusterId string `json:"cluster_id"` +func (st *PinClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pinClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pinClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type PinClusterResponse struct { +func (st PinClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := pinClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Describes a Cluster Policy entity. type Policy struct { // Creation time. The timestamp (in millisecond) when this Cluster Policy // was created. - CreatedAtTimestamp int64 `json:"created_at_timestamp,omitempty"` + // Wire name: 'created_at_timestamp' + CreatedAtTimestamp int64 // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // Policy definition document expressed in [Databricks Cluster Policy // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition string `json:"definition,omitempty"` + // Wire name: 'definition' + Definition string // Additional human-readable description of the cluster policy. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // 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"` + // Wire name: 'is_default' + IsDefault bool // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries []Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []Library // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + // Wire name: 'max_clusters_per_user' + MaxClustersPerUser int64 // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -4846,26 +9101,46 @@ type Policy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + // Wire name: 'policy_family_definition_overrides' + PolicyFamilyDefinitionOverrides string // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId string `json:"policy_family_id,omitempty"` + // Wire name: 'policy_family_id' + PolicyFamilyId string // Canonical unique identifier for the Cluster Policy. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Policy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Policy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &policyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := policyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Policy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Policy) MarshalJSON() ([]byte, error) { + pb, err := policyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PolicyFamily struct { @@ -4873,78 +9148,190 @@ type PolicyFamily struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition string `json:"definition,omitempty"` + // Wire name: 'definition' + Definition string // Human-readable description of the purpose of the policy family. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Name of the policy family. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Unique identifier for the policy family. - PolicyFamilyId string `json:"policy_family_id,omitempty"` + // Wire name: 'policy_family_id' + PolicyFamilyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PolicyFamily) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PolicyFamily) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &policyFamilyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := policyFamilyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PolicyFamily) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PolicyFamily) MarshalJSON() ([]byte, error) { + pb, err := policyFamilyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PythonPyPiLibrary struct { // The name of the pypi package to install. An optional exact version // specification is also supported. Examples: "simplejson" and // "simplejson==3.8.0". - Package string `json:"package"` + // Wire name: 'package' + Package string // The repository where the package can be found. If not specified, the // default pip index is used. - Repo string `json:"repo,omitempty"` + // Wire name: 'repo' + Repo string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PythonPyPiLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PythonPyPiLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pythonPyPiLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pythonPyPiLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PythonPyPiLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PythonPyPiLibrary) MarshalJSON() ([]byte, error) { + pb, err := pythonPyPiLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RCranLibrary struct { // The name of the CRAN package to install. - Package string `json:"package"` + // Wire name: 'package' + Package string // The repository where the package can be found. If not specified, the // default CRAN repo is used. - Repo string `json:"repo,omitempty"` + // Wire name: 'repo' + Repo string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RCranLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RCranLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rCranLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rCranLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RCranLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RCranLibrary) MarshalJSON() ([]byte, error) { + pb, err := rCranLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RemoveInstanceProfile struct { // The ARN of the instance profile to remove. This field is required. - InstanceProfileArn string `json:"instance_profile_arn"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string +} + +func (st *RemoveInstanceProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &removeInstanceProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := removeInstanceProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RemoveInstanceProfile) MarshalJSON() ([]byte, error) { + pb, err := removeInstanceProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RemoveResponse struct { } +func (st *RemoveResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &removeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := removeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RemoveResponse) MarshalJSON() ([]byte, error) { + pb, err := removeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ResizeCluster struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // The cluster to be resized. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -4955,43 +9342,131 @@ type ResizeCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResizeCluster) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResizeCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resizeClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resizeClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResizeCluster) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResizeCluster) MarshalJSON() ([]byte, error) { + pb, err := resizeClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResizeClusterResponse struct { } +func (st *ResizeClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resizeClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resizeClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResizeClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := resizeClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type RestartCluster struct { // The cluster to be started. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string - RestartUser string `json:"restart_user,omitempty"` + // Wire name: 'restart_user' + RestartUser string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RestartCluster) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RestartCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restartClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restartClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RestartCluster) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RestartCluster) MarshalJSON() ([]byte, error) { + pb, err := restartClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestartClusterResponse struct { } +func (st *RestartClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restartClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restartClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestartClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := restartClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ResultType string +type resultTypePb string const ResultTypeError ResultType = `error` @@ -5024,41 +9499,85 @@ func (f *ResultType) Type() string { return "ResultType" } +func resultTypeToPb(st *ResultType) (*resultTypePb, error) { + if st == nil { + return nil, nil + } + pb := resultTypePb(*st) + return &pb, nil +} + +func resultTypeFromPb(pb *resultTypePb) (*ResultType, error) { + if pb == nil { + return nil, nil + } + st := ResultType(*pb) + return &st, nil +} + type Results struct { // The cause of the error - Cause string `json:"cause,omitempty"` + // Wire name: 'cause' + Cause string - Data any `json:"data,omitempty"` + // Wire name: 'data' + Data any // The image filename - FileName string `json:"fileName,omitempty"` + // Wire name: 'fileName' + FileName string - FileNames []string `json:"fileNames,omitempty"` + // Wire name: 'fileNames' + FileNames []string // true if a JSON schema is returned instead of a string representation of // the Hive type. - IsJsonSchema bool `json:"isJsonSchema,omitempty"` + // Wire name: 'isJsonSchema' + IsJsonSchema bool // internal field used by SDK - Pos int `json:"pos,omitempty"` + // Wire name: 'pos' + Pos int - ResultType ResultType `json:"resultType,omitempty"` + // Wire name: 'resultType' + ResultType ResultType // The table schema - Schema []map[string]any `json:"schema,omitempty"` + // Wire name: 'schema' + Schema []map[string]any // The summary of the error - Summary string `json:"summary,omitempty"` + // Wire name: 'summary' + Summary string // true if partial results are returned. - Truncated bool `json:"truncated,omitempty"` + // Wire name: 'truncated' + Truncated bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Results) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Results) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Results) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Results) MarshalJSON() ([]byte, error) { + pb, err := resultsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RuntimeEngine string +type runtimeEnginePb string const RuntimeEngineNull RuntimeEngine = `NULL` @@ -5087,6 +9606,22 @@ func (f *RuntimeEngine) Type() string { return "RuntimeEngine" } +func runtimeEngineToPb(st *RuntimeEngine) (*runtimeEnginePb, error) { + if st == nil { + return nil, nil + } + pb := runtimeEnginePb(*st) + return &pb, nil +} + +func runtimeEngineFromPb(pb *runtimeEnginePb) (*RuntimeEngine, error) { + if pb == nil { + return nil, nil + } + st := RuntimeEngine(*pb) + return &st, nil +} + // A storage location in Amazon S3 type S3StorageInfo struct { // (Optional) Set canned access control list for the logs, e.g. @@ -5098,85 +9633,151 @@ type S3StorageInfo struct { // controls. If you are using cross account role for writing data, you may // want to set `bucket-owner-full-control` to make bucket owner able to read // the logs. - CannedAcl string `json:"canned_acl,omitempty"` + // Wire name: 'canned_acl' + CannedAcl string // S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be // delivered using cluster iam role, please make sure you set cluster iam // role and the role has write access to the destination. Please also note // that you cannot use AWS keys to deliver logs. - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string // (Optional) Flag to enable server side encryption, `false` by default. - EnableEncryption bool `json:"enable_encryption,omitempty"` + // Wire name: 'enable_encryption' + EnableEncryption bool // (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It // will be used only when encryption is enabled and the default type is // `sse-s3`. - EncryptionType string `json:"encryption_type,omitempty"` + // Wire name: 'encryption_type' + EncryptionType string // S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or // endpoint needs to be set. If both are set, endpoint will be used. - Endpoint string `json:"endpoint,omitempty"` + // Wire name: 'endpoint' + Endpoint string // (Optional) Kms key which will be used if encryption is enabled and // encryption type is set to `sse-kms`. - KmsKey string `json:"kms_key,omitempty"` + // Wire name: 'kms_key' + KmsKey string // S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. // If both are set, endpoint will be used. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *S3StorageInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *S3StorageInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &s3StorageInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := s3StorageInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s S3StorageInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st S3StorageInfo) MarshalJSON() ([]byte, error) { + pb, err := s3StorageInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Describes a specific Spark driver or executor. type SparkNode struct { // The private IP address of the host instance. - HostPrivateIp string `json:"host_private_ip,omitempty"` + // Wire name: 'host_private_ip' + HostPrivateIp string // Globally unique identifier for the host instance from the cloud provider. - InstanceId string `json:"instance_id,omitempty"` + // Wire name: 'instance_id' + InstanceId string // Attributes specific to AWS for a Spark node. - NodeAwsAttributes *SparkNodeAwsAttributes `json:"node_aws_attributes,omitempty"` + // Wire name: 'node_aws_attributes' + NodeAwsAttributes *SparkNodeAwsAttributes // Globally unique identifier for this node. - NodeId string `json:"node_id,omitempty"` + // Wire name: 'node_id' + NodeId string // Private IP address (typically a 10.x.x.x address) of the Spark node. Note // that this is different from the private IP address of the host instance. - PrivateIp string `json:"private_ip,omitempty"` + // Wire name: 'private_ip' + PrivateIp string // Public DNS address of this node. This address can be used to access the // Spark JDBC server on the driver node. To communicate with the JDBC // server, traffic must be manually authorized by adding security group // rules to the "worker-unmanaged" security group via the AWS console. - PublicDns string `json:"public_dns,omitempty"` + // Wire name: 'public_dns' + PublicDns string // The timestamp (in millisecond) when the Spark node is launched. - StartTimestamp int64 `json:"start_timestamp,omitempty"` + // Wire name: 'start_timestamp' + StartTimestamp int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SparkNode) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SparkNode) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkNodePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkNodeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SparkNode) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SparkNode) MarshalJSON() ([]byte, error) { + pb, err := sparkNodeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Attributes specific to AWS for a Spark node. type SparkNodeAwsAttributes struct { // Whether this node is on an Amazon spot instance. - IsSpot bool `json:"is_spot,omitempty"` + // Wire name: 'is_spot' + IsSpot bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SparkNodeAwsAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SparkNodeAwsAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkNodeAwsAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkNodeAwsAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SparkNodeAwsAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SparkNodeAwsAttributes) MarshalJSON() ([]byte, error) { + pb, err := sparkNodeAwsAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SparkVersion struct { @@ -5185,29 +9786,99 @@ type SparkVersion struct { // Note that the exact Spark version may change over time for a "wildcard" // version (i.e., "2.1.x-scala2.11" is a "wildcard" version) with minor bug // fixes. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // A descriptive name for this Spark version, for example "Spark 2.1". - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SparkVersion) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SparkVersion) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkVersionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkVersionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SparkVersion) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SparkVersion) MarshalJSON() ([]byte, error) { + pb, err := sparkVersionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StartCluster struct { // The cluster to be started. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string +} + +func (st *StartCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StartCluster) MarshalJSON() ([]byte, error) { + pb, err := startClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StartClusterResponse struct { } +func (st *StartClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StartClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := startClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The state of a Cluster. The current allowable state transitions are as // follows: // @@ -5216,6 +9887,7 @@ type StartClusterResponse struct { // `RESTARTING` -> `RUNNING` - `RESTARTING` -> `TERMINATING` - `RESIZING` -> // `RUNNING` - `RESIZING` -> `TERMINATING` - `TERMINATING` -> `TERMINATED` type State string +type statePb string const StateError State = `ERROR` @@ -5254,18 +9926,63 @@ func (f *State) Type() string { return "State" } +func stateToPb(st *State) (*statePb, error) { + if st == nil { + return nil, nil + } + pb := statePb(*st) + return &pb, nil +} + +func stateFromPb(pb *statePb) (*State, error) { + if pb == nil { + return nil, nil + } + st := State(*pb) + return &st, nil +} + type TerminationReason struct { // status code indicating why the cluster was terminated - Code TerminationReasonCode `json:"code,omitempty"` + // Wire name: 'code' + Code TerminationReasonCode // list of parameters that provide additional information about why the // cluster was terminated - Parameters map[string]string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters map[string]string // type of the termination - Type TerminationReasonType `json:"type,omitempty"` + // Wire name: 'type' + Type TerminationReasonType +} + +func (st *TerminationReason) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &terminationReasonPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := terminationReasonFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TerminationReason) MarshalJSON() ([]byte, error) { + pb, err := terminationReasonToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status code indicating why the cluster was terminated type TerminationReasonCode string +type terminationReasonCodePb string const TerminationReasonCodeAbuseDetected TerminationReasonCode = `ABUSE_DETECTED` @@ -5630,8 +10347,25 @@ func (f *TerminationReasonCode) Type() string { return "TerminationReasonCode" } +func terminationReasonCodeToPb(st *TerminationReasonCode) (*terminationReasonCodePb, error) { + if st == nil { + return nil, nil + } + pb := terminationReasonCodePb(*st) + return &pb, nil +} + +func terminationReasonCodeFromPb(pb *terminationReasonCodePb) (*TerminationReasonCode, error) { + if pb == nil { + return nil, nil + } + st := TerminationReasonCode(*pb) + return &st, nil +} + // type of the termination type TerminationReasonType string +type terminationReasonTypePb string const TerminationReasonTypeClientError TerminationReasonType = `CLIENT_ERROR` @@ -5662,28 +10396,150 @@ func (f *TerminationReasonType) Type() string { return "TerminationReasonType" } +func terminationReasonTypeToPb(st *TerminationReasonType) (*terminationReasonTypePb, error) { + if st == nil { + return nil, nil + } + pb := terminationReasonTypePb(*st) + return &pb, nil +} + +func terminationReasonTypeFromPb(pb *terminationReasonTypePb) (*TerminationReasonType, error) { + if pb == nil { + return nil, nil + } + st := TerminationReasonType(*pb) + return &st, nil +} + type UninstallLibraries struct { // Unique identifier for the cluster on which to uninstall these libraries. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // The libraries to uninstall. - Libraries []Library `json:"libraries"` + // Wire name: 'libraries' + Libraries []Library +} + +func (st *UninstallLibraries) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &uninstallLibrariesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := uninstallLibrariesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UninstallLibraries) MarshalJSON() ([]byte, error) { + pb, err := uninstallLibrariesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UninstallLibrariesResponse struct { } +func (st *UninstallLibrariesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &uninstallLibrariesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := uninstallLibrariesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UninstallLibrariesResponse) MarshalJSON() ([]byte, error) { + pb, err := uninstallLibrariesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UnpinCluster struct { - ClusterId string `json:"cluster_id"` + + // Wire name: 'cluster_id' + ClusterId string +} + +func (st *UnpinCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unpinClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unpinClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnpinCluster) MarshalJSON() ([]byte, error) { + pb, err := unpinClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UnpinClusterResponse struct { } +func (st *UnpinClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unpinClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unpinClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnpinClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := unpinClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateCluster struct { // The cluster to be updated. - Cluster *UpdateClusterResource `json:"cluster,omitempty"` + // Wire name: 'cluster' + Cluster *UpdateClusterResource // ID of the cluster. - ClusterId string `json:"cluster_id"` + // Wire name: 'cluster_id' + ClusterId string // Used to specify which cluster attributes and size fields to update. See // https://google.aip.dev/161 for more details. // @@ -5698,26 +10554,56 @@ type UpdateCluster struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - UpdateMask string `json:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string +} + +func (st *UpdateCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCluster) MarshalJSON() ([]byte, error) { + pb, err := updateClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateClusterResource struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *AutoScale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *AutoScale // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + // Wire name: 'autotermination_minutes' + AutoterminationMinutes int // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *AzureAttributes // The configuration for delivering spark logs to a long-term storage // destination. Three kinds of destinations (DBFS, S3 and Unity Catalog // volumes) are supported. Only one destination can be specified for one @@ -5725,12 +10611,14 @@ type UpdateClusterResource struct { // destination every `5 mins`. The destination of driver logs is // `$destination/$clusterId/driver`, while the destination of executor logs // is `$destination/$clusterId/executor`. - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *ClusterLogConf // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. For // job clusters, the cluster name is automatically set based on the job and // job run IDs. - ClusterName string `json:"cluster_name,omitempty"` + // Wire name: 'cluster_name' + ClusterName string // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -5739,7 +10627,8 @@ type UpdateClusterResource struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -5769,13 +10658,16 @@ type UpdateClusterResource struct { // `LEGACY_SINGLE_USER`: This 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. - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + // Wire name: 'data_security_mode' + DataSecurityMode DataSecurityMode // Custom docker image BYOC - DockerImage *DockerImage `json:"docker_image,omitempty"` + // Wire name: 'docker_image' + DockerImage *DockerImage // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. @@ -5784,29 +10676,36 @@ type UpdateClusterResource struct { // virtual_cluster_size is set. If both driver_node_type_id, node_type_id, // and virtual_cluster_size are specified, driver_node_type_id and // node_type_id take precedence. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + // Wire name: 'enable_elastic_disk' + EnableElasticDisk bool // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode bool `json:"is_single_node,omitempty"` + // Wire name: 'is_single_node' + IsSingleNode bool // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -5824,13 +10723,15 @@ type UpdateClusterResource struct { // CLASSIC_PREVIEW`. // // [simple form]: https://docs.databricks.com/compute/simple-form.html - Kind Kind `json:"kind,omitempty"` + // Wire name: 'kind' + Kind Kind // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -5841,9 +10742,11 @@ type UpdateClusterResource struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -5852,15 +10755,18 @@ type UpdateClusterResource struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + // Wire name: 'runtime_engine' + RuntimeEngine RuntimeEngine // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName string `json:"single_user_name,omitempty"` + // Wire name: 'single_user_name' + SingleUserName string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -5874,57 +10780,261 @@ type UpdateClusterResource struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion string `json:"spark_version,omitempty"` + // Wire name: 'spark_version' + SparkVersion string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string // This field can only be used when `kind = CLASSIC_PREVIEW`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + // Wire name: 'use_ml_runtime' + UseMlRuntime bool // Cluster Attributes showing for clusters workload types. - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType *WorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateClusterResource) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateClusterResource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateClusterResourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateClusterResourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateClusterResource) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateClusterResource) MarshalJSON() ([]byte, error) { + pb, err := updateClusterResourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateClusterResponse struct { } +func (st *UpdateClusterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateClusterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateClusterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateClusterResponse) MarshalJSON() ([]byte, error) { + pb, err := updateClusterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // A storage location back by UC Volumes. type VolumesStorageInfo struct { // UC Volumes destination, e.g. // `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or // `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *VolumesStorageInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &volumesStorageInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := volumesStorageInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st VolumesStorageInfo) MarshalJSON() ([]byte, error) { + pb, err := volumesStorageInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Cluster Attributes showing for clusters workload types. type WorkloadType struct { // defined what type of clients can use the cluster. E.g. Notebooks, Jobs - Clients ClientsTypes `json:"clients"` + // Wire name: 'clients' + Clients ClientsTypes +} + +func (st *WorkloadType) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workloadTypePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workloadTypeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WorkloadType) MarshalJSON() ([]byte, error) { + pb, err := workloadTypeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A storage location in Workspace Filesystem (WSFS) type WorkspaceStorageInfo struct { // wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` - Destination string `json:"destination"` + // Wire name: 'destination' + Destination string +} + +func (st *WorkspaceStorageInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceStorageInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceStorageInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WorkspaceStorageInfo) MarshalJSON() ([]byte, error) { + pb, err := workspaceStorageInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index da4987e7e..7594f9b22 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -18,115 +18,357 @@ type genieImpl struct { } func (a *genieImpl) CreateMessage(ctx context.Context, request GenieCreateConversationMessageRequest) (*GenieMessage, error) { - var genieMessage GenieMessage - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages", request.SpaceId, request.ConversationId) + + requestPb, pbErr := genieCreateConversationMessageRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieMessagePb genieMessagePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages", requestPb.SpaceId, requestPb.ConversationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &genieMessage) - return &genieMessage, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &genieMessagePb, + ) + if err != nil { + return nil, err + } + resp, err := genieMessageFromPb(&genieMessagePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) ExecuteMessageAttachmentQuery(ctx context.Context, request GenieExecuteMessageAttachmentQueryRequest) (*GenieGetMessageQueryResultResponse, error) { - var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/execute-query", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) + + requestPb, pbErr := genieExecuteMessageAttachmentQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetMessageQueryResultResponsePb genieGetMessageQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/execute-query", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId, requestPb.AttachmentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &genieGetMessageQueryResultResponse) - return &genieGetMessageQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &genieGetMessageQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetMessageQueryResultResponseFromPb(&genieGetMessageQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) ExecuteMessageQuery(ctx context.Context, request GenieExecuteMessageQueryRequest) (*GenieGetMessageQueryResultResponse, error) { - var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/execute-query", request.SpaceId, request.ConversationId, request.MessageId) + + requestPb, pbErr := genieExecuteMessageQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetMessageQueryResultResponsePb genieGetMessageQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/execute-query", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &genieGetMessageQueryResultResponse) - return &genieGetMessageQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &genieGetMessageQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetMessageQueryResultResponseFromPb(&genieGetMessageQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GenerateDownloadFullQueryResult(ctx context.Context, request GenieGenerateDownloadFullQueryResultRequest) (*GenieGenerateDownloadFullQueryResultResponse, error) { - var genieGenerateDownloadFullQueryResultResponse GenieGenerateDownloadFullQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) + + requestPb, pbErr := genieGenerateDownloadFullQueryResultRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGenerateDownloadFullQueryResultResponsePb genieGenerateDownloadFullQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId, requestPb.AttachmentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &genieGenerateDownloadFullQueryResultResponse) - return &genieGenerateDownloadFullQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &genieGenerateDownloadFullQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGenerateDownloadFullQueryResultResponseFromPb(&genieGenerateDownloadFullQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetDownloadFullQueryResult(ctx context.Context, request GenieGetDownloadFullQueryResultRequest) (*GenieGetDownloadFullQueryResultResponse, error) { - var genieGetDownloadFullQueryResultResponse GenieGetDownloadFullQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads/%v", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId, request.DownloadId) + + requestPb, pbErr := genieGetDownloadFullQueryResultRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetDownloadFullQueryResultResponsePb genieGetDownloadFullQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads/%v", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId, requestPb.AttachmentId, requestPb.DownloadId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetDownloadFullQueryResultResponse) - return &genieGetDownloadFullQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieGetDownloadFullQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetDownloadFullQueryResultResponseFromPb(&genieGetDownloadFullQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetMessage(ctx context.Context, request GenieGetConversationMessageRequest) (*GenieMessage, error) { - var genieMessage GenieMessage - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v", request.SpaceId, request.ConversationId, request.MessageId) + + requestPb, pbErr := genieGetConversationMessageRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieMessagePb genieMessagePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieMessage) - return &genieMessage, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieMessagePb, + ) + if err != nil { + return nil, err + } + resp, err := genieMessageFromPb(&genieMessagePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetMessageAttachmentQueryResult(ctx context.Context, request GenieGetMessageAttachmentQueryResultRequest) (*GenieGetMessageQueryResultResponse, error) { - var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/query-result", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) + + requestPb, pbErr := genieGetMessageAttachmentQueryResultRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetMessageQueryResultResponsePb genieGetMessageQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/query-result", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId, requestPb.AttachmentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetMessageQueryResultResponse) - return &genieGetMessageQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieGetMessageQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetMessageQueryResultResponseFromPb(&genieGetMessageQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetMessageQueryResult(ctx context.Context, request GenieGetMessageQueryResultRequest) (*GenieGetMessageQueryResultResponse, error) { - var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/query-result", request.SpaceId, request.ConversationId, request.MessageId) + + requestPb, pbErr := genieGetMessageQueryResultRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetMessageQueryResultResponsePb genieGetMessageQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/query-result", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetMessageQueryResultResponse) - return &genieGetMessageQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieGetMessageQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetMessageQueryResultResponseFromPb(&genieGetMessageQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetMessageQueryResultByAttachment(ctx context.Context, request GenieGetQueryResultByAttachmentRequest) (*GenieGetMessageQueryResultResponse, error) { - var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/query-result/%v", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) + + requestPb, pbErr := genieGetQueryResultByAttachmentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieGetMessageQueryResultResponsePb genieGetMessageQueryResultResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/query-result/%v", requestPb.SpaceId, requestPb.ConversationId, requestPb.MessageId, requestPb.AttachmentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetMessageQueryResultResponse) - return &genieGetMessageQueryResultResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieGetMessageQueryResultResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieGetMessageQueryResultResponseFromPb(&genieGetMessageQueryResultResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) GetSpace(ctx context.Context, request GenieGetSpaceRequest) (*GenieSpace, error) { - var genieSpace GenieSpace - path := fmt.Sprintf("/api/2.0/genie/spaces/%v", request.SpaceId) + + requestPb, pbErr := genieGetSpaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieSpacePb genieSpacePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v", requestPb.SpaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieSpace) - return &genieSpace, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &genieSpacePb, + ) + if err != nil { + return nil, err + } + resp, err := genieSpaceFromPb(&genieSpacePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *genieImpl) StartConversation(ctx context.Context, request GenieStartConversationMessageRequest) (*GenieStartConversationResponse, error) { - var genieStartConversationResponse GenieStartConversationResponse - path := fmt.Sprintf("/api/2.0/genie/spaces/%v/start-conversation", request.SpaceId) + + requestPb, pbErr := genieStartConversationMessageRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var genieStartConversationResponsePb genieStartConversationResponsePb + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/start-conversation", requestPb.SpaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &genieStartConversationResponse) - return &genieStartConversationResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &genieStartConversationResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := genieStartConversationResponseFromPb(&genieStartConversationResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Lakeview API methods @@ -135,96 +377,286 @@ type lakeviewImpl struct { } func (a *lakeviewImpl) Create(ctx context.Context, request CreateDashboardRequest) (*Dashboard, error) { - var dashboard Dashboard + + requestPb, pbErr := createDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb path := "/api/2.0/lakeview/dashboards" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Dashboard, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Dashboard, + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := createScheduleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schedulePb schedulePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Schedule, &schedule) - return &schedule, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Schedule, + &schedulePb, + ) + if err != nil { + return nil, err + } + resp, err := scheduleFromPb(&schedulePb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := createSubscriptionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var subscriptionPb subscriptionPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", requestPb.DashboardId, requestPb.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Subscription, &subscription) - return &subscription, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Subscription, + &subscriptionPb, + ) + if err != nil { + return nil, err + } + resp, err := subscriptionFromPb(&subscriptionPb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := deleteScheduleRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteScheduleResponsePb deleteScheduleResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", requestPb.DashboardId, requestPb.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteScheduleResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteScheduleResponsePb, + ) + if err != nil { + return err + } + 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) + + requestPb, pbErr := deleteSubscriptionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteSubscriptionResponsePb deleteSubscriptionResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", requestPb.DashboardId, requestPb.ScheduleId, requestPb.SubscriptionId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteSubscriptionResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteSubscriptionResponsePb, + ) + if err != nil { + return err + } + 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) + + requestPb, pbErr := getDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *lakeviewImpl) GetPublished(ctx context.Context, request GetPublishedDashboardRequest) (*PublishedDashboard, error) { - var publishedDashboard PublishedDashboard - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + + requestPb, pbErr := getPublishedDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var publishedDashboardPb publishedDashboardPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &publishedDashboard) - return &publishedDashboard, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &publishedDashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := publishedDashboardFromPb(&publishedDashboardPb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := getScheduleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schedulePb schedulePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", requestPb.DashboardId, requestPb.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &schedule) - return &schedule, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &schedulePb, + ) + if err != nil { + return nil, err + } + resp, err := scheduleFromPb(&schedulePb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := getSubscriptionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var subscriptionPb subscriptionPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", requestPb.DashboardId, requestPb.ScheduleId, requestPb.SubscriptionId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &subscription) - return &subscription, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &subscriptionPb, + ) + if err != nil { + return nil, err + } + resp, err := subscriptionFromPb(&subscriptionPb) + if err != nil { + return nil, err + } + + return resp, err } // List dashboards. @@ -259,13 +691,35 @@ func (a *lakeviewImpl) ListAll(ctx context.Context, request ListDashboardsReques } func (a *lakeviewImpl) internalList(ctx context.Context, request ListDashboardsRequest) (*ListDashboardsResponse, error) { - var listDashboardsResponse ListDashboardsResponse + + requestPb, pbErr := listDashboardsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listDashboardsResponsePb listDashboardsResponsePb path := "/api/2.0/lakeview/dashboards" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDashboardsResponse) - return &listDashboardsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listDashboardsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listDashboardsResponseFromPb(&listDashboardsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List dashboard schedules. @@ -300,13 +754,35 @@ func (a *lakeviewImpl) ListSchedulesAll(ctx context.Context, request ListSchedul } func (a *lakeviewImpl) internalListSchedules(ctx context.Context, request ListSchedulesRequest) (*ListSchedulesResponse, error) { - var listSchedulesResponse ListSchedulesResponse - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) + + requestPb, pbErr := listSchedulesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSchedulesResponsePb listSchedulesResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSchedulesResponse) - return &listSchedulesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSchedulesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSchedulesResponseFromPb(&listSchedulesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List schedule subscriptions. @@ -341,77 +817,223 @@ func (a *lakeviewImpl) ListSubscriptionsAll(ctx context.Context, request ListSub } func (a *lakeviewImpl) internalListSubscriptions(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) + + requestPb, pbErr := listSubscriptionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSubscriptionsResponsePb listSubscriptionsResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", requestPb.DashboardId, requestPb.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSubscriptionsResponse) - return &listSubscriptionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSubscriptionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSubscriptionsResponseFromPb(&listSubscriptionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *lakeviewImpl) Migrate(ctx context.Context, request MigrateDashboardRequest) (*Dashboard, error) { - var dashboard Dashboard + + requestPb, pbErr := migrateDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb path := "/api/2.0/lakeview/dashboards/migrate" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *lakeviewImpl) Publish(ctx context.Context, request PublishRequest) (*PublishedDashboard, error) { - var publishedDashboard PublishedDashboard - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + + requestPb, pbErr := publishRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var publishedDashboardPb publishedDashboardPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &publishedDashboard) - return &publishedDashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &publishedDashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := publishedDashboardFromPb(&publishedDashboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *lakeviewImpl) Trash(ctx context.Context, request TrashDashboardRequest) error { - var trashDashboardResponse TrashDashboardResponse - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) + + requestPb, pbErr := trashDashboardRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var trashDashboardResponsePb trashDashboardResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &trashDashboardResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &trashDashboardResponsePb, + ) + if err != nil { + return err + } + return err } func (a *lakeviewImpl) Unpublish(ctx context.Context, request UnpublishDashboardRequest) error { - var unpublishDashboardResponse UnpublishDashboardResponse - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + + requestPb, pbErr := unpublishDashboardRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var unpublishDashboardResponsePb unpublishDashboardResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unpublishDashboardResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &unpublishDashboardResponsePb, + ) + if err != nil { + return err + } + return err } func (a *lakeviewImpl) Update(ctx context.Context, request UpdateDashboardRequest) (*Dashboard, error) { - var dashboard Dashboard - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) + + requestPb, pbErr := updateDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Dashboard, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Dashboard, + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := updateScheduleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var schedulePb schedulePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", requestPb.DashboardId, requestPb.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Schedule, &schedule) - return &schedule, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb).Schedule, + &schedulePb, + ) + if err != nil { + return nil, err + } + resp, err := scheduleFromPb(&schedulePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just LakeviewEmbedded API methods @@ -420,23 +1042,63 @@ type lakeviewEmbeddedImpl struct { } func (a *lakeviewEmbeddedImpl) GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error { - var getPublishedDashboardEmbeddedResponse GetPublishedDashboardEmbeddedResponse - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/embedded", request.DashboardId) + + requestPb, pbErr := getPublishedDashboardEmbeddedRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var getPublishedDashboardEmbeddedResponsePb getPublishedDashboardEmbeddedResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/embedded", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedDashboardEmbeddedResponse) + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPublishedDashboardEmbeddedResponsePb, + ) + if err != nil { + return err + } + return err } func (a *lakeviewEmbeddedImpl) GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) { - var getPublishedDashboardTokenInfoResponse GetPublishedDashboardTokenInfoResponse - path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/tokeninfo", request.DashboardId) + + requestPb, pbErr := getPublishedDashboardTokenInfoRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPublishedDashboardTokenInfoResponsePb getPublishedDashboardTokenInfoResponsePb + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/tokeninfo", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedDashboardTokenInfoResponse) - return &getPublishedDashboardTokenInfoResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPublishedDashboardTokenInfoResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPublishedDashboardTokenInfoResponseFromPb(&getPublishedDashboardTokenInfoResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QueryExecution API methods @@ -445,32 +1107,94 @@ type queryExecutionImpl struct { } func (a *queryExecutionImpl) CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) { - var cancelQueryExecutionResponse CancelQueryExecutionResponse + + requestPb, pbErr := cancelPublishedQueryExecutionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cancelQueryExecutionResponsePb cancelQueryExecutionResponsePb path := "/api/2.0/lakeview-query/query/published" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &cancelQueryExecutionResponse) - return &cancelQueryExecutionResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &cancelQueryExecutionResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := cancelQueryExecutionResponseFromPb(&cancelQueryExecutionResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queryExecutionImpl) ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error { - var executeQueryResponse ExecuteQueryResponse + + requestPb, pbErr := executePublishedDashboardQueryRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var executeQueryResponsePb executeQueryResponsePb path := "/api/2.0/lakeview-query/query/published" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &executeQueryResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &executeQueryResponsePb, + ) + if err != nil { + return err + } + return err } func (a *queryExecutionImpl) PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) { - var pollQueryStatusResponse PollQueryStatusResponse + + requestPb, pbErr := pollPublishedQueryStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var pollQueryStatusResponsePb pollQueryStatusResponsePb path := "/api/2.0/lakeview-query/query/published" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &pollQueryStatusResponse) - return &pollQueryStatusResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &pollQueryStatusResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := pollQueryStatusResponseFromPb(&pollQueryStatusResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/dashboards/internal.go b/service/dashboards/internal.go new file mode 100755 index 000000000..6060016e7 --- /dev/null +++ b/service/dashboards/internal.go @@ -0,0 +1,2854 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package dashboards + +import ( + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/sql" +) + +func authorizationDetailsToPb(st *AuthorizationDetails) (*authorizationDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &authorizationDetailsPb{} + pb.GrantRules = st.GrantRules + + pb.ResourceLegacyAclPath = st.ResourceLegacyAclPath + + pb.ResourceName = st.ResourceName + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type authorizationDetailsPb struct { + GrantRules []AuthorizationDetailsGrantRule `json:"grant_rules,omitempty"` + + ResourceLegacyAclPath string `json:"resource_legacy_acl_path,omitempty"` + + ResourceName string `json:"resource_name,omitempty"` + + Type string `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func authorizationDetailsFromPb(pb *authorizationDetailsPb) (*AuthorizationDetails, error) { + if pb == nil { + return nil, nil + } + st := &AuthorizationDetails{} + st.GrantRules = pb.GrantRules + st.ResourceLegacyAclPath = pb.ResourceLegacyAclPath + st.ResourceName = pb.ResourceName + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *authorizationDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st authorizationDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func authorizationDetailsGrantRuleToPb(st *AuthorizationDetailsGrantRule) (*authorizationDetailsGrantRulePb, error) { + if st == nil { + return nil, nil + } + pb := &authorizationDetailsGrantRulePb{} + pb.PermissionSet = st.PermissionSet + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type authorizationDetailsGrantRulePb struct { + PermissionSet string `json:"permission_set,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func authorizationDetailsGrantRuleFromPb(pb *authorizationDetailsGrantRulePb) (*AuthorizationDetailsGrantRule, error) { + if pb == nil { + return nil, nil + } + st := &AuthorizationDetailsGrantRule{} + st.PermissionSet = pb.PermissionSet + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *authorizationDetailsGrantRulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st authorizationDetailsGrantRulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelPublishedQueryExecutionRequestToPb(st *CancelPublishedQueryExecutionRequest) (*cancelPublishedQueryExecutionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelPublishedQueryExecutionRequestPb{} + pb.DashboardName = st.DashboardName + + pb.DashboardRevisionId = st.DashboardRevisionId + + pb.Tokens = st.Tokens + + return pb, nil +} + +type cancelPublishedQueryExecutionRequestPb struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +func cancelPublishedQueryExecutionRequestFromPb(pb *cancelPublishedQueryExecutionRequestPb) (*CancelPublishedQueryExecutionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CancelPublishedQueryExecutionRequest{} + st.DashboardName = pb.DashboardName + st.DashboardRevisionId = pb.DashboardRevisionId + st.Tokens = pb.Tokens + + return st, nil +} + +func cancelQueryExecutionResponseToPb(st *CancelQueryExecutionResponse) (*cancelQueryExecutionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelQueryExecutionResponsePb{} + pb.Status = st.Status + + return pb, nil +} + +type cancelQueryExecutionResponsePb struct { + Status []CancelQueryExecutionResponseStatus `json:"status,omitempty"` +} + +func cancelQueryExecutionResponseFromPb(pb *cancelQueryExecutionResponsePb) (*CancelQueryExecutionResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelQueryExecutionResponse{} + st.Status = pb.Status + + return st, nil +} + +func cancelQueryExecutionResponseStatusToPb(st *CancelQueryExecutionResponseStatus) (*cancelQueryExecutionResponseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelQueryExecutionResponseStatusPb{} + pb.DataToken = st.DataToken + + pb.Pending = st.Pending + + pb.Success = st.Success + + return pb, nil +} + +type cancelQueryExecutionResponseStatusPb struct { + DataToken string `json:"data_token"` + + Pending *Empty `json:"pending,omitempty"` + + Success *Empty `json:"success,omitempty"` +} + +func cancelQueryExecutionResponseStatusFromPb(pb *cancelQueryExecutionResponseStatusPb) (*CancelQueryExecutionResponseStatus, error) { + if pb == nil { + return nil, nil + } + st := &CancelQueryExecutionResponseStatus{} + st.DataToken = pb.DataToken + st.Pending = pb.Pending + st.Success = pb.Success + + return st, nil +} + +func createDashboardRequestToPb(st *CreateDashboardRequest) (*createDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createDashboardRequestPb{} + pb.Dashboard = st.Dashboard + + return pb, nil +} + +type createDashboardRequestPb struct { + Dashboard Dashboard `json:"dashboard"` +} + +func createDashboardRequestFromPb(pb *createDashboardRequestPb) (*CreateDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateDashboardRequest{} + st.Dashboard = pb.Dashboard + + return st, nil +} + +func createScheduleRequestToPb(st *CreateScheduleRequest) (*createScheduleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createScheduleRequestPb{} + pb.DashboardId = st.DashboardId + + pb.Schedule = st.Schedule + + return pb, nil +} + +type createScheduleRequestPb struct { + DashboardId string `json:"-" url:"-"` + + Schedule Schedule `json:"schedule"` +} + +func createScheduleRequestFromPb(pb *createScheduleRequestPb) (*CreateScheduleRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateScheduleRequest{} + st.DashboardId = pb.DashboardId + st.Schedule = pb.Schedule + + return st, nil +} + +func createSubscriptionRequestToPb(st *CreateSubscriptionRequest) (*createSubscriptionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createSubscriptionRequestPb{} + pb.DashboardId = st.DashboardId + + pb.ScheduleId = st.ScheduleId + + pb.Subscription = st.Subscription + + return pb, nil +} + +type createSubscriptionRequestPb struct { + DashboardId string `json:"-" url:"-"` + + ScheduleId string `json:"-" url:"-"` + + Subscription Subscription `json:"subscription"` +} + +func createSubscriptionRequestFromPb(pb *createSubscriptionRequestPb) (*CreateSubscriptionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateSubscriptionRequest{} + st.DashboardId = pb.DashboardId + st.ScheduleId = pb.ScheduleId + st.Subscription = pb.Subscription + + return st, nil +} + +func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { + if st == nil { + return nil, nil + } + pb := &cronSchedulePb{} + pb.QuartzCronExpression = st.QuartzCronExpression + + pb.TimezoneId = st.TimezoneId + + return pb, nil +} + +type cronSchedulePb struct { + QuartzCronExpression string `json:"quartz_cron_expression"` + + TimezoneId string `json:"timezone_id"` +} + +func cronScheduleFromPb(pb *cronSchedulePb) (*CronSchedule, error) { + if pb == nil { + return nil, nil + } + st := &CronSchedule{} + st.QuartzCronExpression = pb.QuartzCronExpression + st.TimezoneId = pb.TimezoneId + + return st, nil +} + +func dashboardToPb(st *Dashboard) (*dashboardPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardPb{} + pb.CreateTime = st.CreateTime + + pb.DashboardId = st.DashboardId + + pb.DisplayName = st.DisplayName + + pb.Etag = st.Etag + + pb.LifecycleState = st.LifecycleState + + pb.ParentPath = st.ParentPath + + pb.Path = st.Path + + pb.SerializedDashboard = st.SerializedDashboard + + pb.UpdateTime = st.UpdateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardPb struct { + CreateTime string `json:"create_time,omitempty"` + + DashboardId string `json:"dashboard_id,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Etag string `json:"etag,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + Path string `json:"path,omitempty"` + + SerializedDashboard string `json:"serialized_dashboard,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardFromPb(pb *dashboardPb) (*Dashboard, error) { + if pb == nil { + return nil, nil + } + st := &Dashboard{} + st.CreateTime = pb.CreateTime + st.DashboardId = pb.DashboardId + st.DisplayName = pb.DisplayName + st.Etag = pb.Etag + st.LifecycleState = pb.LifecycleState + st.ParentPath = pb.ParentPath + st.Path = pb.Path + st.SerializedDashboard = pb.SerializedDashboard + st.UpdateTime = pb.UpdateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteScheduleRequestToPb(st *DeleteScheduleRequest) (*deleteScheduleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteScheduleRequestPb{} + pb.DashboardId = st.DashboardId + + pb.Etag = st.Etag + + pb.ScheduleId = st.ScheduleId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteScheduleRequestPb struct { + DashboardId string `json:"-" url:"-"` + + Etag string `json:"-" url:"etag,omitempty"` + + ScheduleId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteScheduleRequestFromPb(pb *deleteScheduleRequestPb) (*DeleteScheduleRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteScheduleRequest{} + st.DashboardId = pb.DashboardId + st.Etag = pb.Etag + st.ScheduleId = pb.ScheduleId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteScheduleRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteScheduleRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteScheduleResponseToPb(st *DeleteScheduleResponse) (*deleteScheduleResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteScheduleResponsePb{} + + return pb, nil +} + +type deleteScheduleResponsePb struct { +} + +func deleteScheduleResponseFromPb(pb *deleteScheduleResponsePb) (*DeleteScheduleResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteScheduleResponse{} + + return st, nil +} + +func deleteSubscriptionRequestToPb(st *DeleteSubscriptionRequest) (*deleteSubscriptionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSubscriptionRequestPb{} + pb.DashboardId = st.DashboardId + + pb.Etag = st.Etag + + pb.ScheduleId = st.ScheduleId + + pb.SubscriptionId = st.SubscriptionId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteSubscriptionRequestPb struct { + DashboardId string `json:"-" url:"-"` + + Etag string `json:"-" url:"etag,omitempty"` + + ScheduleId string `json:"-" url:"-"` + + SubscriptionId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteSubscriptionRequestFromPb(pb *deleteSubscriptionRequestPb) (*DeleteSubscriptionRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSubscriptionRequest{} + st.DashboardId = pb.DashboardId + st.Etag = pb.Etag + st.ScheduleId = pb.ScheduleId + st.SubscriptionId = pb.SubscriptionId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteSubscriptionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteSubscriptionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteSubscriptionResponseToPb(st *DeleteSubscriptionResponse) (*deleteSubscriptionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSubscriptionResponsePb{} + + return pb, nil +} + +type deleteSubscriptionResponsePb struct { +} + +func deleteSubscriptionResponseFromPb(pb *deleteSubscriptionResponsePb) (*DeleteSubscriptionResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSubscriptionResponse{} + + return st, nil +} + +func emptyToPb(st *Empty) (*emptyPb, error) { + if st == nil { + return nil, nil + } + pb := &emptyPb{} + + return pb, nil +} + +type emptyPb struct { +} + +func emptyFromPb(pb *emptyPb) (*Empty, error) { + if pb == nil { + return nil, nil + } + st := &Empty{} + + return st, nil +} + +func executePublishedDashboardQueryRequestToPb(st *ExecutePublishedDashboardQueryRequest) (*executePublishedDashboardQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &executePublishedDashboardQueryRequestPb{} + pb.DashboardName = st.DashboardName + + pb.DashboardRevisionId = st.DashboardRevisionId + + pb.OverrideWarehouseId = st.OverrideWarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type executePublishedDashboardQueryRequestPb struct { + DashboardName string `json:"dashboard_name"` + + DashboardRevisionId string `json:"dashboard_revision_id"` + + OverrideWarehouseId string `json:"override_warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func executePublishedDashboardQueryRequestFromPb(pb *executePublishedDashboardQueryRequestPb) (*ExecutePublishedDashboardQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExecutePublishedDashboardQueryRequest{} + st.DashboardName = pb.DashboardName + st.DashboardRevisionId = pb.DashboardRevisionId + st.OverrideWarehouseId = pb.OverrideWarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *executePublishedDashboardQueryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st executePublishedDashboardQueryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func executeQueryResponseToPb(st *ExecuteQueryResponse) (*executeQueryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &executeQueryResponsePb{} + + return pb, nil +} + +type executeQueryResponsePb struct { +} + +func executeQueryResponseFromPb(pb *executeQueryResponsePb) (*ExecuteQueryResponse, error) { + if pb == nil { + return nil, nil + } + st := &ExecuteQueryResponse{} + + return st, nil +} + +func genieAttachmentToPb(st *GenieAttachment) (*genieAttachmentPb, error) { + if st == nil { + return nil, nil + } + pb := &genieAttachmentPb{} + pb.AttachmentId = st.AttachmentId + + pb.Query = st.Query + + pb.Text = st.Text + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieAttachmentPb struct { + AttachmentId string `json:"attachment_id,omitempty"` + + Query *GenieQueryAttachment `json:"query,omitempty"` + + Text *TextAttachment `json:"text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieAttachmentFromPb(pb *genieAttachmentPb) (*GenieAttachment, error) { + if pb == nil { + return nil, nil + } + st := &GenieAttachment{} + st.AttachmentId = pb.AttachmentId + st.Query = pb.Query + st.Text = pb.Text + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieAttachmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieAttachmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieConversationToPb(st *GenieConversation) (*genieConversationPb, error) { + if st == nil { + return nil, nil + } + pb := &genieConversationPb{} + pb.ConversationId = st.ConversationId + + pb.CreatedTimestamp = st.CreatedTimestamp + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.SpaceId = st.SpaceId + + pb.Title = st.Title + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieConversationPb struct { + ConversationId string `json:"conversation_id"` + + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + + Id string `json:"id"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + SpaceId string `json:"space_id"` + + Title string `json:"title"` + + UserId int `json:"user_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieConversationFromPb(pb *genieConversationPb) (*GenieConversation, error) { + if pb == nil { + return nil, nil + } + st := &GenieConversation{} + st.ConversationId = pb.ConversationId + st.CreatedTimestamp = pb.CreatedTimestamp + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.SpaceId = pb.SpaceId + st.Title = pb.Title + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieConversationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieConversationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieCreateConversationMessageRequestToPb(st *GenieCreateConversationMessageRequest) (*genieCreateConversationMessageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieCreateConversationMessageRequestPb{} + pb.Content = st.Content + + pb.ConversationId = st.ConversationId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieCreateConversationMessageRequestPb struct { + Content string `json:"content"` + + ConversationId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieCreateConversationMessageRequestFromPb(pb *genieCreateConversationMessageRequestPb) (*GenieCreateConversationMessageRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieCreateConversationMessageRequest{} + st.Content = pb.Content + st.ConversationId = pb.ConversationId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieExecuteMessageAttachmentQueryRequestToPb(st *GenieExecuteMessageAttachmentQueryRequest) (*genieExecuteMessageAttachmentQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieExecuteMessageAttachmentQueryRequestPb{} + pb.AttachmentId = st.AttachmentId + + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieExecuteMessageAttachmentQueryRequestPb struct { + AttachmentId string `json:"-" url:"-"` + + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieExecuteMessageAttachmentQueryRequestFromPb(pb *genieExecuteMessageAttachmentQueryRequestPb) (*GenieExecuteMessageAttachmentQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieExecuteMessageAttachmentQueryRequest{} + st.AttachmentId = pb.AttachmentId + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieExecuteMessageQueryRequestToPb(st *GenieExecuteMessageQueryRequest) (*genieExecuteMessageQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieExecuteMessageQueryRequestPb{} + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieExecuteMessageQueryRequestPb struct { + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieExecuteMessageQueryRequestFromPb(pb *genieExecuteMessageQueryRequestPb) (*GenieExecuteMessageQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieExecuteMessageQueryRequest{} + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGenerateDownloadFullQueryResultRequestToPb(st *GenieGenerateDownloadFullQueryResultRequest) (*genieGenerateDownloadFullQueryResultRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGenerateDownloadFullQueryResultRequestPb{} + pb.AttachmentId = st.AttachmentId + + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGenerateDownloadFullQueryResultRequestPb struct { + AttachmentId string `json:"-" url:"-"` + + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGenerateDownloadFullQueryResultRequestFromPb(pb *genieGenerateDownloadFullQueryResultRequestPb) (*GenieGenerateDownloadFullQueryResultRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGenerateDownloadFullQueryResultRequest{} + st.AttachmentId = pb.AttachmentId + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGenerateDownloadFullQueryResultResponseToPb(st *GenieGenerateDownloadFullQueryResultResponse) (*genieGenerateDownloadFullQueryResultResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &genieGenerateDownloadFullQueryResultResponsePb{} + pb.DownloadId = st.DownloadId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieGenerateDownloadFullQueryResultResponsePb struct { + DownloadId string `json:"download_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieGenerateDownloadFullQueryResultResponseFromPb(pb *genieGenerateDownloadFullQueryResultResponsePb) (*GenieGenerateDownloadFullQueryResultResponse, error) { + if pb == nil { + return nil, nil + } + st := &GenieGenerateDownloadFullQueryResultResponse{} + st.DownloadId = pb.DownloadId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieGenerateDownloadFullQueryResultResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieGenerateDownloadFullQueryResultResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieGetConversationMessageRequestToPb(st *GenieGetConversationMessageRequest) (*genieGetConversationMessageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetConversationMessageRequestPb{} + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetConversationMessageRequestPb struct { + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGetConversationMessageRequestFromPb(pb *genieGetConversationMessageRequestPb) (*GenieGetConversationMessageRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetConversationMessageRequest{} + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGetDownloadFullQueryResultRequestToPb(st *GenieGetDownloadFullQueryResultRequest) (*genieGetDownloadFullQueryResultRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetDownloadFullQueryResultRequestPb{} + pb.AttachmentId = st.AttachmentId + + pb.ConversationId = st.ConversationId + + pb.DownloadId = st.DownloadId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetDownloadFullQueryResultRequestPb struct { + AttachmentId string `json:"-" url:"-"` + + ConversationId string `json:"-" url:"-"` + + DownloadId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGetDownloadFullQueryResultRequestFromPb(pb *genieGetDownloadFullQueryResultRequestPb) (*GenieGetDownloadFullQueryResultRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetDownloadFullQueryResultRequest{} + st.AttachmentId = pb.AttachmentId + st.ConversationId = pb.ConversationId + st.DownloadId = pb.DownloadId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGetDownloadFullQueryResultResponseToPb(st *GenieGetDownloadFullQueryResultResponse) (*genieGetDownloadFullQueryResultResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetDownloadFullQueryResultResponsePb{} + pb.StatementResponse = st.StatementResponse + + return pb, nil +} + +type genieGetDownloadFullQueryResultResponsePb struct { + StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` +} + +func genieGetDownloadFullQueryResultResponseFromPb(pb *genieGetDownloadFullQueryResultResponsePb) (*GenieGetDownloadFullQueryResultResponse, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetDownloadFullQueryResultResponse{} + st.StatementResponse = pb.StatementResponse + + return st, nil +} + +func genieGetMessageAttachmentQueryResultRequestToPb(st *GenieGetMessageAttachmentQueryResultRequest) (*genieGetMessageAttachmentQueryResultRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetMessageAttachmentQueryResultRequestPb{} + pb.AttachmentId = st.AttachmentId + + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetMessageAttachmentQueryResultRequestPb struct { + AttachmentId string `json:"-" url:"-"` + + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGetMessageAttachmentQueryResultRequestFromPb(pb *genieGetMessageAttachmentQueryResultRequestPb) (*GenieGetMessageAttachmentQueryResultRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetMessageAttachmentQueryResultRequest{} + st.AttachmentId = pb.AttachmentId + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGetMessageQueryResultRequestToPb(st *GenieGetMessageQueryResultRequest) (*genieGetMessageQueryResultRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetMessageQueryResultRequestPb{} + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetMessageQueryResultRequestPb struct { + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGetMessageQueryResultRequestFromPb(pb *genieGetMessageQueryResultRequestPb) (*GenieGetMessageQueryResultRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetMessageQueryResultRequest{} + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGetMessageQueryResultResponseToPb(st *GenieGetMessageQueryResultResponse) (*genieGetMessageQueryResultResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetMessageQueryResultResponsePb{} + pb.StatementResponse = st.StatementResponse + + return pb, nil +} + +type genieGetMessageQueryResultResponsePb struct { + StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` +} + +func genieGetMessageQueryResultResponseFromPb(pb *genieGetMessageQueryResultResponsePb) (*GenieGetMessageQueryResultResponse, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetMessageQueryResultResponse{} + st.StatementResponse = pb.StatementResponse + + return st, nil +} + +func genieGetQueryResultByAttachmentRequestToPb(st *GenieGetQueryResultByAttachmentRequest) (*genieGetQueryResultByAttachmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetQueryResultByAttachmentRequestPb{} + pb.AttachmentId = st.AttachmentId + + pb.ConversationId = st.ConversationId + + pb.MessageId = st.MessageId + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetQueryResultByAttachmentRequestPb struct { + AttachmentId string `json:"-" url:"-"` + + ConversationId string `json:"-" url:"-"` + + MessageId string `json:"-" url:"-"` + + SpaceId string `json:"-" url:"-"` +} + +func genieGetQueryResultByAttachmentRequestFromPb(pb *genieGetQueryResultByAttachmentRequestPb) (*GenieGetQueryResultByAttachmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetQueryResultByAttachmentRequest{} + st.AttachmentId = pb.AttachmentId + st.ConversationId = pb.ConversationId + st.MessageId = pb.MessageId + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieGetSpaceRequestToPb(st *GenieGetSpaceRequest) (*genieGetSpaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieGetSpaceRequestPb{} + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieGetSpaceRequestPb struct { + SpaceId string `json:"-" url:"-"` +} + +func genieGetSpaceRequestFromPb(pb *genieGetSpaceRequestPb) (*GenieGetSpaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieGetSpaceRequest{} + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieMessageToPb(st *GenieMessage) (*genieMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &genieMessagePb{} + pb.Attachments = st.Attachments + + pb.Content = st.Content + + pb.ConversationId = st.ConversationId + + pb.CreatedTimestamp = st.CreatedTimestamp + + pb.Error = st.Error + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.MessageId = st.MessageId + + pb.QueryResult = st.QueryResult + + pb.SpaceId = st.SpaceId + + pb.Status = st.Status + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieMessagePb struct { + Attachments []GenieAttachment `json:"attachments,omitempty"` + + Content string `json:"content"` + + ConversationId string `json:"conversation_id"` + + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + + Error *MessageError `json:"error,omitempty"` + + Id string `json:"id"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + MessageId string `json:"message_id"` + + QueryResult *Result `json:"query_result,omitempty"` + + SpaceId string `json:"space_id"` + + Status MessageStatus `json:"status,omitempty"` + + UserId int64 `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieMessageFromPb(pb *genieMessagePb) (*GenieMessage, error) { + if pb == nil { + return nil, nil + } + st := &GenieMessage{} + st.Attachments = pb.Attachments + st.Content = pb.Content + st.ConversationId = pb.ConversationId + st.CreatedTimestamp = pb.CreatedTimestamp + st.Error = pb.Error + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.MessageId = pb.MessageId + st.QueryResult = pb.QueryResult + st.SpaceId = pb.SpaceId + st.Status = pb.Status + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieMessagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieMessagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieQueryAttachmentToPb(st *GenieQueryAttachment) (*genieQueryAttachmentPb, error) { + if st == nil { + return nil, nil + } + pb := &genieQueryAttachmentPb{} + pb.Description = st.Description + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.Query = st.Query + + pb.QueryResultMetadata = st.QueryResultMetadata + + pb.StatementId = st.StatementId + + pb.Title = st.Title + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieQueryAttachmentPb struct { + Description string `json:"description,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + Query string `json:"query,omitempty"` + + QueryResultMetadata *GenieResultMetadata `json:"query_result_metadata,omitempty"` + + StatementId string `json:"statement_id,omitempty"` + + Title string `json:"title,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieQueryAttachmentFromPb(pb *genieQueryAttachmentPb) (*GenieQueryAttachment, error) { + if pb == nil { + return nil, nil + } + st := &GenieQueryAttachment{} + st.Description = pb.Description + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.Query = pb.Query + st.QueryResultMetadata = pb.QueryResultMetadata + st.StatementId = pb.StatementId + st.Title = pb.Title + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieQueryAttachmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieQueryAttachmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieResultMetadataToPb(st *GenieResultMetadata) (*genieResultMetadataPb, error) { + if st == nil { + return nil, nil + } + pb := &genieResultMetadataPb{} + pb.IsTruncated = st.IsTruncated + + pb.RowCount = st.RowCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieResultMetadataPb struct { + IsTruncated bool `json:"is_truncated,omitempty"` + + RowCount int64 `json:"row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieResultMetadataFromPb(pb *genieResultMetadataPb) (*GenieResultMetadata, error) { + if pb == nil { + return nil, nil + } + st := &GenieResultMetadata{} + st.IsTruncated = pb.IsTruncated + st.RowCount = pb.RowCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieResultMetadataPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieResultMetadataPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieSpaceToPb(st *GenieSpace) (*genieSpacePb, error) { + if st == nil { + return nil, nil + } + pb := &genieSpacePb{} + pb.Description = st.Description + + pb.SpaceId = st.SpaceId + + pb.Title = st.Title + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genieSpacePb struct { + Description string `json:"description,omitempty"` + + SpaceId string `json:"space_id"` + + Title string `json:"title"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genieSpaceFromPb(pb *genieSpacePb) (*GenieSpace, error) { + if pb == nil { + return nil, nil + } + st := &GenieSpace{} + st.Description = pb.Description + st.SpaceId = pb.SpaceId + st.Title = pb.Title + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genieSpacePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genieSpacePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genieStartConversationMessageRequestToPb(st *GenieStartConversationMessageRequest) (*genieStartConversationMessageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &genieStartConversationMessageRequestPb{} + pb.Content = st.Content + + pb.SpaceId = st.SpaceId + + return pb, nil +} + +type genieStartConversationMessageRequestPb struct { + Content string `json:"content"` + + SpaceId string `json:"-" url:"-"` +} + +func genieStartConversationMessageRequestFromPb(pb *genieStartConversationMessageRequestPb) (*GenieStartConversationMessageRequest, error) { + if pb == nil { + return nil, nil + } + st := &GenieStartConversationMessageRequest{} + st.Content = pb.Content + st.SpaceId = pb.SpaceId + + return st, nil +} + +func genieStartConversationResponseToPb(st *GenieStartConversationResponse) (*genieStartConversationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &genieStartConversationResponsePb{} + pb.Conversation = st.Conversation + + pb.ConversationId = st.ConversationId + + pb.Message = st.Message + + pb.MessageId = st.MessageId + + return pb, nil +} + +type genieStartConversationResponsePb struct { + Conversation *GenieConversation `json:"conversation,omitempty"` + + ConversationId string `json:"conversation_id"` + + Message *GenieMessage `json:"message,omitempty"` + + MessageId string `json:"message_id"` +} + +func genieStartConversationResponseFromPb(pb *genieStartConversationResponsePb) (*GenieStartConversationResponse, error) { + if pb == nil { + return nil, nil + } + st := &GenieStartConversationResponse{} + st.Conversation = pb.Conversation + st.ConversationId = pb.ConversationId + st.Message = pb.Message + st.MessageId = pb.MessageId + + return st, nil +} + +func getDashboardRequestToPb(st *GetDashboardRequest) (*getDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type getDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func getDashboardRequestFromPb(pb *getDashboardRequestPb) (*GetDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func getPublishedDashboardEmbeddedRequestToPb(st *GetPublishedDashboardEmbeddedRequest) (*getPublishedDashboardEmbeddedRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedDashboardEmbeddedRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type getPublishedDashboardEmbeddedRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func getPublishedDashboardEmbeddedRequestFromPb(pb *getPublishedDashboardEmbeddedRequestPb) (*GetPublishedDashboardEmbeddedRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedDashboardEmbeddedRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func getPublishedDashboardEmbeddedResponseToPb(st *GetPublishedDashboardEmbeddedResponse) (*getPublishedDashboardEmbeddedResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedDashboardEmbeddedResponsePb{} + + return pb, nil +} + +type getPublishedDashboardEmbeddedResponsePb struct { +} + +func getPublishedDashboardEmbeddedResponseFromPb(pb *getPublishedDashboardEmbeddedResponsePb) (*GetPublishedDashboardEmbeddedResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedDashboardEmbeddedResponse{} + + return st, nil +} + +func getPublishedDashboardRequestToPb(st *GetPublishedDashboardRequest) (*getPublishedDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type getPublishedDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func getPublishedDashboardRequestFromPb(pb *getPublishedDashboardRequestPb) (*GetPublishedDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func getPublishedDashboardTokenInfoRequestToPb(st *GetPublishedDashboardTokenInfoRequest) (*getPublishedDashboardTokenInfoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedDashboardTokenInfoRequestPb{} + pb.DashboardId = st.DashboardId + + pb.ExternalValue = st.ExternalValue + + pb.ExternalViewerId = st.ExternalViewerId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPublishedDashboardTokenInfoRequestPb struct { + DashboardId string `json:"-" url:"-"` + + ExternalValue string `json:"-" url:"external_value,omitempty"` + + ExternalViewerId string `json:"-" url:"external_viewer_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPublishedDashboardTokenInfoRequestFromPb(pb *getPublishedDashboardTokenInfoRequestPb) (*GetPublishedDashboardTokenInfoRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedDashboardTokenInfoRequest{} + st.DashboardId = pb.DashboardId + st.ExternalValue = pb.ExternalValue + st.ExternalViewerId = pb.ExternalViewerId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPublishedDashboardTokenInfoRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPublishedDashboardTokenInfoRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPublishedDashboardTokenInfoResponseToPb(st *GetPublishedDashboardTokenInfoResponse) (*getPublishedDashboardTokenInfoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedDashboardTokenInfoResponsePb{} + pb.AuthorizationDetails = st.AuthorizationDetails + + pb.CustomClaim = st.CustomClaim + + pb.Scope = st.Scope + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPublishedDashboardTokenInfoResponsePb struct { + AuthorizationDetails []AuthorizationDetails `json:"authorization_details,omitempty"` + + CustomClaim string `json:"custom_claim,omitempty"` + + Scope string `json:"scope,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPublishedDashboardTokenInfoResponseFromPb(pb *getPublishedDashboardTokenInfoResponsePb) (*GetPublishedDashboardTokenInfoResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedDashboardTokenInfoResponse{} + st.AuthorizationDetails = pb.AuthorizationDetails + st.CustomClaim = pb.CustomClaim + st.Scope = pb.Scope + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPublishedDashboardTokenInfoResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPublishedDashboardTokenInfoResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getScheduleRequestToPb(st *GetScheduleRequest) (*getScheduleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getScheduleRequestPb{} + pb.DashboardId = st.DashboardId + + pb.ScheduleId = st.ScheduleId + + return pb, nil +} + +type getScheduleRequestPb struct { + DashboardId string `json:"-" url:"-"` + + ScheduleId string `json:"-" url:"-"` +} + +func getScheduleRequestFromPb(pb *getScheduleRequestPb) (*GetScheduleRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetScheduleRequest{} + st.DashboardId = pb.DashboardId + st.ScheduleId = pb.ScheduleId + + return st, nil +} + +func getSubscriptionRequestToPb(st *GetSubscriptionRequest) (*getSubscriptionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getSubscriptionRequestPb{} + pb.DashboardId = st.DashboardId + + pb.ScheduleId = st.ScheduleId + + pb.SubscriptionId = st.SubscriptionId + + return pb, nil +} + +type getSubscriptionRequestPb struct { + DashboardId string `json:"-" url:"-"` + + ScheduleId string `json:"-" url:"-"` + + SubscriptionId string `json:"-" url:"-"` +} + +func getSubscriptionRequestFromPb(pb *getSubscriptionRequestPb) (*GetSubscriptionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetSubscriptionRequest{} + st.DashboardId = pb.DashboardId + st.ScheduleId = pb.ScheduleId + st.SubscriptionId = pb.SubscriptionId + + return st, nil +} + +func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listDashboardsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ShowTrashed = st.ShowTrashed + + pb.View = st.View + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDashboardsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ShowTrashed bool `json:"-" url:"show_trashed,omitempty"` + + View DashboardView `json:"-" url:"view,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDashboardsRequestFromPb(pb *listDashboardsRequestPb) (*ListDashboardsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListDashboardsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.ShowTrashed = pb.ShowTrashed + st.View = pb.View + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDashboardsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDashboardsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listDashboardsResponseToPb(st *ListDashboardsResponse) (*listDashboardsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listDashboardsResponsePb{} + pb.Dashboards = st.Dashboards + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDashboardsResponsePb struct { + Dashboards []Dashboard `json:"dashboards,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDashboardsResponseFromPb(pb *listDashboardsResponsePb) (*ListDashboardsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListDashboardsResponse{} + st.Dashboards = pb.Dashboards + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDashboardsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDashboardsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSchedulesRequestToPb(st *ListSchedulesRequest) (*listSchedulesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSchedulesRequestPb{} + pb.DashboardId = st.DashboardId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSchedulesRequestPb struct { + DashboardId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSchedulesRequestFromPb(pb *listSchedulesRequestPb) (*ListSchedulesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSchedulesRequest{} + st.DashboardId = pb.DashboardId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSchedulesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSchedulesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSchedulesResponseToPb(st *ListSchedulesResponse) (*listSchedulesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSchedulesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Schedules = st.Schedules + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSchedulesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Schedules []Schedule `json:"schedules,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSchedulesResponseFromPb(pb *listSchedulesResponsePb) (*ListSchedulesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSchedulesResponse{} + st.NextPageToken = pb.NextPageToken + st.Schedules = pb.Schedules + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSchedulesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSchedulesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSubscriptionsRequestToPb(st *ListSubscriptionsRequest) (*listSubscriptionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSubscriptionsRequestPb{} + pb.DashboardId = st.DashboardId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ScheduleId = st.ScheduleId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSubscriptionsRequestPb struct { + DashboardId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ScheduleId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSubscriptionsRequestFromPb(pb *listSubscriptionsRequestPb) (*ListSubscriptionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSubscriptionsRequest{} + st.DashboardId = pb.DashboardId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.ScheduleId = pb.ScheduleId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSubscriptionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSubscriptionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSubscriptionsResponseToPb(st *ListSubscriptionsResponse) (*listSubscriptionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSubscriptionsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Subscriptions = st.Subscriptions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSubscriptionsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Subscriptions []Subscription `json:"subscriptions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSubscriptionsResponseFromPb(pb *listSubscriptionsResponsePb) (*ListSubscriptionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSubscriptionsResponse{} + st.NextPageToken = pb.NextPageToken + st.Subscriptions = pb.Subscriptions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSubscriptionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSubscriptionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func messageErrorToPb(st *MessageError) (*messageErrorPb, error) { + if st == nil { + return nil, nil + } + pb := &messageErrorPb{} + pb.Error = st.Error + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type messageErrorPb struct { + Error string `json:"error,omitempty"` + + Type MessageErrorType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func messageErrorFromPb(pb *messageErrorPb) (*MessageError, error) { + if pb == nil { + return nil, nil + } + st := &MessageError{} + st.Error = pb.Error + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *messageErrorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st messageErrorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func migrateDashboardRequestToPb(st *MigrateDashboardRequest) (*migrateDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &migrateDashboardRequestPb{} + pb.DisplayName = st.DisplayName + + pb.ParentPath = st.ParentPath + + pb.SourceDashboardId = st.SourceDashboardId + + pb.UpdateParameterSyntax = st.UpdateParameterSyntax + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type migrateDashboardRequestPb struct { + DisplayName string `json:"display_name,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + SourceDashboardId string `json:"source_dashboard_id"` + + UpdateParameterSyntax bool `json:"update_parameter_syntax,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func migrateDashboardRequestFromPb(pb *migrateDashboardRequestPb) (*MigrateDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &MigrateDashboardRequest{} + st.DisplayName = pb.DisplayName + st.ParentPath = pb.ParentPath + st.SourceDashboardId = pb.SourceDashboardId + st.UpdateParameterSyntax = pb.UpdateParameterSyntax + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *migrateDashboardRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st migrateDashboardRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pendingStatusToPb(st *PendingStatus) (*pendingStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &pendingStatusPb{} + pb.DataToken = st.DataToken + + return pb, nil +} + +type pendingStatusPb struct { + DataToken string `json:"data_token"` +} + +func pendingStatusFromPb(pb *pendingStatusPb) (*PendingStatus, error) { + if pb == nil { + return nil, nil + } + st := &PendingStatus{} + st.DataToken = pb.DataToken + + return st, nil +} + +func pollPublishedQueryStatusRequestToPb(st *PollPublishedQueryStatusRequest) (*pollPublishedQueryStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &pollPublishedQueryStatusRequestPb{} + pb.DashboardName = st.DashboardName + + pb.DashboardRevisionId = st.DashboardRevisionId + + pb.Tokens = st.Tokens + + return pb, nil +} + +type pollPublishedQueryStatusRequestPb struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +func pollPublishedQueryStatusRequestFromPb(pb *pollPublishedQueryStatusRequestPb) (*PollPublishedQueryStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &PollPublishedQueryStatusRequest{} + st.DashboardName = pb.DashboardName + st.DashboardRevisionId = pb.DashboardRevisionId + st.Tokens = pb.Tokens + + return st, nil +} + +func pollQueryStatusResponseToPb(st *PollQueryStatusResponse) (*pollQueryStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &pollQueryStatusResponsePb{} + pb.Data = st.Data + + return pb, nil +} + +type pollQueryStatusResponsePb struct { + Data []PollQueryStatusResponseData `json:"data,omitempty"` +} + +func pollQueryStatusResponseFromPb(pb *pollQueryStatusResponsePb) (*PollQueryStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &PollQueryStatusResponse{} + st.Data = pb.Data + + return st, nil +} + +func pollQueryStatusResponseDataToPb(st *PollQueryStatusResponseData) (*pollQueryStatusResponseDataPb, error) { + if st == nil { + return nil, nil + } + pb := &pollQueryStatusResponseDataPb{} + pb.Status = st.Status + + return pb, nil +} + +type pollQueryStatusResponseDataPb struct { + Status QueryResponseStatus `json:"status"` +} + +func pollQueryStatusResponseDataFromPb(pb *pollQueryStatusResponseDataPb) (*PollQueryStatusResponseData, error) { + if pb == nil { + return nil, nil + } + st := &PollQueryStatusResponseData{} + st.Status = pb.Status + + return st, nil +} + +func publishRequestToPb(st *PublishRequest) (*publishRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &publishRequestPb{} + pb.DashboardId = st.DashboardId + + pb.EmbedCredentials = st.EmbedCredentials + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type publishRequestPb struct { + DashboardId string `json:"-" url:"-"` + + EmbedCredentials bool `json:"embed_credentials,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func publishRequestFromPb(pb *publishRequestPb) (*PublishRequest, error) { + if pb == nil { + return nil, nil + } + st := &PublishRequest{} + st.DashboardId = pb.DashboardId + st.EmbedCredentials = pb.EmbedCredentials + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *publishRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st publishRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func publishedDashboardToPb(st *PublishedDashboard) (*publishedDashboardPb, error) { + if st == nil { + return nil, nil + } + pb := &publishedDashboardPb{} + pb.DisplayName = st.DisplayName + + pb.EmbedCredentials = st.EmbedCredentials + + pb.RevisionCreateTime = st.RevisionCreateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type publishedDashboardPb struct { + DisplayName string `json:"display_name,omitempty"` + + EmbedCredentials bool `json:"embed_credentials,omitempty"` + + RevisionCreateTime string `json:"revision_create_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func publishedDashboardFromPb(pb *publishedDashboardPb) (*PublishedDashboard, error) { + if pb == nil { + return nil, nil + } + st := &PublishedDashboard{} + st.DisplayName = pb.DisplayName + st.EmbedCredentials = pb.EmbedCredentials + st.RevisionCreateTime = pb.RevisionCreateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *publishedDashboardPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st publishedDashboardPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryResponseStatusToPb(st *QueryResponseStatus) (*queryResponseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &queryResponseStatusPb{} + pb.Canceled = st.Canceled + + pb.Closed = st.Closed + + pb.Pending = st.Pending + + pb.StatementId = st.StatementId + + pb.Success = st.Success + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryResponseStatusPb struct { + Canceled *Empty `json:"canceled,omitempty"` + + Closed *Empty `json:"closed,omitempty"` + + Pending *PendingStatus `json:"pending,omitempty"` + + StatementId string `json:"statement_id,omitempty"` + + Success *SuccessStatus `json:"success,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryResponseStatusFromPb(pb *queryResponseStatusPb) (*QueryResponseStatus, error) { + if pb == nil { + return nil, nil + } + st := &QueryResponseStatus{} + st.Canceled = pb.Canceled + st.Closed = pb.Closed + st.Pending = pb.Pending + st.StatementId = pb.StatementId + st.Success = pb.Success + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryResponseStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryResponseStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resultToPb(st *Result) (*resultPb, error) { + if st == nil { + return nil, nil + } + pb := &resultPb{} + pb.IsTruncated = st.IsTruncated + + pb.RowCount = st.RowCount + + pb.StatementId = st.StatementId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultPb struct { + IsTruncated bool `json:"is_truncated,omitempty"` + + RowCount int64 `json:"row_count,omitempty"` + + StatementId string `json:"statement_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultFromPb(pb *resultPb) (*Result, error) { + if pb == nil { + return nil, nil + } + st := &Result{} + st.IsTruncated = pb.IsTruncated + st.RowCount = pb.RowCount + st.StatementId = pb.StatementId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func scheduleToPb(st *Schedule) (*schedulePb, error) { + if st == nil { + return nil, nil + } + pb := &schedulePb{} + pb.CreateTime = st.CreateTime + + pb.CronSchedule = st.CronSchedule + + pb.DashboardId = st.DashboardId + + pb.DisplayName = st.DisplayName + + pb.Etag = st.Etag + + pb.PauseStatus = st.PauseStatus + + pb.ScheduleId = st.ScheduleId + + pb.UpdateTime = st.UpdateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type schedulePb struct { + CreateTime string `json:"create_time,omitempty"` + + CronSchedule CronSchedule `json:"cron_schedule"` + + DashboardId string `json:"dashboard_id,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Etag string `json:"etag,omitempty"` + + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + + ScheduleId string `json:"schedule_id,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func scheduleFromPb(pb *schedulePb) (*Schedule, error) { + if pb == nil { + return nil, nil + } + st := &Schedule{} + st.CreateTime = pb.CreateTime + st.CronSchedule = pb.CronSchedule + st.DashboardId = pb.DashboardId + st.DisplayName = pb.DisplayName + st.Etag = pb.Etag + st.PauseStatus = pb.PauseStatus + st.ScheduleId = pb.ScheduleId + st.UpdateTime = pb.UpdateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *schedulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st schedulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func subscriberToPb(st *Subscriber) (*subscriberPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriberPb{} + pb.DestinationSubscriber = st.DestinationSubscriber + + pb.UserSubscriber = st.UserSubscriber + + return pb, nil +} + +type subscriberPb struct { + DestinationSubscriber *SubscriptionSubscriberDestination `json:"destination_subscriber,omitempty"` + + UserSubscriber *SubscriptionSubscriberUser `json:"user_subscriber,omitempty"` +} + +func subscriberFromPb(pb *subscriberPb) (*Subscriber, error) { + if pb == nil { + return nil, nil + } + st := &Subscriber{} + st.DestinationSubscriber = pb.DestinationSubscriber + st.UserSubscriber = pb.UserSubscriber + + return st, nil +} + +func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriptionPb{} + pb.CreateTime = st.CreateTime + + pb.CreatedByUserId = st.CreatedByUserId + + pb.DashboardId = st.DashboardId + + pb.Etag = st.Etag + + pb.ScheduleId = st.ScheduleId + + pb.Subscriber = st.Subscriber + + pb.SubscriptionId = st.SubscriptionId + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type subscriptionPb struct { + CreateTime string `json:"create_time,omitempty"` + + CreatedByUserId int64 `json:"created_by_user_id,omitempty"` + + DashboardId string `json:"dashboard_id,omitempty"` + + Etag string `json:"etag,omitempty"` + + ScheduleId string `json:"schedule_id,omitempty"` + + Subscriber Subscriber `json:"subscriber"` + + SubscriptionId string `json:"subscription_id,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func subscriptionFromPb(pb *subscriptionPb) (*Subscription, error) { + if pb == nil { + return nil, nil + } + st := &Subscription{} + st.CreateTime = pb.CreateTime + st.CreatedByUserId = pb.CreatedByUserId + st.DashboardId = pb.DashboardId + st.Etag = pb.Etag + st.ScheduleId = pb.ScheduleId + st.Subscriber = pb.Subscriber + st.SubscriptionId = pb.SubscriptionId + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *subscriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st subscriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func subscriptionSubscriberDestinationToPb(st *SubscriptionSubscriberDestination) (*subscriptionSubscriberDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriptionSubscriberDestinationPb{} + pb.DestinationId = st.DestinationId + + return pb, nil +} + +type subscriptionSubscriberDestinationPb struct { + DestinationId string `json:"destination_id"` +} + +func subscriptionSubscriberDestinationFromPb(pb *subscriptionSubscriberDestinationPb) (*SubscriptionSubscriberDestination, error) { + if pb == nil { + return nil, nil + } + st := &SubscriptionSubscriberDestination{} + st.DestinationId = pb.DestinationId + + return st, nil +} + +func subscriptionSubscriberUserToPb(st *SubscriptionSubscriberUser) (*subscriptionSubscriberUserPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriptionSubscriberUserPb{} + pb.UserId = st.UserId + + return pb, nil +} + +type subscriptionSubscriberUserPb struct { + UserId int64 `json:"user_id"` +} + +func subscriptionSubscriberUserFromPb(pb *subscriptionSubscriberUserPb) (*SubscriptionSubscriberUser, error) { + if pb == nil { + return nil, nil + } + st := &SubscriptionSubscriberUser{} + st.UserId = pb.UserId + + return st, nil +} + +func successStatusToPb(st *SuccessStatus) (*successStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &successStatusPb{} + pb.DataToken = st.DataToken + + pb.Truncated = st.Truncated + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type successStatusPb struct { + DataToken string `json:"data_token"` + + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func successStatusFromPb(pb *successStatusPb) (*SuccessStatus, error) { + if pb == nil { + return nil, nil + } + st := &SuccessStatus{} + st.DataToken = pb.DataToken + st.Truncated = pb.Truncated + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *successStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st successStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func textAttachmentToPb(st *TextAttachment) (*textAttachmentPb, error) { + if st == nil { + return nil, nil + } + pb := &textAttachmentPb{} + pb.Content = st.Content + + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type textAttachmentPb struct { + Content string `json:"content,omitempty"` + + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func textAttachmentFromPb(pb *textAttachmentPb) (*TextAttachment, error) { + if pb == nil { + return nil, nil + } + st := &TextAttachment{} + st.Content = pb.Content + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *textAttachmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st textAttachmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func trashDashboardRequestToPb(st *TrashDashboardRequest) (*trashDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &trashDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type trashDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func trashDashboardRequestFromPb(pb *trashDashboardRequestPb) (*TrashDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &TrashDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func trashDashboardResponseToPb(st *TrashDashboardResponse) (*trashDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &trashDashboardResponsePb{} + + return pb, nil +} + +type trashDashboardResponsePb struct { +} + +func trashDashboardResponseFromPb(pb *trashDashboardResponsePb) (*TrashDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &TrashDashboardResponse{} + + return st, nil +} + +func unpublishDashboardRequestToPb(st *UnpublishDashboardRequest) (*unpublishDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &unpublishDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type unpublishDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func unpublishDashboardRequestFromPb(pb *unpublishDashboardRequestPb) (*UnpublishDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &UnpublishDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func unpublishDashboardResponseToPb(st *UnpublishDashboardResponse) (*unpublishDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &unpublishDashboardResponsePb{} + + return pb, nil +} + +type unpublishDashboardResponsePb struct { +} + +func unpublishDashboardResponseFromPb(pb *unpublishDashboardResponsePb) (*UnpublishDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &UnpublishDashboardResponse{} + + return st, nil +} + +func updateDashboardRequestToPb(st *UpdateDashboardRequest) (*updateDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDashboardRequestPb{} + pb.Dashboard = st.Dashboard + + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type updateDashboardRequestPb struct { + Dashboard Dashboard `json:"dashboard"` + + DashboardId string `json:"-" url:"-"` +} + +func updateDashboardRequestFromPb(pb *updateDashboardRequestPb) (*UpdateDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDashboardRequest{} + st.Dashboard = pb.Dashboard + st.DashboardId = pb.DashboardId + + return st, nil +} + +func updateScheduleRequestToPb(st *UpdateScheduleRequest) (*updateScheduleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateScheduleRequestPb{} + pb.DashboardId = st.DashboardId + + pb.Schedule = st.Schedule + + pb.ScheduleId = st.ScheduleId + + return pb, nil +} + +type updateScheduleRequestPb struct { + DashboardId string `json:"-" url:"-"` + + Schedule Schedule `json:"schedule"` + + ScheduleId string `json:"-" url:"-"` +} + +func updateScheduleRequestFromPb(pb *updateScheduleRequestPb) (*UpdateScheduleRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateScheduleRequest{} + st.DashboardId = pb.DashboardId + st.Schedule = pb.Schedule + st.ScheduleId = pb.ScheduleId + + return st, nil +} diff --git a/service/dashboards/model.go b/service/dashboards/model.go index b3ed5aa82..2663b9375 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -3,101 +3,308 @@ package dashboards import ( + "encoding/json" "fmt" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/sql" ) type AuthorizationDetails struct { // Represents downscoped permission rules with specific access rights. This // field is specific to `workspace_rule_set` constraint. - GrantRules []AuthorizationDetailsGrantRule `json:"grant_rules,omitempty"` + // Wire name: 'grant_rules' + GrantRules []AuthorizationDetailsGrantRule // The acl path of the tree store resource resource. - ResourceLegacyAclPath string `json:"resource_legacy_acl_path,omitempty"` + // Wire name: 'resource_legacy_acl_path' + ResourceLegacyAclPath string // The resource name to which the authorization rule applies. This field is // specific to `workspace_rule_set` constraint. Format: // `workspaces/{workspace_id}/dashboards/{dashboard_id}` - ResourceName string `json:"resource_name,omitempty"` + // Wire name: 'resource_name' + ResourceName string // The type of authorization downscoping policy. Ex: `workspace_rule_set` // defines access rules for a specific workspace resource - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AuthorizationDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AuthorizationDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &authorizationDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := authorizationDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AuthorizationDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AuthorizationDetails) MarshalJSON() ([]byte, error) { + pb, err := authorizationDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AuthorizationDetailsGrantRule struct { // Permission sets for dashboard are defined in // iam-common/rbac-common/permission-sets/definitions/TreeStoreBasePermissionSets // Ex: `permissionSets/dashboard.runner` - PermissionSet string `json:"permission_set,omitempty"` + // Wire name: 'permission_set' + PermissionSet string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AuthorizationDetailsGrantRule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AuthorizationDetailsGrantRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &authorizationDetailsGrantRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := authorizationDetailsGrantRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AuthorizationDetailsGrantRule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AuthorizationDetailsGrantRule) MarshalJSON() ([]byte, error) { + pb, err := authorizationDetailsGrantRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Cancel the results for the a query for a published, embedded dashboard type CancelPublishedQueryExecutionRequest struct { - DashboardName string `json:"-" url:"dashboard_name"` - DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Wire name: 'dashboard_name' + DashboardName string `tf:"-"` + + // Wire name: 'dashboard_revision_id' + DashboardRevisionId string `tf:"-"` // Example: // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ - Tokens []string `json:"-" url:"tokens,omitempty"` + // Wire name: 'tokens' + Tokens []string `tf:"-"` +} + +func (st *CancelPublishedQueryExecutionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelPublishedQueryExecutionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelPublishedQueryExecutionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelPublishedQueryExecutionRequest) MarshalJSON() ([]byte, error) { + pb, err := cancelPublishedQueryExecutionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelQueryExecutionResponse struct { - Status []CancelQueryExecutionResponseStatus `json:"status,omitempty"` + + // Wire name: 'status' + Status []CancelQueryExecutionResponseStatus +} + +func (st *CancelQueryExecutionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelQueryExecutionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelQueryExecutionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelQueryExecutionResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelQueryExecutionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelQueryExecutionResponseStatus struct { // The token to poll for result asynchronously Example: // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ - DataToken string `json:"data_token"` + // Wire name: 'data_token' + DataToken string // Represents an empty message, similar to google.protobuf.Empty, which is // not available in the firm right now. - Pending *Empty `json:"pending,omitempty"` + // Wire name: 'pending' + Pending *Empty // Represents an empty message, similar to google.protobuf.Empty, which is // not available in the firm right now. - Success *Empty `json:"success,omitempty"` + // Wire name: 'success' + Success *Empty +} + +func (st *CancelQueryExecutionResponseStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelQueryExecutionResponseStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelQueryExecutionResponseStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelQueryExecutionResponseStatus) MarshalJSON() ([]byte, error) { + pb, err := cancelQueryExecutionResponseStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create dashboard type CreateDashboardRequest struct { - Dashboard Dashboard `json:"dashboard"` + + // Wire name: 'dashboard' + Dashboard Dashboard +} + +func (st *CreateDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := createDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create dashboard schedule type CreateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` + + // Wire name: 'schedule' + Schedule Schedule +} - Schedule Schedule `json:"schedule"` +func (st *CreateScheduleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createScheduleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createScheduleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateScheduleRequest) MarshalJSON() ([]byte, error) { + pb, err := createScheduleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create schedule subscription type CreateSubscriptionRequest struct { // UUID identifying the dashboard to which the subscription belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` - Subscription Subscription `json:"subscription"` + // Wire name: 'subscription' + Subscription Subscription +} + +func (st *CreateSubscriptionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createSubscriptionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createSubscriptionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateSubscriptionRequest) MarshalJSON() ([]byte, error) { + pb, err := createSubscriptionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CronSchedule struct { @@ -105,35 +312,69 @@ type CronSchedule struct { // 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"` + // Wire name: 'quartz_cron_expression' + QuartzCronExpression string // 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"` + // Wire name: 'timezone_id' + TimezoneId string +} + +func (st *CronSchedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cronSchedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cronScheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CronSchedule) MarshalJSON() ([]byte, error) { + pb, err := cronScheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Dashboard struct { // The timestamp of when the dashboard was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // UUID identifying the dashboard. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The display name of the dashboard. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // The etag for the dashboard. Can be optionally provided on updates to // ensure that the dashboard has not been modified since the last read. This // field is excluded in List Dashboards responses. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // The state of the dashboard resource. Used for tracking trashed status. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // The workspace path of the folder containing the dashboard. Includes // leading slash and no trailing slash. This field is excluded in List // Dashboards responses. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // The workspace path of the dashboard asset, including the file name. // Exported dashboards always have the file extension `.lvdash.json`. This // field is excluded in List Dashboards responses. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // The contents of the dashboard in serialized string form. This field is // excluded in List Dashboards responses. Use the [get dashboard API] to // retrieve an example response, which includes the `serialized_dashboard` @@ -141,25 +382,46 @@ type Dashboard struct { // represents the dashboard's layout and components. // // [get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get - SerializedDashboard string `json:"serialized_dashboard,omitempty"` + // Wire name: 'serialized_dashboard' + SerializedDashboard string // The timestamp of when the dashboard was last updated by the user. This // field is excluded in List Dashboards responses. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // The warehouse ID used to run the dashboard. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Dashboard) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Dashboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Dashboard) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Dashboard) MarshalJSON() ([]byte, error) { + pb, err := dashboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardView string +type dashboardViewPb string const DashboardViewDashboardViewBasic DashboardView = `DASHBOARD_VIEW_BASIC` @@ -184,61 +446,193 @@ func (f *DashboardView) Type() string { return "DashboardView" } +func dashboardViewToPb(st *DashboardView) (*dashboardViewPb, error) { + if st == nil { + return nil, nil + } + pb := dashboardViewPb(*st) + return &pb, nil +} + +func dashboardViewFromPb(pb *dashboardViewPb) (*DashboardView, error) { + if pb == nil { + return nil, nil + } + st := DashboardView(*pb) + return &st, nil +} + // Delete dashboard schedule type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // 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"` + // Wire name: 'etag' + Etag string `tf:"-"` // UUID identifying the schedule. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteScheduleRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteScheduleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteScheduleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteScheduleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteScheduleRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteScheduleRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteScheduleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteScheduleResponse struct { } +func (st *DeleteScheduleResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteScheduleResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteScheduleResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteScheduleResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteScheduleResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete schedule subscription type DeleteSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // 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"` + // Wire name: 'etag' + Etag string `tf:"-"` // UUID identifying the schedule which the subscription belongs. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` // UUID identifying the subscription. - SubscriptionId string `json:"-" url:"-"` + // Wire name: 'subscription_id' + SubscriptionId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteSubscriptionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteSubscriptionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSubscriptionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSubscriptionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteSubscriptionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteSubscriptionResponse struct { } +func (st *DeleteSubscriptionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSubscriptionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSubscriptionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteSubscriptionResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteSubscriptionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Represents an empty message, similar to google.protobuf.Empty, which is not // available in the firm right now. type Empty struct { } +func (st *Empty) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &emptyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := emptyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Empty) MarshalJSON() ([]byte, error) { + pb, err := emptyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Execute query request for published Dashboards. Since published dashboards // have the option of running as the publisher, the datasets, warehouse_id are // excluded from the request and instead read from the source (lakeview-config) @@ -247,235 +641,688 @@ type ExecutePublishedDashboardQueryRequest struct { // Dashboard name and revision_id is required to retrieve // PublishedDatasetDataModel which contains the list of datasets, // warehouse_id, and embedded_credentials - DashboardName string `json:"dashboard_name"` + // Wire name: 'dashboard_name' + DashboardName string - DashboardRevisionId string `json:"dashboard_revision_id"` + // Wire name: 'dashboard_revision_id' + DashboardRevisionId string // A dashboard schedule can override the warehouse used as compute for // processing the published dashboard queries - OverrideWarehouseId string `json:"override_warehouse_id,omitempty"` + // Wire name: 'override_warehouse_id' + OverrideWarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExecutePublishedDashboardQueryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExecutePublishedDashboardQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &executePublishedDashboardQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := executePublishedDashboardQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExecutePublishedDashboardQueryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExecutePublishedDashboardQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := executePublishedDashboardQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExecuteQueryResponse struct { } +func (st *ExecuteQueryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &executeQueryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := executeQueryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExecuteQueryResponse) MarshalJSON() ([]byte, error) { + pb, err := executeQueryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Genie AI Response type GenieAttachment struct { // Attachment ID - AttachmentId string `json:"attachment_id,omitempty"` + // Wire name: 'attachment_id' + AttachmentId string // Query Attachment if Genie responds with a SQL query - Query *GenieQueryAttachment `json:"query,omitempty"` + // Wire name: 'query' + Query *GenieQueryAttachment // Text Attachment if Genie responds with text - Text *TextAttachment `json:"text,omitempty"` + // Wire name: 'text' + Text *TextAttachment - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieAttachment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieAttachment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieAttachmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieAttachmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieAttachment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieAttachment) MarshalJSON() ([]byte, error) { + pb, err := genieAttachmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieConversation struct { // Conversation ID - ConversationId string `json:"conversation_id"` + // Wire name: 'conversation_id' + ConversationId string // Timestamp when the message was created - CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + // Wire name: 'created_timestamp' + CreatedTimestamp int64 // Conversation ID. Legacy identifier, use conversation_id instead - Id string `json:"id"` + // Wire name: 'id' + Id string // Timestamp when the message was last updated - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Genie space ID - SpaceId string `json:"space_id"` + // Wire name: 'space_id' + SpaceId string // Conversation title - Title string `json:"title"` + // Wire name: 'title' + Title string // ID of the user who created the conversation - UserId int `json:"user_id"` + // Wire name: 'user_id' + UserId int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieConversation) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieConversation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieConversationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieConversationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieConversation) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieConversation) MarshalJSON() ([]byte, error) { + pb, err := genieConversationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieCreateConversationMessageRequest struct { // User message content. - Content string `json:"content"` + // Wire name: 'content' + Content string // The ID associated with the conversation. - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // The ID associated with the Genie space where the conversation is started. - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieCreateConversationMessageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieCreateConversationMessageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieCreateConversationMessageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieCreateConversationMessageRequest) MarshalJSON() ([]byte, error) { + pb, err := genieCreateConversationMessageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Execute message attachment SQL query type GenieExecuteMessageAttachmentQueryRequest struct { // Attachment ID - AttachmentId string `json:"-" url:"-"` + // Wire name: 'attachment_id' + AttachmentId string `tf:"-"` // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieExecuteMessageAttachmentQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieExecuteMessageAttachmentQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieExecuteMessageAttachmentQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieExecuteMessageAttachmentQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := genieExecuteMessageAttachmentQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // [Deprecated] Execute SQL query in a conversation message type GenieExecuteMessageQueryRequest struct { // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieExecuteMessageQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieExecuteMessageQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieExecuteMessageQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieExecuteMessageQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := genieExecuteMessageQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Generate full query result download type GenieGenerateDownloadFullQueryResultRequest struct { // Attachment ID - AttachmentId string `json:"-" url:"-"` + // Wire name: 'attachment_id' + AttachmentId string `tf:"-"` // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGenerateDownloadFullQueryResultRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGenerateDownloadFullQueryResultRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGenerateDownloadFullQueryResultRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGenerateDownloadFullQueryResultRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGenerateDownloadFullQueryResultRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieGenerateDownloadFullQueryResultResponse struct { // Download ID. Use this ID to track the download request in subsequent // polling calls - DownloadId string `json:"download_id,omitempty"` + // Wire name: 'download_id' + DownloadId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieGenerateDownloadFullQueryResultResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieGenerateDownloadFullQueryResultResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGenerateDownloadFullQueryResultResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGenerateDownloadFullQueryResultResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieGenerateDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieGenerateDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { + pb, err := genieGenerateDownloadFullQueryResultResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get conversation message type GenieGetConversationMessageRequest struct { // The ID associated with the target conversation. - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // The ID associated with the target message from the identified // conversation. - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // The ID associated with the Genie space where the target conversation is // located. - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetConversationMessageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetConversationMessageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetConversationMessageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetConversationMessageRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetConversationMessageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get download full query result type GenieGetDownloadFullQueryResultRequest struct { // Attachment ID - AttachmentId string `json:"-" url:"-"` + // Wire name: 'attachment_id' + AttachmentId string `tf:"-"` // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Download ID. This ID is provided by the [Generate Download // endpoint](:method:genie/generateDownloadFullQueryResult) - DownloadId string `json:"-" url:"-"` + // Wire name: 'download_id' + DownloadId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetDownloadFullQueryResultRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetDownloadFullQueryResultRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetDownloadFullQueryResultRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetDownloadFullQueryResultRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetDownloadFullQueryResultRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieGetDownloadFullQueryResultResponse struct { // SQL Statement Execution response. See [Get status, manifest, and result // first chunk](:method:statementexecution/getstatement) for more details. - StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` + // Wire name: 'statement_response' + StatementResponse *sql.StatementResponse +} + +func (st *GenieGetDownloadFullQueryResultResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetDownloadFullQueryResultResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetDownloadFullQueryResultResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { + pb, err := genieGetDownloadFullQueryResultResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get message attachment SQL query result type GenieGetMessageAttachmentQueryResultRequest struct { // Attachment ID - AttachmentId string `json:"-" url:"-"` + // Wire name: 'attachment_id' + AttachmentId string `tf:"-"` // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetMessageAttachmentQueryResultRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetMessageAttachmentQueryResultRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetMessageAttachmentQueryResultRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetMessageAttachmentQueryResultRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetMessageAttachmentQueryResultRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // [Deprecated] Get conversation message SQL query result type GenieGetMessageQueryResultRequest struct { // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetMessageQueryResultRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetMessageQueryResultRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetMessageQueryResultRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetMessageQueryResultRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetMessageQueryResultRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieGetMessageQueryResultResponse struct { // SQL Statement Execution response. See [Get status, manifest, and result // first chunk](:method:statementexecution/getstatement) for more details. - StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` + // Wire name: 'statement_response' + StatementResponse *sql.StatementResponse +} + +func (st *GenieGetMessageQueryResultResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetMessageQueryResultResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetMessageQueryResultResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetMessageQueryResultResponse) MarshalJSON() ([]byte, error) { + pb, err := genieGetMessageQueryResultResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // [Deprecated] Get conversation message SQL query result type GenieGetQueryResultByAttachmentRequest struct { // Attachment ID - AttachmentId string `json:"-" url:"-"` + // Wire name: 'attachment_id' + AttachmentId string `tf:"-"` // Conversation ID - ConversationId string `json:"-" url:"-"` + // Wire name: 'conversation_id' + ConversationId string `tf:"-"` // Message ID - MessageId string `json:"-" url:"-"` + // Wire name: 'message_id' + MessageId string `tf:"-"` // Genie space ID - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetQueryResultByAttachmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetQueryResultByAttachmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetQueryResultByAttachmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetQueryResultByAttachmentRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetQueryResultByAttachmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get Genie Space type GenieGetSpaceRequest struct { // The ID associated with the Genie space - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieGetSpaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieGetSpaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieGetSpaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieGetSpaceRequest) MarshalJSON() ([]byte, error) { + pb, err := genieGetSpaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieMessage struct { // AI-generated response to the message - Attachments []GenieAttachment `json:"attachments,omitempty"` + // Wire name: 'attachments' + Attachments []GenieAttachment // User message content - Content string `json:"content"` + // Wire name: 'content' + Content string // Conversation ID - ConversationId string `json:"conversation_id"` + // Wire name: 'conversation_id' + ConversationId string // Timestamp when the message was created - CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + // Wire name: 'created_timestamp' + CreatedTimestamp int64 // Error message if Genie failed to respond to the message - Error *MessageError `json:"error,omitempty"` + // Wire name: 'error' + Error *MessageError // Message ID. Legacy identifier, use message_id instead - Id string `json:"id"` + // Wire name: 'id' + Id string // Timestamp when the message was last updated - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Message ID - MessageId string `json:"message_id"` + // Wire name: 'message_id' + MessageId string // The result of SQL query if the message includes a query attachment. // Deprecated. Use `query_result_metadata` in `GenieQueryAttachment` // instead. - QueryResult *Result `json:"query_result,omitempty"` + // Wire name: 'query_result' + QueryResult *Result // Genie space ID - SpaceId string `json:"space_id"` + // Wire name: 'space_id' + SpaceId string // MessageStatus. The possible values are: * `FETCHING_METADATA`: Fetching // metadata from the data sources. * `FILTERING_CONTEXT`: Running smart // context step to determine relevant context. * `ASKING_AI`: Waiting for @@ -493,187 +1340,525 @@ type GenieMessage struct { // Rerun the SQL query result by calling // [executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) // API. * `CANCELLED`: Message has been cancelled. - Status MessageStatus `json:"status,omitempty"` + // Wire name: 'status' + Status MessageStatus // ID of the user who created the message - UserId int64 `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieMessage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieMessage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieMessage) MarshalJSON() ([]byte, error) { + pb, err := genieMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieQueryAttachment struct { // Description of the query - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time when the user updated the query last - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // AI generated SQL query - Query string `json:"query,omitempty"` + // Wire name: 'query' + Query string // Metadata associated with the query result. - QueryResultMetadata *GenieResultMetadata `json:"query_result_metadata,omitempty"` + // Wire name: 'query_result_metadata' + QueryResultMetadata *GenieResultMetadata // Statement Execution API statement id. Use [Get status, manifest, and // result first chunk](:method:statementexecution/getstatement) to get the // full result data. - StatementId string `json:"statement_id,omitempty"` + // Wire name: 'statement_id' + StatementId string // Name of the query - Title string `json:"title,omitempty"` + // Wire name: 'title' + Title string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieQueryAttachment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieQueryAttachment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieQueryAttachmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieQueryAttachmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieQueryAttachment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieQueryAttachment) MarshalJSON() ([]byte, error) { + pb, err := genieQueryAttachmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieResultMetadata struct { // Indicates whether the result set is truncated. - IsTruncated bool `json:"is_truncated,omitempty"` + // Wire name: 'is_truncated' + IsTruncated bool // The number of rows in the result set. - RowCount int64 `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieResultMetadata) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieResultMetadata) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieResultMetadataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieResultMetadataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieResultMetadata) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieResultMetadata) MarshalJSON() ([]byte, error) { + pb, err := genieResultMetadataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieSpace struct { // Description of the Genie Space - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Genie space ID - SpaceId string `json:"space_id"` + // Wire name: 'space_id' + SpaceId string // Title of the Genie Space - Title string `json:"title"` + // Wire name: 'title' + Title string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenieSpace) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenieSpace) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieSpacePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieSpaceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenieSpace) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenieSpace) MarshalJSON() ([]byte, error) { + pb, err := genieSpaceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieStartConversationMessageRequest struct { // The text of the message that starts the conversation. - Content string `json:"content"` + // Wire name: 'content' + Content string // The ID associated with the Genie space where you want to start a // conversation. - SpaceId string `json:"-" url:"-"` + // Wire name: 'space_id' + SpaceId string `tf:"-"` +} + +func (st *GenieStartConversationMessageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieStartConversationMessageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieStartConversationMessageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieStartConversationMessageRequest) MarshalJSON() ([]byte, error) { + pb, err := genieStartConversationMessageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenieStartConversationResponse struct { - Conversation *GenieConversation `json:"conversation,omitempty"` + + // Wire name: 'conversation' + Conversation *GenieConversation // Conversation ID - ConversationId string `json:"conversation_id"` + // Wire name: 'conversation_id' + ConversationId string - Message *GenieMessage `json:"message,omitempty"` + // Wire name: 'message' + Message *GenieMessage // Message ID - MessageId string `json:"message_id"` + // Wire name: 'message_id' + MessageId string +} + +func (st *GenieStartConversationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genieStartConversationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genieStartConversationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GenieStartConversationResponse) MarshalJSON() ([]byte, error) { + pb, err := genieStartConversationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get dashboard type GetDashboardRequest struct { // UUID identifying the dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *GetDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := getDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Read a published dashboard in an embedded ui. type GetPublishedDashboardEmbeddedRequest struct { // UUID identifying the published dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *GetPublishedDashboardEmbeddedRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedDashboardEmbeddedRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedDashboardEmbeddedRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPublishedDashboardEmbeddedRequest) MarshalJSON() ([]byte, error) { + pb, err := getPublishedDashboardEmbeddedRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type GetPublishedDashboardEmbeddedResponse struct { +} + +func (st *GetPublishedDashboardEmbeddedResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedDashboardEmbeddedResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedDashboardEmbeddedResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type GetPublishedDashboardEmbeddedResponse struct { +func (st GetPublishedDashboardEmbeddedResponse) MarshalJSON() ([]byte, error) { + pb, err := getPublishedDashboardEmbeddedResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get published dashboard type GetPublishedDashboardRequest struct { // UUID identifying the published dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *GetPublishedDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPublishedDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := getPublishedDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Read an information of a published dashboard to mint an OAuth token. type GetPublishedDashboardTokenInfoRequest struct { // UUID identifying the published dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // Provided external value to be included in the custom claim. - ExternalValue string `json:"-" url:"external_value,omitempty"` + // Wire name: 'external_value' + ExternalValue string `tf:"-"` // Provided external viewer id to be included in the custom claim. - ExternalViewerId string `json:"-" url:"external_viewer_id,omitempty"` + // Wire name: 'external_viewer_id' + ExternalViewerId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPublishedDashboardTokenInfoRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPublishedDashboardTokenInfoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedDashboardTokenInfoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedDashboardTokenInfoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPublishedDashboardTokenInfoRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPublishedDashboardTokenInfoRequest) MarshalJSON() ([]byte, error) { + pb, err := getPublishedDashboardTokenInfoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPublishedDashboardTokenInfoResponse struct { // Authorization constraints for accessing the published dashboard. // Currently includes `workspace_rule_set` and could be enriched with // `unity_catalog_privileges` before oAuth token generation. - AuthorizationDetails []AuthorizationDetails `json:"authorization_details,omitempty"` + // Wire name: 'authorization_details' + AuthorizationDetails []AuthorizationDetails // Custom claim generated from external_value and external_viewer_id. // Format: // `urn:aibi:external_data:::` - CustomClaim string `json:"custom_claim,omitempty"` + // Wire name: 'custom_claim' + CustomClaim string // Scope defining access permissions. - Scope string `json:"scope,omitempty"` + // Wire name: 'scope' + Scope string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPublishedDashboardTokenInfoResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPublishedDashboardTokenInfoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedDashboardTokenInfoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedDashboardTokenInfoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPublishedDashboardTokenInfoResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPublishedDashboardTokenInfoResponse) MarshalJSON() ([]byte, error) { + pb, err := getPublishedDashboardTokenInfoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get dashboard schedule type GetScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // UUID identifying the schedule. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` +} + +func (st *GetScheduleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getScheduleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getScheduleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetScheduleRequest) MarshalJSON() ([]byte, error) { + pb, err := getScheduleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get schedule subscription type GetSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // UUID identifying the schedule which the subscription belongs. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` // UUID identifying the subscription. - SubscriptionId string `json:"-" url:"-"` + // Wire name: 'subscription_id' + SubscriptionId string `tf:"-"` +} + +func (st *GetSubscriptionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSubscriptionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSubscriptionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetSubscriptionRequest) MarshalJSON() ([]byte, error) { + pb, err := getSubscriptionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LifecycleState string +type lifecycleStatePb string const LifecycleStateActive LifecycleState = `ACTIVE` @@ -700,146 +1885,303 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } +func lifecycleStateToPb(st *LifecycleState) (*lifecycleStatePb, error) { + if st == nil { + return nil, nil + } + pb := lifecycleStatePb(*st) + return &pb, nil +} + +func lifecycleStateFromPb(pb *lifecycleStatePb) (*LifecycleState, error) { + if pb == nil { + return nil, nil + } + st := LifecycleState(*pb) + return &st, nil +} + // List dashboards type ListDashboardsRequest struct { // The number of dashboards to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token, received from a previous `ListDashboards` call. This token // can be used to retrieve the subsequent page. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The flag to include dashboards located in the trash. If unspecified, only // active dashboards will be returned. - ShowTrashed bool `json:"-" url:"show_trashed,omitempty"` + // Wire name: 'show_trashed' + ShowTrashed bool `tf:"-"` // `DASHBOARD_VIEW_BASIC`only includes summary metadata from the dashboard. - View DashboardView `json:"-" url:"view,omitempty"` + // Wire name: 'view' + View DashboardView `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDashboardsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDashboardsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDashboardsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDashboardsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDashboardsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDashboardsRequest) MarshalJSON() ([]byte, error) { + pb, err := listDashboardsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListDashboardsResponse struct { - Dashboards []Dashboard `json:"dashboards,omitempty"` + + // Wire name: 'dashboards' + Dashboards []Dashboard // A token, which can be sent as `page_token` to retrieve the next page. If // this field is omitted, there are no subsequent dashboards. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDashboardsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDashboardsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDashboardsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDashboardsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDashboardsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDashboardsResponse) MarshalJSON() ([]byte, error) { + pb, err := listDashboardsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List dashboard schedules type ListSchedulesRequest struct { // UUID identifying the dashboard to which the schedules belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // The number of schedules to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token, received from a previous `ListSchedules` call. Use this to // retrieve the subsequent page. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSchedulesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSchedulesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSchedulesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSchedulesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSchedulesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSchedulesRequest) MarshalJSON() ([]byte, error) { + pb, err := listSchedulesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } 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"` + // Wire name: 'next_page_token' + NextPageToken string - Schedules []Schedule `json:"schedules,omitempty"` + // Wire name: 'schedules' + Schedules []Schedule - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSchedulesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSchedulesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSchedulesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSchedulesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSchedulesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSchedulesResponse) MarshalJSON() ([]byte, error) { + pb, err := listSchedulesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List schedule subscriptions type ListSubscriptionsRequest struct { // UUID identifying the dashboard which the subscriptions belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // The number of subscriptions to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token, received from a previous `ListSubscriptions` call. Use this // to retrieve the subsequent page. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // UUID identifying the schedule which the subscriptions belongs. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSubscriptionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSubscriptionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSubscriptionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSubscriptionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSubscriptionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSubscriptionsRequest) MarshalJSON() ([]byte, error) { + pb, err := listSubscriptionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } 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"` + // Wire name: 'next_page_token' + NextPageToken string - Subscriptions []Subscription `json:"subscriptions,omitempty"` + // Wire name: 'subscriptions' + Subscriptions []Subscription - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSubscriptionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSubscriptionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSubscriptionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSubscriptionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + pb, err := listSubscriptionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MessageError struct { - Error string `json:"error,omitempty"` - Type MessageErrorType `json:"type,omitempty"` + // Wire name: 'error' + Error string + + // Wire name: 'type' + Type MessageErrorType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MessageError) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MessageError) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &messageErrorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := messageErrorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MessageError) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MessageError) MarshalJSON() ([]byte, error) { + pb, err := messageErrorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MessageErrorType string +type messageErrorTypePb string const MessageErrorTypeBlockMultipleExecutionsException MessageErrorType = `BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION` @@ -968,6 +2310,22 @@ func (f *MessageErrorType) Type() string { return "MessageErrorType" } +func messageErrorTypeToPb(st *MessageErrorType) (*messageErrorTypePb, error) { + if st == nil { + return nil, nil + } + pb := messageErrorTypePb(*st) + return &pb, nil +} + +func messageErrorTypeFromPb(pb *messageErrorTypePb) (*MessageErrorType, error) { + if pb == nil { + return nil, nil + } + st := MessageErrorType(*pb) + return &st, nil +} + // MessageStatus. The possible values are: * `FETCHING_METADATA`: Fetching // metadata from the data sources. * `FILTERING_CONTEXT`: Running smart context // step to determine relevant context. * `ASKING_AI`: Waiting for the LLM to @@ -985,6 +2343,7 @@ func (f *MessageErrorType) Type() string { // [executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) // API. * `CANCELLED`: Message has been cancelled. type MessageStatus string +type messageStatusPb string // Waiting for the LLM to respond to the user's question. const MessageStatusAskingAi MessageStatus = `ASKING_AI` @@ -1045,181 +2404,437 @@ func (f *MessageStatus) Type() string { return "MessageStatus" } +func messageStatusToPb(st *MessageStatus) (*messageStatusPb, error) { + if st == nil { + return nil, nil + } + pb := messageStatusPb(*st) + return &pb, nil +} + +func messageStatusFromPb(pb *messageStatusPb) (*MessageStatus, error) { + if pb == nil { + return nil, nil + } + st := MessageStatus(*pb) + return &st, nil +} + type MigrateDashboardRequest struct { // Display name for the new Lakeview dashboard. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // The workspace path of the folder to contain the migrated Lakeview // dashboard. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // UUID of the dashboard to be migrated. - SourceDashboardId string `json:"source_dashboard_id"` + // Wire name: 'source_dashboard_id' + SourceDashboardId string // Flag to indicate if mustache parameter syntax ({{ param }}) should be // auto-updated to named syntax (:param) when converting datasets in the // dashboard. - UpdateParameterSyntax bool `json:"update_parameter_syntax,omitempty"` + // Wire name: 'update_parameter_syntax' + UpdateParameterSyntax bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MigrateDashboardRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MigrateDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &migrateDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := migrateDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MigrateDashboardRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MigrateDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := migrateDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PendingStatus struct { // The token to poll for result asynchronously Example: // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ - DataToken string `json:"data_token"` + // Wire name: 'data_token' + DataToken string +} + +func (st *PendingStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pendingStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pendingStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PendingStatus) MarshalJSON() ([]byte, error) { + pb, err := pendingStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Poll the results for the a query for a published, embedded dashboard type PollPublishedQueryStatusRequest struct { - DashboardName string `json:"-" url:"dashboard_name"` - DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Wire name: 'dashboard_name' + DashboardName string `tf:"-"` + + // Wire name: 'dashboard_revision_id' + DashboardRevisionId string `tf:"-"` // Example: // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ - Tokens []string `json:"-" url:"tokens,omitempty"` + // Wire name: 'tokens' + Tokens []string `tf:"-"` +} + +func (st *PollPublishedQueryStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pollPublishedQueryStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pollPublishedQueryStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PollPublishedQueryStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := pollPublishedQueryStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PollQueryStatusResponse struct { - Data []PollQueryStatusResponseData `json:"data,omitempty"` + + // Wire name: 'data' + Data []PollQueryStatusResponseData +} + +func (st *PollQueryStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pollQueryStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pollQueryStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PollQueryStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := pollQueryStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PollQueryStatusResponseData struct { - Status QueryResponseStatus `json:"status"` + + // Wire name: 'status' + Status QueryResponseStatus +} + +func (st *PollQueryStatusResponseData) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pollQueryStatusResponseDataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pollQueryStatusResponseDataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PollQueryStatusResponseData) MarshalJSON() ([]byte, error) { + pb, err := pollQueryStatusResponseDataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PublishRequest struct { // UUID identifying the dashboard to be published. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // Flag to indicate if the publisher's credentials should be embedded in the // published dashboard. These embedded credentials will be used to execute // the published dashboard's queries. - EmbedCredentials bool `json:"embed_credentials,omitempty"` + // Wire name: 'embed_credentials' + EmbedCredentials bool // The ID of the warehouse that can be used to override the warehouse which // was set in the draft. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PublishRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PublishRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &publishRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := publishRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PublishRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PublishRequest) MarshalJSON() ([]byte, error) { + pb, err := publishRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PublishedDashboard struct { // The display name of the published dashboard. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Indicates whether credentials are embedded in the published dashboard. - EmbedCredentials bool `json:"embed_credentials,omitempty"` + // Wire name: 'embed_credentials' + EmbedCredentials bool // The timestamp of when the published dashboard was last revised. - RevisionCreateTime string `json:"revision_create_time,omitempty"` + // Wire name: 'revision_create_time' + RevisionCreateTime string // The warehouse ID used to run the published dashboard. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PublishedDashboard) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PublishedDashboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &publishedDashboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := publishedDashboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PublishedDashboard) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PublishedDashboard) MarshalJSON() ([]byte, error) { + pb, err := publishedDashboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryResponseStatus struct { // Represents an empty message, similar to google.protobuf.Empty, which is // not available in the firm right now. - Canceled *Empty `json:"canceled,omitempty"` + // Wire name: 'canceled' + Canceled *Empty // Represents an empty message, similar to google.protobuf.Empty, which is // not available in the firm right now. - Closed *Empty `json:"closed,omitempty"` + // Wire name: 'closed' + Closed *Empty - Pending *PendingStatus `json:"pending,omitempty"` + // Wire name: 'pending' + Pending *PendingStatus // The statement id in format(01eef5da-c56e-1f36-bafa-21906587d6ba) The // statement_id should be identical to data_token in SuccessStatus and // PendingStatus. This field is created for audit logging purpose to record // the statement_id of all QueryResponseStatus. - StatementId string `json:"statement_id,omitempty"` + // Wire name: 'statement_id' + StatementId string - Success *SuccessStatus `json:"success,omitempty"` + // Wire name: 'success' + Success *SuccessStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryResponseStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryResponseStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryResponseStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryResponseStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryResponseStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryResponseStatus) MarshalJSON() ([]byte, error) { + pb, err := queryResponseStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Result struct { // If result is truncated - IsTruncated bool `json:"is_truncated,omitempty"` + // Wire name: 'is_truncated' + IsTruncated bool // Row count of the result - RowCount int64 `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int64 // Statement Execution API statement id. Use [Get status, manifest, and // result first chunk](:method:statementexecution/getstatement) to get the // full result data. - StatementId string `json:"statement_id,omitempty"` + // Wire name: 'statement_id' + StatementId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Result) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Result) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Result) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Result) MarshalJSON() ([]byte, error) { + pb, err := resultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Schedule struct { // A timestamp indicating when the schedule was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // The cron expression describing the frequency of the periodic refresh for // this schedule. - CronSchedule CronSchedule `json:"cron_schedule"` + // Wire name: 'cron_schedule' + CronSchedule CronSchedule // UUID identifying the dashboard to which the schedule belongs. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The display name for schedule. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // 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"` + // Wire name: 'etag' + Etag string // The status indicates whether this schedule is paused or not. - PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus SchedulePauseStatus // UUID identifying the schedule. - ScheduleId string `json:"schedule_id,omitempty"` + // Wire name: 'schedule_id' + ScheduleId string // A timestamp indicating when the schedule was last updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // The warehouse id to run the dashboard with for the schedule. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Schedule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Schedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &schedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := scheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Schedule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Schedule) MarshalJSON() ([]byte, error) { + pb, err := scheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SchedulePauseStatus string +type schedulePauseStatusPb string const SchedulePauseStatusPaused SchedulePauseStatus = `PAUSED` @@ -1246,125 +2861,495 @@ func (f *SchedulePauseStatus) Type() string { return "SchedulePauseStatus" } +func schedulePauseStatusToPb(st *SchedulePauseStatus) (*schedulePauseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := schedulePauseStatusPb(*st) + return &pb, nil +} + +func schedulePauseStatusFromPb(pb *schedulePauseStatusPb) (*SchedulePauseStatus, error) { + if pb == nil { + return nil, nil + } + st := SchedulePauseStatus(*pb) + return &st, nil +} + type Subscriber struct { // The destination to receive the subscription email. This parameter is // mutually exclusive with `user_subscriber`. - DestinationSubscriber *SubscriptionSubscriberDestination `json:"destination_subscriber,omitempty"` + // Wire name: 'destination_subscriber' + DestinationSubscriber *SubscriptionSubscriberDestination // The user to receive the subscription email. This parameter is mutually // exclusive with `destination_subscriber`. - UserSubscriber *SubscriptionSubscriberUser `json:"user_subscriber,omitempty"` + // Wire name: 'user_subscriber' + UserSubscriber *SubscriptionSubscriberUser +} + +func (st *Subscriber) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriberPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriberFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Subscriber) MarshalJSON() ([]byte, error) { + pb, err := subscriberToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Subscription struct { // A timestamp indicating when the subscription was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // UserId of the user who adds subscribers (users or notification // destinations) to the dashboard's schedule. - CreatedByUserId int64 `json:"created_by_user_id,omitempty"` + // Wire name: 'created_by_user_id' + CreatedByUserId int64 // UUID identifying the dashboard to which the subscription belongs. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // 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"` + // Wire name: 'etag' + Etag string // UUID identifying the schedule to which the subscription belongs. - ScheduleId string `json:"schedule_id,omitempty"` + // Wire name: 'schedule_id' + ScheduleId string // Subscriber details for users and destinations to be added as subscribers // to the schedule. - Subscriber Subscriber `json:"subscriber"` + // Wire name: 'subscriber' + Subscriber Subscriber // UUID identifying the subscription. - SubscriptionId string `json:"subscription_id,omitempty"` + // Wire name: 'subscription_id' + SubscriptionId string // A timestamp indicating when the subscription was last updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Subscription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Subscription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Subscription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Subscription) MarshalJSON() ([]byte, error) { + pb, err := subscriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SubscriptionSubscriberDestination struct { // The canonical identifier of the destination to receive email // notification. - DestinationId string `json:"destination_id"` + // Wire name: 'destination_id' + DestinationId string +} + +func (st *SubscriptionSubscriberDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriptionSubscriberDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriptionSubscriberDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SubscriptionSubscriberDestination) MarshalJSON() ([]byte, error) { + pb, err := subscriptionSubscriberDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SubscriptionSubscriberUser struct { // UserId of the subscriber. - UserId int64 `json:"user_id"` + // Wire name: 'user_id' + UserId int64 +} + +func (st *SubscriptionSubscriberUser) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriptionSubscriberUserPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriptionSubscriberUserFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SubscriptionSubscriberUser) MarshalJSON() ([]byte, error) { + pb, err := subscriptionSubscriberUserToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SuccessStatus struct { // The token to poll for result asynchronously Example: // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ - DataToken string `json:"data_token"` + // Wire name: 'data_token' + DataToken string // Whether the query result is truncated (either by byte limit or row limit) - Truncated bool `json:"truncated,omitempty"` + // Wire name: 'truncated' + Truncated bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SuccessStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SuccessStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &successStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := successStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SuccessStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SuccessStatus) MarshalJSON() ([]byte, error) { + pb, err := successStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TextAttachment struct { // AI generated message - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TextAttachment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TextAttachment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &textAttachmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := textAttachmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TextAttachment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TextAttachment) MarshalJSON() ([]byte, error) { + pb, err := textAttachmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Trash dashboard type TrashDashboardRequest struct { // UUID identifying the dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *TrashDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trashDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trashDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrashDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := trashDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TrashDashboardResponse struct { } +func (st *TrashDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trashDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trashDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrashDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := trashDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Unpublish dashboard type UnpublishDashboardRequest struct { // UUID identifying the published dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *UnpublishDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unpublishDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unpublishDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnpublishDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := unpublishDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UnpublishDashboardResponse struct { } +func (st *UnpublishDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &unpublishDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := unpublishDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UnpublishDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := unpublishDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Update dashboard type UpdateDashboardRequest struct { - Dashboard Dashboard `json:"dashboard"` + + // Wire name: 'dashboard' + Dashboard Dashboard // UUID identifying the dashboard. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *UpdateDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update dashboard schedule type UpdateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId string `json:"-" url:"-"` + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` - Schedule Schedule `json:"schedule"` + // Wire name: 'schedule' + Schedule Schedule // UUID identifying the schedule. - ScheduleId string `json:"-" url:"-"` + // Wire name: 'schedule_id' + ScheduleId string `tf:"-"` +} + +func (st *UpdateScheduleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateScheduleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateScheduleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateScheduleRequest) MarshalJSON() ([]byte, error) { + pb, err := updateScheduleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/files/impl.go b/service/files/impl.go index 85b5ae279..0adc8b4e5 100755 --- a/service/files/impl.go +++ b/service/files/impl.go @@ -20,57 +20,155 @@ type dbfsImpl struct { } func (a *dbfsImpl) AddBlock(ctx context.Context, request AddBlock) error { - var addBlockResponse AddBlockResponse + + requestPb, pbErr := addBlockToPb(&request) + if pbErr != nil { + return pbErr + } + + var addBlockResponsePb addBlockResponsePb path := "/api/2.0/dbfs/add-block" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addBlockResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &addBlockResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) Close(ctx context.Context, request Close) error { - var closeResponse CloseResponse + + requestPb, pbErr := closeToPb(&request) + if pbErr != nil { + return pbErr + } + + var closeResponsePb closeResponsePb path := "/api/2.0/dbfs/close" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &closeResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &closeResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) Create(ctx context.Context, request Create) (*CreateResponse, error) { - var createResponse CreateResponse + + requestPb, pbErr := createToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createResponsePb createResponsePb path := "/api/2.0/dbfs/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) - return &createResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createResponseFromPb(&createResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dbfsImpl) Delete(ctx context.Context, request Delete) error { - var deleteResponse DeleteResponse + + requestPb, pbErr := deleteToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb path := "/api/2.0/dbfs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*FileInfo, error) { - var fileInfo FileInfo + + requestPb, pbErr := getStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var fileInfoPb fileInfoPb path := "/api/2.0/dbfs/get-status" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &fileInfo) - return &fileInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &fileInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := fileInfoFromPb(&fileInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List directory contents or file details. @@ -123,56 +221,154 @@ func (a *dbfsImpl) ListAll(ctx context.Context, request ListDbfsRequest) ([]File } func (a *dbfsImpl) internalList(ctx context.Context, request ListDbfsRequest) (*ListStatusResponse, error) { - var listStatusResponse ListStatusResponse + + requestPb, pbErr := listDbfsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listStatusResponsePb listStatusResponsePb path := "/api/2.0/dbfs/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listStatusResponse) - return &listStatusResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listStatusResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listStatusResponseFromPb(&listStatusResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dbfsImpl) Mkdirs(ctx context.Context, request MkDirs) error { - var mkDirsResponse MkDirsResponse + + requestPb, pbErr := mkDirsToPb(&request) + if pbErr != nil { + return pbErr + } + + var mkDirsResponsePb mkDirsResponsePb path := "/api/2.0/dbfs/mkdirs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkDirsResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &mkDirsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) Move(ctx context.Context, request Move) error { - var moveResponse MoveResponse + + requestPb, pbErr := moveToPb(&request) + if pbErr != nil { + return pbErr + } + + var moveResponsePb moveResponsePb path := "/api/2.0/dbfs/move" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &moveResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &moveResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) Put(ctx context.Context, request Put) error { - var putResponse PutResponse + + requestPb, pbErr := putToPb(&request) + if pbErr != nil { + return pbErr + } + + var putResponsePb putResponsePb path := "/api/2.0/dbfs/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &putResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dbfsImpl) Read(ctx context.Context, request ReadDbfsRequest) (*ReadResponse, error) { - var readResponse ReadResponse + + requestPb, pbErr := readDbfsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var readResponsePb readResponsePb path := "/api/2.0/dbfs/read" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &readResponse) - return &readResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &readResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := readResponseFromPb(&readResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Files API methods @@ -181,58 +377,174 @@ type filesImpl struct { } func (a *filesImpl) CreateDirectory(ctx context.Context, request CreateDirectoryRequest) error { - var createDirectoryResponse CreateDirectoryResponse - path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + + requestPb, pbErr := createDirectoryRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var createDirectoryResponsePb createDirectoryResponsePb + path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, &createDirectoryResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + nil, + &createDirectoryResponsePb, + ) + if err != nil { + return err + } + return err } func (a *filesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + + requestPb, pbErr := deleteFileRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.FilePath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *filesImpl) DeleteDirectory(ctx context.Context, request DeleteDirectoryRequest) error { - var deleteDirectoryResponse DeleteDirectoryResponse - path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + + requestPb, pbErr := deleteDirectoryRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteDirectoryResponsePb deleteDirectoryResponsePb + path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDirectoryResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDirectoryResponsePb, + ) + if err != nil { + return err + } + return err } func (a *filesImpl) Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) { - var downloadResponse DownloadResponse - path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + + requestPb, pbErr := downloadRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var downloadResponsePb downloadResponsePb + path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.FilePath)) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/octet-stream" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &downloadResponse) - return &downloadResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &downloadResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := downloadResponseFromPb(&downloadResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *filesImpl) GetDirectoryMetadata(ctx context.Context, request GetDirectoryMetadataRequest) error { - var getDirectoryMetadataResponse GetDirectoryMetadataResponse - path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + + requestPb, pbErr := getDirectoryMetadataRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var getDirectoryMetadataResponsePb getDirectoryMetadataResponsePb + path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, &getDirectoryMetadataResponse) + err := a.client.Do( + ctx, + http.MethodHead, + path, + headers, + queryParams, + (*requestPb), + &getDirectoryMetadataResponsePb, + ) + if err != nil { + return err + } + return err } func (a *filesImpl) GetMetadata(ctx context.Context, request GetMetadataRequest) (*GetMetadataResponse, error) { - var getMetadataResponse GetMetadataResponse - path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + + requestPb, pbErr := getMetadataRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getMetadataResponsePb getMetadataResponsePb + path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.FilePath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, &getMetadataResponse) - return &getMetadataResponse, err + err := a.client.Do( + ctx, + http.MethodHead, + path, + headers, + queryParams, + (*requestPb), + &getMetadataResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getMetadataResponseFromPb(&getMetadataResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List directory contents. @@ -273,24 +585,64 @@ func (a *filesImpl) ListDirectoryContentsAll(ctx context.Context, request ListDi } func (a *filesImpl) internalListDirectoryContents(ctx context.Context, request ListDirectoryContentsRequest) (*ListDirectoryResponse, error) { - var listDirectoryResponse ListDirectoryResponse - path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + + requestPb, pbErr := listDirectoryContentsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listDirectoryResponsePb listDirectoryResponsePb + path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDirectoryResponse) - return &listDirectoryResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listDirectoryResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listDirectoryResponseFromPb(&listDirectoryResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *filesImpl) Upload(ctx context.Context, request UploadRequest) error { - var uploadResponse UploadResponse - path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + + requestPb, pbErr := uploadRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var uploadResponsePb uploadResponsePb + path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(requestPb.FilePath)) queryParams := make(map[string]any) - if request.Overwrite != false || slices.Contains(request.ForceSendFields, "Overwrite") { - queryParams["overwrite"] = request.Overwrite + if requestPb.Overwrite != false || slices.Contains(requestPb.ForceSendFields, "Overwrite") { + queryParams["overwrite"] = requestPb.Overwrite } headers := make(map[string]string) headers["Content-Type"] = "application/octet-stream" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Contents, &uploadResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb).Contents, + &uploadResponsePb, + ) + if err != nil { + return err + } + return err } diff --git a/service/files/internal.go b/service/files/internal.go new file mode 100755 index 000000000..ff0b76937 --- /dev/null +++ b/service/files/internal.go @@ -0,0 +1,1129 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package files + +import ( + "io" + + "github.com/databricks/databricks-sdk-go/marshal" +) + +func addBlockToPb(st *AddBlock) (*addBlockPb, error) { + if st == nil { + return nil, nil + } + pb := &addBlockPb{} + pb.Data = st.Data + + pb.Handle = st.Handle + + return pb, nil +} + +type addBlockPb struct { + Data string `json:"data"` + + Handle int64 `json:"handle"` +} + +func addBlockFromPb(pb *addBlockPb) (*AddBlock, error) { + if pb == nil { + return nil, nil + } + st := &AddBlock{} + st.Data = pb.Data + st.Handle = pb.Handle + + return st, nil +} + +func addBlockResponseToPb(st *AddBlockResponse) (*addBlockResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &addBlockResponsePb{} + + return pb, nil +} + +type addBlockResponsePb struct { +} + +func addBlockResponseFromPb(pb *addBlockResponsePb) (*AddBlockResponse, error) { + if pb == nil { + return nil, nil + } + st := &AddBlockResponse{} + + return st, nil +} + +func closeToPb(st *Close) (*closePb, error) { + if st == nil { + return nil, nil + } + pb := &closePb{} + pb.Handle = st.Handle + + return pb, nil +} + +type closePb struct { + Handle int64 `json:"handle"` +} + +func closeFromPb(pb *closePb) (*Close, error) { + if pb == nil { + return nil, nil + } + st := &Close{} + st.Handle = pb.Handle + + return st, nil +} + +func closeResponseToPb(st *CloseResponse) (*closeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &closeResponsePb{} + + return pb, nil +} + +type closeResponsePb struct { +} + +func closeResponseFromPb(pb *closeResponsePb) (*CloseResponse, error) { + if pb == nil { + return nil, nil + } + st := &CloseResponse{} + + return st, nil +} + +func createToPb(st *Create) (*createPb, error) { + if st == nil { + return nil, nil + } + pb := &createPb{} + pb.Overwrite = st.Overwrite + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPb struct { + Overwrite bool `json:"overwrite,omitempty"` + + Path string `json:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createFromPb(pb *createPb) (*Create, error) { + if pb == nil { + return nil, nil + } + st := &Create{} + st.Overwrite = pb.Overwrite + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createDirectoryRequestToPb(st *CreateDirectoryRequest) (*createDirectoryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createDirectoryRequestPb{} + pb.DirectoryPath = st.DirectoryPath + + return pb, nil +} + +type createDirectoryRequestPb struct { + DirectoryPath string `json:"-" url:"-"` +} + +func createDirectoryRequestFromPb(pb *createDirectoryRequestPb) (*CreateDirectoryRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateDirectoryRequest{} + st.DirectoryPath = pb.DirectoryPath + + return st, nil +} + +func createDirectoryResponseToPb(st *CreateDirectoryResponse) (*createDirectoryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createDirectoryResponsePb{} + + return pb, nil +} + +type createDirectoryResponsePb struct { +} + +func createDirectoryResponseFromPb(pb *createDirectoryResponsePb) (*CreateDirectoryResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateDirectoryResponse{} + + return st, nil +} + +func createResponseToPb(st *CreateResponse) (*createResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createResponsePb{} + pb.Handle = st.Handle + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createResponsePb struct { + Handle int64 `json:"handle,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createResponseFromPb(pb *createResponsePb) (*CreateResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateResponse{} + st.Handle = pb.Handle + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteToPb(st *Delete) (*deletePb, error) { + if st == nil { + return nil, nil + } + pb := &deletePb{} + pb.Path = st.Path + + pb.Recursive = st.Recursive + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deletePb struct { + Path string `json:"path"` + + Recursive bool `json:"recursive,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteFromPb(pb *deletePb) (*Delete, error) { + if pb == nil { + return nil, nil + } + st := &Delete{} + st.Path = pb.Path + st.Recursive = pb.Recursive + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deletePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deletePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDirectoryRequestToPb(st *DeleteDirectoryRequest) (*deleteDirectoryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDirectoryRequestPb{} + pb.DirectoryPath = st.DirectoryPath + + return pb, nil +} + +type deleteDirectoryRequestPb struct { + DirectoryPath string `json:"-" url:"-"` +} + +func deleteDirectoryRequestFromPb(pb *deleteDirectoryRequestPb) (*DeleteDirectoryRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDirectoryRequest{} + st.DirectoryPath = pb.DirectoryPath + + return st, nil +} + +func deleteDirectoryResponseToPb(st *DeleteDirectoryResponse) (*deleteDirectoryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDirectoryResponsePb{} + + return pb, nil +} + +type deleteDirectoryResponsePb struct { +} + +func deleteDirectoryResponseFromPb(pb *deleteDirectoryResponsePb) (*DeleteDirectoryResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDirectoryResponse{} + + return st, nil +} + +func deleteFileRequestToPb(st *DeleteFileRequest) (*deleteFileRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteFileRequestPb{} + pb.FilePath = st.FilePath + + return pb, nil +} + +type deleteFileRequestPb struct { + FilePath string `json:"-" url:"-"` +} + +func deleteFileRequestFromPb(pb *deleteFileRequestPb) (*DeleteFileRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteFileRequest{} + st.FilePath = pb.FilePath + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func directoryEntryToPb(st *DirectoryEntry) (*directoryEntryPb, error) { + if st == nil { + return nil, nil + } + pb := &directoryEntryPb{} + pb.FileSize = st.FileSize + + pb.IsDirectory = st.IsDirectory + + pb.LastModified = st.LastModified + + pb.Name = st.Name + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type directoryEntryPb struct { + FileSize int64 `json:"file_size,omitempty"` + + IsDirectory bool `json:"is_directory,omitempty"` + + LastModified int64 `json:"last_modified,omitempty"` + + Name string `json:"name,omitempty"` + + Path string `json:"path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func directoryEntryFromPb(pb *directoryEntryPb) (*DirectoryEntry, error) { + if pb == nil { + return nil, nil + } + st := &DirectoryEntry{} + st.FileSize = pb.FileSize + st.IsDirectory = pb.IsDirectory + st.LastModified = pb.LastModified + st.Name = pb.Name + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *directoryEntryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st directoryEntryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func downloadRequestToPb(st *DownloadRequest) (*downloadRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &downloadRequestPb{} + pb.FilePath = st.FilePath + + return pb, nil +} + +type downloadRequestPb struct { + FilePath string `json:"-" url:"-"` +} + +func downloadRequestFromPb(pb *downloadRequestPb) (*DownloadRequest, error) { + if pb == nil { + return nil, nil + } + st := &DownloadRequest{} + st.FilePath = pb.FilePath + + return st, nil +} + +func downloadResponseToPb(st *DownloadResponse) (*downloadResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &downloadResponsePb{} + pb.ContentLength = st.ContentLength + + pb.ContentType = st.ContentType + + pb.Contents = st.Contents + + pb.LastModified = st.LastModified + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type downloadResponsePb struct { + ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + + ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + + Contents io.ReadCloser `json:"-"` + + LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func downloadResponseFromPb(pb *downloadResponsePb) (*DownloadResponse, error) { + if pb == nil { + return nil, nil + } + st := &DownloadResponse{} + st.ContentLength = pb.ContentLength + st.ContentType = pb.ContentType + st.Contents = pb.Contents + st.LastModified = pb.LastModified + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *downloadResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st downloadResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &fileInfoPb{} + pb.FileSize = st.FileSize + + pb.IsDir = st.IsDir + + pb.ModificationTime = st.ModificationTime + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileInfoPb struct { + FileSize int64 `json:"file_size,omitempty"` + + IsDir bool `json:"is_dir,omitempty"` + + ModificationTime int64 `json:"modification_time,omitempty"` + + Path string `json:"path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileInfoFromPb(pb *fileInfoPb) (*FileInfo, error) { + if pb == nil { + return nil, nil + } + st := &FileInfo{} + st.FileSize = pb.FileSize + st.IsDir = pb.IsDir + st.ModificationTime = pb.ModificationTime + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getDirectoryMetadataRequestToPb(st *GetDirectoryMetadataRequest) (*getDirectoryMetadataRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDirectoryMetadataRequestPb{} + pb.DirectoryPath = st.DirectoryPath + + return pb, nil +} + +type getDirectoryMetadataRequestPb struct { + DirectoryPath string `json:"-" url:"-"` +} + +func getDirectoryMetadataRequestFromPb(pb *getDirectoryMetadataRequestPb) (*GetDirectoryMetadataRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDirectoryMetadataRequest{} + st.DirectoryPath = pb.DirectoryPath + + return st, nil +} + +func getDirectoryMetadataResponseToPb(st *GetDirectoryMetadataResponse) (*getDirectoryMetadataResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getDirectoryMetadataResponsePb{} + + return pb, nil +} + +type getDirectoryMetadataResponsePb struct { +} + +func getDirectoryMetadataResponseFromPb(pb *getDirectoryMetadataResponsePb) (*GetDirectoryMetadataResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetDirectoryMetadataResponse{} + + return st, nil +} + +func getMetadataRequestToPb(st *GetMetadataRequest) (*getMetadataRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getMetadataRequestPb{} + pb.FilePath = st.FilePath + + return pb, nil +} + +type getMetadataRequestPb struct { + FilePath string `json:"-" url:"-"` +} + +func getMetadataRequestFromPb(pb *getMetadataRequestPb) (*GetMetadataRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetMetadataRequest{} + st.FilePath = pb.FilePath + + return st, nil +} + +func getMetadataResponseToPb(st *GetMetadataResponse) (*getMetadataResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getMetadataResponsePb{} + pb.ContentLength = st.ContentLength + + pb.ContentType = st.ContentType + + pb.LastModified = st.LastModified + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getMetadataResponsePb struct { + ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + + ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + + LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getMetadataResponseFromPb(pb *getMetadataResponsePb) (*GetMetadataResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetMetadataResponse{} + st.ContentLength = pb.ContentLength + st.ContentType = pb.ContentType + st.LastModified = pb.LastModified + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getMetadataResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getMetadataResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getStatusRequestToPb(st *GetStatusRequest) (*getStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStatusRequestPb{} + pb.Path = st.Path + + return pb, nil +} + +type getStatusRequestPb struct { + Path string `json:"-" url:"path"` +} + +func getStatusRequestFromPb(pb *getStatusRequestPb) (*GetStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStatusRequest{} + st.Path = pb.Path + + return st, nil +} + +func listDbfsRequestToPb(st *ListDbfsRequest) (*listDbfsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listDbfsRequestPb{} + pb.Path = st.Path + + return pb, nil +} + +type listDbfsRequestPb struct { + Path string `json:"-" url:"path"` +} + +func listDbfsRequestFromPb(pb *listDbfsRequestPb) (*ListDbfsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListDbfsRequest{} + st.Path = pb.Path + + return st, nil +} + +func listDirectoryContentsRequestToPb(st *ListDirectoryContentsRequest) (*listDirectoryContentsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listDirectoryContentsRequestPb{} + pb.DirectoryPath = st.DirectoryPath + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDirectoryContentsRequestPb struct { + DirectoryPath string `json:"-" url:"-"` + + PageSize int64 `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDirectoryContentsRequestFromPb(pb *listDirectoryContentsRequestPb) (*ListDirectoryContentsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListDirectoryContentsRequest{} + st.DirectoryPath = pb.DirectoryPath + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDirectoryContentsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDirectoryContentsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listDirectoryResponseToPb(st *ListDirectoryResponse) (*listDirectoryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listDirectoryResponsePb{} + pb.Contents = st.Contents + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDirectoryResponsePb struct { + Contents []DirectoryEntry `json:"contents,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDirectoryResponseFromPb(pb *listDirectoryResponsePb) (*ListDirectoryResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListDirectoryResponse{} + st.Contents = pb.Contents + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDirectoryResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDirectoryResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listStatusResponseToPb(st *ListStatusResponse) (*listStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listStatusResponsePb{} + pb.Files = st.Files + + return pb, nil +} + +type listStatusResponsePb struct { + Files []FileInfo `json:"files,omitempty"` +} + +func listStatusResponseFromPb(pb *listStatusResponsePb) (*ListStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListStatusResponse{} + st.Files = pb.Files + + return st, nil +} + +func mkDirsToPb(st *MkDirs) (*mkDirsPb, error) { + if st == nil { + return nil, nil + } + pb := &mkDirsPb{} + pb.Path = st.Path + + return pb, nil +} + +type mkDirsPb struct { + Path string `json:"path"` +} + +func mkDirsFromPb(pb *mkDirsPb) (*MkDirs, error) { + if pb == nil { + return nil, nil + } + st := &MkDirs{} + st.Path = pb.Path + + return st, nil +} + +func mkDirsResponseToPb(st *MkDirsResponse) (*mkDirsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &mkDirsResponsePb{} + + return pb, nil +} + +type mkDirsResponsePb struct { +} + +func mkDirsResponseFromPb(pb *mkDirsResponsePb) (*MkDirsResponse, error) { + if pb == nil { + return nil, nil + } + st := &MkDirsResponse{} + + return st, nil +} + +func moveToPb(st *Move) (*movePb, error) { + if st == nil { + return nil, nil + } + pb := &movePb{} + pb.DestinationPath = st.DestinationPath + + pb.SourcePath = st.SourcePath + + return pb, nil +} + +type movePb struct { + DestinationPath string `json:"destination_path"` + + SourcePath string `json:"source_path"` +} + +func moveFromPb(pb *movePb) (*Move, error) { + if pb == nil { + return nil, nil + } + st := &Move{} + st.DestinationPath = pb.DestinationPath + st.SourcePath = pb.SourcePath + + return st, nil +} + +func moveResponseToPb(st *MoveResponse) (*moveResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &moveResponsePb{} + + return pb, nil +} + +type moveResponsePb struct { +} + +func moveResponseFromPb(pb *moveResponsePb) (*MoveResponse, error) { + if pb == nil { + return nil, nil + } + st := &MoveResponse{} + + return st, nil +} + +func putToPb(st *Put) (*putPb, error) { + if st == nil { + return nil, nil + } + pb := &putPb{} + pb.Contents = st.Contents + + pb.Overwrite = st.Overwrite + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type putPb struct { + Contents string `json:"contents,omitempty"` + + Overwrite bool `json:"overwrite,omitempty"` + + Path string `json:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func putFromPb(pb *putPb) (*Put, error) { + if pb == nil { + return nil, nil + } + st := &Put{} + st.Contents = pb.Contents + st.Overwrite = pb.Overwrite + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *putPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st putPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func putResponseToPb(st *PutResponse) (*putResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &putResponsePb{} + + return pb, nil +} + +type putResponsePb struct { +} + +func putResponseFromPb(pb *putResponsePb) (*PutResponse, error) { + if pb == nil { + return nil, nil + } + st := &PutResponse{} + + return st, nil +} + +func readDbfsRequestToPb(st *ReadDbfsRequest) (*readDbfsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &readDbfsRequestPb{} + pb.Length = st.Length + + pb.Offset = st.Offset + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type readDbfsRequestPb struct { + Length int64 `json:"-" url:"length,omitempty"` + + Offset int64 `json:"-" url:"offset,omitempty"` + + Path string `json:"-" url:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func readDbfsRequestFromPb(pb *readDbfsRequestPb) (*ReadDbfsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ReadDbfsRequest{} + st.Length = pb.Length + st.Offset = pb.Offset + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *readDbfsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st readDbfsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func readResponseToPb(st *ReadResponse) (*readResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &readResponsePb{} + pb.BytesRead = st.BytesRead + + pb.Data = st.Data + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type readResponsePb struct { + BytesRead int64 `json:"bytes_read,omitempty"` + + Data string `json:"data,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func readResponseFromPb(pb *readResponsePb) (*ReadResponse, error) { + if pb == nil { + return nil, nil + } + st := &ReadResponse{} + st.BytesRead = pb.BytesRead + st.Data = pb.Data + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *readResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st readResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func uploadRequestToPb(st *UploadRequest) (*uploadRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &uploadRequestPb{} + pb.Contents = st.Contents + + pb.FilePath = st.FilePath + + pb.Overwrite = st.Overwrite + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type uploadRequestPb struct { + Contents io.ReadCloser `json:"-"` + + FilePath string `json:"-" url:"-"` + + Overwrite bool `json:"-" url:"overwrite,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func uploadRequestFromPb(pb *uploadRequestPb) (*UploadRequest, error) { + if pb == nil { + return nil, nil + } + st := &UploadRequest{} + st.Contents = pb.Contents + st.FilePath = pb.FilePath + st.Overwrite = pb.Overwrite + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *uploadRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st uploadRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func uploadResponseToPb(st *UploadResponse) (*uploadResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &uploadResponsePb{} + + return pb, nil +} + +type uploadResponsePb struct { +} + +func uploadResponseFromPb(pb *uploadResponsePb) (*UploadResponse, error) { + if pb == nil { + return nil, nil + } + st := &UploadResponse{} + + return st, nil +} diff --git a/service/files/model.go b/service/files/model.go index 3c406ade5..6196bd786 100755 --- a/service/files/model.go +++ b/service/files/model.go @@ -3,233 +3,787 @@ package files import ( + "encoding/json" + "fmt" "io" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AddBlock struct { // The base64-encoded data to append to the stream. This has a limit of 1 // MB. - Data string `json:"data"` + // Wire name: 'data' + Data string // The handle on an open stream. - Handle int64 `json:"handle"` + // Wire name: 'handle' + Handle int64 +} + +func (st *AddBlock) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addBlockPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addBlockFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AddBlock) MarshalJSON() ([]byte, error) { + pb, err := addBlockToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AddBlockResponse struct { } +func (st *AddBlockResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addBlockResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addBlockResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AddBlockResponse) MarshalJSON() ([]byte, error) { + pb, err := addBlockResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Close struct { // The handle on an open stream. - Handle int64 `json:"handle"` + // Wire name: 'handle' + Handle int64 +} + +func (st *Close) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &closePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := closeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Close) MarshalJSON() ([]byte, error) { + pb, err := closeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CloseResponse struct { } +func (st *CloseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &closeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := closeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CloseResponse) MarshalJSON() ([]byte, error) { + pb, err := closeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Create struct { // The flag that specifies whether to overwrite existing file/files. - Overwrite bool `json:"overwrite,omitempty"` + // Wire name: 'overwrite' + Overwrite bool // The path of the new file. The path should be the absolute DBFS path. - Path string `json:"path"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Create) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Create) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Create) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Create) MarshalJSON() ([]byte, error) { + pb, err := createToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a directory type CreateDirectoryRequest struct { // The absolute path of a directory. - DirectoryPath string `json:"-" url:"-"` + // Wire name: 'directory_path' + DirectoryPath string `tf:"-"` +} + +func (st *CreateDirectoryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDirectoryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDirectoryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDirectoryRequest) MarshalJSON() ([]byte, error) { + pb, err := createDirectoryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateDirectoryResponse struct { } +func (st *CreateDirectoryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createDirectoryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createDirectoryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateDirectoryResponse) MarshalJSON() ([]byte, error) { + pb, err := createDirectoryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type CreateResponse struct { // Handle which should subsequently be passed into the AddBlock and Close // calls when writing to a file through a stream. - Handle int64 `json:"handle,omitempty"` + // Wire name: 'handle' + Handle int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateResponse) MarshalJSON() ([]byte, error) { + pb, err := createResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Delete struct { // The path of the file or directory to delete. The path should be the // absolute DBFS path. - Path string `json:"path"` + // Wire name: 'path' + Path string // Whether or not to recursively delete the directory's contents. Deleting // empty directories can be done without providing the recursive flag. - Recursive bool `json:"recursive,omitempty"` + // Wire name: 'recursive' + Recursive bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Delete) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Delete) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Delete) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Delete) MarshalJSON() ([]byte, error) { + pb, err := deleteToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a directory type DeleteDirectoryRequest struct { // The absolute path of a directory. - DirectoryPath string `json:"-" url:"-"` + // Wire name: 'directory_path' + DirectoryPath string `tf:"-"` +} + +func (st *DeleteDirectoryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDirectoryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDirectoryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDirectoryRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDirectoryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDirectoryResponse struct { } +func (st *DeleteDirectoryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDirectoryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDirectoryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDirectoryResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDirectoryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a file type DeleteFileRequest struct { // The absolute path of the file. - FilePath string `json:"-" url:"-"` + // Wire name: 'file_path' + FilePath string `tf:"-"` +} + +func (st *DeleteFileRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteFileRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFileRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteFileRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteFileRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DirectoryEntry struct { // The length of the file in bytes. This field is omitted for directories. - FileSize int64 `json:"file_size,omitempty"` + // Wire name: 'file_size' + FileSize int64 // True if the path is a directory. - IsDirectory bool `json:"is_directory,omitempty"` + // Wire name: 'is_directory' + IsDirectory bool // Last modification time of given file in milliseconds since unix epoch. - LastModified int64 `json:"last_modified,omitempty"` + // Wire name: 'last_modified' + LastModified int64 // The name of the file or directory. This is the last component of the // path. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The absolute path of the file or directory. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DirectoryEntry) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DirectoryEntry) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &directoryEntryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := directoryEntryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DirectoryEntry) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DirectoryEntry) MarshalJSON() ([]byte, error) { + pb, err := directoryEntryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Download a file type DownloadRequest struct { // The absolute path of the file. - FilePath string `json:"-" url:"-"` + // Wire name: 'file_path' + FilePath string `tf:"-"` +} + +func (st *DownloadRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &downloadRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := downloadRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DownloadRequest) MarshalJSON() ([]byte, error) { + pb, err := downloadRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DownloadResponse struct { // The length of the HTTP response body in bytes. - ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + // Wire name: 'content-length' + ContentLength int64 `tf:"-"` - ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + // Wire name: 'content-type' + ContentType string `tf:"-"` - Contents io.ReadCloser `json:"-"` + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` // The last modified time of the file in HTTP-date (RFC 7231) format. - LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + // Wire name: 'last-modified' + LastModified string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DownloadResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DownloadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &downloadResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := downloadResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DownloadResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DownloadResponse) MarshalJSON() ([]byte, error) { + pb, err := downloadResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileInfo struct { // The length of the file in bytes. This field is omitted for directories. - FileSize int64 `json:"file_size,omitempty"` + // Wire name: 'file_size' + FileSize int64 // True if the path is a directory. - IsDir bool `json:"is_dir,omitempty"` + // Wire name: 'is_dir' + IsDir bool // Last modification time of given file in milliseconds since epoch. - ModificationTime int64 `json:"modification_time,omitempty"` + // Wire name: 'modification_time' + ModificationTime int64 // The absolute path of the file or directory. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileInfo) MarshalJSON() ([]byte, error) { + pb, err := fileInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get directory metadata type GetDirectoryMetadataRequest struct { // The absolute path of a directory. - DirectoryPath string `json:"-" url:"-"` + // Wire name: 'directory_path' + DirectoryPath string `tf:"-"` +} + +func (st *GetDirectoryMetadataRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDirectoryMetadataRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDirectoryMetadataRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDirectoryMetadataRequest) MarshalJSON() ([]byte, error) { + pb, err := getDirectoryMetadataRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetDirectoryMetadataResponse struct { } +func (st *GetDirectoryMetadataResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDirectoryMetadataResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDirectoryMetadataResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDirectoryMetadataResponse) MarshalJSON() ([]byte, error) { + pb, err := getDirectoryMetadataResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get file metadata type GetMetadataRequest struct { // The absolute path of the file. - FilePath string `json:"-" url:"-"` + // Wire name: 'file_path' + FilePath string `tf:"-"` +} + +func (st *GetMetadataRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getMetadataRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getMetadataRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetMetadataRequest) MarshalJSON() ([]byte, error) { + pb, err := getMetadataRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetMetadataResponse struct { // The length of the HTTP response body in bytes. - ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + // Wire name: 'content-length' + ContentLength int64 `tf:"-"` - ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + // Wire name: 'content-type' + ContentType string `tf:"-"` // The last modified time of the file in HTTP-date (RFC 7231) format. - LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + // Wire name: 'last-modified' + LastModified string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetMetadataResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetMetadataResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getMetadataResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getMetadataResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetMetadataResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetMetadataResponse) MarshalJSON() ([]byte, error) { + pb, err := getMetadataResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the information of a file or directory type GetStatusRequest struct { // The path of the file or directory. The path should be the absolute DBFS // path. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` +} + +func (st *GetStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := getStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List directory contents or file details type ListDbfsRequest struct { // The path of the file or directory. The path should be the absolute DBFS // path. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` +} + +func (st *ListDbfsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDbfsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDbfsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListDbfsRequest) MarshalJSON() ([]byte, error) { + pb, err := listDbfsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List directory contents type ListDirectoryContentsRequest struct { // The absolute path of a directory. - DirectoryPath string `json:"-" url:"-"` + // Wire name: 'directory_path' + DirectoryPath string `tf:"-"` // The maximum number of directory entries to return. The response may // contain fewer entries. If the response contains a `next_page_token`, // there may be more entries, even if fewer than `page_size` entries are in @@ -240,7 +794,8 @@ type ListDirectoryContentsRequest struct { // // If unspecified, at most 1000 directory entries will be returned. The // maximum value is 1000. Values above 1000 will be coerced to 1000. - PageSize int64 `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int64 `tf:"-"` // An opaque page token which was the `next_page_token` in the response of // the previous request to list the contents of this directory. Provide this // token to retrieve the next page of directory entries. When providing a @@ -249,143 +804,493 @@ type ListDirectoryContentsRequest struct { // necessary to continue requesting pages of entries until the response // contains no `next_page_token`. Note that the number of entries returned // must not be used to determine when the listing is complete. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDirectoryContentsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDirectoryContentsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDirectoryContentsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDirectoryContentsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDirectoryContentsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDirectoryContentsRequest) MarshalJSON() ([]byte, error) { + pb, err := listDirectoryContentsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListDirectoryResponse struct { // Array of DirectoryEntry. - Contents []DirectoryEntry `json:"contents,omitempty"` + // Wire name: 'contents' + Contents []DirectoryEntry // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDirectoryResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDirectoryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDirectoryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDirectoryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDirectoryResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDirectoryResponse) MarshalJSON() ([]byte, error) { + pb, err := listDirectoryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListStatusResponse struct { // A list of FileInfo's that describe contents of directory or file. See // example above. - Files []FileInfo `json:"files,omitempty"` + // Wire name: 'files' + Files []FileInfo +} + +func (st *ListStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := listStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MkDirs struct { // The path of the new directory. The path should be the absolute DBFS path. - Path string `json:"path"` + // Wire name: 'path' + Path string +} + +func (st *MkDirs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mkDirsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mkDirsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MkDirs) MarshalJSON() ([]byte, error) { + pb, err := mkDirsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MkDirsResponse struct { } +func (st *MkDirsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mkDirsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mkDirsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MkDirsResponse) MarshalJSON() ([]byte, error) { + pb, err := mkDirsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Move struct { // The destination path of the file or directory. The path should be the // absolute DBFS path. - DestinationPath string `json:"destination_path"` + // Wire name: 'destination_path' + DestinationPath string // The source path of the file or directory. The path should be the absolute // DBFS path. - SourcePath string `json:"source_path"` + // Wire name: 'source_path' + SourcePath string +} + +func (st *Move) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &movePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := moveFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Move) MarshalJSON() ([]byte, error) { + pb, err := moveToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MoveResponse struct { } +func (st *MoveResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &moveResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := moveResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MoveResponse) MarshalJSON() ([]byte, error) { + pb, err := moveResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Put struct { // This parameter might be absent, and instead a posted file will be used. - Contents string `json:"contents,omitempty"` + // Wire name: 'contents' + Contents string // The flag that specifies whether to overwrite existing file/files. - Overwrite bool `json:"overwrite,omitempty"` + // Wire name: 'overwrite' + Overwrite bool // The path of the new file. The path should be the absolute DBFS path. - Path string `json:"path"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Put) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Put) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Put) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Put) MarshalJSON() ([]byte, error) { + pb, err := putToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutResponse struct { } +func (st *PutResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutResponse) MarshalJSON() ([]byte, error) { + pb, err := putResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get the contents of a file type ReadDbfsRequest struct { // The number of bytes to read starting from the offset. This has a limit of // 1 MB, and a default value of 0.5 MB. - Length int64 `json:"-" url:"length,omitempty"` + // Wire name: 'length' + Length int64 `tf:"-"` // The offset to read from in bytes. - Offset int64 `json:"-" url:"offset,omitempty"` + // Wire name: 'offset' + Offset int64 `tf:"-"` // The path of the file to read. The path should be the absolute DBFS path. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ReadDbfsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ReadDbfsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &readDbfsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := readDbfsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ReadDbfsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ReadDbfsRequest) MarshalJSON() ([]byte, error) { + pb, err := readDbfsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ReadResponse struct { // The number of bytes read (could be less than ``length`` if we hit end of // file). This refers to number of bytes read in unencoded version (response // data is base64-encoded). - BytesRead int64 `json:"bytes_read,omitempty"` + // Wire name: 'bytes_read' + BytesRead int64 // The base64-encoded contents of the file read. - Data string `json:"data,omitempty"` + // Wire name: 'data' + Data string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ReadResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ReadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &readResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := readResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ReadResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ReadResponse) MarshalJSON() ([]byte, error) { + pb, err := readResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Upload a file type UploadRequest struct { - Contents io.ReadCloser `json:"-"` + + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` // The absolute path of the file. - FilePath string `json:"-" url:"-"` + // Wire name: 'file_path' + FilePath string `tf:"-"` // If true or unspecified, an existing file will be overwritten. If false, // an error will be returned if the path points to an existing file. - Overwrite bool `json:"-" url:"overwrite,omitempty"` + // Wire name: 'overwrite' + Overwrite bool `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UploadRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UploadRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &uploadRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := uploadRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UploadRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UploadRequest) MarshalJSON() ([]byte, error) { + pb, err := uploadRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UploadResponse struct { } + +func (st *UploadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &uploadResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := uploadResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UploadResponse) MarshalJSON() ([]byte, error) { + pb, err := uploadResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/iam/impl.go b/service/iam/impl.go index 59ee7a50e..e75043ec7 100755 --- a/service/iam/impl.go +++ b/service/iam/impl.go @@ -18,13 +18,35 @@ type accessControlImpl struct { } func (a *accessControlImpl) CheckPolicy(ctx context.Context, request CheckPolicyRequest) (*CheckPolicyResponse, error) { - var checkPolicyResponse CheckPolicyResponse + + requestPb, pbErr := checkPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var checkPolicyResponsePb checkPolicyResponsePb path := "/api/2.0/access-control/check-policy-v2" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &checkPolicyResponse) - return &checkPolicyResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &checkPolicyResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := checkPolicyResponseFromPb(&checkPolicyResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AccountAccessControl API methods @@ -33,34 +55,100 @@ type accountAccessControlImpl struct { } func (a *accountAccessControlImpl) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error) { - var getAssignableRolesForResourceResponse GetAssignableRolesForResourceResponse + + requestPb, pbErr := getAssignableRolesForResourceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getAssignableRolesForResourceResponsePb getAssignableRolesForResourceResponsePb path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/assignable-roles", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAssignableRolesForResourceResponse) - return &getAssignableRolesForResourceResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getAssignableRolesForResourceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getAssignableRolesForResourceResponseFromPb(&getAssignableRolesForResourceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountAccessControlImpl) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error) { - var ruleSetResponse RuleSetResponse + + requestPb, pbErr := getRuleSetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var ruleSetResponsePb ruleSetResponsePb path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/rule-sets", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &ruleSetResponse) - return &ruleSetResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &ruleSetResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := ruleSetResponseFromPb(&ruleSetResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountAccessControlImpl) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error) { - var ruleSetResponse RuleSetResponse + + requestPb, pbErr := updateRuleSetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var ruleSetResponsePb ruleSetResponsePb path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/rule-sets", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &ruleSetResponse) - return &ruleSetResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &ruleSetResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := ruleSetResponseFromPb(&ruleSetResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AccountAccessControlProxy API methods @@ -69,34 +157,100 @@ type accountAccessControlProxyImpl struct { } func (a *accountAccessControlProxyImpl) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error) { - var getAssignableRolesForResourceResponse GetAssignableRolesForResourceResponse + + requestPb, pbErr := getAssignableRolesForResourceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getAssignableRolesForResourceResponsePb getAssignableRolesForResourceResponsePb path := "/api/2.0/preview/accounts/access-control/assignable-roles" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAssignableRolesForResourceResponse) - return &getAssignableRolesForResourceResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getAssignableRolesForResourceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getAssignableRolesForResourceResponseFromPb(&getAssignableRolesForResourceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountAccessControlProxyImpl) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error) { - var ruleSetResponse RuleSetResponse + + requestPb, pbErr := getRuleSetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var ruleSetResponsePb ruleSetResponsePb path := "/api/2.0/preview/accounts/access-control/rule-sets" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &ruleSetResponse) - return &ruleSetResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &ruleSetResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := ruleSetResponseFromPb(&ruleSetResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountAccessControlProxyImpl) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error) { - var ruleSetResponse RuleSetResponse + + requestPb, pbErr := updateRuleSetRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var ruleSetResponsePb ruleSetResponsePb path := "/api/2.0/preview/accounts/access-control/rule-sets" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &ruleSetResponse) - return &ruleSetResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &ruleSetResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := ruleSetResponseFromPb(&ruleSetResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AccountGroups API methods @@ -105,33 +259,95 @@ type accountGroupsImpl struct { } func (a *accountGroupsImpl) Create(ctx context.Context, request Group) (*Group, error) { - var group Group + + requestPb, pbErr := groupToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var groupPb groupPb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &group) - return &group, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &groupPb, + ) + if err != nil { + return nil, err + } + resp, err := groupFromPb(&groupPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountGroupsImpl) Delete(ctx context.Context, request DeleteAccountGroupRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := deleteAccountGroupRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountGroupsImpl) Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error) { - var group Group - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := getAccountGroupRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var groupPb groupPb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &group) - return &group, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &groupPb, + ) + if err != nil { + return nil, err + } + resp, err := groupFromPb(&groupPb) + if err != nil { + return nil, err + } + + return resp, err } // List group details. @@ -180,32 +396,90 @@ func (a *accountGroupsImpl) ListAll(ctx context.Context, request ListAccountGrou } func (a *accountGroupsImpl) internalList(ctx context.Context, request ListAccountGroupsRequest) (*ListGroupsResponse, error) { - var listGroupsResponse ListGroupsResponse + + requestPb, pbErr := listAccountGroupsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listGroupsResponsePb listGroupsResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listGroupsResponse) - return &listGroupsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listGroupsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listGroupsResponseFromPb(&listGroupsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountGroupsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountGroupsImpl) Update(ctx context.Context, request Group) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := groupToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -215,33 +489,95 @@ type accountServicePrincipalsImpl struct { } func (a *accountServicePrincipalsImpl) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error) { - var servicePrincipal ServicePrincipal + + requestPb, pbErr := servicePrincipalToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servicePrincipalPb servicePrincipalPb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servicePrincipal) - return &servicePrincipal, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &servicePrincipalPb, + ) + if err != nil { + return nil, err + } + resp, err := servicePrincipalFromPb(&servicePrincipalPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountServicePrincipalsImpl) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := deleteAccountServicePrincipalRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountServicePrincipalsImpl) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error) { - var servicePrincipal ServicePrincipal - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := getAccountServicePrincipalRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servicePrincipalPb servicePrincipalPb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servicePrincipal) - return &servicePrincipal, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &servicePrincipalPb, + ) + if err != nil { + return nil, err + } + resp, err := servicePrincipalFromPb(&servicePrincipalPb) + if err != nil { + return nil, err + } + + return resp, err } // List service principals. @@ -290,32 +626,90 @@ func (a *accountServicePrincipalsImpl) ListAll(ctx context.Context, request List } func (a *accountServicePrincipalsImpl) internalList(ctx context.Context, request ListAccountServicePrincipalsRequest) (*ListServicePrincipalResponse, error) { - var listServicePrincipalResponse ListServicePrincipalResponse + + requestPb, pbErr := listAccountServicePrincipalsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listServicePrincipalResponsePb listServicePrincipalResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalResponse) - return &listServicePrincipalResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listServicePrincipalResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listServicePrincipalResponseFromPb(&listServicePrincipalResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountServicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountServicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := servicePrincipalToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -325,33 +719,95 @@ type accountUsersImpl struct { } func (a *accountUsersImpl) Create(ctx context.Context, request User) (*User, error) { - var user User + + requestPb, pbErr := userToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var userPb userPb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &user) - return &user, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &userPb, + ) + if err != nil { + return nil, err + } + resp, err := userFromPb(&userPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountUsersImpl) Delete(ctx context.Context, request DeleteAccountUserRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := deleteAccountUserRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountUsersImpl) Get(ctx context.Context, request GetAccountUserRequest) (*User, error) { - var user User - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := getAccountUserRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var userPb userPb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &user) - return &user, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &userPb, + ) + if err != nil { + return nil, err + } + resp, err := userFromPb(&userPb) + if err != nil { + return nil, err + } + + return resp, err } // List users. @@ -400,32 +856,90 @@ func (a *accountUsersImpl) ListAll(ctx context.Context, request ListAccountUsers } func (a *accountUsersImpl) internalList(ctx context.Context, request ListAccountUsersRequest) (*ListUsersResponse, error) { - var listUsersResponse ListUsersResponse + + requestPb, pbErr := listAccountUsersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listUsersResponsePb listUsersResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUsersResponse) - return &listUsersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listUsersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listUsersResponseFromPb(&listUsersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountUsersImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountUsersImpl) Update(ctx context.Context, request User) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + + requestPb, pbErr := userToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -435,13 +949,30 @@ type currentUserImpl struct { } func (a *currentUserImpl) Me(ctx context.Context) (*User, error) { - var user User + + var userPb userPb path := "/api/2.0/preview/scim/v2/Me" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &user) - return &user, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &userPb, + ) + if err != nil { + return nil, err + } + resp, err := userFromPb(&userPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Groups API methods @@ -450,33 +981,95 @@ type groupsImpl struct { } func (a *groupsImpl) Create(ctx context.Context, request Group) (*Group, error) { - var group Group + + requestPb, pbErr := groupToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var groupPb groupPb path := "/api/2.0/preview/scim/v2/Groups" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &group) - return &group, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &groupPb, + ) + if err != nil { + return nil, err + } + resp, err := groupFromPb(&groupPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *groupsImpl) Delete(ctx context.Context, request DeleteGroupRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + + requestPb, pbErr := deleteGroupRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *groupsImpl) Get(ctx context.Context, request GetGroupRequest) (*Group, error) { - var group Group - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + + requestPb, pbErr := getGroupRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var groupPb groupPb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &group) - return &group, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &groupPb, + ) + if err != nil { + return nil, err + } + resp, err := groupFromPb(&groupPb) + if err != nil { + return nil, err + } + + return resp, err } // List group details. @@ -525,32 +1118,90 @@ func (a *groupsImpl) ListAll(ctx context.Context, request ListGroupsRequest) ([] } func (a *groupsImpl) internalList(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error) { - var listGroupsResponse ListGroupsResponse + + requestPb, pbErr := listGroupsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listGroupsResponsePb listGroupsResponsePb path := "/api/2.0/preview/scim/v2/Groups" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listGroupsResponse) - return &listGroupsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listGroupsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listGroupsResponseFromPb(&listGroupsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *groupsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *groupsImpl) Update(ctx context.Context, request Group) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + + requestPb, pbErr := groupToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -560,14 +1211,36 @@ type permissionMigrationImpl struct { } func (a *permissionMigrationImpl) MigratePermissions(ctx context.Context, request MigratePermissionsRequest) (*MigratePermissionsResponse, error) { - var migratePermissionsResponse MigratePermissionsResponse + + requestPb, pbErr := migratePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var migratePermissionsResponsePb migratePermissionsResponsePb path := "/api/2.0/permissionmigration" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &migratePermissionsResponse) - return &migratePermissionsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &migratePermissionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := migratePermissionsResponseFromPb(&migratePermissionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Permissions API methods @@ -576,45 +1249,133 @@ type permissionsImpl struct { } func (a *permissionsImpl) Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error) { - var objectPermissions ObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + + requestPb, pbErr := getPermissionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var objectPermissionsPb objectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.RequestObjectType, requestPb.RequestObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &objectPermissions) - return &objectPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &objectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := objectPermissionsFromPb(&objectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *permissionsImpl) GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error) { - var getPermissionLevelsResponse GetPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", request.RequestObjectType, request.RequestObjectId) + + requestPb, pbErr := getPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPermissionLevelsResponsePb getPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", requestPb.RequestObjectType, requestPb.RequestObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPermissionLevelsResponse) - return &getPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPermissionLevelsResponseFromPb(&getPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *permissionsImpl) Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error) { - var objectPermissions ObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + + requestPb, pbErr := setObjectPermissionsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var objectPermissionsPb objectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.RequestObjectType, requestPb.RequestObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &objectPermissions) - return &objectPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &objectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := objectPermissionsFromPb(&objectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *permissionsImpl) Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error) { - var objectPermissions ObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + + requestPb, pbErr := updateObjectPermissionsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var objectPermissionsPb objectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.RequestObjectType, requestPb.RequestObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &objectPermissions) - return &objectPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &objectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := objectPermissionsFromPb(&objectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ServicePrincipals API methods @@ -623,33 +1384,95 @@ type servicePrincipalsImpl struct { } func (a *servicePrincipalsImpl) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error) { - var servicePrincipal ServicePrincipal + + requestPb, pbErr := servicePrincipalToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servicePrincipalPb servicePrincipalPb path := "/api/2.0/preview/scim/v2/ServicePrincipals" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servicePrincipal) - return &servicePrincipal, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &servicePrincipalPb, + ) + if err != nil { + return nil, err + } + resp, err := servicePrincipalFromPb(&servicePrincipalPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servicePrincipalsImpl) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + + requestPb, pbErr := deleteServicePrincipalRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *servicePrincipalsImpl) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error) { - var servicePrincipal ServicePrincipal - path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + + requestPb, pbErr := getServicePrincipalRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servicePrincipalPb servicePrincipalPb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servicePrincipal) - return &servicePrincipal, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &servicePrincipalPb, + ) + if err != nil { + return nil, err + } + resp, err := servicePrincipalFromPb(&servicePrincipalPb) + if err != nil { + return nil, err + } + + return resp, err } // List service principals. @@ -698,32 +1521,90 @@ func (a *servicePrincipalsImpl) ListAll(ctx context.Context, request ListService } func (a *servicePrincipalsImpl) internalList(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error) { - var listServicePrincipalResponse ListServicePrincipalResponse + + requestPb, pbErr := listServicePrincipalsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listServicePrincipalResponsePb listServicePrincipalResponsePb path := "/api/2.0/preview/scim/v2/ServicePrincipals" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalResponse) - return &listServicePrincipalResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listServicePrincipalResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listServicePrincipalResponseFromPb(&listServicePrincipalResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *servicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + + requestPb, pbErr := servicePrincipalToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -733,53 +1614,149 @@ type usersImpl struct { } func (a *usersImpl) Create(ctx context.Context, request User) (*User, error) { - var user User + + requestPb, pbErr := userToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var userPb userPb path := "/api/2.0/preview/scim/v2/Users" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &user) - return &user, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &userPb, + ) + if err != nil { + return nil, err + } + resp, err := userFromPb(&userPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usersImpl) Delete(ctx context.Context, request DeleteUserRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + + requestPb, pbErr := deleteUserRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *usersImpl) Get(ctx context.Context, request GetUserRequest) (*User, error) { - var user User - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + + requestPb, pbErr := getUserRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var userPb userPb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &user) - return &user, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &userPb, + ) + if err != nil { + return nil, err + } + resp, err := userFromPb(&userPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usersImpl) GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error) { - var getPasswordPermissionLevelsResponse GetPasswordPermissionLevelsResponse + + var getPasswordPermissionLevelsResponsePb getPasswordPermissionLevelsResponsePb path := "/api/2.0/permissions/authorization/passwords/permissionLevels" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getPasswordPermissionLevelsResponse) - return &getPasswordPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getPasswordPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPasswordPermissionLevelsResponseFromPb(&getPasswordPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usersImpl) GetPermissions(ctx context.Context) (*PasswordPermissions, error) { - var passwordPermissions PasswordPermissions + + var passwordPermissionsPb passwordPermissionsPb path := "/api/2.0/permissions/authorization/passwords" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &passwordPermissions) - return &passwordPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &passwordPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := passwordPermissionsFromPb(&passwordPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List users. @@ -828,55 +1805,157 @@ func (a *usersImpl) ListAll(ctx context.Context, request ListUsersRequest) ([]Us } func (a *usersImpl) internalList(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error) { - var listUsersResponse ListUsersResponse + + requestPb, pbErr := listUsersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listUsersResponsePb listUsersResponsePb path := "/api/2.0/preview/scim/v2/Users" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUsersResponse) - return &listUsersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listUsersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listUsersResponseFromPb(&listUsersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usersImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + + requestPb, pbErr := partialUpdateToPb(&request) + if pbErr != nil { + return pbErr + } + + var patchResponsePb patchResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *usersImpl) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error) { - var passwordPermissions PasswordPermissions + + requestPb, pbErr := passwordPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var passwordPermissionsPb passwordPermissionsPb path := "/api/2.0/permissions/authorization/passwords" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &passwordPermissions) - return &passwordPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &passwordPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := passwordPermissionsFromPb(&passwordPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *usersImpl) Update(ctx context.Context, request User) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + + requestPb, pbErr := userToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } func (a *usersImpl) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error) { - var passwordPermissions PasswordPermissions + + requestPb, pbErr := passwordPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var passwordPermissionsPb passwordPermissionsPb path := "/api/2.0/permissions/authorization/passwords" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &passwordPermissions) - return &passwordPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &passwordPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := passwordPermissionsFromPb(&passwordPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just WorkspaceAssignment API methods @@ -885,23 +1964,63 @@ type workspaceAssignmentImpl struct { } func (a *workspaceAssignmentImpl) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error { - var deleteWorkspacePermissionAssignmentResponse DeleteWorkspacePermissionAssignmentResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) + + requestPb, pbErr := deleteWorkspaceAssignmentRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteWorkspacePermissionAssignmentResponsePb deleteWorkspacePermissionAssignmentResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId, requestPb.PrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWorkspacePermissionAssignmentResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteWorkspacePermissionAssignmentResponsePb, + ) + if err != nil { + return err + } + return err } func (a *workspaceAssignmentImpl) Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error) { - var workspacePermissions WorkspacePermissions - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/permissions", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := getWorkspaceAssignmentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspacePermissionsPb workspacePermissionsPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/permissions", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspacePermissions) - return &workspacePermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &workspacePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := workspacePermissionsFromPb(&workspacePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // Get permission assignments. @@ -936,22 +2055,66 @@ func (a *workspaceAssignmentImpl) ListAll(ctx context.Context, request ListWorks } func (a *workspaceAssignmentImpl) internalList(ctx context.Context, request ListWorkspaceAssignmentRequest) (*PermissionAssignments, error) { - var permissionAssignments PermissionAssignments - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := listWorkspaceAssignmentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var permissionAssignmentsPb permissionAssignmentsPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &permissionAssignments) - return &permissionAssignments, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &permissionAssignmentsPb, + ) + if err != nil { + return nil, err + } + resp, err := permissionAssignmentsFromPb(&permissionAssignmentsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceAssignmentImpl) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) { - var permissionAssignment PermissionAssignment - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) + + requestPb, pbErr := updateWorkspaceAssignmentsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var permissionAssignmentPb permissionAssignmentPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId, requestPb.PrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &permissionAssignment) - return &permissionAssignment, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &permissionAssignmentPb, + ) + if err != nil { + return nil, err + } + resp, err := permissionAssignmentFromPb(&permissionAssignmentPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/iam/internal.go b/service/iam/internal.go new file mode 100755 index 000000000..c952aba6c --- /dev/null +++ b/service/iam/internal.go @@ -0,0 +1,2978 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package iam + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func accessControlRequestToPb(st *AccessControlRequest) (*accessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &accessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type accessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func accessControlRequestFromPb(pb *accessControlRequestPb) (*AccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &AccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *accessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st accessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func accessControlResponseToPb(st *AccessControlResponse) (*accessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &accessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type accessControlResponsePb struct { + AllPermissions []Permission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func accessControlResponseFromPb(pb *accessControlResponsePb) (*AccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &AccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *accessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st accessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func actorToPb(st *Actor) (*actorPb, error) { + if st == nil { + return nil, nil + } + pb := &actorPb{} + pb.ActorId = st.ActorId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type actorPb struct { + ActorId int64 `json:"actor_id,omitempty" url:"actor_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func actorFromPb(pb *actorPb) (*Actor, error) { + if pb == nil { + return nil, nil + } + st := &Actor{} + st.ActorId = pb.ActorId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *actorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st actorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func checkPolicyRequestToPb(st *CheckPolicyRequest) (*checkPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &checkPolicyRequestPb{} + pb.Actor = st.Actor + + pb.AuthzIdentity = st.AuthzIdentity + + pb.ConsistencyToken = st.ConsistencyToken + + pb.Permission = st.Permission + + pb.Resource = st.Resource + + pb.ResourceInfo = st.ResourceInfo + + return pb, nil +} + +type checkPolicyRequestPb struct { + Actor Actor `json:"-" url:"actor"` + + AuthzIdentity RequestAuthzIdentity `json:"-" url:"authz_identity"` + + ConsistencyToken ConsistencyToken `json:"-" url:"consistency_token"` + + Permission string `json:"-" url:"permission"` + + Resource string `json:"-" url:"resource"` + + ResourceInfo *ResourceInfo `json:"-" url:"resource_info,omitempty"` +} + +func checkPolicyRequestFromPb(pb *checkPolicyRequestPb) (*CheckPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CheckPolicyRequest{} + st.Actor = pb.Actor + st.AuthzIdentity = pb.AuthzIdentity + st.ConsistencyToken = pb.ConsistencyToken + st.Permission = pb.Permission + st.Resource = pb.Resource + st.ResourceInfo = pb.ResourceInfo + + return st, nil +} + +func checkPolicyResponseToPb(st *CheckPolicyResponse) (*checkPolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &checkPolicyResponsePb{} + pb.ConsistencyToken = st.ConsistencyToken + + pb.IsPermitted = st.IsPermitted + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type checkPolicyResponsePb struct { + ConsistencyToken ConsistencyToken `json:"consistency_token"` + + IsPermitted bool `json:"is_permitted,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func checkPolicyResponseFromPb(pb *checkPolicyResponsePb) (*CheckPolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &CheckPolicyResponse{} + st.ConsistencyToken = pb.ConsistencyToken + st.IsPermitted = pb.IsPermitted + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *checkPolicyResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st checkPolicyResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func complexValueToPb(st *ComplexValue) (*complexValuePb, error) { + if st == nil { + return nil, nil + } + pb := &complexValuePb{} + pb.Display = st.Display + + pb.Primary = st.Primary + + pb.Ref = st.Ref + + pb.Type = st.Type + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type complexValuePb struct { + Display string `json:"display,omitempty"` + + Primary bool `json:"primary,omitempty"` + + Ref string `json:"$ref,omitempty"` + + Type string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func complexValueFromPb(pb *complexValuePb) (*ComplexValue, error) { + if pb == nil { + return nil, nil + } + st := &ComplexValue{} + st.Display = pb.Display + st.Primary = pb.Primary + st.Ref = pb.Ref + st.Type = pb.Type + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *complexValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st complexValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func consistencyTokenToPb(st *ConsistencyToken) (*consistencyTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &consistencyTokenPb{} + pb.Value = st.Value + + return pb, nil +} + +type consistencyTokenPb struct { + Value string `json:"value"` +} + +func consistencyTokenFromPb(pb *consistencyTokenPb) (*ConsistencyToken, error) { + if pb == nil { + return nil, nil + } + st := &ConsistencyToken{} + st.Value = pb.Value + + return st, nil +} + +func deleteAccountGroupRequestToPb(st *DeleteAccountGroupRequest) (*deleteAccountGroupRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountGroupRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteAccountGroupRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteAccountGroupRequestFromPb(pb *deleteAccountGroupRequestPb) (*DeleteAccountGroupRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountGroupRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteAccountServicePrincipalRequestToPb(st *DeleteAccountServicePrincipalRequest) (*deleteAccountServicePrincipalRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountServicePrincipalRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteAccountServicePrincipalRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteAccountServicePrincipalRequestFromPb(pb *deleteAccountServicePrincipalRequestPb) (*DeleteAccountServicePrincipalRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountServicePrincipalRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteAccountUserRequestToPb(st *DeleteAccountUserRequest) (*deleteAccountUserRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountUserRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteAccountUserRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteAccountUserRequestFromPb(pb *deleteAccountUserRequestPb) (*DeleteAccountUserRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountUserRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteGroupRequestToPb(st *DeleteGroupRequest) (*deleteGroupRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteGroupRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteGroupRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteGroupRequestFromPb(pb *deleteGroupRequestPb) (*DeleteGroupRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteGroupRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteServicePrincipalRequestToPb(st *DeleteServicePrincipalRequest) (*deleteServicePrincipalRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteServicePrincipalRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteServicePrincipalRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteServicePrincipalRequestFromPb(pb *deleteServicePrincipalRequestPb) (*DeleteServicePrincipalRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteServicePrincipalRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteUserRequestToPb(st *DeleteUserRequest) (*deleteUserRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteUserRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteUserRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteUserRequestFromPb(pb *deleteUserRequestPb) (*DeleteUserRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteUserRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteWorkspaceAssignmentRequestToPb(st *DeleteWorkspaceAssignmentRequest) (*deleteWorkspaceAssignmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWorkspaceAssignmentRequestPb{} + pb.PrincipalId = st.PrincipalId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type deleteWorkspaceAssignmentRequestPb struct { + PrincipalId int64 `json:"-" url:"-"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func deleteWorkspaceAssignmentRequestFromPb(pb *deleteWorkspaceAssignmentRequestPb) (*DeleteWorkspaceAssignmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWorkspaceAssignmentRequest{} + st.PrincipalId = pb.PrincipalId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func deleteWorkspacePermissionAssignmentResponseToPb(st *DeleteWorkspacePermissionAssignmentResponse) (*deleteWorkspacePermissionAssignmentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWorkspacePermissionAssignmentResponsePb{} + + return pb, nil +} + +type deleteWorkspacePermissionAssignmentResponsePb struct { +} + +func deleteWorkspacePermissionAssignmentResponseFromPb(pb *deleteWorkspacePermissionAssignmentResponsePb) (*DeleteWorkspacePermissionAssignmentResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWorkspacePermissionAssignmentResponse{} + + return st, nil +} + +func getAccountGroupRequestToPb(st *GetAccountGroupRequest) (*getAccountGroupRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountGroupRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getAccountGroupRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getAccountGroupRequestFromPb(pb *getAccountGroupRequestPb) (*GetAccountGroupRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountGroupRequest{} + st.Id = pb.Id + + return st, nil +} + +func getAccountServicePrincipalRequestToPb(st *GetAccountServicePrincipalRequest) (*getAccountServicePrincipalRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountServicePrincipalRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getAccountServicePrincipalRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getAccountServicePrincipalRequestFromPb(pb *getAccountServicePrincipalRequestPb) (*GetAccountServicePrincipalRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountServicePrincipalRequest{} + st.Id = pb.Id + + return st, nil +} + +func getAccountUserRequestToPb(st *GetAccountUserRequest) (*getAccountUserRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountUserRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.Id = st.Id + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getAccountUserRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + Id string `json:"-" url:"-"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getAccountUserRequestFromPb(pb *getAccountUserRequestPb) (*GetAccountUserRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountUserRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.Id = pb.Id + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getAccountUserRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getAccountUserRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAssignableRolesForResourceRequestToPb(st *GetAssignableRolesForResourceRequest) (*getAssignableRolesForResourceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAssignableRolesForResourceRequestPb{} + pb.Resource = st.Resource + + return pb, nil +} + +type getAssignableRolesForResourceRequestPb struct { + Resource string `json:"-" url:"resource"` +} + +func getAssignableRolesForResourceRequestFromPb(pb *getAssignableRolesForResourceRequestPb) (*GetAssignableRolesForResourceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAssignableRolesForResourceRequest{} + st.Resource = pb.Resource + + return st, nil +} + +func getAssignableRolesForResourceResponseToPb(st *GetAssignableRolesForResourceResponse) (*getAssignableRolesForResourceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getAssignableRolesForResourceResponsePb{} + pb.Roles = st.Roles + + return pb, nil +} + +type getAssignableRolesForResourceResponsePb struct { + Roles []Role `json:"roles,omitempty"` +} + +func getAssignableRolesForResourceResponseFromPb(pb *getAssignableRolesForResourceResponsePb) (*GetAssignableRolesForResourceResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetAssignableRolesForResourceResponse{} + st.Roles = pb.Roles + + return st, nil +} + +func getGroupRequestToPb(st *GetGroupRequest) (*getGroupRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getGroupRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getGroupRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getGroupRequestFromPb(pb *getGroupRequestPb) (*GetGroupRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetGroupRequest{} + st.Id = pb.Id + + return st, nil +} + +func getPasswordPermissionLevelsResponseToPb(st *GetPasswordPermissionLevelsResponse) (*getPasswordPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPasswordPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getPasswordPermissionLevelsResponsePb struct { + PermissionLevels []PasswordPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getPasswordPermissionLevelsResponseFromPb(pb *getPasswordPermissionLevelsResponsePb) (*GetPasswordPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPasswordPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getPermissionLevelsRequestToPb(st *GetPermissionLevelsRequest) (*getPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPermissionLevelsRequestPb{} + pb.RequestObjectId = st.RequestObjectId + + pb.RequestObjectType = st.RequestObjectType + + return pb, nil +} + +type getPermissionLevelsRequestPb struct { + RequestObjectId string `json:"-" url:"-"` + + RequestObjectType string `json:"-" url:"-"` +} + +func getPermissionLevelsRequestFromPb(pb *getPermissionLevelsRequestPb) (*GetPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPermissionLevelsRequest{} + st.RequestObjectId = pb.RequestObjectId + st.RequestObjectType = pb.RequestObjectType + + return st, nil +} + +func getPermissionLevelsResponseToPb(st *GetPermissionLevelsResponse) (*getPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getPermissionLevelsResponsePb struct { + PermissionLevels []PermissionsDescription `json:"permission_levels,omitempty"` +} + +func getPermissionLevelsResponseFromPb(pb *getPermissionLevelsResponsePb) (*GetPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getPermissionRequestToPb(st *GetPermissionRequest) (*getPermissionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPermissionRequestPb{} + pb.RequestObjectId = st.RequestObjectId + + pb.RequestObjectType = st.RequestObjectType + + return pb, nil +} + +type getPermissionRequestPb struct { + RequestObjectId string `json:"-" url:"-"` + + RequestObjectType string `json:"-" url:"-"` +} + +func getPermissionRequestFromPb(pb *getPermissionRequestPb) (*GetPermissionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPermissionRequest{} + st.RequestObjectId = pb.RequestObjectId + st.RequestObjectType = pb.RequestObjectType + + return st, nil +} + +func getRuleSetRequestToPb(st *GetRuleSetRequest) (*getRuleSetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRuleSetRequestPb{} + pb.Etag = st.Etag + + pb.Name = st.Name + + return pb, nil +} + +type getRuleSetRequestPb struct { + Etag string `json:"-" url:"etag"` + + Name string `json:"-" url:"name"` +} + +func getRuleSetRequestFromPb(pb *getRuleSetRequestPb) (*GetRuleSetRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRuleSetRequest{} + st.Etag = pb.Etag + st.Name = pb.Name + + return st, nil +} + +func getServicePrincipalRequestToPb(st *GetServicePrincipalRequest) (*getServicePrincipalRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getServicePrincipalRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getServicePrincipalRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getServicePrincipalRequestFromPb(pb *getServicePrincipalRequestPb) (*GetServicePrincipalRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetServicePrincipalRequest{} + st.Id = pb.Id + + return st, nil +} + +func getUserRequestToPb(st *GetUserRequest) (*getUserRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getUserRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.Id = st.Id + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getUserRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + Id string `json:"-" url:"-"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getUserRequestFromPb(pb *getUserRequestPb) (*GetUserRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetUserRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.Id = pb.Id + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getUserRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getUserRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getWorkspaceAssignmentRequestToPb(st *GetWorkspaceAssignmentRequest) (*getWorkspaceAssignmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceAssignmentRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type getWorkspaceAssignmentRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func getWorkspaceAssignmentRequestFromPb(pb *getWorkspaceAssignmentRequestPb) (*GetWorkspaceAssignmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceAssignmentRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func grantRuleToPb(st *GrantRule) (*grantRulePb, error) { + if st == nil { + return nil, nil + } + pb := &grantRulePb{} + pb.Principals = st.Principals + + pb.Role = st.Role + + return pb, nil +} + +type grantRulePb struct { + Principals []string `json:"principals,omitempty"` + + Role string `json:"role"` +} + +func grantRuleFromPb(pb *grantRulePb) (*GrantRule, error) { + if pb == nil { + return nil, nil + } + st := &GrantRule{} + st.Principals = pb.Principals + st.Role = pb.Role + + return st, nil +} + +func groupToPb(st *Group) (*groupPb, error) { + if st == nil { + return nil, nil + } + pb := &groupPb{} + pb.DisplayName = st.DisplayName + + pb.Entitlements = st.Entitlements + + pb.ExternalId = st.ExternalId + + pb.Groups = st.Groups + + pb.Id = st.Id + + pb.Members = st.Members + + pb.Meta = st.Meta + + pb.Roles = st.Roles + + pb.Schemas = st.Schemas + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type groupPb struct { + DisplayName string `json:"displayName,omitempty"` + + Entitlements []ComplexValue `json:"entitlements,omitempty"` + + ExternalId string `json:"externalId,omitempty"` + + Groups []ComplexValue `json:"groups,omitempty"` + + Id string `json:"id,omitempty" url:"-"` + + Members []ComplexValue `json:"members,omitempty"` + + Meta *ResourceMeta `json:"meta,omitempty"` + + Roles []ComplexValue `json:"roles,omitempty"` + + Schemas []GroupSchema `json:"schemas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func groupFromPb(pb *groupPb) (*Group, error) { + if pb == nil { + return nil, nil + } + st := &Group{} + st.DisplayName = pb.DisplayName + st.Entitlements = pb.Entitlements + st.ExternalId = pb.ExternalId + st.Groups = pb.Groups + st.Id = pb.Id + st.Members = pb.Members + st.Meta = pb.Meta + st.Roles = pb.Roles + st.Schemas = pb.Schemas + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *groupPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st groupPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAccountGroupsRequestToPb(st *ListAccountGroupsRequest) (*listAccountGroupsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountGroupsRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAccountGroupsRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAccountGroupsRequestFromPb(pb *listAccountGroupsRequestPb) (*ListAccountGroupsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountGroupsRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAccountGroupsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAccountGroupsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAccountServicePrincipalsRequestToPb(st *ListAccountServicePrincipalsRequest) (*listAccountServicePrincipalsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountServicePrincipalsRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAccountServicePrincipalsRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAccountServicePrincipalsRequestFromPb(pb *listAccountServicePrincipalsRequestPb) (*ListAccountServicePrincipalsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountServicePrincipalsRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAccountServicePrincipalsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAccountServicePrincipalsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAccountUsersRequestToPb(st *ListAccountUsersRequest) (*listAccountUsersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountUsersRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAccountUsersRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAccountUsersRequestFromPb(pb *listAccountUsersRequestPb) (*ListAccountUsersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountUsersRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAccountUsersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAccountUsersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listGroupsRequestToPb(st *ListGroupsRequest) (*listGroupsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listGroupsRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listGroupsRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listGroupsRequestFromPb(pb *listGroupsRequestPb) (*ListGroupsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListGroupsRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listGroupsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listGroupsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listGroupsResponseToPb(st *ListGroupsResponse) (*listGroupsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listGroupsResponsePb{} + pb.ItemsPerPage = st.ItemsPerPage + + pb.Resources = st.Resources + + pb.Schemas = st.Schemas + + pb.StartIndex = st.StartIndex + + pb.TotalResults = st.TotalResults + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listGroupsResponsePb struct { + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + Resources []Group `json:"Resources,omitempty"` + + Schemas []ListResponseSchema `json:"schemas,omitempty"` + + StartIndex int64 `json:"startIndex,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listGroupsResponseFromPb(pb *listGroupsResponsePb) (*ListGroupsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListGroupsResponse{} + st.ItemsPerPage = pb.ItemsPerPage + st.Resources = pb.Resources + st.Schemas = pb.Schemas + st.StartIndex = pb.StartIndex + st.TotalResults = pb.TotalResults + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listGroupsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listGroupsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listServicePrincipalResponseToPb(st *ListServicePrincipalResponse) (*listServicePrincipalResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listServicePrincipalResponsePb{} + pb.ItemsPerPage = st.ItemsPerPage + + pb.Resources = st.Resources + + pb.Schemas = st.Schemas + + pb.StartIndex = st.StartIndex + + pb.TotalResults = st.TotalResults + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listServicePrincipalResponsePb struct { + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + Resources []ServicePrincipal `json:"Resources,omitempty"` + + Schemas []ListResponseSchema `json:"schemas,omitempty"` + + StartIndex int64 `json:"startIndex,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listServicePrincipalResponseFromPb(pb *listServicePrincipalResponsePb) (*ListServicePrincipalResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListServicePrincipalResponse{} + st.ItemsPerPage = pb.ItemsPerPage + st.Resources = pb.Resources + st.Schemas = pb.Schemas + st.StartIndex = pb.StartIndex + st.TotalResults = pb.TotalResults + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listServicePrincipalResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listServicePrincipalResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listServicePrincipalsRequestToPb(st *ListServicePrincipalsRequest) (*listServicePrincipalsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listServicePrincipalsRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listServicePrincipalsRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listServicePrincipalsRequestFromPb(pb *listServicePrincipalsRequestPb) (*ListServicePrincipalsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListServicePrincipalsRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listServicePrincipalsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listServicePrincipalsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listUsersRequestToPb(st *ListUsersRequest) (*listUsersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listUsersRequestPb{} + pb.Attributes = st.Attributes + + pb.Count = st.Count + + pb.ExcludedAttributes = st.ExcludedAttributes + + pb.Filter = st.Filter + + pb.SortBy = st.SortBy + + pb.SortOrder = st.SortOrder + + pb.StartIndex = st.StartIndex + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listUsersRequestPb struct { + Attributes string `json:"-" url:"attributes,omitempty"` + + Count int64 `json:"-" url:"count,omitempty"` + + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + + Filter string `json:"-" url:"filter,omitempty"` + + SortBy string `json:"-" url:"sortBy,omitempty"` + + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + + StartIndex int64 `json:"-" url:"startIndex,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listUsersRequestFromPb(pb *listUsersRequestPb) (*ListUsersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListUsersRequest{} + st.Attributes = pb.Attributes + st.Count = pb.Count + st.ExcludedAttributes = pb.ExcludedAttributes + st.Filter = pb.Filter + st.SortBy = pb.SortBy + st.SortOrder = pb.SortOrder + st.StartIndex = pb.StartIndex + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listUsersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listUsersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listUsersResponseToPb(st *ListUsersResponse) (*listUsersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listUsersResponsePb{} + pb.ItemsPerPage = st.ItemsPerPage + + pb.Resources = st.Resources + + pb.Schemas = st.Schemas + + pb.StartIndex = st.StartIndex + + pb.TotalResults = st.TotalResults + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listUsersResponsePb struct { + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + Resources []User `json:"Resources,omitempty"` + + Schemas []ListResponseSchema `json:"schemas,omitempty"` + + StartIndex int64 `json:"startIndex,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listUsersResponseFromPb(pb *listUsersResponsePb) (*ListUsersResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListUsersResponse{} + st.ItemsPerPage = pb.ItemsPerPage + st.Resources = pb.Resources + st.Schemas = pb.Schemas + st.StartIndex = pb.StartIndex + st.TotalResults = pb.TotalResults + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listUsersResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listUsersResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listWorkspaceAssignmentRequestToPb(st *ListWorkspaceAssignmentRequest) (*listWorkspaceAssignmentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listWorkspaceAssignmentRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type listWorkspaceAssignmentRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func listWorkspaceAssignmentRequestFromPb(pb *listWorkspaceAssignmentRequestPb) (*ListWorkspaceAssignmentRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListWorkspaceAssignmentRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func migratePermissionsRequestToPb(st *MigratePermissionsRequest) (*migratePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &migratePermissionsRequestPb{} + pb.FromWorkspaceGroupName = st.FromWorkspaceGroupName + + pb.Size = st.Size + + pb.ToAccountGroupName = st.ToAccountGroupName + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type migratePermissionsRequestPb struct { + FromWorkspaceGroupName string `json:"from_workspace_group_name"` + + Size int `json:"size,omitempty"` + + ToAccountGroupName string `json:"to_account_group_name"` + + WorkspaceId int64 `json:"workspace_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func migratePermissionsRequestFromPb(pb *migratePermissionsRequestPb) (*MigratePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &MigratePermissionsRequest{} + st.FromWorkspaceGroupName = pb.FromWorkspaceGroupName + st.Size = pb.Size + st.ToAccountGroupName = pb.ToAccountGroupName + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *migratePermissionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st migratePermissionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func migratePermissionsResponseToPb(st *MigratePermissionsResponse) (*migratePermissionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &migratePermissionsResponsePb{} + pb.PermissionsMigrated = st.PermissionsMigrated + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type migratePermissionsResponsePb struct { + PermissionsMigrated int `json:"permissions_migrated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func migratePermissionsResponseFromPb(pb *migratePermissionsResponsePb) (*MigratePermissionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &MigratePermissionsResponse{} + st.PermissionsMigrated = pb.PermissionsMigrated + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *migratePermissionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st migratePermissionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nameToPb(st *Name) (*namePb, error) { + if st == nil { + return nil, nil + } + pb := &namePb{} + pb.FamilyName = st.FamilyName + + pb.GivenName = st.GivenName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type namePb struct { + FamilyName string `json:"familyName,omitempty"` + + GivenName string `json:"givenName,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func nameFromPb(pb *namePb) (*Name, error) { + if pb == nil { + return nil, nil + } + st := &Name{} + st.FamilyName = pb.FamilyName + st.GivenName = pb.GivenName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *namePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st namePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func objectPermissionsToPb(st *ObjectPermissions) (*objectPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &objectPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type objectPermissionsPb struct { + AccessControlList []AccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func objectPermissionsFromPb(pb *objectPermissionsPb) (*ObjectPermissions, error) { + if pb == nil { + return nil, nil + } + st := &ObjectPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *objectPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st objectPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func partialUpdateToPb(st *PartialUpdate) (*partialUpdatePb, error) { + if st == nil { + return nil, nil + } + pb := &partialUpdatePb{} + pb.Id = st.Id + + pb.Operations = st.Operations + + pb.Schemas = st.Schemas + + return pb, nil +} + +type partialUpdatePb struct { + Id string `json:"-" url:"-"` + + Operations []Patch `json:"Operations,omitempty"` + + Schemas []PatchSchema `json:"schemas,omitempty"` +} + +func partialUpdateFromPb(pb *partialUpdatePb) (*PartialUpdate, error) { + if pb == nil { + return nil, nil + } + st := &PartialUpdate{} + st.Id = pb.Id + st.Operations = pb.Operations + st.Schemas = pb.Schemas + + return st, nil +} + +func passwordAccessControlRequestToPb(st *PasswordAccessControlRequest) (*passwordAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &passwordAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type passwordAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func passwordAccessControlRequestFromPb(pb *passwordAccessControlRequestPb) (*PasswordAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &PasswordAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *passwordAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st passwordAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func passwordAccessControlResponseToPb(st *PasswordAccessControlResponse) (*passwordAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &passwordAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type passwordAccessControlResponsePb struct { + AllPermissions []PasswordPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func passwordAccessControlResponseFromPb(pb *passwordAccessControlResponsePb) (*PasswordAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &PasswordAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *passwordAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st passwordAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func passwordPermissionToPb(st *PasswordPermission) (*passwordPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &passwordPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type passwordPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func passwordPermissionFromPb(pb *passwordPermissionPb) (*PasswordPermission, error) { + if pb == nil { + return nil, nil + } + st := &PasswordPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *passwordPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st passwordPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func passwordPermissionsToPb(st *PasswordPermissions) (*passwordPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &passwordPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type passwordPermissionsPb struct { + AccessControlList []PasswordAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func passwordPermissionsFromPb(pb *passwordPermissionsPb) (*PasswordPermissions, error) { + if pb == nil { + return nil, nil + } + st := &PasswordPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *passwordPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st passwordPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func passwordPermissionsDescriptionToPb(st *PasswordPermissionsDescription) (*passwordPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &passwordPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type passwordPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func passwordPermissionsDescriptionFromPb(pb *passwordPermissionsDescriptionPb) (*PasswordPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &PasswordPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *passwordPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st passwordPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func passwordPermissionsRequestToPb(st *PasswordPermissionsRequest) (*passwordPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &passwordPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + return pb, nil +} + +type passwordPermissionsRequestPb struct { + AccessControlList []PasswordAccessControlRequest `json:"access_control_list,omitempty"` +} + +func passwordPermissionsRequestFromPb(pb *passwordPermissionsRequestPb) (*PasswordPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &PasswordPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + + return st, nil +} + +func patchToPb(st *Patch) (*patchPb, error) { + if st == nil { + return nil, nil + } + pb := &patchPb{} + pb.Op = st.Op + + pb.Path = st.Path + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type patchPb struct { + Op PatchOp `json:"op,omitempty"` + + Path string `json:"path,omitempty"` + + Value any `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func patchFromPb(pb *patchPb) (*Patch, error) { + if pb == nil { + return nil, nil + } + st := &Patch{} + st.Op = pb.Op + st.Path = pb.Path + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *patchPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st patchPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func patchResponseToPb(st *PatchResponse) (*patchResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &patchResponsePb{} + + return pb, nil +} + +type patchResponsePb struct { +} + +func patchResponseFromPb(pb *patchResponsePb) (*PatchResponse, error) { + if pb == nil { + return nil, nil + } + st := &PatchResponse{} + + return st, nil +} + +func permissionToPb(st *Permission) (*permissionPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionFromPb(pb *permissionPb) (*Permission, error) { + if pb == nil { + return nil, nil + } + st := &Permission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionAssignmentToPb(st *PermissionAssignment) (*permissionAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionAssignmentPb{} + pb.Error = st.Error + + pb.Permissions = st.Permissions + + pb.Principal = st.Principal + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionAssignmentPb struct { + Error string `json:"error,omitempty"` + + Permissions []WorkspacePermission `json:"permissions,omitempty"` + + Principal *PrincipalOutput `json:"principal,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionAssignmentFromPb(pb *permissionAssignmentPb) (*PermissionAssignment, error) { + if pb == nil { + return nil, nil + } + st := &PermissionAssignment{} + st.Error = pb.Error + st.Permissions = pb.Permissions + st.Principal = pb.Principal + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionAssignmentsToPb(st *PermissionAssignments) (*permissionAssignmentsPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionAssignmentsPb{} + pb.PermissionAssignments = st.PermissionAssignments + + return pb, nil +} + +type permissionAssignmentsPb struct { + PermissionAssignments []PermissionAssignment `json:"permission_assignments,omitempty"` +} + +func permissionAssignmentsFromPb(pb *permissionAssignmentsPb) (*PermissionAssignments, error) { + if pb == nil { + return nil, nil + } + st := &PermissionAssignments{} + st.PermissionAssignments = pb.PermissionAssignments + + return st, nil +} + +func permissionOutputToPb(st *PermissionOutput) (*permissionOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionOutputPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionOutputPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel WorkspacePermission `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionOutputFromPb(pb *permissionOutputPb) (*PermissionOutput, error) { + if pb == nil { + return nil, nil + } + st := &PermissionOutput{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionsDescriptionToPb(st *PermissionsDescription) (*permissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &permissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionsDescriptionFromPb(pb *permissionsDescriptionPb) (*PermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &PermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func principalOutputToPb(st *PrincipalOutput) (*principalOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &principalOutputPb{} + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.PrincipalId = st.PrincipalId + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type principalOutputPb struct { + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + PrincipalId int64 `json:"principal_id,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func principalOutputFromPb(pb *principalOutputPb) (*PrincipalOutput, error) { + if pb == nil { + return nil, nil + } + st := &PrincipalOutput{} + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.PrincipalId = pb.PrincipalId + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *principalOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st principalOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resourceInfoToPb(st *ResourceInfo) (*resourceInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &resourceInfoPb{} + pb.Id = st.Id + + pb.LegacyAclPath = st.LegacyAclPath + + pb.ParentResourceInfo = st.ParentResourceInfo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resourceInfoPb struct { + Id string `json:"id" url:"id"` + + LegacyAclPath string `json:"legacy_acl_path,omitempty" url:"legacy_acl_path,omitempty"` + + ParentResourceInfo *ResourceInfo `json:"parent_resource_info,omitempty" url:"parent_resource_info,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resourceInfoFromPb(pb *resourceInfoPb) (*ResourceInfo, error) { + if pb == nil { + return nil, nil + } + st := &ResourceInfo{} + st.Id = pb.Id + st.LegacyAclPath = pb.LegacyAclPath + st.ParentResourceInfo = pb.ParentResourceInfo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resourceInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resourceInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resourceMetaToPb(st *ResourceMeta) (*resourceMetaPb, error) { + if st == nil { + return nil, nil + } + pb := &resourceMetaPb{} + pb.ResourceType = st.ResourceType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resourceMetaPb struct { + ResourceType string `json:"resourceType,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resourceMetaFromPb(pb *resourceMetaPb) (*ResourceMeta, error) { + if pb == nil { + return nil, nil + } + st := &ResourceMeta{} + st.ResourceType = pb.ResourceType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resourceMetaPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resourceMetaPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func roleToPb(st *Role) (*rolePb, error) { + if st == nil { + return nil, nil + } + pb := &rolePb{} + pb.Name = st.Name + + return pb, nil +} + +type rolePb struct { + Name string `json:"name"` +} + +func roleFromPb(pb *rolePb) (*Role, error) { + if pb == nil { + return nil, nil + } + st := &Role{} + st.Name = pb.Name + + return st, nil +} + +func ruleSetResponseToPb(st *RuleSetResponse) (*ruleSetResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &ruleSetResponsePb{} + pb.Etag = st.Etag + + pb.GrantRules = st.GrantRules + + pb.Name = st.Name + + return pb, nil +} + +type ruleSetResponsePb struct { + Etag string `json:"etag"` + + GrantRules []GrantRule `json:"grant_rules,omitempty"` + + Name string `json:"name"` +} + +func ruleSetResponseFromPb(pb *ruleSetResponsePb) (*RuleSetResponse, error) { + if pb == nil { + return nil, nil + } + st := &RuleSetResponse{} + st.Etag = pb.Etag + st.GrantRules = pb.GrantRules + st.Name = pb.Name + + return st, nil +} + +func ruleSetUpdateRequestToPb(st *RuleSetUpdateRequest) (*ruleSetUpdateRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &ruleSetUpdateRequestPb{} + pb.Etag = st.Etag + + pb.GrantRules = st.GrantRules + + pb.Name = st.Name + + return pb, nil +} + +type ruleSetUpdateRequestPb struct { + Etag string `json:"etag"` + + GrantRules []GrantRule `json:"grant_rules,omitempty"` + + Name string `json:"name"` +} + +func ruleSetUpdateRequestFromPb(pb *ruleSetUpdateRequestPb) (*RuleSetUpdateRequest, error) { + if pb == nil { + return nil, nil + } + st := &RuleSetUpdateRequest{} + st.Etag = pb.Etag + st.GrantRules = pb.GrantRules + st.Name = pb.Name + + return st, nil +} + +func servicePrincipalToPb(st *ServicePrincipal) (*servicePrincipalPb, error) { + if st == nil { + return nil, nil + } + pb := &servicePrincipalPb{} + pb.Active = st.Active + + pb.ApplicationId = st.ApplicationId + + pb.DisplayName = st.DisplayName + + pb.Entitlements = st.Entitlements + + pb.ExternalId = st.ExternalId + + pb.Groups = st.Groups + + pb.Id = st.Id + + pb.Roles = st.Roles + + pb.Schemas = st.Schemas + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servicePrincipalPb struct { + Active bool `json:"active,omitempty"` + + ApplicationId string `json:"applicationId,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Entitlements []ComplexValue `json:"entitlements,omitempty"` + + ExternalId string `json:"externalId,omitempty"` + + Groups []ComplexValue `json:"groups,omitempty"` + + Id string `json:"id,omitempty" url:"-"` + + Roles []ComplexValue `json:"roles,omitempty"` + + Schemas []ServicePrincipalSchema `json:"schemas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servicePrincipalFromPb(pb *servicePrincipalPb) (*ServicePrincipal, error) { + if pb == nil { + return nil, nil + } + st := &ServicePrincipal{} + st.Active = pb.Active + st.ApplicationId = pb.ApplicationId + st.DisplayName = pb.DisplayName + st.Entitlements = pb.Entitlements + st.ExternalId = pb.ExternalId + st.Groups = pb.Groups + st.Id = pb.Id + st.Roles = pb.Roles + st.Schemas = pb.Schemas + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servicePrincipalPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servicePrincipalPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setObjectPermissionsToPb(st *SetObjectPermissions) (*setObjectPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &setObjectPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.RequestObjectId = st.RequestObjectId + + pb.RequestObjectType = st.RequestObjectType + + return pb, nil +} + +type setObjectPermissionsPb struct { + AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + + RequestObjectId string `json:"-" url:"-"` + + RequestObjectType string `json:"-" url:"-"` +} + +func setObjectPermissionsFromPb(pb *setObjectPermissionsPb) (*SetObjectPermissions, error) { + if pb == nil { + return nil, nil + } + st := &SetObjectPermissions{} + st.AccessControlList = pb.AccessControlList + st.RequestObjectId = pb.RequestObjectId + st.RequestObjectType = pb.RequestObjectType + + return st, nil +} + +func updateObjectPermissionsToPb(st *UpdateObjectPermissions) (*updateObjectPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &updateObjectPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.RequestObjectId = st.RequestObjectId + + pb.RequestObjectType = st.RequestObjectType + + return pb, nil +} + +type updateObjectPermissionsPb struct { + AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + + RequestObjectId string `json:"-" url:"-"` + + RequestObjectType string `json:"-" url:"-"` +} + +func updateObjectPermissionsFromPb(pb *updateObjectPermissionsPb) (*UpdateObjectPermissions, error) { + if pb == nil { + return nil, nil + } + st := &UpdateObjectPermissions{} + st.AccessControlList = pb.AccessControlList + st.RequestObjectId = pb.RequestObjectId + st.RequestObjectType = pb.RequestObjectType + + return st, nil +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func updateRuleSetRequestToPb(st *UpdateRuleSetRequest) (*updateRuleSetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRuleSetRequestPb{} + pb.Name = st.Name + + pb.RuleSet = st.RuleSet + + return pb, nil +} + +type updateRuleSetRequestPb struct { + Name string `json:"name"` + + RuleSet RuleSetUpdateRequest `json:"rule_set"` +} + +func updateRuleSetRequestFromPb(pb *updateRuleSetRequestPb) (*UpdateRuleSetRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRuleSetRequest{} + st.Name = pb.Name + st.RuleSet = pb.RuleSet + + return st, nil +} + +func updateWorkspaceAssignmentsToPb(st *UpdateWorkspaceAssignments) (*updateWorkspaceAssignmentsPb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceAssignmentsPb{} + pb.Permissions = st.Permissions + + pb.PrincipalId = st.PrincipalId + + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type updateWorkspaceAssignmentsPb struct { + Permissions []WorkspacePermission `json:"permissions,omitempty"` + + PrincipalId int64 `json:"-" url:"-"` + + WorkspaceId int64 `json:"-" url:"-"` +} + +func updateWorkspaceAssignmentsFromPb(pb *updateWorkspaceAssignmentsPb) (*UpdateWorkspaceAssignments, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceAssignments{} + st.Permissions = pb.Permissions + st.PrincipalId = pb.PrincipalId + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func userToPb(st *User) (*userPb, error) { + if st == nil { + return nil, nil + } + pb := &userPb{} + pb.Active = st.Active + + pb.DisplayName = st.DisplayName + + pb.Emails = st.Emails + + pb.Entitlements = st.Entitlements + + pb.ExternalId = st.ExternalId + + pb.Groups = st.Groups + + pb.Id = st.Id + + pb.Name = st.Name + + pb.Roles = st.Roles + + pb.Schemas = st.Schemas + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type userPb struct { + Active bool `json:"active,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Emails []ComplexValue `json:"emails,omitempty"` + + Entitlements []ComplexValue `json:"entitlements,omitempty"` + + ExternalId string `json:"externalId,omitempty"` + + Groups []ComplexValue `json:"groups,omitempty"` + + Id string `json:"id,omitempty" url:"-"` + + Name *Name `json:"name,omitempty"` + + Roles []ComplexValue `json:"roles,omitempty"` + + Schemas []UserSchema `json:"schemas,omitempty"` + + UserName string `json:"userName,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func userFromPb(pb *userPb) (*User, error) { + if pb == nil { + return nil, nil + } + st := &User{} + st.Active = pb.Active + st.DisplayName = pb.DisplayName + st.Emails = pb.Emails + st.Entitlements = pb.Entitlements + st.ExternalId = pb.ExternalId + st.Groups = pb.Groups + st.Id = pb.Id + st.Name = pb.Name + st.Roles = pb.Roles + st.Schemas = pb.Schemas + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *userPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st userPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspacePermissionsToPb(st *WorkspacePermissions) (*workspacePermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &workspacePermissionsPb{} + pb.Permissions = st.Permissions + + return pb, nil +} + +type workspacePermissionsPb struct { + Permissions []PermissionOutput `json:"permissions,omitempty"` +} + +func workspacePermissionsFromPb(pb *workspacePermissionsPb) (*WorkspacePermissions, error) { + if pb == nil { + return nil, nil + } + st := &WorkspacePermissions{} + st.Permissions = pb.Permissions + + return st, nil +} diff --git a/service/iam/model.go b/service/iam/model.go index 0bd923991..a3ebdf1c6 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -3,202 +3,655 @@ package iam import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := accessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccessControlResponse struct { // All permissions. - AllPermissions []Permission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []Permission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := accessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // represents an identity trying to access a resource - user or a service // principal group can be a principal of a permission set assignment but an // actor is always a user or a service principal type Actor struct { - ActorId int64 `json:"actor_id,omitempty" url:"actor_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'actor_id' + ActorId int64 + + ForceSendFields []string `tf:"-"` } -func (s *Actor) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Actor) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &actorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := actorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Actor) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Actor) MarshalJSON() ([]byte, error) { + pb, err := actorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Check access policy to a resource type CheckPolicyRequest struct { - Actor Actor `json:"-" url:"actor"` - AuthzIdentity RequestAuthzIdentity `json:"-" url:"authz_identity"` + // Wire name: 'actor' + Actor Actor `tf:"-"` + + // Wire name: 'authz_identity' + AuthzIdentity RequestAuthzIdentity `tf:"-"` - ConsistencyToken ConsistencyToken `json:"-" url:"consistency_token"` + // Wire name: 'consistency_token' + ConsistencyToken ConsistencyToken `tf:"-"` - Permission string `json:"-" url:"permission"` + // Wire name: 'permission' + Permission string `tf:"-"` // Ex: (servicePrincipal/use, // accounts//servicePrincipals/) Ex: // (servicePrincipal.ruleSet/update, // accounts//servicePrincipals//ruleSets/default) - Resource string `json:"-" url:"resource"` + // Wire name: 'resource' + Resource string `tf:"-"` + + // Wire name: 'resource_info' + ResourceInfo *ResourceInfo `tf:"-"` +} + +func (st *CheckPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &checkPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := checkPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - ResourceInfo *ResourceInfo `json:"-" url:"resource_info,omitempty"` +func (st CheckPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := checkPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CheckPolicyResponse struct { - ConsistencyToken ConsistencyToken `json:"consistency_token"` - IsPermitted bool `json:"is_permitted,omitempty"` + // Wire name: 'consistency_token' + ConsistencyToken ConsistencyToken + + // Wire name: 'is_permitted' + IsPermitted bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CheckPolicyResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CheckPolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &checkPolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := checkPolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CheckPolicyResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CheckPolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := checkPolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ComplexValue struct { - Display string `json:"display,omitempty"` - Primary bool `json:"primary,omitempty"` + // Wire name: 'display' + Display string + + // Wire name: 'primary' + Primary bool - Ref string `json:"$ref,omitempty"` + // Wire name: '$ref' + Ref string - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComplexValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComplexValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &complexValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := complexValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComplexValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComplexValue) MarshalJSON() ([]byte, error) { + pb, err := complexValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ConsistencyToken struct { - Value string `json:"value"` + + // Wire name: 'value' + Value string +} + +func (st *ConsistencyToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &consistencyTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := consistencyTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ConsistencyToken) MarshalJSON() ([]byte, error) { + pb, err := consistencyTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a group. type DeleteAccountGroupRequest struct { // Unique ID for a group in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteAccountGroupRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountGroupRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountGroupRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountGroupRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountGroupRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a service principal. type DeleteAccountServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteAccountServicePrincipalRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountServicePrincipalRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountServicePrincipalRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountServicePrincipalRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a user. type DeleteAccountUserRequest struct { // Unique ID for a user in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteAccountUserRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountUserRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountUserRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountUserRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountUserRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a group. type DeleteGroupRequest struct { // Unique ID for a group in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteGroupRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteGroupRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteGroupRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteGroupRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteGroupRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a service principal. type DeleteServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteServicePrincipalRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteServicePrincipalRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteServicePrincipalRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteServicePrincipalRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteServicePrincipalRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a user. type DeleteUserRequest struct { // Unique ID for a user in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteUserRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteUserRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteUserRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteUserRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteUserRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete permissions assignment type DeleteWorkspaceAssignmentRequest struct { // The ID of the user, service principal, or group. - PrincipalId int64 `json:"-" url:"-"` + // Wire name: 'principal_id' + PrincipalId int64 `tf:"-"` // The workspace ID for the account. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *DeleteWorkspaceAssignmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWorkspaceAssignmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWorkspaceAssignmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWorkspaceAssignmentRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteWorkspaceAssignmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteWorkspacePermissionAssignmentResponse struct { } +func (st *DeleteWorkspacePermissionAssignmentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWorkspacePermissionAssignmentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWorkspacePermissionAssignmentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWorkspacePermissionAssignmentResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteWorkspacePermissionAssignmentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get group details. type GetAccountGroupRequest struct { // Unique ID for a group in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetAccountGroupRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountGroupRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountGroupRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountGroupRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountGroupRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get service principal details. type GetAccountServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetAccountServicePrincipalRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountServicePrincipalRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountServicePrincipalRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountServicePrincipalRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get user details. type GetAccountUserRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. Default is 10000. - Count int `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -206,26 +659,48 @@ type GetAccountUserRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Unique ID for a user in the Databricks account. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // Attribute to sort the results. Multi-part paths are supported. For // example, `userName`, `name.givenName`, and `emails`. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder GetSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetAccountUserRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetAccountUserRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountUserRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountUserRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetAccountUserRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetAccountUserRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountUserRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get assignable roles for a resource @@ -237,50 +712,236 @@ type GetAssignableRolesForResourceRequest struct { // `resource=accounts//groups/` | A resource name for // the group. `resource=accounts//servicePrincipals/` | A // resource name for the service principal. - Resource string `json:"-" url:"resource"` + // Wire name: 'resource' + Resource string `tf:"-"` +} + +func (st *GetAssignableRolesForResourceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAssignableRolesForResourceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAssignableRolesForResourceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAssignableRolesForResourceRequest) MarshalJSON() ([]byte, error) { + pb, err := getAssignableRolesForResourceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetAssignableRolesForResourceResponse struct { - Roles []Role `json:"roles,omitempty"` + + // Wire name: 'roles' + Roles []Role +} + +func (st *GetAssignableRolesForResourceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAssignableRolesForResourceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAssignableRolesForResourceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAssignableRolesForResourceResponse) MarshalJSON() ([]byte, error) { + pb, err := getAssignableRolesForResourceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get group details. type GetGroupRequest struct { // Unique ID for a group in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetGroupRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getGroupRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getGroupRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetGroupRequest) MarshalJSON() ([]byte, error) { + pb, err := getGroupRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPasswordPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []PasswordPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []PasswordPermissionsDescription +} + +func (st *GetPasswordPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPasswordPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPasswordPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPasswordPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getPasswordPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get object permission levels type GetPermissionLevelsRequest struct { - RequestObjectId string `json:"-" url:"-"` + + // Wire name: 'request_object_id' + RequestObjectId string `tf:"-"` // The type of the request object. Can be one of the following: alerts, // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, // directories, experiments, files, instance-pools, jobs, notebooks, // pipelines, queries, registered-models, repos, serving-endpoints, or // warehouses. - RequestObjectType string `json:"-" url:"-"` + // Wire name: 'request_object_type' + RequestObjectType string `tf:"-"` +} + +func (st *GetPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []PermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []PermissionsDescription +} + +func (st *GetPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get object permissions type GetPermissionRequest struct { // The id of the request object. - RequestObjectId string `json:"-" url:"-"` + // Wire name: 'request_object_id' + RequestObjectId string `tf:"-"` // The type of the request object. Can be one of the following: alerts, // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, // directories, experiments, files, instance-pools, jobs, notebooks, // pipelines, queries, registered-models, repos, serving-endpoints, or // warehouses. - RequestObjectType string `json:"-" url:"-"` + // Wire name: 'request_object_type' + RequestObjectType string `tf:"-"` +} + +func (st *GetPermissionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPermissionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPermissionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPermissionRequest) MarshalJSON() ([]byte, error) { + pb, err := getPermissionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a rule set @@ -298,7 +959,8 @@ type GetRuleSetRequest struct { // in GET to indicate no freshness requirements. // `etag=RENUAAABhSweA4NvVmmUYdiU717H3Tgy0UJdor3gE4a+mq/oj9NjAf8ZsQ==` | An // etag encoded a specific version of the rule set to get or to be updated. - Etag string `json:"-" url:"etag"` + // Wire name: 'etag' + Etag string `tf:"-"` // The ruleset name associated with the request. // // Examples | Summary :--- | :--- @@ -308,16 +970,69 @@ type GetRuleSetRequest struct { // for a rule set on the group. // `name=accounts//servicePrincipals//ruleSets/default` // | A name for a rule set on the service principal. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetRuleSetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRuleSetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRuleSetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRuleSetRequest) MarshalJSON() ([]byte, error) { + pb, err := getRuleSetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get service principal details. type GetServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetServicePrincipalRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServicePrincipalRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServicePrincipalRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServicePrincipalRequest) MarshalJSON() ([]byte, error) { + pb, err := getServicePrincipalRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetSortOrder string +type getSortOrderPb string const GetSortOrderAscending GetSortOrder = `ascending` @@ -344,14 +1059,33 @@ func (f *GetSortOrder) Type() string { return "GetSortOrder" } +func getSortOrderToPb(st *GetSortOrder) (*getSortOrderPb, error) { + if st == nil { + return nil, nil + } + pb := getSortOrderPb(*st) + return &pb, nil +} + +func getSortOrderFromPb(pb *getSortOrderPb) (*GetSortOrder, error) { + if pb == nil { + return nil, nil + } + st := GetSortOrder(*pb) + return &st, nil +} + // Get user details. type GetUserRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. - Count int `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -359,32 +1093,80 @@ type GetUserRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Unique ID for a user in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // Attribute to sort the results. Multi-part paths are supported. For // example, `userName`, `name.givenName`, and `emails`. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder GetSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetUserRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetUserRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getUserRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getUserRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetUserRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetUserRequest) MarshalJSON() ([]byte, error) { + pb, err := getUserRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List workspace permissions type GetWorkspaceAssignmentRequest struct { // The workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *GetWorkspaceAssignmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceAssignmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceAssignmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceAssignmentRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceAssignmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GrantRule struct { @@ -393,46 +1175,100 @@ type GrantRule struct { // an account group. Each principal has its own identifier format: * // users/ * groups/ * // servicePrincipals/ - Principals []string `json:"principals,omitempty"` + // Wire name: 'principals' + Principals []string // Role that is assigned to the list of principals. - Role string `json:"role"` + // Wire name: 'role' + Role string +} + +func (st *GrantRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &grantRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := grantRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GrantRule) MarshalJSON() ([]byte, error) { + pb, err := grantRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Group struct { // String that represents a human-readable group name - DisplayName string `json:"displayName,omitempty"` + // Wire name: 'displayName' + DisplayName string // Entitlements assigned to the group. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements []ComplexValue `json:"entitlements,omitempty"` + // Wire name: 'entitlements' + Entitlements []ComplexValue - ExternalId string `json:"externalId,omitempty"` + // Wire name: 'externalId' + ExternalId string - Groups []ComplexValue `json:"groups,omitempty"` + // Wire name: 'groups' + Groups []ComplexValue // Databricks group ID - Id string `json:"id,omitempty" url:"-"` + // Wire name: 'id' + Id string - Members []ComplexValue `json:"members,omitempty"` + // Wire name: 'members' + Members []ComplexValue // Container for the group identifier. Workspace local versus account. - Meta *ResourceMeta `json:"meta,omitempty"` + // Wire name: 'meta' + Meta *ResourceMeta // Corresponds to AWS instance profile/arn role. - Roles []ComplexValue `json:"roles,omitempty"` + // Wire name: 'roles' + Roles []ComplexValue // The schema of the group. - Schemas []GroupSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []GroupSchema - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Group) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Group) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &groupPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := groupFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Group) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Group) MarshalJSON() ([]byte, error) { + pb, err := groupToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GroupSchema string +type groupSchemaPb string const GroupSchemaUrnIetfParamsScimSchemasCore20Group GroupSchema = `urn:ietf:params:scim:schemas:core:2.0:Group` @@ -457,14 +1293,33 @@ func (f *GroupSchema) Type() string { return "GroupSchema" } +func groupSchemaToPb(st *GroupSchema) (*groupSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := groupSchemaPb(*st) + return &pb, nil +} + +func groupSchemaFromPb(pb *groupSchemaPb) (*GroupSchema, error) { + if pb == nil { + return nil, nil + } + st := GroupSchema(*pb) + return &st, nil +} + // List group details. type ListAccountGroupsRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. Default is 10000. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -472,33 +1327,57 @@ type ListAccountGroupsRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAccountGroupsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAccountGroupsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountGroupsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountGroupsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAccountGroupsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAccountGroupsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountGroupsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List service principals. type ListAccountServicePrincipalsRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. Default is 10000. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -506,33 +1385,57 @@ type ListAccountServicePrincipalsRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAccountServicePrincipalsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAccountServicePrincipalsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountServicePrincipalsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountServicePrincipalsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAccountServicePrincipalsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAccountServicePrincipalsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountServicePrincipalsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List users. type ListAccountUsersRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. Default is 10000. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -540,34 +1443,58 @@ type ListAccountUsersRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. Multi-part paths are supported. For // example, `userName`, `name.givenName`, and `emails`. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAccountUsersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAccountUsersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountUsersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountUsersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAccountUsersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAccountUsersRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountUsersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List group details. type ListGroupsRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -575,50 +1502,94 @@ type ListGroupsRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListGroupsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListGroupsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listGroupsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listGroupsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListGroupsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListGroupsRequest) MarshalJSON() ([]byte, error) { + pb, err := listGroupsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListGroupsResponse struct { // Total results returned in the response. - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + // Wire name: 'itemsPerPage' + ItemsPerPage int64 // User objects returned in the response. - Resources []Group `json:"Resources,omitempty"` + // Wire name: 'Resources' + Resources []Group // The schema of the service principal. - Schemas []ListResponseSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []ListResponseSchema // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex int64 `json:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 // Total results that match the request filters. - TotalResults int64 `json:"totalResults,omitempty"` + // Wire name: 'totalResults' + TotalResults int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListGroupsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListGroupsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listGroupsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listGroupsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListGroupsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListGroupsResponse) MarshalJSON() ([]byte, error) { + pb, err := listGroupsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListResponseSchema string +type listResponseSchemaPb string const ListResponseSchemaUrnIetfParamsScimApiMessages20ListResponse ListResponseSchema = `urn:ietf:params:scim:api:messages:2.0:ListResponse` @@ -643,38 +1614,79 @@ func (f *ListResponseSchema) Type() string { return "ListResponseSchema" } +func listResponseSchemaToPb(st *ListResponseSchema) (*listResponseSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := listResponseSchemaPb(*st) + return &pb, nil +} + +func listResponseSchemaFromPb(pb *listResponseSchemaPb) (*ListResponseSchema, error) { + if pb == nil { + return nil, nil + } + st := ListResponseSchema(*pb) + return &st, nil +} + type ListServicePrincipalResponse struct { // Total results returned in the response. - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + // Wire name: 'itemsPerPage' + ItemsPerPage int64 // User objects returned in the response. - Resources []ServicePrincipal `json:"Resources,omitempty"` + // Wire name: 'Resources' + Resources []ServicePrincipal // The schema of the List response. - Schemas []ListResponseSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []ListResponseSchema // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex int64 `json:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 // Total results that match the request filters. - TotalResults int64 `json:"totalResults,omitempty"` + // Wire name: 'totalResults' + TotalResults int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListServicePrincipalResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListServicePrincipalResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listServicePrincipalResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listServicePrincipalResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListServicePrincipalResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListServicePrincipalResponse) MarshalJSON() ([]byte, error) { + pb, err := listServicePrincipalResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List service principals. type ListServicePrincipalsRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -682,26 +1694,48 @@ type ListServicePrincipalsRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListServicePrincipalsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListServicePrincipalsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listServicePrincipalsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listServicePrincipalsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListServicePrincipalsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListServicePrincipalsRequest) MarshalJSON() ([]byte, error) { + pb, err := listServicePrincipalsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSortOrder string +type listSortOrderPb string const ListSortOrderAscending ListSortOrder = `ascending` @@ -728,14 +1762,33 @@ func (f *ListSortOrder) Type() string { return "ListSortOrder" } +func listSortOrderToPb(st *ListSortOrder) (*listSortOrderPb, error) { + if st == nil { + return nil, nil + } + pb := listSortOrderPb(*st) + return &pb, nil +} + +func listSortOrderFromPb(pb *listSortOrderPb) (*ListSortOrder, error) { + if pb == nil { + return nil, nil + } + st := ListSortOrder(*pb) + return &st, nil +} + // List users. type ListUsersRequest struct { // Comma-separated list of attributes to return in response. - Attributes string `json:"-" url:"attributes,omitempty"` + // Wire name: 'attributes' + Attributes string `tf:"-"` // Desired number of results per page. - Count int64 `json:"-" url:"count,omitempty"` + // Wire name: 'count' + Count int64 `tf:"-"` // Comma-separated list of attributes to exclude in response. - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + // Wire name: 'excludedAttributes' + ExcludedAttributes string `tf:"-"` // Query by which the results have to be filtered. Supported operators are // equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). // Additionally, simple expressions can be formed using logical operators - @@ -743,202 +1796,443 @@ type ListUsersRequest struct { // support simple expressions. // // [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Attribute to sort the results. Multi-part paths are supported. For // example, `userName`, `name.givenName`, and `emails`. - SortBy string `json:"-" url:"sortBy,omitempty"` + // Wire name: 'sortBy' + SortBy string `tf:"-"` // The order to sort the results. - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + // Wire name: 'sortOrder' + SortOrder ListSortOrder `tf:"-"` // Specifies the index of the first result. First item is number 1. - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListUsersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListUsersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listUsersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listUsersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListUsersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListUsersRequest) MarshalJSON() ([]byte, error) { + pb, err := listUsersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListUsersResponse struct { // Total results returned in the response. - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + // Wire name: 'itemsPerPage' + ItemsPerPage int64 // User objects returned in the response. - Resources []User `json:"Resources,omitempty"` + // Wire name: 'Resources' + Resources []User // The schema of the List response. - Schemas []ListResponseSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []ListResponseSchema // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex int64 `json:"startIndex,omitempty"` + // Wire name: 'startIndex' + StartIndex int64 // Total results that match the request filters. - TotalResults int64 `json:"totalResults,omitempty"` + // Wire name: 'totalResults' + TotalResults int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListUsersResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListUsersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listUsersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listUsersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListUsersResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListUsersResponse) MarshalJSON() ([]byte, error) { + pb, err := listUsersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get permission assignments type ListWorkspaceAssignmentRequest struct { // The workspace ID for the account. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *ListWorkspaceAssignmentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listWorkspaceAssignmentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listWorkspaceAssignmentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListWorkspaceAssignmentRequest) MarshalJSON() ([]byte, error) { + pb, err := listWorkspaceAssignmentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MigratePermissionsRequest struct { // The name of the workspace group that permissions will be migrated from. - FromWorkspaceGroupName string `json:"from_workspace_group_name"` + // Wire name: 'from_workspace_group_name' + FromWorkspaceGroupName string // The maximum number of permissions that will be migrated. - Size int `json:"size,omitempty"` + // Wire name: 'size' + Size int // The name of the account group that permissions will be migrated to. - ToAccountGroupName string `json:"to_account_group_name"` + // Wire name: 'to_account_group_name' + ToAccountGroupName string // WorkspaceId of the associated workspace where the permission migration // will occur. - WorkspaceId int64 `json:"workspace_id"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MigratePermissionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MigratePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &migratePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := migratePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MigratePermissionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MigratePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := migratePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MigratePermissionsResponse struct { // Number of permissions migrated. - PermissionsMigrated int `json:"permissions_migrated,omitempty"` + // Wire name: 'permissions_migrated' + PermissionsMigrated int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MigratePermissionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MigratePermissionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &migratePermissionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := migratePermissionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MigratePermissionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MigratePermissionsResponse) MarshalJSON() ([]byte, error) { + pb, err := migratePermissionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Name struct { // Family name of the Databricks user. - FamilyName string `json:"familyName,omitempty"` + // Wire name: 'familyName' + FamilyName string // Given name of the Databricks user. - GivenName string `json:"givenName,omitempty"` + // Wire name: 'givenName' + GivenName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Name) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Name) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &namePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nameFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Name) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Name) MarshalJSON() ([]byte, error) { + pb, err := nameToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ObjectPermissions struct { - AccessControlList []AccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []AccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ObjectPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ObjectPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &objectPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := objectPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ObjectPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ObjectPermissions) MarshalJSON() ([]byte, error) { + pb, err := objectPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PartialUpdate struct { // Unique ID in the Databricks workspace. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` - Operations []Patch `json:"Operations,omitempty"` + // Wire name: 'Operations' + Operations []Patch // The schema of the patch request. Must be // ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. - Schemas []PatchSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []PatchSchema +} + +func (st *PartialUpdate) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &partialUpdatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := partialUpdateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PartialUpdate) MarshalJSON() ([]byte, error) { + pb, err := partialUpdateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PasswordAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PasswordPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PasswordAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PasswordAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PasswordAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PasswordAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := passwordAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PasswordAccessControlResponse struct { // All permissions. - AllPermissions []PasswordPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []PasswordPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PasswordAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PasswordAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PasswordAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PasswordAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := passwordAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PasswordPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PasswordPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PasswordPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PasswordPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PasswordPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PasswordPermission) MarshalJSON() ([]byte, error) { + pb, err := passwordPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type PasswordPermissionLevel string +type passwordPermissionLevelPb string const PasswordPermissionLevelCanUse PasswordPermissionLevel = `CAN_USE` @@ -963,65 +2257,170 @@ func (f *PasswordPermissionLevel) Type() string { return "PasswordPermissionLevel" } +func passwordPermissionLevelToPb(st *PasswordPermissionLevel) (*passwordPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := passwordPermissionLevelPb(*st) + return &pb, nil +} + +func passwordPermissionLevelFromPb(pb *passwordPermissionLevelPb) (*PasswordPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := PasswordPermissionLevel(*pb) + return &st, nil +} + type PasswordPermissions struct { - AccessControlList []PasswordAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []PasswordAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PasswordPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PasswordPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PasswordPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PasswordPermissions) MarshalJSON() ([]byte, error) { + pb, err := passwordPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PasswordPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PasswordPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PasswordPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PasswordPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PasswordPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PasswordPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := passwordPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PasswordPermissionsRequest struct { - AccessControlList []PasswordAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []PasswordAccessControlRequest +} + +func (st *PasswordPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &passwordPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := passwordPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PasswordPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := passwordPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Patch struct { // Type of patch operation. - Op PatchOp `json:"op,omitempty"` + // Wire name: 'op' + Op PatchOp // Selection of patch operation - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // Value to modify - Value any `json:"value,omitempty"` + // Wire name: 'value' + Value any - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Patch) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Patch) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Patch) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Patch) MarshalJSON() ([]byte, error) { + pb, err := patchToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Type of patch operation. type PatchOp string +type patchOpPb string const PatchOpAdd PatchOp = `add` @@ -1050,10 +2449,52 @@ func (f *PatchOp) Type() string { return "PatchOp" } +func patchOpToPb(st *PatchOp) (*patchOpPb, error) { + if st == nil { + return nil, nil + } + pb := patchOpPb(*st) + return &pb, nil +} + +func patchOpFromPb(pb *patchOpPb) (*PatchOp, error) { + if pb == nil { + return nil, nil + } + st := PatchOp(*pb) + return &st, nil +} + type PatchResponse struct { } +func (st *PatchResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PatchResponse) MarshalJSON() ([]byte, error) { + pb, err := patchResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type PatchSchema string +type patchSchemaPb string const PatchSchemaUrnIetfParamsScimApiMessages20PatchOp PatchSchema = `urn:ietf:params:scim:api:messages:2.0:PatchOp` @@ -1078,52 +2519,136 @@ func (f *PatchSchema) Type() string { return "PatchSchema" } +func patchSchemaToPb(st *PatchSchema) (*patchSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := patchSchemaPb(*st) + return &pb, nil +} + +func patchSchemaFromPb(pb *patchSchemaPb) (*PatchSchema, error) { + if pb == nil { + return nil, nil + } + st := PatchSchema(*pb) + return &st, nil +} + type Permission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Permission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Permission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Permission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Permission) MarshalJSON() ([]byte, error) { + pb, err := permissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The output format for existing workspace PermissionAssignment records, which // contains some info for user consumption. type PermissionAssignment struct { // Error response associated with a workspace permission assignment, if any. - Error string `json:"error,omitempty"` + // Wire name: 'error' + Error string // The permissions level of the principal. - Permissions []WorkspacePermission `json:"permissions,omitempty"` + // Wire name: 'permissions' + Permissions []WorkspacePermission // Information about the principal assigned to the workspace. - Principal *PrincipalOutput `json:"principal,omitempty"` + // Wire name: 'principal' + Principal *PrincipalOutput - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PermissionAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PermissionAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PermissionAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermissionAssignment) MarshalJSON() ([]byte, error) { + pb, err := permissionAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PermissionAssignments struct { // Array of permissions assignments defined for a workspace. - PermissionAssignments []PermissionAssignment `json:"permission_assignments,omitempty"` + // Wire name: 'permission_assignments' + PermissionAssignments []PermissionAssignment +} + +func (st *PermissionAssignments) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionAssignmentsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionAssignmentsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PermissionAssignments) MarshalJSON() ([]byte, error) { + pb, err := permissionAssignmentsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type PermissionLevel string +type permissionLevelPb string const PermissionLevelCanAttachTo PermissionLevel = `CAN_ATTACH_TO` @@ -1184,67 +2709,145 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } +func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := permissionLevelPb(*st) + return &pb, nil +} + +func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := PermissionLevel(*pb) + return &st, nil +} + type PermissionOutput struct { // The results of a permissions query. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string - PermissionLevel WorkspacePermission `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WorkspacePermission - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PermissionOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PermissionOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PermissionOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermissionOutput) MarshalJSON() ([]byte, error) { + pb, err := permissionOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := permissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Information about the principal assigned to the workspace. type PrincipalOutput struct { // The display name of the principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // The group name of the group. Present only if the principal is a group. - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // The unique, opaque id of the principal. - PrincipalId int64 `json:"principal_id,omitempty"` + // Wire name: 'principal_id' + PrincipalId int64 // The name of the service principal. Present only if the principal is a // service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // The username of the user. Present only if the principal is a user. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PrincipalOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PrincipalOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &principalOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := principalOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PrincipalOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PrincipalOutput) MarshalJSON() ([]byte, error) { + pb, err := principalOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Defines the identity to be used for authZ of the request on the server side. // See one pager for for more information: http://go/acl/service-identity type RequestAuthzIdentity string +type requestAuthzIdentityPb string const RequestAuthzIdentityRequestAuthzIdentityServiceIdentity RequestAuthzIdentity = `REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY` @@ -1271,45 +2874,125 @@ func (f *RequestAuthzIdentity) Type() string { return "RequestAuthzIdentity" } +func requestAuthzIdentityToPb(st *RequestAuthzIdentity) (*requestAuthzIdentityPb, error) { + if st == nil { + return nil, nil + } + pb := requestAuthzIdentityPb(*st) + return &pb, nil +} + +func requestAuthzIdentityFromPb(pb *requestAuthzIdentityPb) (*RequestAuthzIdentity, error) { + if pb == nil { + return nil, nil + } + st := RequestAuthzIdentity(*pb) + return &st, nil +} + type ResourceInfo struct { // Id of the current resource. - Id string `json:"id" url:"id"` + // Wire name: 'id' + Id string // The legacy acl path of the current resource. - LegacyAclPath string `json:"legacy_acl_path,omitempty" url:"legacy_acl_path,omitempty"` + // Wire name: 'legacy_acl_path' + LegacyAclPath string // Parent resource info for the current resource. The parent may have // another parent. - ParentResourceInfo *ResourceInfo `json:"parent_resource_info,omitempty" url:"parent_resource_info,omitempty"` + // Wire name: 'parent_resource_info' + ParentResourceInfo *ResourceInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResourceInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResourceInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resourceInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resourceInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResourceInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResourceInfo) MarshalJSON() ([]byte, error) { + pb, err := resourceInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResourceMeta struct { // Identifier for group type. Can be local workspace group // (`WorkspaceGroup`) or account group (`Group`). - ResourceType string `json:"resourceType,omitempty"` + // Wire name: 'resourceType' + ResourceType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResourceMeta) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResourceMeta) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resourceMetaPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resourceMetaFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResourceMeta) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResourceMeta) MarshalJSON() ([]byte, error) { + pb, err := resourceMetaToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Role struct { // Role to assign to a principal or a list of principals on a resource. - Name string `json:"name"` + // Wire name: 'name' + Name string +} + +func (st *Role) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rolePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := roleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Role) MarshalJSON() ([]byte, error) { + pb, err := roleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RuleSetResponse struct { @@ -1322,11 +3005,39 @@ type RuleSetResponse struct { // race conditions that is get an etag from a GET rule set request, and pass // it with the PUT update request to identify the rule set version you are // updating. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string - GrantRules []GrantRule `json:"grant_rules,omitempty"` + // Wire name: 'grant_rules' + GrantRules []GrantRule // Name of the rule set. - Name string `json:"name"` + // Wire name: 'name' + Name string +} + +func (st *RuleSetResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ruleSetResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ruleSetResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RuleSetResponse) MarshalJSON() ([]byte, error) { + pb, err := ruleSetResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RuleSetUpdateRequest struct { @@ -1339,48 +3050,103 @@ type RuleSetUpdateRequest struct { // race conditions that is get an etag from a GET rule set request, and pass // it with the PUT update request to identify the rule set version you are // updating. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string - GrantRules []GrantRule `json:"grant_rules,omitempty"` + // Wire name: 'grant_rules' + GrantRules []GrantRule // Name of the rule set. - Name string `json:"name"` + // Wire name: 'name' + Name string +} + +func (st *RuleSetUpdateRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ruleSetUpdateRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ruleSetUpdateRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RuleSetUpdateRequest) MarshalJSON() ([]byte, error) { + pb, err := ruleSetUpdateRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServicePrincipal struct { // If this user is active - Active bool `json:"active,omitempty"` + // Wire name: 'active' + Active bool // UUID relating to the service principal - ApplicationId string `json:"applicationId,omitempty"` + // Wire name: 'applicationId' + ApplicationId string // String that represents a concatenation of given and family names. - DisplayName string `json:"displayName,omitempty"` + // Wire name: 'displayName' + DisplayName string // Entitlements assigned to the service principal. See [assigning // entitlements] for a full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements []ComplexValue `json:"entitlements,omitempty"` + // Wire name: 'entitlements' + Entitlements []ComplexValue - ExternalId string `json:"externalId,omitempty"` + // Wire name: 'externalId' + ExternalId string - Groups []ComplexValue `json:"groups,omitempty"` + // Wire name: 'groups' + Groups []ComplexValue // Databricks service principal ID. - Id string `json:"id,omitempty" url:"-"` + // Wire name: 'id' + Id string // Corresponds to AWS instance profile/arn role. - Roles []ComplexValue `json:"roles,omitempty"` + // Wire name: 'roles' + Roles []ComplexValue // The schema of the List response. - Schemas []ServicePrincipalSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []ServicePrincipalSchema - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServicePrincipal) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServicePrincipal) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servicePrincipalPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servicePrincipalFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServicePrincipal) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServicePrincipal) MarshalJSON() ([]byte, error) { + pb, err := servicePrincipalToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServicePrincipalSchema string +type servicePrincipalSchemaPb string const ServicePrincipalSchemaUrnIetfParamsScimSchemasCore20ServicePrincipal ServicePrincipalSchema = `urn:ietf:params:scim:schemas:core:2.0:ServicePrincipal` @@ -1405,38 +3171,164 @@ func (f *ServicePrincipalSchema) Type() string { return "ServicePrincipalSchema" } +func servicePrincipalSchemaToPb(st *ServicePrincipalSchema) (*servicePrincipalSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := servicePrincipalSchemaPb(*st) + return &pb, nil +} + +func servicePrincipalSchemaFromPb(pb *servicePrincipalSchemaPb) (*ServicePrincipalSchema, error) { + if pb == nil { + return nil, nil + } + st := ServicePrincipalSchema(*pb) + return &st, nil +} + type SetObjectPermissions struct { - AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AccessControlRequest // The id of the request object. - RequestObjectId string `json:"-" url:"-"` + // Wire name: 'request_object_id' + RequestObjectId string `tf:"-"` // The type of the request object. Can be one of the following: alerts, // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, // directories, experiments, files, instance-pools, jobs, notebooks, // pipelines, queries, registered-models, repos, serving-endpoints, or // warehouses. - RequestObjectType string `json:"-" url:"-"` + // Wire name: 'request_object_type' + RequestObjectType string `tf:"-"` +} + +func (st *SetObjectPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setObjectPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setObjectPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetObjectPermissions) MarshalJSON() ([]byte, error) { + pb, err := setObjectPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateObjectPermissions struct { - AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AccessControlRequest // The id of the request object. - RequestObjectId string `json:"-" url:"-"` + // Wire name: 'request_object_id' + RequestObjectId string `tf:"-"` // The type of the request object. Can be one of the following: alerts, // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, // directories, experiments, files, instance-pools, jobs, notebooks, // pipelines, queries, registered-models, repos, serving-endpoints, or // warehouses. - RequestObjectType string `json:"-" url:"-"` + // Wire name: 'request_object_type' + RequestObjectType string `tf:"-"` +} + +func (st *UpdateObjectPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateObjectPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateObjectPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateObjectPermissions) MarshalJSON() ([]byte, error) { + pb, err := updateObjectPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateRuleSetRequest struct { // Name of the rule set. - Name string `json:"name"` + // Wire name: 'name' + Name string + + // Wire name: 'rule_set' + RuleSet RuleSetUpdateRequest +} + +func (st *UpdateRuleSetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRuleSetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRuleSetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - RuleSet RuleSetUpdateRequest `json:"rule_set"` +func (st UpdateRuleSetRequest) MarshalJSON() ([]byte, error) { + pb, err := updateRuleSetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateWorkspaceAssignments struct { @@ -1446,57 +3338,114 @@ type UpdateWorkspaceAssignments struct { // that excluding this field, or providing unsupported values, will have the // same effect as providing an empty list, which will result in the deletion // of all permissions for the principal. - Permissions []WorkspacePermission `json:"permissions,omitempty"` + // Wire name: 'permissions' + Permissions []WorkspacePermission // The ID of the user, service principal, or group. - PrincipalId int64 `json:"-" url:"-"` + // Wire name: 'principal_id' + PrincipalId int64 `tf:"-"` // The workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *UpdateWorkspaceAssignments) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceAssignmentsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceAssignmentsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateWorkspaceAssignments) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceAssignmentsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type User struct { // If this user is active - Active bool `json:"active,omitempty"` + // Wire name: 'active' + Active bool // String that represents a concatenation of given and family names. For // example `John Smith`. This field cannot be updated through the Workspace // SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to // update `displayName`. // // [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation - DisplayName string `json:"displayName,omitempty"` + // Wire name: 'displayName' + DisplayName string // All the emails associated with the Databricks user. - Emails []ComplexValue `json:"emails,omitempty"` + // Wire name: 'emails' + Emails []ComplexValue // Entitlements assigned to the user. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements []ComplexValue `json:"entitlements,omitempty"` + // Wire name: 'entitlements' + Entitlements []ComplexValue // External ID is not currently supported. It is reserved for future use. - ExternalId string `json:"externalId,omitempty"` + // Wire name: 'externalId' + ExternalId string - Groups []ComplexValue `json:"groups,omitempty"` + // Wire name: 'groups' + Groups []ComplexValue // Databricks user ID. - Id string `json:"id,omitempty" url:"-"` + // Wire name: 'id' + Id string - Name *Name `json:"name,omitempty"` + // Wire name: 'name' + Name *Name // Corresponds to AWS instance profile/arn role. - Roles []ComplexValue `json:"roles,omitempty"` + // Wire name: 'roles' + Roles []ComplexValue // The schema of the user. - Schemas []UserSchema `json:"schemas,omitempty"` + // Wire name: 'schemas' + Schemas []UserSchema // Email address of the Databricks user. - UserName string `json:"userName,omitempty"` + // Wire name: 'userName' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *User) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *User) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &userPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := userFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s User) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st User) MarshalJSON() ([]byte, error) { + pb, err := userToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UserSchema string +type userSchemaPb string const UserSchemaUrnIetfParamsScimSchemasCore20User UserSchema = `urn:ietf:params:scim:schemas:core:2.0:User` @@ -1523,7 +3472,24 @@ func (f *UserSchema) Type() string { return "UserSchema" } +func userSchemaToPb(st *UserSchema) (*userSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := userSchemaPb(*st) + return &pb, nil +} + +func userSchemaFromPb(pb *userSchemaPb) (*UserSchema, error) { + if pb == nil { + return nil, nil + } + st := UserSchema(*pb) + return &st, nil +} + type WorkspacePermission string +type workspacePermissionPb string const WorkspacePermissionAdmin WorkspacePermission = `ADMIN` @@ -1552,7 +3518,103 @@ func (f *WorkspacePermission) Type() string { return "WorkspacePermission" } +func workspacePermissionToPb(st *WorkspacePermission) (*workspacePermissionPb, error) { + if st == nil { + return nil, nil + } + pb := workspacePermissionPb(*st) + return &pb, nil +} + +func workspacePermissionFromPb(pb *workspacePermissionPb) (*WorkspacePermission, error) { + if pb == nil { + return nil, nil + } + st := WorkspacePermission(*pb) + return &st, nil +} + type WorkspacePermissions struct { // Array of permissions defined for a workspace. - Permissions []PermissionOutput `json:"permissions,omitempty"` + // Wire name: 'permissions' + Permissions []PermissionOutput +} + +func (st *WorkspacePermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspacePermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspacePermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WorkspacePermissions) MarshalJSON() ([]byte, error) { + pb, err := workspacePermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/jobs/impl.go b/service/jobs/impl.go index 66b4ddc00..8331c8763 100755 --- a/service/jobs/impl.go +++ b/service/jobs/impl.go @@ -18,114 +18,340 @@ type jobsImpl struct { } func (a *jobsImpl) CancelAllRuns(ctx context.Context, request CancelAllRuns) error { - var cancelAllRunsResponse CancelAllRunsResponse + + requestPb, pbErr := cancelAllRunsToPb(&request) + if pbErr != nil { + return pbErr + } + + var cancelAllRunsResponsePb cancelAllRunsResponsePb path := "/api/2.2/jobs/runs/cancel-all" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelAllRunsResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &cancelAllRunsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) CancelRun(ctx context.Context, request CancelRun) error { - var cancelRunResponse CancelRunResponse + + requestPb, pbErr := cancelRunToPb(&request) + if pbErr != nil { + return pbErr + } + + var cancelRunResponsePb cancelRunResponsePb path := "/api/2.2/jobs/runs/cancel" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelRunResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &cancelRunResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) Create(ctx context.Context, request CreateJob) (*CreateResponse, error) { - var createResponse CreateResponse + + requestPb, pbErr := createJobToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createResponsePb createResponsePb path := "/api/2.2/jobs/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) - return &createResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createResponseFromPb(&createResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) Delete(ctx context.Context, request DeleteJob) error { - var deleteResponse DeleteResponse + + requestPb, pbErr := deleteJobToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb path := "/api/2.2/jobs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { - var deleteRunResponse DeleteRunResponse + + requestPb, pbErr := deleteRunToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteRunResponsePb deleteRunResponsePb path := "/api/2.2/jobs/runs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteRunResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error) { - var exportRunOutput ExportRunOutput + + requestPb, pbErr := exportRunRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var exportRunOutputPb exportRunOutputPb path := "/api/2.2/jobs/runs/export" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportRunOutput) - return &exportRunOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &exportRunOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := exportRunOutputFromPb(&exportRunOutputPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) Get(ctx context.Context, request GetJobRequest) (*Job, error) { - var job Job + + requestPb, pbErr := getJobRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var jobPb jobPb path := "/api/2.2/jobs/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &job) - return &job, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &jobPb, + ) + if err != nil { + return nil, err + } + resp, err := jobFromPb(&jobPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error) { - var getJobPermissionLevelsResponse GetJobPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/jobs/%v/permissionLevels", request.JobId) + + requestPb, pbErr := getJobPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getJobPermissionLevelsResponsePb getJobPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/jobs/%v/permissionLevels", requestPb.JobId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getJobPermissionLevelsResponse) - return &getJobPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getJobPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getJobPermissionLevelsResponseFromPb(&getJobPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error) { - var jobPermissions JobPermissions - path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + + requestPb, pbErr := getJobPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var jobPermissionsPb jobPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", requestPb.JobId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &jobPermissions) - return &jobPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &jobPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := jobPermissionsFromPb(&jobPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) GetRun(ctx context.Context, request GetRunRequest) (*Run, error) { - var run Run + + requestPb, pbErr := getRunRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var runPb runPb path := "/api/2.2/jobs/runs/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &run) - return &run, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &runPb, + ) + if err != nil { + return nil, err + } + resp, err := runFromPb(&runPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error) { - var runOutput RunOutput + + requestPb, pbErr := getRunOutputRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var runOutputPb runOutputPb path := "/api/2.2/jobs/runs/get-output" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &runOutput) - return &runOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &runOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := runOutputFromPb(&runOutputPb) + if err != nil { + return nil, err + } + + return resp, err } // List jobs. @@ -164,13 +390,35 @@ func (a *jobsImpl) ListAll(ctx context.Context, request ListJobsRequest) ([]Base } func (a *jobsImpl) internalList(ctx context.Context, request ListJobsRequest) (*ListJobsResponse, error) { - var listJobsResponse ListJobsResponse + + requestPb, pbErr := listJobsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listJobsResponsePb listJobsResponsePb path := "/api/2.2/jobs/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listJobsResponse) - return &listJobsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listJobsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listJobsResponseFromPb(&listJobsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List job runs. @@ -209,88 +457,256 @@ func (a *jobsImpl) ListRunsAll(ctx context.Context, request ListRunsRequest) ([] } func (a *jobsImpl) internalListRuns(ctx context.Context, request ListRunsRequest) (*ListRunsResponse, error) { - var listRunsResponse ListRunsResponse + + requestPb, pbErr := listRunsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listRunsResponsePb listRunsResponsePb path := "/api/2.2/jobs/runs/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRunsResponse) - return &listRunsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listRunsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listRunsResponseFromPb(&listRunsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) RepairRun(ctx context.Context, request RepairRun) (*RepairRunResponse, error) { - var repairRunResponse RepairRunResponse + + requestPb, pbErr := repairRunToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var repairRunResponsePb repairRunResponsePb path := "/api/2.2/jobs/runs/repair" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &repairRunResponse) - return &repairRunResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &repairRunResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := repairRunResponseFromPb(&repairRunResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) Reset(ctx context.Context, request ResetJob) error { - var resetResponse ResetResponse + + requestPb, pbErr := resetJobToPb(&request) + if pbErr != nil { + return pbErr + } + + var resetResponsePb resetResponsePb path := "/api/2.2/jobs/reset" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resetResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &resetResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) RunNow(ctx context.Context, request RunNow) (*RunNowResponse, error) { - var runNowResponse RunNowResponse + + requestPb, pbErr := runNowToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var runNowResponsePb runNowResponsePb path := "/api/2.2/jobs/run-now" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &runNowResponse) - return &runNowResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &runNowResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := runNowResponseFromPb(&runNowResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error) { - var jobPermissions JobPermissions - path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + + requestPb, pbErr := jobPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var jobPermissionsPb jobPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", requestPb.JobId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &jobPermissions) - return &jobPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &jobPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := jobPermissionsFromPb(&jobPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) Submit(ctx context.Context, request SubmitRun) (*SubmitRunResponse, error) { - var submitRunResponse SubmitRunResponse + + requestPb, pbErr := submitRunToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var submitRunResponsePb submitRunResponsePb path := "/api/2.2/jobs/runs/submit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &submitRunResponse) - return &submitRunResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &submitRunResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := submitRunResponseFromPb(&submitRunResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *jobsImpl) Update(ctx context.Context, request UpdateJob) error { - var updateResponse UpdateResponse + + requestPb, pbErr := updateJobToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb path := "/api/2.2/jobs/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } func (a *jobsImpl) UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error) { - var jobPermissions JobPermissions - path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + + requestPb, pbErr := jobPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var jobPermissionsPb jobPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", requestPb.JobId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &jobPermissions) - return &jobPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &jobPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := jobPermissionsFromPb(&jobPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just PolicyComplianceForJobs API methods @@ -299,24 +715,68 @@ type policyComplianceForJobsImpl struct { } func (a *policyComplianceForJobsImpl) EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error) { - var enforcePolicyComplianceResponse EnforcePolicyComplianceResponse + + requestPb, pbErr := enforcePolicyComplianceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enforcePolicyComplianceResponsePb enforcePolicyComplianceResponsePb path := "/api/2.0/policies/jobs/enforce-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &enforcePolicyComplianceResponse) - return &enforcePolicyComplianceResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &enforcePolicyComplianceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := enforcePolicyComplianceResponseFromPb(&enforcePolicyComplianceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *policyComplianceForJobsImpl) GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error) { - var getPolicyComplianceResponse GetPolicyComplianceResponse + + requestPb, pbErr := getPolicyComplianceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPolicyComplianceResponsePb getPolicyComplianceResponsePb path := "/api/2.0/policies/jobs/get-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPolicyComplianceResponse) - return &getPolicyComplianceResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPolicyComplianceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPolicyComplianceResponseFromPb(&getPolicyComplianceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List job policy compliance. @@ -361,11 +821,33 @@ func (a *policyComplianceForJobsImpl) ListComplianceAll(ctx context.Context, req } func (a *policyComplianceForJobsImpl) internalListCompliance(ctx context.Context, request ListJobComplianceRequest) (*ListJobComplianceForPolicyResponse, error) { - var listJobComplianceForPolicyResponse ListJobComplianceForPolicyResponse + + requestPb, pbErr := listJobComplianceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listJobComplianceForPolicyResponsePb listJobComplianceForPolicyResponsePb path := "/api/2.0/policies/jobs/list-compliance" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listJobComplianceForPolicyResponse) - return &listJobComplianceForPolicyResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listJobComplianceForPolicyResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listJobComplianceForPolicyResponseFromPb(&listJobComplianceForPolicyResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/jobs/internal.go b/service/jobs/internal.go new file mode 100755 index 000000000..bc9919f8a --- /dev/null +++ b/service/jobs/internal.go @@ -0,0 +1,7217 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package jobs + +import ( + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/compute" +) + +func baseJobToPb(st *BaseJob) (*baseJobPb, error) { + if st == nil { + return nil, nil + } + pb := &baseJobPb{} + pb.CreatedTime = st.CreatedTime + + pb.CreatorUserName = st.CreatorUserName + + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.HasMore = st.HasMore + + pb.JobId = st.JobId + + pb.Settings = st.Settings + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type baseJobPb struct { + CreatedTime int64 `json:"created_time,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + HasMore bool `json:"has_more,omitempty"` + + JobId int64 `json:"job_id,omitempty"` + + Settings *JobSettings `json:"settings,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func baseJobFromPb(pb *baseJobPb) (*BaseJob, error) { + if pb == nil { + return nil, nil + } + st := &BaseJob{} + st.CreatedTime = pb.CreatedTime + st.CreatorUserName = pb.CreatorUserName + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + st.HasMore = pb.HasMore + st.JobId = pb.JobId + st.Settings = pb.Settings + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *baseJobPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st baseJobPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func baseRunToPb(st *BaseRun) (*baseRunPb, error) { + if st == nil { + return nil, nil + } + pb := &baseRunPb{} + pb.AttemptNumber = st.AttemptNumber + + pb.CleanupDuration = st.CleanupDuration + + pb.ClusterInstance = st.ClusterInstance + + pb.ClusterSpec = st.ClusterSpec + + pb.CreatorUserName = st.CreatorUserName + + pb.Description = st.Description + + pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget + + pb.EndTime = st.EndTime + + pb.ExecutionDuration = st.ExecutionDuration + + pb.GitSource = st.GitSource + + pb.HasMore = st.HasMore + + pb.JobClusters = st.JobClusters + + pb.JobId = st.JobId + + pb.JobParameters = st.JobParameters + + pb.JobRunId = st.JobRunId + + pb.NumberInJob = st.NumberInJob + + pb.OriginalAttemptRunId = st.OriginalAttemptRunId + + pb.OverridingParameters = st.OverridingParameters + + pb.QueueDuration = st.QueueDuration + + pb.RepairHistory = st.RepairHistory + + pb.RunDuration = st.RunDuration + + pb.RunId = st.RunId + + pb.RunName = st.RunName + + pb.RunPageUrl = st.RunPageUrl + + pb.RunType = st.RunType + + pb.Schedule = st.Schedule + + pb.SetupDuration = st.SetupDuration + + pb.StartTime = st.StartTime + + pb.State = st.State + + pb.Status = st.Status + + pb.Tasks = st.Tasks + + pb.Trigger = st.Trigger + + pb.TriggerInfo = st.TriggerInfo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type baseRunPb struct { + AttemptNumber int `json:"attempt_number,omitempty"` + + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + + ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + Description string `json:"description,omitempty"` + + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + + EndTime int64 `json:"end_time,omitempty"` + + ExecutionDuration int64 `json:"execution_duration,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + HasMore bool `json:"has_more,omitempty"` + + JobClusters []JobCluster `json:"job_clusters,omitempty"` + + JobId int64 `json:"job_id,omitempty"` + + JobParameters []JobParameter `json:"job_parameters,omitempty"` + + JobRunId int64 `json:"job_run_id,omitempty"` + + NumberInJob int64 `json:"number_in_job,omitempty"` + + OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + + OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + + QueueDuration int64 `json:"queue_duration,omitempty"` + + RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + + RunDuration int64 `json:"run_duration,omitempty"` + + RunId int64 `json:"run_id,omitempty"` + + RunName string `json:"run_name,omitempty"` + + RunPageUrl string `json:"run_page_url,omitempty"` + + RunType RunType `json:"run_type,omitempty"` + + Schedule *CronSchedule `json:"schedule,omitempty"` + + SetupDuration int64 `json:"setup_duration,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + State *RunState `json:"state,omitempty"` + + Status *RunStatus `json:"status,omitempty"` + + Tasks []RunTask `json:"tasks,omitempty"` + + Trigger TriggerType `json:"trigger,omitempty"` + + TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func baseRunFromPb(pb *baseRunPb) (*BaseRun, error) { + if pb == nil { + return nil, nil + } + st := &BaseRun{} + st.AttemptNumber = pb.AttemptNumber + st.CleanupDuration = pb.CleanupDuration + st.ClusterInstance = pb.ClusterInstance + st.ClusterSpec = pb.ClusterSpec + st.CreatorUserName = pb.CreatorUserName + st.Description = pb.Description + st.EffectivePerformanceTarget = pb.EffectivePerformanceTarget + st.EndTime = pb.EndTime + st.ExecutionDuration = pb.ExecutionDuration + st.GitSource = pb.GitSource + st.HasMore = pb.HasMore + st.JobClusters = pb.JobClusters + st.JobId = pb.JobId + st.JobParameters = pb.JobParameters + st.JobRunId = pb.JobRunId + st.NumberInJob = pb.NumberInJob + st.OriginalAttemptRunId = pb.OriginalAttemptRunId + st.OverridingParameters = pb.OverridingParameters + st.QueueDuration = pb.QueueDuration + st.RepairHistory = pb.RepairHistory + st.RunDuration = pb.RunDuration + st.RunId = pb.RunId + st.RunName = pb.RunName + st.RunPageUrl = pb.RunPageUrl + st.RunType = pb.RunType + st.Schedule = pb.Schedule + st.SetupDuration = pb.SetupDuration + st.StartTime = pb.StartTime + st.State = pb.State + st.Status = pb.Status + st.Tasks = pb.Tasks + st.Trigger = pb.Trigger + st.TriggerInfo = pb.TriggerInfo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *baseRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st baseRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelAllRunsToPb(st *CancelAllRuns) (*cancelAllRunsPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelAllRunsPb{} + pb.AllQueuedRuns = st.AllQueuedRuns + + pb.JobId = st.JobId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cancelAllRunsPb struct { + AllQueuedRuns bool `json:"all_queued_runs,omitempty"` + + JobId int64 `json:"job_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cancelAllRunsFromPb(pb *cancelAllRunsPb) (*CancelAllRuns, error) { + if pb == nil { + return nil, nil + } + st := &CancelAllRuns{} + st.AllQueuedRuns = pb.AllQueuedRuns + st.JobId = pb.JobId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cancelAllRunsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cancelAllRunsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelAllRunsResponseToPb(st *CancelAllRunsResponse) (*cancelAllRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelAllRunsResponsePb{} + + return pb, nil +} + +type cancelAllRunsResponsePb struct { +} + +func cancelAllRunsResponseFromPb(pb *cancelAllRunsResponsePb) (*CancelAllRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelAllRunsResponse{} + + return st, nil +} + +func cancelRunToPb(st *CancelRun) (*cancelRunPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelRunPb{} + pb.RunId = st.RunId + + return pb, nil +} + +type cancelRunPb struct { + RunId int64 `json:"run_id"` +} + +func cancelRunFromPb(pb *cancelRunPb) (*CancelRun, error) { + if pb == nil { + return nil, nil + } + st := &CancelRun{} + st.RunId = pb.RunId + + return st, nil +} + +func cancelRunResponseToPb(st *CancelRunResponse) (*cancelRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelRunResponsePb{} + + return pb, nil +} + +type cancelRunResponsePb struct { +} + +func cancelRunResponseFromPb(pb *cancelRunResponsePb) (*CancelRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelRunResponse{} + + return st, nil +} + +func cleanRoomTaskRunStateToPb(st *CleanRoomTaskRunState) (*cleanRoomTaskRunStatePb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomTaskRunStatePb{} + pb.LifeCycleState = st.LifeCycleState + + pb.ResultState = st.ResultState + + return pb, nil +} + +type cleanRoomTaskRunStatePb struct { + LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` + + ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` +} + +func cleanRoomTaskRunStateFromPb(pb *cleanRoomTaskRunStatePb) (*CleanRoomTaskRunState, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomTaskRunState{} + st.LifeCycleState = pb.LifeCycleState + st.ResultState = pb.ResultState + + return st, nil +} + +func cleanRoomsNotebookTaskToPb(st *CleanRoomsNotebookTask) (*cleanRoomsNotebookTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomsNotebookTaskPb{} + pb.CleanRoomName = st.CleanRoomName + + pb.Etag = st.Etag + + pb.NotebookBaseParameters = st.NotebookBaseParameters + + pb.NotebookName = st.NotebookName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cleanRoomsNotebookTaskPb struct { + CleanRoomName string `json:"clean_room_name"` + + Etag string `json:"etag,omitempty"` + + NotebookBaseParameters map[string]string `json:"notebook_base_parameters,omitempty"` + + NotebookName string `json:"notebook_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cleanRoomsNotebookTaskFromPb(pb *cleanRoomsNotebookTaskPb) (*CleanRoomsNotebookTask, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomsNotebookTask{} + st.CleanRoomName = pb.CleanRoomName + st.Etag = pb.Etag + st.NotebookBaseParameters = pb.NotebookBaseParameters + st.NotebookName = pb.NotebookName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cleanRoomsNotebookTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cleanRoomsNotebookTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputToPb(st *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput) (*cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb{} + pb.CleanRoomJobRunState = st.CleanRoomJobRunState + + pb.NotebookOutput = st.NotebookOutput + + pb.OutputSchemaInfo = st.OutputSchemaInfo + + return pb, nil +} + +type cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb struct { + CleanRoomJobRunState *CleanRoomTaskRunState `json:"clean_room_job_run_state,omitempty"` + + NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + + OutputSchemaInfo *OutputSchemaInfo `json:"output_schema_info,omitempty"` +} + +func cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputFromPb(pb *cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb) (*CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput, error) { + if pb == nil { + return nil, nil + } + st := &CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput{} + st.CleanRoomJobRunState = pb.CleanRoomJobRunState + st.NotebookOutput = pb.NotebookOutput + st.OutputSchemaInfo = pb.OutputSchemaInfo + + return st, nil +} + +func clusterInstanceToPb(st *ClusterInstance) (*clusterInstancePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterInstancePb{} + pb.ClusterId = st.ClusterId + + pb.SparkContextId = st.SparkContextId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterInstancePb struct { + ClusterId string `json:"cluster_id,omitempty"` + + SparkContextId string `json:"spark_context_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterInstanceFromPb(pb *clusterInstancePb) (*ClusterInstance, error) { + if pb == nil { + return nil, nil + } + st := &ClusterInstance{} + st.ClusterId = pb.ClusterId + st.SparkContextId = pb.SparkContextId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterInstancePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterInstancePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterSpecPb{} + pb.ExistingClusterId = st.ExistingClusterId + + pb.JobClusterKey = st.JobClusterKey + + pb.Libraries = st.Libraries + + pb.NewCluster = st.NewCluster + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterSpecPb struct { + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + + JobClusterKey string `json:"job_cluster_key,omitempty"` + + Libraries []compute.Library `json:"libraries,omitempty"` + + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterSpecFromPb(pb *clusterSpecPb) (*ClusterSpec, error) { + if pb == nil { + return nil, nil + } + st := &ClusterSpec{} + st.ExistingClusterId = pb.ExistingClusterId + st.JobClusterKey = pb.JobClusterKey + st.Libraries = pb.Libraries + st.NewCluster = pb.NewCluster + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func computeConfigToPb(st *ComputeConfig) (*computeConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &computeConfigPb{} + pb.GpuNodePoolId = st.GpuNodePoolId + + pb.GpuType = st.GpuType + + pb.NumGpus = st.NumGpus + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type computeConfigPb struct { + GpuNodePoolId string `json:"gpu_node_pool_id,omitempty"` + + GpuType string `json:"gpu_type,omitempty"` + + NumGpus int `json:"num_gpus"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func computeConfigFromPb(pb *computeConfigPb) (*ComputeConfig, error) { + if pb == nil { + return nil, nil + } + st := &ComputeConfig{} + st.GpuNodePoolId = pb.GpuNodePoolId + st.GpuType = pb.GpuType + st.NumGpus = pb.NumGpus + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *computeConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st computeConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func conditionTaskToPb(st *ConditionTask) (*conditionTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &conditionTaskPb{} + pb.Left = st.Left + + pb.Op = st.Op + + pb.Right = st.Right + + return pb, nil +} + +type conditionTaskPb struct { + Left string `json:"left"` + + Op ConditionTaskOp `json:"op"` + + Right string `json:"right"` +} + +func conditionTaskFromPb(pb *conditionTaskPb) (*ConditionTask, error) { + if pb == nil { + return nil, nil + } + st := &ConditionTask{} + st.Left = pb.Left + st.Op = pb.Op + st.Right = pb.Right + + return st, nil +} + +func continuousToPb(st *Continuous) (*continuousPb, error) { + if st == nil { + return nil, nil + } + pb := &continuousPb{} + pb.PauseStatus = st.PauseStatus + + return pb, nil +} + +type continuousPb struct { + PauseStatus PauseStatus `json:"pause_status,omitempty"` +} + +func continuousFromPb(pb *continuousPb) (*Continuous, error) { + if pb == nil { + return nil, nil + } + st := &Continuous{} + st.PauseStatus = pb.PauseStatus + + return st, nil +} + +func createJobToPb(st *CreateJob) (*createJobPb, error) { + if st == nil { + return nil, nil + } + pb := &createJobPb{} + pb.AccessControlList = st.AccessControlList + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Continuous = st.Continuous + + pb.Deployment = st.Deployment + + pb.Description = st.Description + + pb.EditMode = st.EditMode + + pb.EmailNotifications = st.EmailNotifications + + pb.Environments = st.Environments + + pb.Format = st.Format + + pb.GitSource = st.GitSource + + pb.Health = st.Health + + pb.JobClusters = st.JobClusters + + pb.MaxConcurrentRuns = st.MaxConcurrentRuns + + pb.Name = st.Name + + pb.NotificationSettings = st.NotificationSettings + + pb.Parameters = st.Parameters + + pb.PerformanceTarget = st.PerformanceTarget + + pb.Queue = st.Queue + + pb.RunAs = st.RunAs + + pb.Schedule = st.Schedule + + pb.Tags = st.Tags + + pb.Tasks = st.Tasks + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.Trigger = st.Trigger + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createJobPb struct { + AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Continuous *Continuous `json:"continuous,omitempty"` + + Deployment *JobDeployment `json:"deployment,omitempty"` + + Description string `json:"description,omitempty"` + + EditMode JobEditMode `json:"edit_mode,omitempty"` + + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + + Environments []JobEnvironment `json:"environments,omitempty"` + + Format Format `json:"format,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + Health *JobsHealthRules `json:"health,omitempty"` + + JobClusters []JobCluster `json:"job_clusters,omitempty"` + + MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + + Name string `json:"name,omitempty"` + + NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + + Parameters []JobParameterDefinition `json:"parameters,omitempty"` + + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + + Queue *QueueSettings `json:"queue,omitempty"` + + RunAs *JobRunAs `json:"run_as,omitempty"` + + Schedule *CronSchedule `json:"schedule,omitempty"` + + Tags map[string]string `json:"tags,omitempty"` + + Tasks []Task `json:"tasks,omitempty"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + Trigger *TriggerSettings `json:"trigger,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createJobFromPb(pb *createJobPb) (*CreateJob, error) { + if pb == nil { + return nil, nil + } + st := &CreateJob{} + st.AccessControlList = pb.AccessControlList + st.BudgetPolicyId = pb.BudgetPolicyId + st.Continuous = pb.Continuous + st.Deployment = pb.Deployment + st.Description = pb.Description + st.EditMode = pb.EditMode + st.EmailNotifications = pb.EmailNotifications + st.Environments = pb.Environments + st.Format = pb.Format + st.GitSource = pb.GitSource + st.Health = pb.Health + st.JobClusters = pb.JobClusters + st.MaxConcurrentRuns = pb.MaxConcurrentRuns + st.Name = pb.Name + st.NotificationSettings = pb.NotificationSettings + st.Parameters = pb.Parameters + st.PerformanceTarget = pb.PerformanceTarget + st.Queue = pb.Queue + st.RunAs = pb.RunAs + st.Schedule = pb.Schedule + st.Tags = pb.Tags + st.Tasks = pb.Tasks + st.TimeoutSeconds = pb.TimeoutSeconds + st.Trigger = pb.Trigger + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createJobPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createJobPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createResponseToPb(st *CreateResponse) (*createResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createResponsePb{} + pb.JobId = st.JobId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createResponsePb struct { + JobId int64 `json:"job_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createResponseFromPb(pb *createResponsePb) (*CreateResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateResponse{} + st.JobId = pb.JobId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { + if st == nil { + return nil, nil + } + pb := &cronSchedulePb{} + pb.PauseStatus = st.PauseStatus + + pb.QuartzCronExpression = st.QuartzCronExpression + + pb.TimezoneId = st.TimezoneId + + return pb, nil +} + +type cronSchedulePb struct { + PauseStatus PauseStatus `json:"pause_status,omitempty"` + + QuartzCronExpression string `json:"quartz_cron_expression"` + + TimezoneId string `json:"timezone_id"` +} + +func cronScheduleFromPb(pb *cronSchedulePb) (*CronSchedule, error) { + if pb == nil { + return nil, nil + } + st := &CronSchedule{} + st.PauseStatus = pb.PauseStatus + st.QuartzCronExpression = pb.QuartzCronExpression + st.TimezoneId = pb.TimezoneId + + return st, nil +} + +func dashboardPageSnapshotToPb(st *DashboardPageSnapshot) (*dashboardPageSnapshotPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardPageSnapshotPb{} + pb.PageDisplayName = st.PageDisplayName + + pb.WidgetErrorDetails = st.WidgetErrorDetails + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardPageSnapshotPb struct { + PageDisplayName string `json:"page_display_name,omitempty"` + + WidgetErrorDetails []WidgetErrorDetail `json:"widget_error_details,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardPageSnapshotFromPb(pb *dashboardPageSnapshotPb) (*DashboardPageSnapshot, error) { + if pb == nil { + return nil, nil + } + st := &DashboardPageSnapshot{} + st.PageDisplayName = pb.PageDisplayName + st.WidgetErrorDetails = pb.WidgetErrorDetails + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardPageSnapshotPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardPageSnapshotPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardTaskToPb(st *DashboardTask) (*dashboardTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardTaskPb{} + pb.DashboardId = st.DashboardId + + pb.Subscription = st.Subscription + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardTaskPb struct { + DashboardId string `json:"dashboard_id,omitempty"` + + Subscription *Subscription `json:"subscription,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardTaskFromPb(pb *dashboardTaskPb) (*DashboardTask, error) { + if pb == nil { + return nil, nil + } + st := &DashboardTask{} + st.DashboardId = pb.DashboardId + st.Subscription = pb.Subscription + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardTaskOutputToPb(st *DashboardTaskOutput) (*dashboardTaskOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardTaskOutputPb{} + pb.PageSnapshots = st.PageSnapshots + + return pb, nil +} + +type dashboardTaskOutputPb struct { + PageSnapshots []DashboardPageSnapshot `json:"page_snapshots,omitempty"` +} + +func dashboardTaskOutputFromPb(pb *dashboardTaskOutputPb) (*DashboardTaskOutput, error) { + if pb == nil { + return nil, nil + } + st := &DashboardTaskOutput{} + st.PageSnapshots = pb.PageSnapshots + + return st, nil +} + +func dbtOutputToPb(st *DbtOutput) (*dbtOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &dbtOutputPb{} + pb.ArtifactsHeaders = st.ArtifactsHeaders + + pb.ArtifactsLink = st.ArtifactsLink + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dbtOutputPb struct { + ArtifactsHeaders map[string]string `json:"artifacts_headers,omitempty"` + + ArtifactsLink string `json:"artifacts_link,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dbtOutputFromPb(pb *dbtOutputPb) (*DbtOutput, error) { + if pb == nil { + return nil, nil + } + st := &DbtOutput{} + st.ArtifactsHeaders = pb.ArtifactsHeaders + st.ArtifactsLink = pb.ArtifactsLink + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dbtOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dbtOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dbtTaskToPb(st *DbtTask) (*dbtTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &dbtTaskPb{} + pb.Catalog = st.Catalog + + pb.Commands = st.Commands + + pb.ProfilesDirectory = st.ProfilesDirectory + + pb.ProjectDirectory = st.ProjectDirectory + + pb.Schema = st.Schema + + pb.Source = st.Source + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dbtTaskPb struct { + Catalog string `json:"catalog,omitempty"` + + Commands []string `json:"commands"` + + ProfilesDirectory string `json:"profiles_directory,omitempty"` + + ProjectDirectory string `json:"project_directory,omitempty"` + + Schema string `json:"schema,omitempty"` + + Source Source `json:"source,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dbtTaskFromPb(pb *dbtTaskPb) (*DbtTask, error) { + if pb == nil { + return nil, nil + } + st := &DbtTask{} + st.Catalog = pb.Catalog + st.Commands = pb.Commands + st.ProfilesDirectory = pb.ProfilesDirectory + st.ProjectDirectory = pb.ProjectDirectory + st.Schema = pb.Schema + st.Source = pb.Source + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dbtTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dbtTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteJobToPb(st *DeleteJob) (*deleteJobPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteJobPb{} + pb.JobId = st.JobId + + return pb, nil +} + +type deleteJobPb struct { + JobId int64 `json:"job_id"` +} + +func deleteJobFromPb(pb *deleteJobPb) (*DeleteJob, error) { + if pb == nil { + return nil, nil + } + st := &DeleteJob{} + st.JobId = pb.JobId + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteRunToPb(st *DeleteRun) (*deleteRunPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunPb{} + pb.RunId = st.RunId + + return pb, nil +} + +type deleteRunPb struct { + RunId int64 `json:"run_id"` +} + +func deleteRunFromPb(pb *deleteRunPb) (*DeleteRun, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRun{} + st.RunId = pb.RunId + + return st, nil +} + +func deleteRunResponseToPb(st *DeleteRunResponse) (*deleteRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunResponsePb{} + + return pb, nil +} + +type deleteRunResponsePb struct { +} + +func deleteRunResponseFromPb(pb *deleteRunResponsePb) (*DeleteRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRunResponse{} + + return st, nil +} + +func enforcePolicyComplianceForJobResponseJobClusterSettingsChangeToPb(st *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) (*enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb, error) { + if st == nil { + return nil, nil + } + pb := &enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb{} + pb.Field = st.Field + + pb.NewValue = st.NewValue + + pb.PreviousValue = st.PreviousValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb struct { + Field string `json:"field,omitempty"` + + NewValue string `json:"new_value,omitempty"` + + PreviousValue string `json:"previous_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enforcePolicyComplianceForJobResponseJobClusterSettingsChangeFromPb(pb *enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb) (*EnforcePolicyComplianceForJobResponseJobClusterSettingsChange, error) { + if pb == nil { + return nil, nil + } + st := &EnforcePolicyComplianceForJobResponseJobClusterSettingsChange{} + st.Field = pb.Field + st.NewValue = pb.NewValue + st.PreviousValue = pb.PreviousValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enforcePolicyComplianceRequestToPb(st *EnforcePolicyComplianceRequest) (*enforcePolicyComplianceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &enforcePolicyComplianceRequestPb{} + pb.JobId = st.JobId + + pb.ValidateOnly = st.ValidateOnly + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enforcePolicyComplianceRequestPb struct { + JobId int64 `json:"job_id"` + + ValidateOnly bool `json:"validate_only,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enforcePolicyComplianceRequestFromPb(pb *enforcePolicyComplianceRequestPb) (*EnforcePolicyComplianceRequest, error) { + if pb == nil { + return nil, nil + } + st := &EnforcePolicyComplianceRequest{} + st.JobId = pb.JobId + st.ValidateOnly = pb.ValidateOnly + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enforcePolicyComplianceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enforcePolicyComplianceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enforcePolicyComplianceResponseToPb(st *EnforcePolicyComplianceResponse) (*enforcePolicyComplianceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &enforcePolicyComplianceResponsePb{} + pb.HasChanges = st.HasChanges + + pb.JobClusterChanges = st.JobClusterChanges + + pb.Settings = st.Settings + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enforcePolicyComplianceResponsePb struct { + HasChanges bool `json:"has_changes,omitempty"` + + JobClusterChanges []EnforcePolicyComplianceForJobResponseJobClusterSettingsChange `json:"job_cluster_changes,omitempty"` + + Settings *JobSettings `json:"settings,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enforcePolicyComplianceResponseFromPb(pb *enforcePolicyComplianceResponsePb) (*EnforcePolicyComplianceResponse, error) { + if pb == nil { + return nil, nil + } + st := &EnforcePolicyComplianceResponse{} + st.HasChanges = pb.HasChanges + st.JobClusterChanges = pb.JobClusterChanges + st.Settings = pb.Settings + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enforcePolicyComplianceResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enforcePolicyComplianceResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func exportRunOutputToPb(st *ExportRunOutput) (*exportRunOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &exportRunOutputPb{} + pb.Views = st.Views + + return pb, nil +} + +type exportRunOutputPb struct { + Views []ViewItem `json:"views,omitempty"` +} + +func exportRunOutputFromPb(pb *exportRunOutputPb) (*ExportRunOutput, error) { + if pb == nil { + return nil, nil + } + st := &ExportRunOutput{} + st.Views = pb.Views + + return st, nil +} + +func exportRunRequestToPb(st *ExportRunRequest) (*exportRunRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &exportRunRequestPb{} + pb.RunId = st.RunId + + pb.ViewsToExport = st.ViewsToExport + + return pb, nil +} + +type exportRunRequestPb struct { + RunId int64 `json:"-" url:"run_id"` + + ViewsToExport ViewsToExport `json:"-" url:"views_to_export,omitempty"` +} + +func exportRunRequestFromPb(pb *exportRunRequestPb) (*ExportRunRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExportRunRequest{} + st.RunId = pb.RunId + st.ViewsToExport = pb.ViewsToExport + + return st, nil +} + +func fileArrivalTriggerConfigurationToPb(st *FileArrivalTriggerConfiguration) (*fileArrivalTriggerConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &fileArrivalTriggerConfigurationPb{} + pb.MinTimeBetweenTriggersSeconds = st.MinTimeBetweenTriggersSeconds + + pb.Url = st.Url + + pb.WaitAfterLastChangeSeconds = st.WaitAfterLastChangeSeconds + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileArrivalTriggerConfigurationPb struct { + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + + Url string `json:"url"` + + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileArrivalTriggerConfigurationFromPb(pb *fileArrivalTriggerConfigurationPb) (*FileArrivalTriggerConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &FileArrivalTriggerConfiguration{} + st.MinTimeBetweenTriggersSeconds = pb.MinTimeBetweenTriggersSeconds + st.Url = pb.Url + st.WaitAfterLastChangeSeconds = pb.WaitAfterLastChangeSeconds + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileArrivalTriggerConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileArrivalTriggerConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func forEachStatsToPb(st *ForEachStats) (*forEachStatsPb, error) { + if st == nil { + return nil, nil + } + pb := &forEachStatsPb{} + pb.ErrorMessageStats = st.ErrorMessageStats + + pb.TaskRunStats = st.TaskRunStats + + return pb, nil +} + +type forEachStatsPb struct { + ErrorMessageStats []ForEachTaskErrorMessageStats `json:"error_message_stats,omitempty"` + + TaskRunStats *ForEachTaskTaskRunStats `json:"task_run_stats,omitempty"` +} + +func forEachStatsFromPb(pb *forEachStatsPb) (*ForEachStats, error) { + if pb == nil { + return nil, nil + } + st := &ForEachStats{} + st.ErrorMessageStats = pb.ErrorMessageStats + st.TaskRunStats = pb.TaskRunStats + + return st, nil +} + +func forEachTaskToPb(st *ForEachTask) (*forEachTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &forEachTaskPb{} + pb.Concurrency = st.Concurrency + + pb.Inputs = st.Inputs + + pb.Task = st.Task + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type forEachTaskPb struct { + Concurrency int `json:"concurrency,omitempty"` + + Inputs string `json:"inputs"` + + Task Task `json:"task"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func forEachTaskFromPb(pb *forEachTaskPb) (*ForEachTask, error) { + if pb == nil { + return nil, nil + } + st := &ForEachTask{} + st.Concurrency = pb.Concurrency + st.Inputs = pb.Inputs + st.Task = pb.Task + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *forEachTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st forEachTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func forEachTaskErrorMessageStatsToPb(st *ForEachTaskErrorMessageStats) (*forEachTaskErrorMessageStatsPb, error) { + if st == nil { + return nil, nil + } + pb := &forEachTaskErrorMessageStatsPb{} + pb.Count = st.Count + + pb.ErrorMessage = st.ErrorMessage + + pb.TerminationCategory = st.TerminationCategory + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type forEachTaskErrorMessageStatsPb struct { + Count int `json:"count,omitempty"` + + ErrorMessage string `json:"error_message,omitempty"` + + TerminationCategory string `json:"termination_category,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func forEachTaskErrorMessageStatsFromPb(pb *forEachTaskErrorMessageStatsPb) (*ForEachTaskErrorMessageStats, error) { + if pb == nil { + return nil, nil + } + st := &ForEachTaskErrorMessageStats{} + st.Count = pb.Count + st.ErrorMessage = pb.ErrorMessage + st.TerminationCategory = pb.TerminationCategory + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *forEachTaskErrorMessageStatsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st forEachTaskErrorMessageStatsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func forEachTaskTaskRunStatsToPb(st *ForEachTaskTaskRunStats) (*forEachTaskTaskRunStatsPb, error) { + if st == nil { + return nil, nil + } + pb := &forEachTaskTaskRunStatsPb{} + pb.ActiveIterations = st.ActiveIterations + + pb.CompletedIterations = st.CompletedIterations + + pb.FailedIterations = st.FailedIterations + + pb.ScheduledIterations = st.ScheduledIterations + + pb.SucceededIterations = st.SucceededIterations + + pb.TotalIterations = st.TotalIterations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type forEachTaskTaskRunStatsPb struct { + ActiveIterations int `json:"active_iterations,omitempty"` + + CompletedIterations int `json:"completed_iterations,omitempty"` + + FailedIterations int `json:"failed_iterations,omitempty"` + + ScheduledIterations int `json:"scheduled_iterations,omitempty"` + + SucceededIterations int `json:"succeeded_iterations,omitempty"` + + TotalIterations int `json:"total_iterations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func forEachTaskTaskRunStatsFromPb(pb *forEachTaskTaskRunStatsPb) (*ForEachTaskTaskRunStats, error) { + if pb == nil { + return nil, nil + } + st := &ForEachTaskTaskRunStats{} + st.ActiveIterations = pb.ActiveIterations + st.CompletedIterations = pb.CompletedIterations + st.FailedIterations = pb.FailedIterations + st.ScheduledIterations = pb.ScheduledIterations + st.SucceededIterations = pb.SucceededIterations + st.TotalIterations = pb.TotalIterations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *forEachTaskTaskRunStatsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st forEachTaskTaskRunStatsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func genAiComputeTaskToPb(st *GenAiComputeTask) (*genAiComputeTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &genAiComputeTaskPb{} + pb.Command = st.Command + + pb.Compute = st.Compute + + pb.DlRuntimeImage = st.DlRuntimeImage + + pb.MlflowExperimentName = st.MlflowExperimentName + + pb.Source = st.Source + + pb.TrainingScriptPath = st.TrainingScriptPath + + pb.YamlParameters = st.YamlParameters + + pb.YamlParametersFilePath = st.YamlParametersFilePath + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genAiComputeTaskPb struct { + Command string `json:"command,omitempty"` + + Compute *ComputeConfig `json:"compute,omitempty"` + + DlRuntimeImage string `json:"dl_runtime_image"` + + MlflowExperimentName string `json:"mlflow_experiment_name,omitempty"` + + Source Source `json:"source,omitempty"` + + TrainingScriptPath string `json:"training_script_path,omitempty"` + + YamlParameters string `json:"yaml_parameters,omitempty"` + + YamlParametersFilePath string `json:"yaml_parameters_file_path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genAiComputeTaskFromPb(pb *genAiComputeTaskPb) (*GenAiComputeTask, error) { + if pb == nil { + return nil, nil + } + st := &GenAiComputeTask{} + st.Command = pb.Command + st.Compute = pb.Compute + st.DlRuntimeImage = pb.DlRuntimeImage + st.MlflowExperimentName = pb.MlflowExperimentName + st.Source = pb.Source + st.TrainingScriptPath = pb.TrainingScriptPath + st.YamlParameters = pb.YamlParameters + st.YamlParametersFilePath = pb.YamlParametersFilePath + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genAiComputeTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genAiComputeTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getJobPermissionLevelsRequestToPb(st *GetJobPermissionLevelsRequest) (*getJobPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getJobPermissionLevelsRequestPb{} + pb.JobId = st.JobId + + return pb, nil +} + +type getJobPermissionLevelsRequestPb struct { + JobId string `json:"-" url:"-"` +} + +func getJobPermissionLevelsRequestFromPb(pb *getJobPermissionLevelsRequestPb) (*GetJobPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetJobPermissionLevelsRequest{} + st.JobId = pb.JobId + + return st, nil +} + +func getJobPermissionLevelsResponseToPb(st *GetJobPermissionLevelsResponse) (*getJobPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getJobPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getJobPermissionLevelsResponsePb struct { + PermissionLevels []JobPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getJobPermissionLevelsResponseFromPb(pb *getJobPermissionLevelsResponsePb) (*GetJobPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetJobPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getJobPermissionsRequestToPb(st *GetJobPermissionsRequest) (*getJobPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getJobPermissionsRequestPb{} + pb.JobId = st.JobId + + return pb, nil +} + +type getJobPermissionsRequestPb struct { + JobId string `json:"-" url:"-"` +} + +func getJobPermissionsRequestFromPb(pb *getJobPermissionsRequestPb) (*GetJobPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetJobPermissionsRequest{} + st.JobId = pb.JobId + + return st, nil +} + +func getJobRequestToPb(st *GetJobRequest) (*getJobRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getJobRequestPb{} + pb.JobId = st.JobId + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getJobRequestPb struct { + JobId int64 `json:"-" url:"job_id"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getJobRequestFromPb(pb *getJobRequestPb) (*GetJobRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetJobRequest{} + st.JobId = pb.JobId + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getJobRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getJobRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPolicyComplianceRequestToPb(st *GetPolicyComplianceRequest) (*getPolicyComplianceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPolicyComplianceRequestPb{} + pb.JobId = st.JobId + + return pb, nil +} + +type getPolicyComplianceRequestPb struct { + JobId int64 `json:"-" url:"job_id"` +} + +func getPolicyComplianceRequestFromPb(pb *getPolicyComplianceRequestPb) (*GetPolicyComplianceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPolicyComplianceRequest{} + st.JobId = pb.JobId + + return st, nil +} + +func getPolicyComplianceResponseToPb(st *GetPolicyComplianceResponse) (*getPolicyComplianceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPolicyComplianceResponsePb{} + pb.IsCompliant = st.IsCompliant + + pb.Violations = st.Violations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPolicyComplianceResponsePb struct { + IsCompliant bool `json:"is_compliant,omitempty"` + + Violations map[string]string `json:"violations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPolicyComplianceResponseFromPb(pb *getPolicyComplianceResponsePb) (*GetPolicyComplianceResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPolicyComplianceResponse{} + st.IsCompliant = pb.IsCompliant + st.Violations = pb.Violations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPolicyComplianceResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPolicyComplianceResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getRunOutputRequestToPb(st *GetRunOutputRequest) (*getRunOutputRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRunOutputRequestPb{} + pb.RunId = st.RunId + + return pb, nil +} + +type getRunOutputRequestPb struct { + RunId int64 `json:"-" url:"run_id"` +} + +func getRunOutputRequestFromPb(pb *getRunOutputRequestPb) (*GetRunOutputRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRunOutputRequest{} + st.RunId = pb.RunId + + return st, nil +} + +func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRunRequestPb{} + pb.IncludeHistory = st.IncludeHistory + + pb.IncludeResolvedValues = st.IncludeResolvedValues + + pb.PageToken = st.PageToken + + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRunRequestPb struct { + IncludeHistory bool `json:"-" url:"include_history,omitempty"` + + IncludeResolvedValues bool `json:"-" url:"include_resolved_values,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + RunId int64 `json:"-" url:"run_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRunRequestFromPb(pb *getRunRequestPb) (*GetRunRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRunRequest{} + st.IncludeHistory = pb.IncludeHistory + st.IncludeResolvedValues = pb.IncludeResolvedValues + st.PageToken = pb.PageToken + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRunRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRunRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gitSnapshotToPb(st *GitSnapshot) (*gitSnapshotPb, error) { + if st == nil { + return nil, nil + } + pb := &gitSnapshotPb{} + pb.UsedCommit = st.UsedCommit + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gitSnapshotPb struct { + UsedCommit string `json:"used_commit,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gitSnapshotFromPb(pb *gitSnapshotPb) (*GitSnapshot, error) { + if pb == nil { + return nil, nil + } + st := &GitSnapshot{} + st.UsedCommit = pb.UsedCommit + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gitSnapshotPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gitSnapshotPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gitSourceToPb(st *GitSource) (*gitSourcePb, error) { + if st == nil { + return nil, nil + } + pb := &gitSourcePb{} + pb.GitBranch = st.GitBranch + + pb.GitCommit = st.GitCommit + + pb.GitProvider = st.GitProvider + + pb.GitSnapshot = st.GitSnapshot + + pb.GitTag = st.GitTag + + pb.GitUrl = st.GitUrl + + pb.JobSource = st.JobSource + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gitSourcePb struct { + GitBranch string `json:"git_branch,omitempty"` + + GitCommit string `json:"git_commit,omitempty"` + + GitProvider GitProvider `json:"git_provider"` + + GitSnapshot *GitSnapshot `json:"git_snapshot,omitempty"` + + GitTag string `json:"git_tag,omitempty"` + + GitUrl string `json:"git_url"` + + JobSource *JobSource `json:"job_source,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gitSourceFromPb(pb *gitSourcePb) (*GitSource, error) { + if pb == nil { + return nil, nil + } + st := &GitSource{} + st.GitBranch = pb.GitBranch + st.GitCommit = pb.GitCommit + st.GitProvider = pb.GitProvider + st.GitSnapshot = pb.GitSnapshot + st.GitTag = pb.GitTag + st.GitUrl = pb.GitUrl + st.JobSource = pb.JobSource + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gitSourcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gitSourcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobToPb(st *Job) (*jobPb, error) { + if st == nil { + return nil, nil + } + pb := &jobPb{} + pb.CreatedTime = st.CreatedTime + + pb.CreatorUserName = st.CreatorUserName + + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.HasMore = st.HasMore + + pb.JobId = st.JobId + + pb.NextPageToken = st.NextPageToken + + pb.RunAsUserName = st.RunAsUserName + + pb.Settings = st.Settings + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobPb struct { + CreatedTime int64 `json:"created_time,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + HasMore bool `json:"has_more,omitempty"` + + JobId int64 `json:"job_id,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + RunAsUserName string `json:"run_as_user_name,omitempty"` + + Settings *JobSettings `json:"settings,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobFromPb(pb *jobPb) (*Job, error) { + if pb == nil { + return nil, nil + } + st := &Job{} + st.CreatedTime = pb.CreatedTime + st.CreatorUserName = pb.CreatorUserName + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + st.HasMore = pb.HasMore + st.JobId = pb.JobId + st.NextPageToken = pb.NextPageToken + st.RunAsUserName = pb.RunAsUserName + st.Settings = pb.Settings + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobAccessControlRequestToPb(st *JobAccessControlRequest) (*jobAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &jobAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobAccessControlRequestFromPb(pb *jobAccessControlRequestPb) (*JobAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &JobAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobAccessControlResponseToPb(st *JobAccessControlResponse) (*jobAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &jobAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobAccessControlResponsePb struct { + AllPermissions []JobPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobAccessControlResponseFromPb(pb *jobAccessControlResponsePb) (*JobAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &JobAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobClusterToPb(st *JobCluster) (*jobClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &jobClusterPb{} + pb.JobClusterKey = st.JobClusterKey + + pb.NewCluster = st.NewCluster + + return pb, nil +} + +type jobClusterPb struct { + JobClusterKey string `json:"job_cluster_key"` + + NewCluster compute.ClusterSpec `json:"new_cluster"` +} + +func jobClusterFromPb(pb *jobClusterPb) (*JobCluster, error) { + if pb == nil { + return nil, nil + } + st := &JobCluster{} + st.JobClusterKey = pb.JobClusterKey + st.NewCluster = pb.NewCluster + + return st, nil +} + +func jobComplianceToPb(st *JobCompliance) (*jobCompliancePb, error) { + if st == nil { + return nil, nil + } + pb := &jobCompliancePb{} + pb.IsCompliant = st.IsCompliant + + pb.JobId = st.JobId + + pb.Violations = st.Violations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobCompliancePb struct { + IsCompliant bool `json:"is_compliant,omitempty"` + + JobId int64 `json:"job_id"` + + Violations map[string]string `json:"violations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobComplianceFromPb(pb *jobCompliancePb) (*JobCompliance, error) { + if pb == nil { + return nil, nil + } + st := &JobCompliance{} + st.IsCompliant = pb.IsCompliant + st.JobId = pb.JobId + st.Violations = pb.Violations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobCompliancePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobCompliancePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobDeploymentToPb(st *JobDeployment) (*jobDeploymentPb, error) { + if st == nil { + return nil, nil + } + pb := &jobDeploymentPb{} + pb.Kind = st.Kind + + pb.MetadataFilePath = st.MetadataFilePath + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobDeploymentPb struct { + Kind JobDeploymentKind `json:"kind"` + + MetadataFilePath string `json:"metadata_file_path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobDeploymentFromPb(pb *jobDeploymentPb) (*JobDeployment, error) { + if pb == nil { + return nil, nil + } + st := &JobDeployment{} + st.Kind = pb.Kind + st.MetadataFilePath = pb.MetadataFilePath + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobDeploymentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobDeploymentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobEmailNotificationsToPb(st *JobEmailNotifications) (*jobEmailNotificationsPb, error) { + if st == nil { + return nil, nil + } + pb := &jobEmailNotificationsPb{} + pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns + + pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded + + pb.OnFailure = st.OnFailure + + pb.OnStart = st.OnStart + + pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded + + pb.OnSuccess = st.OnSuccess + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobEmailNotificationsPb struct { + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + + OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` + + OnFailure []string `json:"on_failure,omitempty"` + + OnStart []string `json:"on_start,omitempty"` + + OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + + OnSuccess []string `json:"on_success,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobEmailNotificationsFromPb(pb *jobEmailNotificationsPb) (*JobEmailNotifications, error) { + if pb == nil { + return nil, nil + } + st := &JobEmailNotifications{} + st.NoAlertForSkippedRuns = pb.NoAlertForSkippedRuns + st.OnDurationWarningThresholdExceeded = pb.OnDurationWarningThresholdExceeded + st.OnFailure = pb.OnFailure + st.OnStart = pb.OnStart + st.OnStreamingBacklogExceeded = pb.OnStreamingBacklogExceeded + st.OnSuccess = pb.OnSuccess + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobEmailNotificationsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobEmailNotificationsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobEnvironmentToPb(st *JobEnvironment) (*jobEnvironmentPb, error) { + if st == nil { + return nil, nil + } + pb := &jobEnvironmentPb{} + pb.EnvironmentKey = st.EnvironmentKey + + pb.Spec = st.Spec + + return pb, nil +} + +type jobEnvironmentPb struct { + EnvironmentKey string `json:"environment_key"` + + Spec *compute.Environment `json:"spec,omitempty"` +} + +func jobEnvironmentFromPb(pb *jobEnvironmentPb) (*JobEnvironment, error) { + if pb == nil { + return nil, nil + } + st := &JobEnvironment{} + st.EnvironmentKey = pb.EnvironmentKey + st.Spec = pb.Spec + + return st, nil +} + +func jobNotificationSettingsToPb(st *JobNotificationSettings) (*jobNotificationSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &jobNotificationSettingsPb{} + pb.NoAlertForCanceledRuns = st.NoAlertForCanceledRuns + + pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobNotificationSettingsPb struct { + NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` + + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobNotificationSettingsFromPb(pb *jobNotificationSettingsPb) (*JobNotificationSettings, error) { + if pb == nil { + return nil, nil + } + st := &JobNotificationSettings{} + st.NoAlertForCanceledRuns = pb.NoAlertForCanceledRuns + st.NoAlertForSkippedRuns = pb.NoAlertForSkippedRuns + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobNotificationSettingsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobNotificationSettingsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobParameterToPb(st *JobParameter) (*jobParameterPb, error) { + if st == nil { + return nil, nil + } + pb := &jobParameterPb{} + pb.Default = st.Default + + pb.Name = st.Name + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobParameterPb struct { + Default string `json:"default,omitempty"` + + Name string `json:"name,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobParameterFromPb(pb *jobParameterPb) (*JobParameter, error) { + if pb == nil { + return nil, nil + } + st := &JobParameter{} + st.Default = pb.Default + st.Name = pb.Name + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobParameterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobParameterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobParameterDefinitionToPb(st *JobParameterDefinition) (*jobParameterDefinitionPb, error) { + if st == nil { + return nil, nil + } + pb := &jobParameterDefinitionPb{} + pb.Default = st.Default + + pb.Name = st.Name + + return pb, nil +} + +type jobParameterDefinitionPb struct { + Default string `json:"default"` + + Name string `json:"name"` +} + +func jobParameterDefinitionFromPb(pb *jobParameterDefinitionPb) (*JobParameterDefinition, error) { + if pb == nil { + return nil, nil + } + st := &JobParameterDefinition{} + st.Default = pb.Default + st.Name = pb.Name + + return st, nil +} + +func jobPermissionToPb(st *JobPermission) (*jobPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &jobPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobPermissionFromPb(pb *jobPermissionPb) (*JobPermission, error) { + if pb == nil { + return nil, nil + } + st := &JobPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobPermissionsToPb(st *JobPermissions) (*jobPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &jobPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobPermissionsPb struct { + AccessControlList []JobAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobPermissionsFromPb(pb *jobPermissionsPb) (*JobPermissions, error) { + if pb == nil { + return nil, nil + } + st := &JobPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobPermissionsDescriptionToPb(st *JobPermissionsDescription) (*jobPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &jobPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobPermissionsDescriptionFromPb(pb *jobPermissionsDescriptionPb) (*JobPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &JobPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobPermissionsRequestToPb(st *JobPermissionsRequest) (*jobPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &jobPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.JobId = st.JobId + + return pb, nil +} + +type jobPermissionsRequestPb struct { + AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + + JobId string `json:"-" url:"-"` +} + +func jobPermissionsRequestFromPb(pb *jobPermissionsRequestPb) (*JobPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &JobPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.JobId = pb.JobId + + return st, nil +} + +func jobRunAsToPb(st *JobRunAs) (*jobRunAsPb, error) { + if st == nil { + return nil, nil + } + pb := &jobRunAsPb{} + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobRunAsPb struct { + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobRunAsFromPb(pb *jobRunAsPb) (*JobRunAs, error) { + if pb == nil { + return nil, nil + } + st := &JobRunAs{} + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobRunAsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobRunAsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobSettingsToPb(st *JobSettings) (*jobSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &jobSettingsPb{} + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Continuous = st.Continuous + + pb.Deployment = st.Deployment + + pb.Description = st.Description + + pb.EditMode = st.EditMode + + pb.EmailNotifications = st.EmailNotifications + + pb.Environments = st.Environments + + pb.Format = st.Format + + pb.GitSource = st.GitSource + + pb.Health = st.Health + + pb.JobClusters = st.JobClusters + + pb.MaxConcurrentRuns = st.MaxConcurrentRuns + + pb.Name = st.Name + + pb.NotificationSettings = st.NotificationSettings + + pb.Parameters = st.Parameters + + pb.PerformanceTarget = st.PerformanceTarget + + pb.Queue = st.Queue + + pb.RunAs = st.RunAs + + pb.Schedule = st.Schedule + + pb.Tags = st.Tags + + pb.Tasks = st.Tasks + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.Trigger = st.Trigger + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobSettingsPb struct { + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Continuous *Continuous `json:"continuous,omitempty"` + + Deployment *JobDeployment `json:"deployment,omitempty"` + + Description string `json:"description,omitempty"` + + EditMode JobEditMode `json:"edit_mode,omitempty"` + + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + + Environments []JobEnvironment `json:"environments,omitempty"` + + Format Format `json:"format,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + Health *JobsHealthRules `json:"health,omitempty"` + + JobClusters []JobCluster `json:"job_clusters,omitempty"` + + MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + + Name string `json:"name,omitempty"` + + NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + + Parameters []JobParameterDefinition `json:"parameters,omitempty"` + + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + + Queue *QueueSettings `json:"queue,omitempty"` + + RunAs *JobRunAs `json:"run_as,omitempty"` + + Schedule *CronSchedule `json:"schedule,omitempty"` + + Tags map[string]string `json:"tags,omitempty"` + + Tasks []Task `json:"tasks,omitempty"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + Trigger *TriggerSettings `json:"trigger,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobSettingsFromPb(pb *jobSettingsPb) (*JobSettings, error) { + if pb == nil { + return nil, nil + } + st := &JobSettings{} + st.BudgetPolicyId = pb.BudgetPolicyId + st.Continuous = pb.Continuous + st.Deployment = pb.Deployment + st.Description = pb.Description + st.EditMode = pb.EditMode + st.EmailNotifications = pb.EmailNotifications + st.Environments = pb.Environments + st.Format = pb.Format + st.GitSource = pb.GitSource + st.Health = pb.Health + st.JobClusters = pb.JobClusters + st.MaxConcurrentRuns = pb.MaxConcurrentRuns + st.Name = pb.Name + st.NotificationSettings = pb.NotificationSettings + st.Parameters = pb.Parameters + st.PerformanceTarget = pb.PerformanceTarget + st.Queue = pb.Queue + st.RunAs = pb.RunAs + st.Schedule = pb.Schedule + st.Tags = pb.Tags + st.Tasks = pb.Tasks + st.TimeoutSeconds = pb.TimeoutSeconds + st.Trigger = pb.Trigger + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobSettingsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobSettingsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobSourceToPb(st *JobSource) (*jobSourcePb, error) { + if st == nil { + return nil, nil + } + pb := &jobSourcePb{} + pb.DirtyState = st.DirtyState + + pb.ImportFromGitBranch = st.ImportFromGitBranch + + pb.JobConfigPath = st.JobConfigPath + + return pb, nil +} + +type jobSourcePb struct { + DirtyState JobSourceDirtyState `json:"dirty_state,omitempty"` + + ImportFromGitBranch string `json:"import_from_git_branch"` + + JobConfigPath string `json:"job_config_path"` +} + +func jobSourceFromPb(pb *jobSourcePb) (*JobSource, error) { + if pb == nil { + return nil, nil + } + st := &JobSource{} + st.DirtyState = pb.DirtyState + st.ImportFromGitBranch = pb.ImportFromGitBranch + st.JobConfigPath = pb.JobConfigPath + + return st, nil +} + +func jobsHealthRuleToPb(st *JobsHealthRule) (*jobsHealthRulePb, error) { + if st == nil { + return nil, nil + } + pb := &jobsHealthRulePb{} + pb.Metric = st.Metric + + pb.Op = st.Op + + pb.Value = st.Value + + return pb, nil +} + +type jobsHealthRulePb struct { + Metric JobsHealthMetric `json:"metric"` + + Op JobsHealthOperator `json:"op"` + + Value int64 `json:"value"` +} + +func jobsHealthRuleFromPb(pb *jobsHealthRulePb) (*JobsHealthRule, error) { + if pb == nil { + return nil, nil + } + st := &JobsHealthRule{} + st.Metric = pb.Metric + st.Op = pb.Op + st.Value = pb.Value + + return st, nil +} + +func jobsHealthRulesToPb(st *JobsHealthRules) (*jobsHealthRulesPb, error) { + if st == nil { + return nil, nil + } + pb := &jobsHealthRulesPb{} + pb.Rules = st.Rules + + return pb, nil +} + +type jobsHealthRulesPb struct { + Rules []JobsHealthRule `json:"rules,omitempty"` +} + +func jobsHealthRulesFromPb(pb *jobsHealthRulesPb) (*JobsHealthRules, error) { + if pb == nil { + return nil, nil + } + st := &JobsHealthRules{} + st.Rules = pb.Rules + + return st, nil +} + +func listJobComplianceForPolicyResponseToPb(st *ListJobComplianceForPolicyResponse) (*listJobComplianceForPolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listJobComplianceForPolicyResponsePb{} + pb.Jobs = st.Jobs + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listJobComplianceForPolicyResponsePb struct { + Jobs []JobCompliance `json:"jobs,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listJobComplianceForPolicyResponseFromPb(pb *listJobComplianceForPolicyResponsePb) (*ListJobComplianceForPolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListJobComplianceForPolicyResponse{} + st.Jobs = pb.Jobs + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listJobComplianceForPolicyResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listJobComplianceForPolicyResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listJobComplianceRequestToPb(st *ListJobComplianceRequest) (*listJobComplianceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listJobComplianceRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listJobComplianceRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + PolicyId string `json:"-" url:"policy_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listJobComplianceRequestFromPb(pb *listJobComplianceRequestPb) (*ListJobComplianceRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListJobComplianceRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listJobComplianceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listJobComplianceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listJobsRequestToPb(st *ListJobsRequest) (*listJobsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listJobsRequestPb{} + pb.ExpandTasks = st.ExpandTasks + + pb.Limit = st.Limit + + pb.Name = st.Name + + pb.Offset = st.Offset + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listJobsRequestPb struct { + ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + + Limit int `json:"-" url:"limit,omitempty"` + + Name string `json:"-" url:"name,omitempty"` + + Offset int `json:"-" url:"offset,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listJobsRequestFromPb(pb *listJobsRequestPb) (*ListJobsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListJobsRequest{} + st.ExpandTasks = pb.ExpandTasks + st.Limit = pb.Limit + st.Name = pb.Name + st.Offset = pb.Offset + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listJobsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listJobsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listJobsResponseToPb(st *ListJobsResponse) (*listJobsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listJobsResponsePb{} + pb.HasMore = st.HasMore + + pb.Jobs = st.Jobs + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listJobsResponsePb struct { + HasMore bool `json:"has_more,omitempty"` + + Jobs []BaseJob `json:"jobs,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listJobsResponseFromPb(pb *listJobsResponsePb) (*ListJobsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListJobsResponse{} + st.HasMore = pb.HasMore + st.Jobs = pb.Jobs + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listJobsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listJobsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRunsRequestToPb(st *ListRunsRequest) (*listRunsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listRunsRequestPb{} + pb.ActiveOnly = st.ActiveOnly + + pb.CompletedOnly = st.CompletedOnly + + pb.ExpandTasks = st.ExpandTasks + + pb.JobId = st.JobId + + pb.Limit = st.Limit + + pb.Offset = st.Offset + + pb.PageToken = st.PageToken + + pb.RunType = st.RunType + + pb.StartTimeFrom = st.StartTimeFrom + + pb.StartTimeTo = st.StartTimeTo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRunsRequestPb struct { + ActiveOnly bool `json:"-" url:"active_only,omitempty"` + + CompletedOnly bool `json:"-" url:"completed_only,omitempty"` + + ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + + JobId int64 `json:"-" url:"job_id,omitempty"` + + Limit int `json:"-" url:"limit,omitempty"` + + Offset int `json:"-" url:"offset,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + RunType RunType `json:"-" url:"run_type,omitempty"` + + StartTimeFrom int64 `json:"-" url:"start_time_from,omitempty"` + + StartTimeTo int64 `json:"-" url:"start_time_to,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRunsRequestFromPb(pb *listRunsRequestPb) (*ListRunsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListRunsRequest{} + st.ActiveOnly = pb.ActiveOnly + st.CompletedOnly = pb.CompletedOnly + st.ExpandTasks = pb.ExpandTasks + st.JobId = pb.JobId + st.Limit = pb.Limit + st.Offset = pb.Offset + st.PageToken = pb.PageToken + st.RunType = pb.RunType + st.StartTimeFrom = pb.StartTimeFrom + st.StartTimeTo = pb.StartTimeTo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRunsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRunsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRunsResponseToPb(st *ListRunsResponse) (*listRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listRunsResponsePb{} + pb.HasMore = st.HasMore + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.Runs = st.Runs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRunsResponsePb struct { + HasMore bool `json:"has_more,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + Runs []BaseRun `json:"runs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRunsResponseFromPb(pb *listRunsResponsePb) (*ListRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListRunsResponse{} + st.HasMore = pb.HasMore + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + st.Runs = pb.Runs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRunsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRunsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func notebookOutputToPb(st *NotebookOutput) (*notebookOutputPb, error) { + if st == nil { + return nil, nil + } + pb := ¬ebookOutputPb{} + pb.Result = st.Result + + pb.Truncated = st.Truncated + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type notebookOutputPb struct { + Result string `json:"result,omitempty"` + + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func notebookOutputFromPb(pb *notebookOutputPb) (*NotebookOutput, error) { + if pb == nil { + return nil, nil + } + st := &NotebookOutput{} + st.Result = pb.Result + st.Truncated = pb.Truncated + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *notebookOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st notebookOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func notebookTaskToPb(st *NotebookTask) (*notebookTaskPb, error) { + if st == nil { + return nil, nil + } + pb := ¬ebookTaskPb{} + pb.BaseParameters = st.BaseParameters + + pb.NotebookPath = st.NotebookPath + + pb.Source = st.Source + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type notebookTaskPb struct { + BaseParameters map[string]string `json:"base_parameters,omitempty"` + + NotebookPath string `json:"notebook_path"` + + Source Source `json:"source,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func notebookTaskFromPb(pb *notebookTaskPb) (*NotebookTask, error) { + if pb == nil { + return nil, nil + } + st := &NotebookTask{} + st.BaseParameters = pb.BaseParameters + st.NotebookPath = pb.NotebookPath + st.Source = pb.Source + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *notebookTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st notebookTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func outputSchemaInfoToPb(st *OutputSchemaInfo) (*outputSchemaInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &outputSchemaInfoPb{} + pb.CatalogName = st.CatalogName + + pb.ExpirationTime = st.ExpirationTime + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type outputSchemaInfoPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func outputSchemaInfoFromPb(pb *outputSchemaInfoPb) (*OutputSchemaInfo, error) { + if pb == nil { + return nil, nil + } + st := &OutputSchemaInfo{} + st.CatalogName = pb.CatalogName + st.ExpirationTime = pb.ExpirationTime + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *outputSchemaInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st outputSchemaInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func periodicTriggerConfigurationToPb(st *PeriodicTriggerConfiguration) (*periodicTriggerConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &periodicTriggerConfigurationPb{} + pb.Interval = st.Interval + + pb.Unit = st.Unit + + return pb, nil +} + +type periodicTriggerConfigurationPb struct { + Interval int `json:"interval"` + + Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` +} + +func periodicTriggerConfigurationFromPb(pb *periodicTriggerConfigurationPb) (*PeriodicTriggerConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &PeriodicTriggerConfiguration{} + st.Interval = pb.Interval + st.Unit = pb.Unit + + return st, nil +} + +func pipelineParamsToPb(st *PipelineParams) (*pipelineParamsPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineParamsPb{} + pb.FullRefresh = st.FullRefresh + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineParamsPb struct { + FullRefresh bool `json:"full_refresh,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineParamsFromPb(pb *pipelineParamsPb) (*PipelineParams, error) { + if pb == nil { + return nil, nil + } + st := &PipelineParams{} + st.FullRefresh = pb.FullRefresh + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineParamsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineParamsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineTaskToPb(st *PipelineTask) (*pipelineTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineTaskPb{} + pb.FullRefresh = st.FullRefresh + + pb.PipelineId = st.PipelineId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineTaskPb struct { + FullRefresh bool `json:"full_refresh,omitempty"` + + PipelineId string `json:"pipeline_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineTaskFromPb(pb *pipelineTaskPb) (*PipelineTask, error) { + if pb == nil { + return nil, nil + } + st := &PipelineTask{} + st.FullRefresh = pb.FullRefresh + st.PipelineId = pb.PipelineId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func powerBiModelToPb(st *PowerBiModel) (*powerBiModelPb, error) { + if st == nil { + return nil, nil + } + pb := &powerBiModelPb{} + pb.AuthenticationMethod = st.AuthenticationMethod + + pb.ModelName = st.ModelName + + pb.OverwriteExisting = st.OverwriteExisting + + pb.StorageMode = st.StorageMode + + pb.WorkspaceName = st.WorkspaceName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type powerBiModelPb struct { + AuthenticationMethod AuthenticationMethod `json:"authentication_method,omitempty"` + + ModelName string `json:"model_name,omitempty"` + + OverwriteExisting bool `json:"overwrite_existing,omitempty"` + + StorageMode StorageMode `json:"storage_mode,omitempty"` + + WorkspaceName string `json:"workspace_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func powerBiModelFromPb(pb *powerBiModelPb) (*PowerBiModel, error) { + if pb == nil { + return nil, nil + } + st := &PowerBiModel{} + st.AuthenticationMethod = pb.AuthenticationMethod + st.ModelName = pb.ModelName + st.OverwriteExisting = pb.OverwriteExisting + st.StorageMode = pb.StorageMode + st.WorkspaceName = pb.WorkspaceName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *powerBiModelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st powerBiModelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func powerBiTableToPb(st *PowerBiTable) (*powerBiTablePb, error) { + if st == nil { + return nil, nil + } + pb := &powerBiTablePb{} + pb.Catalog = st.Catalog + + pb.Name = st.Name + + pb.Schema = st.Schema + + pb.StorageMode = st.StorageMode + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type powerBiTablePb struct { + Catalog string `json:"catalog,omitempty"` + + Name string `json:"name,omitempty"` + + Schema string `json:"schema,omitempty"` + + StorageMode StorageMode `json:"storage_mode,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func powerBiTableFromPb(pb *powerBiTablePb) (*PowerBiTable, error) { + if pb == nil { + return nil, nil + } + st := &PowerBiTable{} + st.Catalog = pb.Catalog + st.Name = pb.Name + st.Schema = pb.Schema + st.StorageMode = pb.StorageMode + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *powerBiTablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st powerBiTablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func powerBiTaskToPb(st *PowerBiTask) (*powerBiTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &powerBiTaskPb{} + pb.ConnectionResourceName = st.ConnectionResourceName + + pb.PowerBiModel = st.PowerBiModel + + pb.RefreshAfterUpdate = st.RefreshAfterUpdate + + pb.Tables = st.Tables + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type powerBiTaskPb struct { + ConnectionResourceName string `json:"connection_resource_name,omitempty"` + + PowerBiModel *PowerBiModel `json:"power_bi_model,omitempty"` + + RefreshAfterUpdate bool `json:"refresh_after_update,omitempty"` + + Tables []PowerBiTable `json:"tables,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func powerBiTaskFromPb(pb *powerBiTaskPb) (*PowerBiTask, error) { + if pb == nil { + return nil, nil + } + st := &PowerBiTask{} + st.ConnectionResourceName = pb.ConnectionResourceName + st.PowerBiModel = pb.PowerBiModel + st.RefreshAfterUpdate = pb.RefreshAfterUpdate + st.Tables = pb.Tables + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *powerBiTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st powerBiTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pythonWheelTaskToPb(st *PythonWheelTask) (*pythonWheelTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &pythonWheelTaskPb{} + pb.EntryPoint = st.EntryPoint + + pb.NamedParameters = st.NamedParameters + + pb.PackageName = st.PackageName + + pb.Parameters = st.Parameters + + return pb, nil +} + +type pythonWheelTaskPb struct { + EntryPoint string `json:"entry_point"` + + NamedParameters map[string]string `json:"named_parameters,omitempty"` + + PackageName string `json:"package_name"` + + Parameters []string `json:"parameters,omitempty"` +} + +func pythonWheelTaskFromPb(pb *pythonWheelTaskPb) (*PythonWheelTask, error) { + if pb == nil { + return nil, nil + } + st := &PythonWheelTask{} + st.EntryPoint = pb.EntryPoint + st.NamedParameters = pb.NamedParameters + st.PackageName = pb.PackageName + st.Parameters = pb.Parameters + + return st, nil +} + +func queueDetailsToPb(st *QueueDetails) (*queueDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &queueDetailsPb{} + pb.Code = st.Code + + pb.Message = st.Message + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queueDetailsPb struct { + Code QueueDetailsCodeCode `json:"code,omitempty"` + + Message string `json:"message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queueDetailsFromPb(pb *queueDetailsPb) (*QueueDetails, error) { + if pb == nil { + return nil, nil + } + st := &QueueDetails{} + st.Code = pb.Code + st.Message = pb.Message + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queueDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queueDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queueSettingsToPb(st *QueueSettings) (*queueSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &queueSettingsPb{} + pb.Enabled = st.Enabled + + return pb, nil +} + +type queueSettingsPb struct { + Enabled bool `json:"enabled"` +} + +func queueSettingsFromPb(pb *queueSettingsPb) (*QueueSettings, error) { + if pb == nil { + return nil, nil + } + st := &QueueSettings{} + st.Enabled = pb.Enabled + + return st, nil +} + +func repairHistoryItemToPb(st *RepairHistoryItem) (*repairHistoryItemPb, error) { + if st == nil { + return nil, nil + } + pb := &repairHistoryItemPb{} + pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget + + pb.EndTime = st.EndTime + + pb.Id = st.Id + + pb.StartTime = st.StartTime + + pb.State = st.State + + pb.Status = st.Status + + pb.TaskRunIds = st.TaskRunIds + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repairHistoryItemPb struct { + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + + EndTime int64 `json:"end_time,omitempty"` + + Id int64 `json:"id,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + State *RunState `json:"state,omitempty"` + + Status *RunStatus `json:"status,omitempty"` + + TaskRunIds []int64 `json:"task_run_ids,omitempty"` + + Type RepairHistoryItemType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repairHistoryItemFromPb(pb *repairHistoryItemPb) (*RepairHistoryItem, error) { + if pb == nil { + return nil, nil + } + st := &RepairHistoryItem{} + st.EffectivePerformanceTarget = pb.EffectivePerformanceTarget + st.EndTime = pb.EndTime + st.Id = pb.Id + st.StartTime = pb.StartTime + st.State = pb.State + st.Status = pb.Status + st.TaskRunIds = pb.TaskRunIds + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repairHistoryItemPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repairHistoryItemPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repairRunToPb(st *RepairRun) (*repairRunPb, error) { + if st == nil { + return nil, nil + } + pb := &repairRunPb{} + pb.DbtCommands = st.DbtCommands + + pb.JarParams = st.JarParams + + pb.JobParameters = st.JobParameters + + pb.LatestRepairId = st.LatestRepairId + + pb.NotebookParams = st.NotebookParams + + pb.PerformanceTarget = st.PerformanceTarget + + pb.PipelineParams = st.PipelineParams + + pb.PythonNamedParams = st.PythonNamedParams + + pb.PythonParams = st.PythonParams + + pb.RerunAllFailedTasks = st.RerunAllFailedTasks + + pb.RerunDependentTasks = st.RerunDependentTasks + + pb.RerunTasks = st.RerunTasks + + pb.RunId = st.RunId + + pb.SparkSubmitParams = st.SparkSubmitParams + + pb.SqlParams = st.SqlParams + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repairRunPb struct { + DbtCommands []string `json:"dbt_commands,omitempty"` + + JarParams []string `json:"jar_params,omitempty"` + + JobParameters map[string]string `json:"job_parameters,omitempty"` + + LatestRepairId int64 `json:"latest_repair_id,omitempty"` + + NotebookParams map[string]string `json:"notebook_params,omitempty"` + + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + + PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + + PythonParams []string `json:"python_params,omitempty"` + + RerunAllFailedTasks bool `json:"rerun_all_failed_tasks,omitempty"` + + RerunDependentTasks bool `json:"rerun_dependent_tasks,omitempty"` + + RerunTasks []string `json:"rerun_tasks,omitempty"` + + RunId int64 `json:"run_id"` + + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + + SqlParams map[string]string `json:"sql_params,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repairRunFromPb(pb *repairRunPb) (*RepairRun, error) { + if pb == nil { + return nil, nil + } + st := &RepairRun{} + st.DbtCommands = pb.DbtCommands + st.JarParams = pb.JarParams + st.JobParameters = pb.JobParameters + st.LatestRepairId = pb.LatestRepairId + st.NotebookParams = pb.NotebookParams + st.PerformanceTarget = pb.PerformanceTarget + st.PipelineParams = pb.PipelineParams + st.PythonNamedParams = pb.PythonNamedParams + st.PythonParams = pb.PythonParams + st.RerunAllFailedTasks = pb.RerunAllFailedTasks + st.RerunDependentTasks = pb.RerunDependentTasks + st.RerunTasks = pb.RerunTasks + st.RunId = pb.RunId + st.SparkSubmitParams = pb.SparkSubmitParams + st.SqlParams = pb.SqlParams + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repairRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repairRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repairRunResponseToPb(st *RepairRunResponse) (*repairRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &repairRunResponsePb{} + pb.RepairId = st.RepairId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repairRunResponsePb struct { + RepairId int64 `json:"repair_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repairRunResponseFromPb(pb *repairRunResponsePb) (*RepairRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &RepairRunResponse{} + st.RepairId = pb.RepairId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repairRunResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repairRunResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resetJobToPb(st *ResetJob) (*resetJobPb, error) { + if st == nil { + return nil, nil + } + pb := &resetJobPb{} + pb.JobId = st.JobId + + pb.NewSettings = st.NewSettings + + return pb, nil +} + +type resetJobPb struct { + JobId int64 `json:"job_id"` + + NewSettings JobSettings `json:"new_settings"` +} + +func resetJobFromPb(pb *resetJobPb) (*ResetJob, error) { + if pb == nil { + return nil, nil + } + st := &ResetJob{} + st.JobId = pb.JobId + st.NewSettings = pb.NewSettings + + return st, nil +} + +func resetResponseToPb(st *ResetResponse) (*resetResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &resetResponsePb{} + + return pb, nil +} + +type resetResponsePb struct { +} + +func resetResponseFromPb(pb *resetResponsePb) (*ResetResponse, error) { + if pb == nil { + return nil, nil + } + st := &ResetResponse{} + + return st, nil +} + +func resolvedConditionTaskValuesToPb(st *ResolvedConditionTaskValues) (*resolvedConditionTaskValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedConditionTaskValuesPb{} + pb.Left = st.Left + + pb.Right = st.Right + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resolvedConditionTaskValuesPb struct { + Left string `json:"left,omitempty"` + + Right string `json:"right,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resolvedConditionTaskValuesFromPb(pb *resolvedConditionTaskValuesPb) (*ResolvedConditionTaskValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedConditionTaskValues{} + st.Left = pb.Left + st.Right = pb.Right + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resolvedConditionTaskValuesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resolvedConditionTaskValuesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resolvedDbtTaskValuesToPb(st *ResolvedDbtTaskValues) (*resolvedDbtTaskValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedDbtTaskValuesPb{} + pb.Commands = st.Commands + + return pb, nil +} + +type resolvedDbtTaskValuesPb struct { + Commands []string `json:"commands,omitempty"` +} + +func resolvedDbtTaskValuesFromPb(pb *resolvedDbtTaskValuesPb) (*ResolvedDbtTaskValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedDbtTaskValues{} + st.Commands = pb.Commands + + return st, nil +} + +func resolvedNotebookTaskValuesToPb(st *ResolvedNotebookTaskValues) (*resolvedNotebookTaskValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedNotebookTaskValuesPb{} + pb.BaseParameters = st.BaseParameters + + return pb, nil +} + +type resolvedNotebookTaskValuesPb struct { + BaseParameters map[string]string `json:"base_parameters,omitempty"` +} + +func resolvedNotebookTaskValuesFromPb(pb *resolvedNotebookTaskValuesPb) (*ResolvedNotebookTaskValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedNotebookTaskValues{} + st.BaseParameters = pb.BaseParameters + + return st, nil +} + +func resolvedParamPairValuesToPb(st *ResolvedParamPairValues) (*resolvedParamPairValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedParamPairValuesPb{} + pb.Parameters = st.Parameters + + return pb, nil +} + +type resolvedParamPairValuesPb struct { + Parameters map[string]string `json:"parameters,omitempty"` +} + +func resolvedParamPairValuesFromPb(pb *resolvedParamPairValuesPb) (*ResolvedParamPairValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedParamPairValues{} + st.Parameters = pb.Parameters + + return st, nil +} + +func resolvedPythonWheelTaskValuesToPb(st *ResolvedPythonWheelTaskValues) (*resolvedPythonWheelTaskValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedPythonWheelTaskValuesPb{} + pb.NamedParameters = st.NamedParameters + + pb.Parameters = st.Parameters + + return pb, nil +} + +type resolvedPythonWheelTaskValuesPb struct { + NamedParameters map[string]string `json:"named_parameters,omitempty"` + + Parameters []string `json:"parameters,omitempty"` +} + +func resolvedPythonWheelTaskValuesFromPb(pb *resolvedPythonWheelTaskValuesPb) (*ResolvedPythonWheelTaskValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedPythonWheelTaskValues{} + st.NamedParameters = pb.NamedParameters + st.Parameters = pb.Parameters + + return st, nil +} + +func resolvedRunJobTaskValuesToPb(st *ResolvedRunJobTaskValues) (*resolvedRunJobTaskValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedRunJobTaskValuesPb{} + pb.JobParameters = st.JobParameters + + pb.Parameters = st.Parameters + + return pb, nil +} + +type resolvedRunJobTaskValuesPb struct { + JobParameters map[string]string `json:"job_parameters,omitempty"` + + Parameters map[string]string `json:"parameters,omitempty"` +} + +func resolvedRunJobTaskValuesFromPb(pb *resolvedRunJobTaskValuesPb) (*ResolvedRunJobTaskValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedRunJobTaskValues{} + st.JobParameters = pb.JobParameters + st.Parameters = pb.Parameters + + return st, nil +} + +func resolvedStringParamsValuesToPb(st *ResolvedStringParamsValues) (*resolvedStringParamsValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedStringParamsValuesPb{} + pb.Parameters = st.Parameters + + return pb, nil +} + +type resolvedStringParamsValuesPb struct { + Parameters []string `json:"parameters,omitempty"` +} + +func resolvedStringParamsValuesFromPb(pb *resolvedStringParamsValuesPb) (*ResolvedStringParamsValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedStringParamsValues{} + st.Parameters = pb.Parameters + + return st, nil +} + +func resolvedValuesToPb(st *ResolvedValues) (*resolvedValuesPb, error) { + if st == nil { + return nil, nil + } + pb := &resolvedValuesPb{} + pb.ConditionTask = st.ConditionTask + + pb.DbtTask = st.DbtTask + + pb.NotebookTask = st.NotebookTask + + pb.PythonWheelTask = st.PythonWheelTask + + pb.RunJobTask = st.RunJobTask + + pb.SimulationTask = st.SimulationTask + + pb.SparkJarTask = st.SparkJarTask + + pb.SparkPythonTask = st.SparkPythonTask + + pb.SparkSubmitTask = st.SparkSubmitTask + + pb.SqlTask = st.SqlTask + + return pb, nil +} + +type resolvedValuesPb struct { + ConditionTask *ResolvedConditionTaskValues `json:"condition_task,omitempty"` + + DbtTask *ResolvedDbtTaskValues `json:"dbt_task,omitempty"` + + NotebookTask *ResolvedNotebookTaskValues `json:"notebook_task,omitempty"` + + PythonWheelTask *ResolvedPythonWheelTaskValues `json:"python_wheel_task,omitempty"` + + RunJobTask *ResolvedRunJobTaskValues `json:"run_job_task,omitempty"` + + SimulationTask *ResolvedParamPairValues `json:"simulation_task,omitempty"` + + SparkJarTask *ResolvedStringParamsValues `json:"spark_jar_task,omitempty"` + + SparkPythonTask *ResolvedStringParamsValues `json:"spark_python_task,omitempty"` + + SparkSubmitTask *ResolvedStringParamsValues `json:"spark_submit_task,omitempty"` + + SqlTask *ResolvedParamPairValues `json:"sql_task,omitempty"` +} + +func resolvedValuesFromPb(pb *resolvedValuesPb) (*ResolvedValues, error) { + if pb == nil { + return nil, nil + } + st := &ResolvedValues{} + st.ConditionTask = pb.ConditionTask + st.DbtTask = pb.DbtTask + st.NotebookTask = pb.NotebookTask + st.PythonWheelTask = pb.PythonWheelTask + st.RunJobTask = pb.RunJobTask + st.SimulationTask = pb.SimulationTask + st.SparkJarTask = pb.SparkJarTask + st.SparkPythonTask = pb.SparkPythonTask + st.SparkSubmitTask = pb.SparkSubmitTask + st.SqlTask = pb.SqlTask + + return st, nil +} + +func runToPb(st *Run) (*runPb, error) { + if st == nil { + return nil, nil + } + pb := &runPb{} + pb.AttemptNumber = st.AttemptNumber + + pb.CleanupDuration = st.CleanupDuration + + pb.ClusterInstance = st.ClusterInstance + + pb.ClusterSpec = st.ClusterSpec + + pb.CreatorUserName = st.CreatorUserName + + pb.Description = st.Description + + pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget + + pb.EndTime = st.EndTime + + pb.ExecutionDuration = st.ExecutionDuration + + pb.GitSource = st.GitSource + + pb.HasMore = st.HasMore + + pb.Iterations = st.Iterations + + pb.JobClusters = st.JobClusters + + pb.JobId = st.JobId + + pb.JobParameters = st.JobParameters + + pb.JobRunId = st.JobRunId + + pb.NextPageToken = st.NextPageToken + + pb.NumberInJob = st.NumberInJob + + pb.OriginalAttemptRunId = st.OriginalAttemptRunId + + pb.OverridingParameters = st.OverridingParameters + + pb.QueueDuration = st.QueueDuration + + pb.RepairHistory = st.RepairHistory + + pb.RunDuration = st.RunDuration + + pb.RunId = st.RunId + + pb.RunName = st.RunName + + pb.RunPageUrl = st.RunPageUrl + + pb.RunType = st.RunType + + pb.Schedule = st.Schedule + + pb.SetupDuration = st.SetupDuration + + pb.StartTime = st.StartTime + + pb.State = st.State + + pb.Status = st.Status + + pb.Tasks = st.Tasks + + pb.Trigger = st.Trigger + + pb.TriggerInfo = st.TriggerInfo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runPb struct { + AttemptNumber int `json:"attempt_number,omitempty"` + + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + + ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + Description string `json:"description,omitempty"` + + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + + EndTime int64 `json:"end_time,omitempty"` + + ExecutionDuration int64 `json:"execution_duration,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + HasMore bool `json:"has_more,omitempty"` + + Iterations []RunTask `json:"iterations,omitempty"` + + JobClusters []JobCluster `json:"job_clusters,omitempty"` + + JobId int64 `json:"job_id,omitempty"` + + JobParameters []JobParameter `json:"job_parameters,omitempty"` + + JobRunId int64 `json:"job_run_id,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + NumberInJob int64 `json:"number_in_job,omitempty"` + + OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + + OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + + QueueDuration int64 `json:"queue_duration,omitempty"` + + RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + + RunDuration int64 `json:"run_duration,omitempty"` + + RunId int64 `json:"run_id,omitempty"` + + RunName string `json:"run_name,omitempty"` + + RunPageUrl string `json:"run_page_url,omitempty"` + + RunType RunType `json:"run_type,omitempty"` + + Schedule *CronSchedule `json:"schedule,omitempty"` + + SetupDuration int64 `json:"setup_duration,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + State *RunState `json:"state,omitempty"` + + Status *RunStatus `json:"status,omitempty"` + + Tasks []RunTask `json:"tasks,omitempty"` + + Trigger TriggerType `json:"trigger,omitempty"` + + TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runFromPb(pb *runPb) (*Run, error) { + if pb == nil { + return nil, nil + } + st := &Run{} + st.AttemptNumber = pb.AttemptNumber + st.CleanupDuration = pb.CleanupDuration + st.ClusterInstance = pb.ClusterInstance + st.ClusterSpec = pb.ClusterSpec + st.CreatorUserName = pb.CreatorUserName + st.Description = pb.Description + st.EffectivePerformanceTarget = pb.EffectivePerformanceTarget + st.EndTime = pb.EndTime + st.ExecutionDuration = pb.ExecutionDuration + st.GitSource = pb.GitSource + st.HasMore = pb.HasMore + st.Iterations = pb.Iterations + st.JobClusters = pb.JobClusters + st.JobId = pb.JobId + st.JobParameters = pb.JobParameters + st.JobRunId = pb.JobRunId + st.NextPageToken = pb.NextPageToken + st.NumberInJob = pb.NumberInJob + st.OriginalAttemptRunId = pb.OriginalAttemptRunId + st.OverridingParameters = pb.OverridingParameters + st.QueueDuration = pb.QueueDuration + st.RepairHistory = pb.RepairHistory + st.RunDuration = pb.RunDuration + st.RunId = pb.RunId + st.RunName = pb.RunName + st.RunPageUrl = pb.RunPageUrl + st.RunType = pb.RunType + st.Schedule = pb.Schedule + st.SetupDuration = pb.SetupDuration + st.StartTime = pb.StartTime + st.State = pb.State + st.Status = pb.Status + st.Tasks = pb.Tasks + st.Trigger = pb.Trigger + st.TriggerInfo = pb.TriggerInfo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runConditionTaskToPb(st *RunConditionTask) (*runConditionTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &runConditionTaskPb{} + pb.Left = st.Left + + pb.Op = st.Op + + pb.Outcome = st.Outcome + + pb.Right = st.Right + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runConditionTaskPb struct { + Left string `json:"left"` + + Op ConditionTaskOp `json:"op"` + + Outcome string `json:"outcome,omitempty"` + + Right string `json:"right"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runConditionTaskFromPb(pb *runConditionTaskPb) (*RunConditionTask, error) { + if pb == nil { + return nil, nil + } + st := &RunConditionTask{} + st.Left = pb.Left + st.Op = pb.Op + st.Outcome = pb.Outcome + st.Right = pb.Right + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runConditionTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runConditionTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runForEachTaskToPb(st *RunForEachTask) (*runForEachTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &runForEachTaskPb{} + pb.Concurrency = st.Concurrency + + pb.Inputs = st.Inputs + + pb.Stats = st.Stats + + pb.Task = st.Task + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runForEachTaskPb struct { + Concurrency int `json:"concurrency,omitempty"` + + Inputs string `json:"inputs"` + + Stats *ForEachStats `json:"stats,omitempty"` + + Task Task `json:"task"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runForEachTaskFromPb(pb *runForEachTaskPb) (*RunForEachTask, error) { + if pb == nil { + return nil, nil + } + st := &RunForEachTask{} + st.Concurrency = pb.Concurrency + st.Inputs = pb.Inputs + st.Stats = pb.Stats + st.Task = pb.Task + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runForEachTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runForEachTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runJobOutputToPb(st *RunJobOutput) (*runJobOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &runJobOutputPb{} + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runJobOutputPb struct { + RunId int64 `json:"run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runJobOutputFromPb(pb *runJobOutputPb) (*RunJobOutput, error) { + if pb == nil { + return nil, nil + } + st := &RunJobOutput{} + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runJobOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runJobOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runJobTaskToPb(st *RunJobTask) (*runJobTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &runJobTaskPb{} + pb.DbtCommands = st.DbtCommands + + pb.JarParams = st.JarParams + + pb.JobId = st.JobId + + pb.JobParameters = st.JobParameters + + pb.NotebookParams = st.NotebookParams + + pb.PipelineParams = st.PipelineParams + + pb.PythonNamedParams = st.PythonNamedParams + + pb.PythonParams = st.PythonParams + + pb.SparkSubmitParams = st.SparkSubmitParams + + pb.SqlParams = st.SqlParams + + return pb, nil +} + +type runJobTaskPb struct { + DbtCommands []string `json:"dbt_commands,omitempty"` + + JarParams []string `json:"jar_params,omitempty"` + + JobId int64 `json:"job_id"` + + JobParameters map[string]string `json:"job_parameters,omitempty"` + + NotebookParams map[string]string `json:"notebook_params,omitempty"` + + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + + PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + + PythonParams []string `json:"python_params,omitempty"` + + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + + SqlParams map[string]string `json:"sql_params,omitempty"` +} + +func runJobTaskFromPb(pb *runJobTaskPb) (*RunJobTask, error) { + if pb == nil { + return nil, nil + } + st := &RunJobTask{} + st.DbtCommands = pb.DbtCommands + st.JarParams = pb.JarParams + st.JobId = pb.JobId + st.JobParameters = pb.JobParameters + st.NotebookParams = pb.NotebookParams + st.PipelineParams = pb.PipelineParams + st.PythonNamedParams = pb.PythonNamedParams + st.PythonParams = pb.PythonParams + st.SparkSubmitParams = pb.SparkSubmitParams + st.SqlParams = pb.SqlParams + + return st, nil +} + +func runNowToPb(st *RunNow) (*runNowPb, error) { + if st == nil { + return nil, nil + } + pb := &runNowPb{} + pb.DbtCommands = st.DbtCommands + + pb.IdempotencyToken = st.IdempotencyToken + + pb.JarParams = st.JarParams + + pb.JobId = st.JobId + + pb.JobParameters = st.JobParameters + + pb.NotebookParams = st.NotebookParams + + pb.Only = st.Only + + pb.PerformanceTarget = st.PerformanceTarget + + pb.PipelineParams = st.PipelineParams + + pb.PythonNamedParams = st.PythonNamedParams + + pb.PythonParams = st.PythonParams + + pb.Queue = st.Queue + + pb.SparkSubmitParams = st.SparkSubmitParams + + pb.SqlParams = st.SqlParams + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runNowPb struct { + DbtCommands []string `json:"dbt_commands,omitempty"` + + IdempotencyToken string `json:"idempotency_token,omitempty"` + + JarParams []string `json:"jar_params,omitempty"` + + JobId int64 `json:"job_id"` + + JobParameters map[string]string `json:"job_parameters,omitempty"` + + NotebookParams map[string]string `json:"notebook_params,omitempty"` + + Only []string `json:"only,omitempty"` + + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + + PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + + PythonParams []string `json:"python_params,omitempty"` + + Queue *QueueSettings `json:"queue,omitempty"` + + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + + SqlParams map[string]string `json:"sql_params,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runNowFromPb(pb *runNowPb) (*RunNow, error) { + if pb == nil { + return nil, nil + } + st := &RunNow{} + st.DbtCommands = pb.DbtCommands + st.IdempotencyToken = pb.IdempotencyToken + st.JarParams = pb.JarParams + st.JobId = pb.JobId + st.JobParameters = pb.JobParameters + st.NotebookParams = pb.NotebookParams + st.Only = pb.Only + st.PerformanceTarget = pb.PerformanceTarget + st.PipelineParams = pb.PipelineParams + st.PythonNamedParams = pb.PythonNamedParams + st.PythonParams = pb.PythonParams + st.Queue = pb.Queue + st.SparkSubmitParams = pb.SparkSubmitParams + st.SqlParams = pb.SqlParams + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runNowPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runNowPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runNowResponseToPb(st *RunNowResponse) (*runNowResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &runNowResponsePb{} + pb.NumberInJob = st.NumberInJob + + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runNowResponsePb struct { + NumberInJob int64 `json:"number_in_job,omitempty"` + + RunId int64 `json:"run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runNowResponseFromPb(pb *runNowResponsePb) (*RunNowResponse, error) { + if pb == nil { + return nil, nil + } + st := &RunNowResponse{} + st.NumberInJob = pb.NumberInJob + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runNowResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runNowResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runOutputToPb(st *RunOutput) (*runOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &runOutputPb{} + pb.CleanRoomsNotebookOutput = st.CleanRoomsNotebookOutput + + pb.DashboardOutput = st.DashboardOutput + + pb.DbtOutput = st.DbtOutput + + pb.Error = st.Error + + pb.ErrorTrace = st.ErrorTrace + + pb.Info = st.Info + + pb.Logs = st.Logs + + pb.LogsTruncated = st.LogsTruncated + + pb.Metadata = st.Metadata + + pb.NotebookOutput = st.NotebookOutput + + pb.RunJobOutput = st.RunJobOutput + + pb.SqlOutput = st.SqlOutput + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runOutputPb struct { + CleanRoomsNotebookOutput *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput `json:"clean_rooms_notebook_output,omitempty"` + + DashboardOutput *DashboardTaskOutput `json:"dashboard_output,omitempty"` + + DbtOutput *DbtOutput `json:"dbt_output,omitempty"` + + Error string `json:"error,omitempty"` + + ErrorTrace string `json:"error_trace,omitempty"` + + Info string `json:"info,omitempty"` + + Logs string `json:"logs,omitempty"` + + LogsTruncated bool `json:"logs_truncated,omitempty"` + + Metadata *Run `json:"metadata,omitempty"` + + NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + + RunJobOutput *RunJobOutput `json:"run_job_output,omitempty"` + + SqlOutput *SqlOutput `json:"sql_output,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runOutputFromPb(pb *runOutputPb) (*RunOutput, error) { + if pb == nil { + return nil, nil + } + st := &RunOutput{} + st.CleanRoomsNotebookOutput = pb.CleanRoomsNotebookOutput + st.DashboardOutput = pb.DashboardOutput + st.DbtOutput = pb.DbtOutput + st.Error = pb.Error + st.ErrorTrace = pb.ErrorTrace + st.Info = pb.Info + st.Logs = pb.Logs + st.LogsTruncated = pb.LogsTruncated + st.Metadata = pb.Metadata + st.NotebookOutput = pb.NotebookOutput + st.RunJobOutput = pb.RunJobOutput + st.SqlOutput = pb.SqlOutput + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runParametersToPb(st *RunParameters) (*runParametersPb, error) { + if st == nil { + return nil, nil + } + pb := &runParametersPb{} + pb.DbtCommands = st.DbtCommands + + pb.JarParams = st.JarParams + + pb.NotebookParams = st.NotebookParams + + pb.PipelineParams = st.PipelineParams + + pb.PythonNamedParams = st.PythonNamedParams + + pb.PythonParams = st.PythonParams + + pb.SparkSubmitParams = st.SparkSubmitParams + + pb.SqlParams = st.SqlParams + + return pb, nil +} + +type runParametersPb struct { + DbtCommands []string `json:"dbt_commands,omitempty"` + + JarParams []string `json:"jar_params,omitempty"` + + NotebookParams map[string]string `json:"notebook_params,omitempty"` + + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + + PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + + PythonParams []string `json:"python_params,omitempty"` + + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + + SqlParams map[string]string `json:"sql_params,omitempty"` +} + +func runParametersFromPb(pb *runParametersPb) (*RunParameters, error) { + if pb == nil { + return nil, nil + } + st := &RunParameters{} + st.DbtCommands = pb.DbtCommands + st.JarParams = pb.JarParams + st.NotebookParams = pb.NotebookParams + st.PipelineParams = pb.PipelineParams + st.PythonNamedParams = pb.PythonNamedParams + st.PythonParams = pb.PythonParams + st.SparkSubmitParams = pb.SparkSubmitParams + st.SqlParams = pb.SqlParams + + return st, nil +} + +func runStateToPb(st *RunState) (*runStatePb, error) { + if st == nil { + return nil, nil + } + pb := &runStatePb{} + pb.LifeCycleState = st.LifeCycleState + + pb.QueueReason = st.QueueReason + + pb.ResultState = st.ResultState + + pb.StateMessage = st.StateMessage + + pb.UserCancelledOrTimedout = st.UserCancelledOrTimedout + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runStatePb struct { + LifeCycleState RunLifeCycleState `json:"life_cycle_state,omitempty"` + + QueueReason string `json:"queue_reason,omitempty"` + + ResultState RunResultState `json:"result_state,omitempty"` + + StateMessage string `json:"state_message,omitempty"` + + UserCancelledOrTimedout bool `json:"user_cancelled_or_timedout,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runStateFromPb(pb *runStatePb) (*RunState, error) { + if pb == nil { + return nil, nil + } + st := &RunState{} + st.LifeCycleState = pb.LifeCycleState + st.QueueReason = pb.QueueReason + st.ResultState = pb.ResultState + st.StateMessage = pb.StateMessage + st.UserCancelledOrTimedout = pb.UserCancelledOrTimedout + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runStatePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runStatePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runStatusToPb(st *RunStatus) (*runStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &runStatusPb{} + pb.QueueDetails = st.QueueDetails + + pb.State = st.State + + pb.TerminationDetails = st.TerminationDetails + + return pb, nil +} + +type runStatusPb struct { + QueueDetails *QueueDetails `json:"queue_details,omitempty"` + + State RunLifecycleStateV2State `json:"state,omitempty"` + + TerminationDetails *TerminationDetails `json:"termination_details,omitempty"` +} + +func runStatusFromPb(pb *runStatusPb) (*RunStatus, error) { + if pb == nil { + return nil, nil + } + st := &RunStatus{} + st.QueueDetails = pb.QueueDetails + st.State = pb.State + st.TerminationDetails = pb.TerminationDetails + + return st, nil +} + +func runTaskToPb(st *RunTask) (*runTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &runTaskPb{} + pb.AttemptNumber = st.AttemptNumber + + pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask + + pb.CleanupDuration = st.CleanupDuration + + pb.ClusterInstance = st.ClusterInstance + + pb.ConditionTask = st.ConditionTask + + pb.DashboardTask = st.DashboardTask + + pb.DbtTask = st.DbtTask + + pb.DependsOn = st.DependsOn + + pb.Description = st.Description + + pb.Disabled = st.Disabled + + pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget + + pb.EmailNotifications = st.EmailNotifications + + pb.EndTime = st.EndTime + + pb.EnvironmentKey = st.EnvironmentKey + + pb.ExecutionDuration = st.ExecutionDuration + + pb.ExistingClusterId = st.ExistingClusterId + + pb.ForEachTask = st.ForEachTask + + pb.GenAiComputeTask = st.GenAiComputeTask + + pb.GitSource = st.GitSource + + pb.JobClusterKey = st.JobClusterKey + + pb.Libraries = st.Libraries + + pb.NewCluster = st.NewCluster + + pb.NotebookTask = st.NotebookTask + + pb.NotificationSettings = st.NotificationSettings + + pb.PipelineTask = st.PipelineTask + + pb.PowerBiTask = st.PowerBiTask + + pb.PythonWheelTask = st.PythonWheelTask + + pb.QueueDuration = st.QueueDuration + + pb.ResolvedValues = st.ResolvedValues + + pb.RunDuration = st.RunDuration + + pb.RunId = st.RunId + + pb.RunIf = st.RunIf + + pb.RunJobTask = st.RunJobTask + + pb.RunPageUrl = st.RunPageUrl + + pb.SetupDuration = st.SetupDuration + + pb.SparkJarTask = st.SparkJarTask + + pb.SparkPythonTask = st.SparkPythonTask + + pb.SparkSubmitTask = st.SparkSubmitTask + + pb.SqlTask = st.SqlTask + + pb.StartTime = st.StartTime + + pb.State = st.State + + pb.Status = st.Status + + pb.TaskKey = st.TaskKey + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runTaskPb struct { + AttemptNumber int `json:"attempt_number,omitempty"` + + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + + ConditionTask *RunConditionTask `json:"condition_task,omitempty"` + + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + + DbtTask *DbtTask `json:"dbt_task,omitempty"` + + DependsOn []TaskDependency `json:"depends_on,omitempty"` + + Description string `json:"description,omitempty"` + + Disabled bool `json:"disabled,omitempty"` + + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + + EndTime int64 `json:"end_time,omitempty"` + + EnvironmentKey string `json:"environment_key,omitempty"` + + ExecutionDuration int64 `json:"execution_duration,omitempty"` + + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + + ForEachTask *RunForEachTask `json:"for_each_task,omitempty"` + + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + JobClusterKey string `json:"job_cluster_key,omitempty"` + + Libraries []compute.Library `json:"libraries,omitempty"` + + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + + QueueDuration int64 `json:"queue_duration,omitempty"` + + ResolvedValues *ResolvedValues `json:"resolved_values,omitempty"` + + RunDuration int64 `json:"run_duration,omitempty"` + + RunId int64 `json:"run_id,omitempty"` + + RunIf RunIf `json:"run_if,omitempty"` + + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + + RunPageUrl string `json:"run_page_url,omitempty"` + + SetupDuration int64 `json:"setup_duration,omitempty"` + + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + + SqlTask *SqlTask `json:"sql_task,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + State *RunState `json:"state,omitempty"` + + Status *RunStatus `json:"status,omitempty"` + + TaskKey string `json:"task_key"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runTaskFromPb(pb *runTaskPb) (*RunTask, error) { + if pb == nil { + return nil, nil + } + st := &RunTask{} + st.AttemptNumber = pb.AttemptNumber + st.CleanRoomsNotebookTask = pb.CleanRoomsNotebookTask + st.CleanupDuration = pb.CleanupDuration + st.ClusterInstance = pb.ClusterInstance + st.ConditionTask = pb.ConditionTask + st.DashboardTask = pb.DashboardTask + st.DbtTask = pb.DbtTask + st.DependsOn = pb.DependsOn + st.Description = pb.Description + st.Disabled = pb.Disabled + st.EffectivePerformanceTarget = pb.EffectivePerformanceTarget + st.EmailNotifications = pb.EmailNotifications + st.EndTime = pb.EndTime + st.EnvironmentKey = pb.EnvironmentKey + st.ExecutionDuration = pb.ExecutionDuration + st.ExistingClusterId = pb.ExistingClusterId + st.ForEachTask = pb.ForEachTask + st.GenAiComputeTask = pb.GenAiComputeTask + st.GitSource = pb.GitSource + st.JobClusterKey = pb.JobClusterKey + st.Libraries = pb.Libraries + st.NewCluster = pb.NewCluster + st.NotebookTask = pb.NotebookTask + st.NotificationSettings = pb.NotificationSettings + st.PipelineTask = pb.PipelineTask + st.PowerBiTask = pb.PowerBiTask + st.PythonWheelTask = pb.PythonWheelTask + st.QueueDuration = pb.QueueDuration + st.ResolvedValues = pb.ResolvedValues + st.RunDuration = pb.RunDuration + st.RunId = pb.RunId + st.RunIf = pb.RunIf + st.RunJobTask = pb.RunJobTask + st.RunPageUrl = pb.RunPageUrl + st.SetupDuration = pb.SetupDuration + st.SparkJarTask = pb.SparkJarTask + st.SparkPythonTask = pb.SparkPythonTask + st.SparkSubmitTask = pb.SparkSubmitTask + st.SqlTask = pb.SqlTask + st.StartTime = pb.StartTime + st.State = pb.State + st.Status = pb.Status + st.TaskKey = pb.TaskKey + st.TimeoutSeconds = pb.TimeoutSeconds + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparkJarTaskToPb(st *SparkJarTask) (*sparkJarTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &sparkJarTaskPb{} + pb.JarUri = st.JarUri + + pb.MainClassName = st.MainClassName + + pb.Parameters = st.Parameters + + pb.RunAsRepl = st.RunAsRepl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sparkJarTaskPb struct { + JarUri string `json:"jar_uri,omitempty"` + + MainClassName string `json:"main_class_name,omitempty"` + + Parameters []string `json:"parameters,omitempty"` + + RunAsRepl bool `json:"run_as_repl,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sparkJarTaskFromPb(pb *sparkJarTaskPb) (*SparkJarTask, error) { + if pb == nil { + return nil, nil + } + st := &SparkJarTask{} + st.JarUri = pb.JarUri + st.MainClassName = pb.MainClassName + st.Parameters = pb.Parameters + st.RunAsRepl = pb.RunAsRepl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sparkJarTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sparkJarTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparkPythonTaskToPb(st *SparkPythonTask) (*sparkPythonTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &sparkPythonTaskPb{} + pb.Parameters = st.Parameters + + pb.PythonFile = st.PythonFile + + pb.Source = st.Source + + return pb, nil +} + +type sparkPythonTaskPb struct { + Parameters []string `json:"parameters,omitempty"` + + PythonFile string `json:"python_file"` + + Source Source `json:"source,omitempty"` +} + +func sparkPythonTaskFromPb(pb *sparkPythonTaskPb) (*SparkPythonTask, error) { + if pb == nil { + return nil, nil + } + st := &SparkPythonTask{} + st.Parameters = pb.Parameters + st.PythonFile = pb.PythonFile + st.Source = pb.Source + + return st, nil +} + +func sparkSubmitTaskToPb(st *SparkSubmitTask) (*sparkSubmitTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &sparkSubmitTaskPb{} + pb.Parameters = st.Parameters + + return pb, nil +} + +type sparkSubmitTaskPb struct { + Parameters []string `json:"parameters,omitempty"` +} + +func sparkSubmitTaskFromPb(pb *sparkSubmitTaskPb) (*SparkSubmitTask, error) { + if pb == nil { + return nil, nil + } + st := &SparkSubmitTask{} + st.Parameters = pb.Parameters + + return st, nil +} + +func sqlAlertOutputToPb(st *SqlAlertOutput) (*sqlAlertOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlAlertOutputPb{} + pb.AlertState = st.AlertState + + pb.OutputLink = st.OutputLink + + pb.QueryText = st.QueryText + + pb.SqlStatements = st.SqlStatements + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlAlertOutputPb struct { + AlertState SqlAlertState `json:"alert_state,omitempty"` + + OutputLink string `json:"output_link,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlAlertOutputFromPb(pb *sqlAlertOutputPb) (*SqlAlertOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlAlertOutput{} + st.AlertState = pb.AlertState + st.OutputLink = pb.OutputLink + st.QueryText = pb.QueryText + st.SqlStatements = pb.SqlStatements + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlAlertOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlAlertOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlDashboardOutputToPb(st *SqlDashboardOutput) (*sqlDashboardOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlDashboardOutputPb{} + pb.WarehouseId = st.WarehouseId + + pb.Widgets = st.Widgets + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlDashboardOutputPb struct { + WarehouseId string `json:"warehouse_id,omitempty"` + + Widgets []SqlDashboardWidgetOutput `json:"widgets,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlDashboardOutputFromPb(pb *sqlDashboardOutputPb) (*SqlDashboardOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlDashboardOutput{} + st.WarehouseId = pb.WarehouseId + st.Widgets = pb.Widgets + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlDashboardOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlDashboardOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlDashboardWidgetOutputToPb(st *SqlDashboardWidgetOutput) (*sqlDashboardWidgetOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlDashboardWidgetOutputPb{} + pb.EndTime = st.EndTime + + pb.Error = st.Error + + pb.OutputLink = st.OutputLink + + pb.StartTime = st.StartTime + + pb.Status = st.Status + + pb.WidgetId = st.WidgetId + + pb.WidgetTitle = st.WidgetTitle + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlDashboardWidgetOutputPb struct { + EndTime int64 `json:"end_time,omitempty"` + + Error *SqlOutputError `json:"error,omitempty"` + + OutputLink string `json:"output_link,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + Status SqlDashboardWidgetOutputStatus `json:"status,omitempty"` + + WidgetId string `json:"widget_id,omitempty"` + + WidgetTitle string `json:"widget_title,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlDashboardWidgetOutputFromPb(pb *sqlDashboardWidgetOutputPb) (*SqlDashboardWidgetOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlDashboardWidgetOutput{} + st.EndTime = pb.EndTime + st.Error = pb.Error + st.OutputLink = pb.OutputLink + st.StartTime = pb.StartTime + st.Status = pb.Status + st.WidgetId = pb.WidgetId + st.WidgetTitle = pb.WidgetTitle + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlDashboardWidgetOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlDashboardWidgetOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlOutputToPb(st *SqlOutput) (*sqlOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlOutputPb{} + pb.AlertOutput = st.AlertOutput + + pb.DashboardOutput = st.DashboardOutput + + pb.QueryOutput = st.QueryOutput + + return pb, nil +} + +type sqlOutputPb struct { + AlertOutput *SqlAlertOutput `json:"alert_output,omitempty"` + + DashboardOutput *SqlDashboardOutput `json:"dashboard_output,omitempty"` + + QueryOutput *SqlQueryOutput `json:"query_output,omitempty"` +} + +func sqlOutputFromPb(pb *sqlOutputPb) (*SqlOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlOutput{} + st.AlertOutput = pb.AlertOutput + st.DashboardOutput = pb.DashboardOutput + st.QueryOutput = pb.QueryOutput + + return st, nil +} + +func sqlOutputErrorToPb(st *SqlOutputError) (*sqlOutputErrorPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlOutputErrorPb{} + pb.Message = st.Message + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlOutputErrorPb struct { + Message string `json:"message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlOutputErrorFromPb(pb *sqlOutputErrorPb) (*SqlOutputError, error) { + if pb == nil { + return nil, nil + } + st := &SqlOutputError{} + st.Message = pb.Message + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlOutputErrorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlOutputErrorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlQueryOutputToPb(st *SqlQueryOutput) (*sqlQueryOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlQueryOutputPb{} + pb.EndpointId = st.EndpointId + + pb.OutputLink = st.OutputLink + + pb.QueryText = st.QueryText + + pb.SqlStatements = st.SqlStatements + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlQueryOutputPb struct { + EndpointId string `json:"endpoint_id,omitempty"` + + OutputLink string `json:"output_link,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlQueryOutputFromPb(pb *sqlQueryOutputPb) (*SqlQueryOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlQueryOutput{} + st.EndpointId = pb.EndpointId + st.OutputLink = pb.OutputLink + st.QueryText = pb.QueryText + st.SqlStatements = pb.SqlStatements + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlQueryOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlQueryOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlStatementOutputToPb(st *SqlStatementOutput) (*sqlStatementOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlStatementOutputPb{} + pb.LookupKey = st.LookupKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlStatementOutputPb struct { + LookupKey string `json:"lookup_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlStatementOutputFromPb(pb *sqlStatementOutputPb) (*SqlStatementOutput, error) { + if pb == nil { + return nil, nil + } + st := &SqlStatementOutput{} + st.LookupKey = pb.LookupKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlStatementOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlStatementOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlTaskToPb(st *SqlTask) (*sqlTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskPb{} + pb.Alert = st.Alert + + pb.Dashboard = st.Dashboard + + pb.File = st.File + + pb.Parameters = st.Parameters + + pb.Query = st.Query + + pb.WarehouseId = st.WarehouseId + + return pb, nil +} + +type sqlTaskPb struct { + Alert *SqlTaskAlert `json:"alert,omitempty"` + + Dashboard *SqlTaskDashboard `json:"dashboard,omitempty"` + + File *SqlTaskFile `json:"file,omitempty"` + + Parameters map[string]string `json:"parameters,omitempty"` + + Query *SqlTaskQuery `json:"query,omitempty"` + + WarehouseId string `json:"warehouse_id"` +} + +func sqlTaskFromPb(pb *sqlTaskPb) (*SqlTask, error) { + if pb == nil { + return nil, nil + } + st := &SqlTask{} + st.Alert = pb.Alert + st.Dashboard = pb.Dashboard + st.File = pb.File + st.Parameters = pb.Parameters + st.Query = pb.Query + st.WarehouseId = pb.WarehouseId + + return st, nil +} + +func sqlTaskAlertToPb(st *SqlTaskAlert) (*sqlTaskAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskAlertPb{} + pb.AlertId = st.AlertId + + pb.PauseSubscriptions = st.PauseSubscriptions + + pb.Subscriptions = st.Subscriptions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlTaskAlertPb struct { + AlertId string `json:"alert_id"` + + PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + + Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlTaskAlertFromPb(pb *sqlTaskAlertPb) (*SqlTaskAlert, error) { + if pb == nil { + return nil, nil + } + st := &SqlTaskAlert{} + st.AlertId = pb.AlertId + st.PauseSubscriptions = pb.PauseSubscriptions + st.Subscriptions = pb.Subscriptions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlTaskAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlTaskAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlTaskDashboardToPb(st *SqlTaskDashboard) (*sqlTaskDashboardPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskDashboardPb{} + pb.CustomSubject = st.CustomSubject + + pb.DashboardId = st.DashboardId + + pb.PauseSubscriptions = st.PauseSubscriptions + + pb.Subscriptions = st.Subscriptions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlTaskDashboardPb struct { + CustomSubject string `json:"custom_subject,omitempty"` + + DashboardId string `json:"dashboard_id"` + + PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + + Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlTaskDashboardFromPb(pb *sqlTaskDashboardPb) (*SqlTaskDashboard, error) { + if pb == nil { + return nil, nil + } + st := &SqlTaskDashboard{} + st.CustomSubject = pb.CustomSubject + st.DashboardId = pb.DashboardId + st.PauseSubscriptions = pb.PauseSubscriptions + st.Subscriptions = pb.Subscriptions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlTaskDashboardPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlTaskDashboardPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sqlTaskFileToPb(st *SqlTaskFile) (*sqlTaskFilePb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskFilePb{} + pb.Path = st.Path + + pb.Source = st.Source + + return pb, nil +} + +type sqlTaskFilePb struct { + Path string `json:"path"` + + Source Source `json:"source,omitempty"` +} + +func sqlTaskFileFromPb(pb *sqlTaskFilePb) (*SqlTaskFile, error) { + if pb == nil { + return nil, nil + } + st := &SqlTaskFile{} + st.Path = pb.Path + st.Source = pb.Source + + return st, nil +} + +func sqlTaskQueryToPb(st *SqlTaskQuery) (*sqlTaskQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskQueryPb{} + pb.QueryId = st.QueryId + + return pb, nil +} + +type sqlTaskQueryPb struct { + QueryId string `json:"query_id"` +} + +func sqlTaskQueryFromPb(pb *sqlTaskQueryPb) (*SqlTaskQuery, error) { + if pb == nil { + return nil, nil + } + st := &SqlTaskQuery{} + st.QueryId = pb.QueryId + + return st, nil +} + +func sqlTaskSubscriptionToPb(st *SqlTaskSubscription) (*sqlTaskSubscriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &sqlTaskSubscriptionPb{} + pb.DestinationId = st.DestinationId + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sqlTaskSubscriptionPb struct { + DestinationId string `json:"destination_id,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sqlTaskSubscriptionFromPb(pb *sqlTaskSubscriptionPb) (*SqlTaskSubscription, error) { + if pb == nil { + return nil, nil + } + st := &SqlTaskSubscription{} + st.DestinationId = pb.DestinationId + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sqlTaskSubscriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sqlTaskSubscriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func submitRunToPb(st *SubmitRun) (*submitRunPb, error) { + if st == nil { + return nil, nil + } + pb := &submitRunPb{} + pb.AccessControlList = st.AccessControlList + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.EmailNotifications = st.EmailNotifications + + pb.Environments = st.Environments + + pb.GitSource = st.GitSource + + pb.Health = st.Health + + pb.IdempotencyToken = st.IdempotencyToken + + pb.NotificationSettings = st.NotificationSettings + + pb.Queue = st.Queue + + pb.RunAs = st.RunAs + + pb.RunName = st.RunName + + pb.Tasks = st.Tasks + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type submitRunPb struct { + AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + + Environments []JobEnvironment `json:"environments,omitempty"` + + GitSource *GitSource `json:"git_source,omitempty"` + + Health *JobsHealthRules `json:"health,omitempty"` + + IdempotencyToken string `json:"idempotency_token,omitempty"` + + NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + + Queue *QueueSettings `json:"queue,omitempty"` + + RunAs *JobRunAs `json:"run_as,omitempty"` + + RunName string `json:"run_name,omitempty"` + + Tasks []SubmitTask `json:"tasks,omitempty"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func submitRunFromPb(pb *submitRunPb) (*SubmitRun, error) { + if pb == nil { + return nil, nil + } + st := &SubmitRun{} + st.AccessControlList = pb.AccessControlList + st.BudgetPolicyId = pb.BudgetPolicyId + st.EmailNotifications = pb.EmailNotifications + st.Environments = pb.Environments + st.GitSource = pb.GitSource + st.Health = pb.Health + st.IdempotencyToken = pb.IdempotencyToken + st.NotificationSettings = pb.NotificationSettings + st.Queue = pb.Queue + st.RunAs = pb.RunAs + st.RunName = pb.RunName + st.Tasks = pb.Tasks + st.TimeoutSeconds = pb.TimeoutSeconds + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *submitRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st submitRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func submitRunResponseToPb(st *SubmitRunResponse) (*submitRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &submitRunResponsePb{} + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type submitRunResponsePb struct { + RunId int64 `json:"run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func submitRunResponseFromPb(pb *submitRunResponsePb) (*SubmitRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &SubmitRunResponse{} + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *submitRunResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st submitRunResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func submitTaskToPb(st *SubmitTask) (*submitTaskPb, error) { + if st == nil { + return nil, nil + } + pb := &submitTaskPb{} + pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask + + pb.ConditionTask = st.ConditionTask + + pb.DashboardTask = st.DashboardTask + + pb.DbtTask = st.DbtTask + + pb.DependsOn = st.DependsOn + + pb.Description = st.Description + + pb.EmailNotifications = st.EmailNotifications + + pb.EnvironmentKey = st.EnvironmentKey + + pb.ExistingClusterId = st.ExistingClusterId + + pb.ForEachTask = st.ForEachTask + + pb.GenAiComputeTask = st.GenAiComputeTask + + pb.Health = st.Health + + pb.Libraries = st.Libraries + + pb.NewCluster = st.NewCluster + + pb.NotebookTask = st.NotebookTask + + pb.NotificationSettings = st.NotificationSettings + + pb.PipelineTask = st.PipelineTask + + pb.PowerBiTask = st.PowerBiTask + + pb.PythonWheelTask = st.PythonWheelTask + + pb.RunIf = st.RunIf + + pb.RunJobTask = st.RunJobTask + + pb.SparkJarTask = st.SparkJarTask + + pb.SparkPythonTask = st.SparkPythonTask + + pb.SparkSubmitTask = st.SparkSubmitTask + + pb.SqlTask = st.SqlTask + + pb.TaskKey = st.TaskKey + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type submitTaskPb struct { + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + + ConditionTask *ConditionTask `json:"condition_task,omitempty"` + + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + + DbtTask *DbtTask `json:"dbt_task,omitempty"` + + DependsOn []TaskDependency `json:"depends_on,omitempty"` + + Description string `json:"description,omitempty"` + + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + + EnvironmentKey string `json:"environment_key,omitempty"` + + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + + ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + + Health *JobsHealthRules `json:"health,omitempty"` + + Libraries []compute.Library `json:"libraries,omitempty"` + + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + + RunIf RunIf `json:"run_if,omitempty"` + + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + + SqlTask *SqlTask `json:"sql_task,omitempty"` + + TaskKey string `json:"task_key"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func submitTaskFromPb(pb *submitTaskPb) (*SubmitTask, error) { + if pb == nil { + return nil, nil + } + st := &SubmitTask{} + st.CleanRoomsNotebookTask = pb.CleanRoomsNotebookTask + st.ConditionTask = pb.ConditionTask + st.DashboardTask = pb.DashboardTask + st.DbtTask = pb.DbtTask + st.DependsOn = pb.DependsOn + st.Description = pb.Description + st.EmailNotifications = pb.EmailNotifications + st.EnvironmentKey = pb.EnvironmentKey + st.ExistingClusterId = pb.ExistingClusterId + st.ForEachTask = pb.ForEachTask + st.GenAiComputeTask = pb.GenAiComputeTask + st.Health = pb.Health + st.Libraries = pb.Libraries + st.NewCluster = pb.NewCluster + st.NotebookTask = pb.NotebookTask + st.NotificationSettings = pb.NotificationSettings + st.PipelineTask = pb.PipelineTask + st.PowerBiTask = pb.PowerBiTask + st.PythonWheelTask = pb.PythonWheelTask + st.RunIf = pb.RunIf + st.RunJobTask = pb.RunJobTask + st.SparkJarTask = pb.SparkJarTask + st.SparkPythonTask = pb.SparkPythonTask + st.SparkSubmitTask = pb.SparkSubmitTask + st.SqlTask = pb.SqlTask + st.TaskKey = pb.TaskKey + st.TimeoutSeconds = pb.TimeoutSeconds + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *submitTaskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st submitTaskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriptionPb{} + pb.CustomSubject = st.CustomSubject + + pb.Paused = st.Paused + + pb.Subscribers = st.Subscribers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type subscriptionPb struct { + CustomSubject string `json:"custom_subject,omitempty"` + + Paused bool `json:"paused,omitempty"` + + Subscribers []SubscriptionSubscriber `json:"subscribers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func subscriptionFromPb(pb *subscriptionPb) (*Subscription, error) { + if pb == nil { + return nil, nil + } + st := &Subscription{} + st.CustomSubject = pb.CustomSubject + st.Paused = pb.Paused + st.Subscribers = pb.Subscribers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *subscriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st subscriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func subscriptionSubscriberToPb(st *SubscriptionSubscriber) (*subscriptionSubscriberPb, error) { + if st == nil { + return nil, nil + } + pb := &subscriptionSubscriberPb{} + pb.DestinationId = st.DestinationId + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type subscriptionSubscriberPb struct { + DestinationId string `json:"destination_id,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func subscriptionSubscriberFromPb(pb *subscriptionSubscriberPb) (*SubscriptionSubscriber, error) { + if pb == nil { + return nil, nil + } + st := &SubscriptionSubscriber{} + st.DestinationId = pb.DestinationId + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *subscriptionSubscriberPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st subscriptionSubscriberPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tableUpdateTriggerConfigurationToPb(st *TableUpdateTriggerConfiguration) (*tableUpdateTriggerConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &tableUpdateTriggerConfigurationPb{} + pb.Condition = st.Condition + + pb.MinTimeBetweenTriggersSeconds = st.MinTimeBetweenTriggersSeconds + + pb.TableNames = st.TableNames + + pb.WaitAfterLastChangeSeconds = st.WaitAfterLastChangeSeconds + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableUpdateTriggerConfigurationPb struct { + Condition Condition `json:"condition,omitempty"` + + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + + TableNames []string `json:"table_names,omitempty"` + + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableUpdateTriggerConfigurationFromPb(pb *tableUpdateTriggerConfigurationPb) (*TableUpdateTriggerConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &TableUpdateTriggerConfiguration{} + st.Condition = pb.Condition + st.MinTimeBetweenTriggersSeconds = pb.MinTimeBetweenTriggersSeconds + st.TableNames = pb.TableNames + st.WaitAfterLastChangeSeconds = pb.WaitAfterLastChangeSeconds + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableUpdateTriggerConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableUpdateTriggerConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func taskToPb(st *Task) (*taskPb, error) { + if st == nil { + return nil, nil + } + pb := &taskPb{} + pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask + + pb.ConditionTask = st.ConditionTask + + pb.DashboardTask = st.DashboardTask + + pb.DbtTask = st.DbtTask + + pb.DependsOn = st.DependsOn + + pb.Description = st.Description + + pb.DisableAutoOptimization = st.DisableAutoOptimization + + pb.EmailNotifications = st.EmailNotifications + + pb.EnvironmentKey = st.EnvironmentKey + + pb.ExistingClusterId = st.ExistingClusterId + + pb.ForEachTask = st.ForEachTask + + pb.GenAiComputeTask = st.GenAiComputeTask + + pb.Health = st.Health + + pb.JobClusterKey = st.JobClusterKey + + pb.Libraries = st.Libraries + + pb.MaxRetries = st.MaxRetries + + pb.MinRetryIntervalMillis = st.MinRetryIntervalMillis + + pb.NewCluster = st.NewCluster + + pb.NotebookTask = st.NotebookTask + + pb.NotificationSettings = st.NotificationSettings + + pb.PipelineTask = st.PipelineTask + + pb.PowerBiTask = st.PowerBiTask + + pb.PythonWheelTask = st.PythonWheelTask + + pb.RetryOnTimeout = st.RetryOnTimeout + + pb.RunIf = st.RunIf + + pb.RunJobTask = st.RunJobTask + + pb.SparkJarTask = st.SparkJarTask + + pb.SparkPythonTask = st.SparkPythonTask + + pb.SparkSubmitTask = st.SparkSubmitTask + + pb.SqlTask = st.SqlTask + + pb.TaskKey = st.TaskKey + + pb.TimeoutSeconds = st.TimeoutSeconds + + pb.WebhookNotifications = st.WebhookNotifications + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type taskPb struct { + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + + ConditionTask *ConditionTask `json:"condition_task,omitempty"` + + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + + DbtTask *DbtTask `json:"dbt_task,omitempty"` + + DependsOn []TaskDependency `json:"depends_on,omitempty"` + + Description string `json:"description,omitempty"` + + DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"` + + EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"` + + EnvironmentKey string `json:"environment_key,omitempty"` + + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + + ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + + Health *JobsHealthRules `json:"health,omitempty"` + + JobClusterKey string `json:"job_cluster_key,omitempty"` + + Libraries []compute.Library `json:"libraries,omitempty"` + + MaxRetries int `json:"max_retries,omitempty"` + + MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"` + + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + + RetryOnTimeout bool `json:"retry_on_timeout,omitempty"` + + RunIf RunIf `json:"run_if,omitempty"` + + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + + SqlTask *SqlTask `json:"sql_task,omitempty"` + + TaskKey string `json:"task_key"` + + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func taskFromPb(pb *taskPb) (*Task, error) { + if pb == nil { + return nil, nil + } + st := &Task{} + st.CleanRoomsNotebookTask = pb.CleanRoomsNotebookTask + st.ConditionTask = pb.ConditionTask + st.DashboardTask = pb.DashboardTask + st.DbtTask = pb.DbtTask + st.DependsOn = pb.DependsOn + st.Description = pb.Description + st.DisableAutoOptimization = pb.DisableAutoOptimization + st.EmailNotifications = pb.EmailNotifications + st.EnvironmentKey = pb.EnvironmentKey + st.ExistingClusterId = pb.ExistingClusterId + st.ForEachTask = pb.ForEachTask + st.GenAiComputeTask = pb.GenAiComputeTask + st.Health = pb.Health + st.JobClusterKey = pb.JobClusterKey + st.Libraries = pb.Libraries + st.MaxRetries = pb.MaxRetries + st.MinRetryIntervalMillis = pb.MinRetryIntervalMillis + st.NewCluster = pb.NewCluster + st.NotebookTask = pb.NotebookTask + st.NotificationSettings = pb.NotificationSettings + st.PipelineTask = pb.PipelineTask + st.PowerBiTask = pb.PowerBiTask + st.PythonWheelTask = pb.PythonWheelTask + st.RetryOnTimeout = pb.RetryOnTimeout + st.RunIf = pb.RunIf + st.RunJobTask = pb.RunJobTask + st.SparkJarTask = pb.SparkJarTask + st.SparkPythonTask = pb.SparkPythonTask + st.SparkSubmitTask = pb.SparkSubmitTask + st.SqlTask = pb.SqlTask + st.TaskKey = pb.TaskKey + st.TimeoutSeconds = pb.TimeoutSeconds + st.WebhookNotifications = pb.WebhookNotifications + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *taskPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st taskPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func taskDependencyToPb(st *TaskDependency) (*taskDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &taskDependencyPb{} + pb.Outcome = st.Outcome + + pb.TaskKey = st.TaskKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type taskDependencyPb struct { + Outcome string `json:"outcome,omitempty"` + + TaskKey string `json:"task_key"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func taskDependencyFromPb(pb *taskDependencyPb) (*TaskDependency, error) { + if pb == nil { + return nil, nil + } + st := &TaskDependency{} + st.Outcome = pb.Outcome + st.TaskKey = pb.TaskKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *taskDependencyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st taskDependencyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func taskEmailNotificationsToPb(st *TaskEmailNotifications) (*taskEmailNotificationsPb, error) { + if st == nil { + return nil, nil + } + pb := &taskEmailNotificationsPb{} + pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns + + pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded + + pb.OnFailure = st.OnFailure + + pb.OnStart = st.OnStart + + pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded + + pb.OnSuccess = st.OnSuccess + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type taskEmailNotificationsPb struct { + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + + OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` + + OnFailure []string `json:"on_failure,omitempty"` + + OnStart []string `json:"on_start,omitempty"` + + OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + + OnSuccess []string `json:"on_success,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func taskEmailNotificationsFromPb(pb *taskEmailNotificationsPb) (*TaskEmailNotifications, error) { + if pb == nil { + return nil, nil + } + st := &TaskEmailNotifications{} + st.NoAlertForSkippedRuns = pb.NoAlertForSkippedRuns + st.OnDurationWarningThresholdExceeded = pb.OnDurationWarningThresholdExceeded + st.OnFailure = pb.OnFailure + st.OnStart = pb.OnStart + st.OnStreamingBacklogExceeded = pb.OnStreamingBacklogExceeded + st.OnSuccess = pb.OnSuccess + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *taskEmailNotificationsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st taskEmailNotificationsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func taskNotificationSettingsToPb(st *TaskNotificationSettings) (*taskNotificationSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &taskNotificationSettingsPb{} + pb.AlertOnLastAttempt = st.AlertOnLastAttempt + + pb.NoAlertForCanceledRuns = st.NoAlertForCanceledRuns + + pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type taskNotificationSettingsPb struct { + AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` + + NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` + + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func taskNotificationSettingsFromPb(pb *taskNotificationSettingsPb) (*TaskNotificationSettings, error) { + if pb == nil { + return nil, nil + } + st := &TaskNotificationSettings{} + st.AlertOnLastAttempt = pb.AlertOnLastAttempt + st.NoAlertForCanceledRuns = pb.NoAlertForCanceledRuns + st.NoAlertForSkippedRuns = pb.NoAlertForSkippedRuns + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *taskNotificationSettingsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st taskNotificationSettingsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func terminationDetailsToPb(st *TerminationDetails) (*terminationDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &terminationDetailsPb{} + pb.Code = st.Code + + pb.Message = st.Message + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type terminationDetailsPb struct { + Code TerminationCodeCode `json:"code,omitempty"` + + Message string `json:"message,omitempty"` + + Type TerminationTypeType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func terminationDetailsFromPb(pb *terminationDetailsPb) (*TerminationDetails, error) { + if pb == nil { + return nil, nil + } + st := &TerminationDetails{} + st.Code = pb.Code + st.Message = pb.Message + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *terminationDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st terminationDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func triggerInfoToPb(st *TriggerInfo) (*triggerInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &triggerInfoPb{} + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type triggerInfoPb struct { + RunId int64 `json:"run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func triggerInfoFromPb(pb *triggerInfoPb) (*TriggerInfo, error) { + if pb == nil { + return nil, nil + } + st := &TriggerInfo{} + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *triggerInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st triggerInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func triggerSettingsToPb(st *TriggerSettings) (*triggerSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &triggerSettingsPb{} + pb.FileArrival = st.FileArrival + + pb.PauseStatus = st.PauseStatus + + pb.Periodic = st.Periodic + + pb.Table = st.Table + + pb.TableUpdate = st.TableUpdate + + return pb, nil +} + +type triggerSettingsPb struct { + FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` + + PauseStatus PauseStatus `json:"pause_status,omitempty"` + + Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` + + Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` + + TableUpdate *TableUpdateTriggerConfiguration `json:"table_update,omitempty"` +} + +func triggerSettingsFromPb(pb *triggerSettingsPb) (*TriggerSettings, error) { + if pb == nil { + return nil, nil + } + st := &TriggerSettings{} + st.FileArrival = pb.FileArrival + st.PauseStatus = pb.PauseStatus + st.Periodic = pb.Periodic + st.Table = pb.Table + st.TableUpdate = pb.TableUpdate + + return st, nil +} + +func updateJobToPb(st *UpdateJob) (*updateJobPb, error) { + if st == nil { + return nil, nil + } + pb := &updateJobPb{} + pb.FieldsToRemove = st.FieldsToRemove + + pb.JobId = st.JobId + + pb.NewSettings = st.NewSettings + + return pb, nil +} + +type updateJobPb struct { + FieldsToRemove []string `json:"fields_to_remove,omitempty"` + + JobId int64 `json:"job_id"` + + NewSettings *JobSettings `json:"new_settings,omitempty"` +} + +func updateJobFromPb(pb *updateJobPb) (*UpdateJob, error) { + if pb == nil { + return nil, nil + } + st := &UpdateJob{} + st.FieldsToRemove = pb.FieldsToRemove + st.JobId = pb.JobId + st.NewSettings = pb.NewSettings + + return st, nil +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func viewItemToPb(st *ViewItem) (*viewItemPb, error) { + if st == nil { + return nil, nil + } + pb := &viewItemPb{} + pb.Content = st.Content + + pb.Name = st.Name + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type viewItemPb struct { + Content string `json:"content,omitempty"` + + Name string `json:"name,omitempty"` + + Type ViewType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func viewItemFromPb(pb *viewItemPb) (*ViewItem, error) { + if pb == nil { + return nil, nil + } + st := &ViewItem{} + st.Content = pb.Content + st.Name = pb.Name + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *viewItemPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st viewItemPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func webhookToPb(st *Webhook) (*webhookPb, error) { + if st == nil { + return nil, nil + } + pb := &webhookPb{} + pb.Id = st.Id + + return pb, nil +} + +type webhookPb struct { + Id string `json:"id"` +} + +func webhookFromPb(pb *webhookPb) (*Webhook, error) { + if pb == nil { + return nil, nil + } + st := &Webhook{} + st.Id = pb.Id + + return st, nil +} + +func webhookNotificationsToPb(st *WebhookNotifications) (*webhookNotificationsPb, error) { + if st == nil { + return nil, nil + } + pb := &webhookNotificationsPb{} + pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded + + pb.OnFailure = st.OnFailure + + pb.OnStart = st.OnStart + + pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded + + pb.OnSuccess = st.OnSuccess + + return pb, nil +} + +type webhookNotificationsPb struct { + OnDurationWarningThresholdExceeded []Webhook `json:"on_duration_warning_threshold_exceeded,omitempty"` + + OnFailure []Webhook `json:"on_failure,omitempty"` + + OnStart []Webhook `json:"on_start,omitempty"` + + OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"` + + OnSuccess []Webhook `json:"on_success,omitempty"` +} + +func webhookNotificationsFromPb(pb *webhookNotificationsPb) (*WebhookNotifications, error) { + if pb == nil { + return nil, nil + } + st := &WebhookNotifications{} + st.OnDurationWarningThresholdExceeded = pb.OnDurationWarningThresholdExceeded + st.OnFailure = pb.OnFailure + st.OnStart = pb.OnStart + st.OnStreamingBacklogExceeded = pb.OnStreamingBacklogExceeded + st.OnSuccess = pb.OnSuccess + + return st, nil +} + +func widgetErrorDetailToPb(st *WidgetErrorDetail) (*widgetErrorDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &widgetErrorDetailPb{} + pb.Message = st.Message + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type widgetErrorDetailPb struct { + Message string `json:"message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func widgetErrorDetailFromPb(pb *widgetErrorDetailPb) (*WidgetErrorDetail, error) { + if pb == nil { + return nil, nil + } + st := &WidgetErrorDetail{} + st.Message = pb.Message + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *widgetErrorDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st widgetErrorDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/jobs/model.go b/service/jobs/model.go index c4b1f796e..82aaf76ab 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -3,13 +3,16 @@ package jobs import ( + "encoding/json" "fmt" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" ) type AuthenticationMethod string +type authenticationMethodPb string const AuthenticationMethodOauth AuthenticationMethod = `OAUTH` @@ -36,40 +39,79 @@ func (f *AuthenticationMethod) Type() string { return "AuthenticationMethod" } +func authenticationMethodToPb(st *AuthenticationMethod) (*authenticationMethodPb, error) { + if st == nil { + return nil, nil + } + pb := authenticationMethodPb(*st) + return &pb, nil +} + +func authenticationMethodFromPb(pb *authenticationMethodPb) (*AuthenticationMethod, error) { + if pb == nil { + return nil, nil + } + st := AuthenticationMethod(*pb) + return &st, nil +} + type BaseJob struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime int64 `json:"created_time,omitempty"` + // Wire name: 'created_time' + CreatedTime int64 // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string // Indicates if the job has more array properties (`tasks`, `job_clusters`) // that are not shown. They can be accessed via :method:jobs/get endpoint. // It is only relevant for API 2.2 :method:jobs/list requests with // `expand_tasks=true`. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // The canonical identifier for this job. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings *JobSettings `json:"settings,omitempty"` + // Wire name: 'settings' + Settings *JobSettings - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BaseJob) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BaseJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &baseJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := baseJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BaseJob) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BaseJob) MarshalJSON() ([]byte, error) { + pb, err := baseJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BaseRun struct { @@ -80,25 +122,31 @@ type BaseRun struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber int `json:"attempt_number,omitempty"` + // Wire name: 'attempt_number' + AttemptNumber int // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration int64 `json:"cleanup_duration,omitempty"` + // Wire name: 'cleanup_duration' + CleanupDuration int64 // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + // Wire name: 'cluster_instance' + ClusterInstance *ClusterInstance // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + // Wire name: 'cluster_spec' + ClusterSpec *ClusterSpec // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // Description of the run - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The actual performance target used by the serverless run during // execution. This can differ from the client-set performance target on the // request depending on whether the performance mode is supported by the job @@ -107,10 +155,12 @@ type BaseRun struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + // Wire name: 'effective_performance_target' + EffectivePerformanceTarget PerformanceTarget // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -118,7 +168,8 @@ type BaseRun struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration int64 `json:"execution_duration,omitempty"` + // Wire name: 'execution_duration' + ExecutionDuration int64 // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -129,60 +180,77 @@ type BaseRun struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // Indicates if the run has more array properties (`tasks`, `job_clusters`) // that are not shown. They can be accessed via :method:jobs/getrun // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests // with `expand_tasks=true`. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. If more than 100 // job clusters are available, you can paginate through them using // :method:jobs/getrun. - JobClusters []JobCluster `json:"job_clusters,omitempty"` + // Wire name: 'job_clusters' + JobClusters []JobCluster // The canonical identifier of the job that contains this run. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 // Job-level parameters used in the run - JobParameters []JobParameter `json:"job_parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters []JobParameter // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId int64 `json:"job_run_id,omitempty"` + // Wire name: 'job_run_id' + JobRunId int64 // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob int64 `json:"number_in_job,omitempty"` + // Wire name: 'number_in_job' + NumberInJob int64 // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + // Wire name: 'original_attempt_run_id' + OriginalAttemptRunId int64 // The parameters used for this run. - OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + // Wire name: 'overriding_parameters' + OverridingParameters *RunParameters // The time in milliseconds that the run has spent in the queue. - QueueDuration int64 `json:"queue_duration,omitempty"` + // Wire name: 'queue_duration' + QueueDuration int64 // The repair history of the run. - RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + // Wire name: 'repair_history' + RepairHistory []RepairHistoryItem // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration int64 `json:"run_duration,omitempty"` + // Wire name: 'run_duration' + RunDuration int64 // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string // The URL to the detail page of the run. - RunPageUrl string `json:"run_page_url,omitempty"` + // Wire name: 'run_page_url' + RunPageUrl string // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType RunType `json:"run_type,omitempty"` + // Wire name: 'run_type' + RunType RunType // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule *CronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *CronSchedule // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -190,22 +258,27 @@ type BaseRun struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration int64 `json:"setup_duration,omitempty"` + // Wire name: 'setup_duration' + SetupDuration int64 // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Deprecated. Please use the `status` field instead. - State *RunState `json:"state,omitempty"` + // Wire name: 'state' + State *RunState // The current status of the run - Status *RunStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *RunStatus // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. If // more than 100 tasks are available, you can paginate through them using // :method:jobs/getrun. Use the `next_page_token` field at the object root // to determine if more results are available. - Tasks []RunTask `json:"tasks,omitempty"` + // Wire name: 'tasks' + Tasks []RunTask // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -218,53 +291,168 @@ type BaseRun struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger TriggerType `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger TriggerType // Additional details about what triggered the run - TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + // Wire name: 'trigger_info' + TriggerInfo *TriggerInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BaseRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BaseRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &baseRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := baseRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BaseRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BaseRun) MarshalJSON() ([]byte, error) { + pb, err := baseRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelAllRuns struct { // Optional boolean parameter to cancel all queued runs. If no job_id is // provided, all queued runs in the workspace are canceled. - AllQueuedRuns bool `json:"all_queued_runs,omitempty"` + // Wire name: 'all_queued_runs' + AllQueuedRuns bool // The canonical identifier of the job to cancel all runs of. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CancelAllRuns) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CancelAllRuns) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelAllRunsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelAllRunsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CancelAllRuns) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CancelAllRuns) MarshalJSON() ([]byte, error) { + pb, err := cancelAllRunsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelAllRunsResponse struct { } +func (st *CancelAllRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelAllRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelAllRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelAllRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelAllRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type CancelRun struct { // This field is required. - RunId int64 `json:"run_id"` + // Wire name: 'run_id' + RunId int64 +} + +func (st *CancelRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelRun) MarshalJSON() ([]byte, error) { + pb, err := cancelRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelRunResponse struct { } +func (st *CancelRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelRunResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Copied from elastic-spark-common/api/messages/runs.proto. Using the original // definition to remove coupling with jobs API definition type CleanRoomTaskRunLifeCycleState string +type cleanRoomTaskRunLifeCycleStatePb string const CleanRoomTaskRunLifeCycleStateBlocked CleanRoomTaskRunLifeCycleState = `BLOCKED` @@ -307,9 +495,26 @@ func (f *CleanRoomTaskRunLifeCycleState) Type() string { return "CleanRoomTaskRunLifeCycleState" } +func cleanRoomTaskRunLifeCycleStateToPb(st *CleanRoomTaskRunLifeCycleState) (*cleanRoomTaskRunLifeCycleStatePb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomTaskRunLifeCycleStatePb(*st) + return &pb, nil +} + +func cleanRoomTaskRunLifeCycleStateFromPb(pb *cleanRoomTaskRunLifeCycleStatePb) (*CleanRoomTaskRunLifeCycleState, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomTaskRunLifeCycleState(*pb) + return &st, nil +} + // Copied from elastic-spark-common/api/messages/runs.proto. Using the original // definition to avoid cyclic dependency. type CleanRoomTaskRunResultState string +type cleanRoomTaskRunResultStatePb string const CleanRoomTaskRunResultStateCanceled CleanRoomTaskRunResultState = `CANCELED` @@ -358,48 +563,140 @@ func (f *CleanRoomTaskRunResultState) Type() string { return "CleanRoomTaskRunResultState" } +func cleanRoomTaskRunResultStateToPb(st *CleanRoomTaskRunResultState) (*cleanRoomTaskRunResultStatePb, error) { + if st == nil { + return nil, nil + } + pb := cleanRoomTaskRunResultStatePb(*st) + return &pb, nil +} + +func cleanRoomTaskRunResultStateFromPb(pb *cleanRoomTaskRunResultStatePb) (*CleanRoomTaskRunResultState, error) { + if pb == nil { + return nil, nil + } + st := CleanRoomTaskRunResultState(*pb) + return &st, nil +} + // Stores the run state of the clean rooms notebook task. type CleanRoomTaskRunState struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. Note: Additional states might be // introduced in future releases. - LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` + // Wire name: 'life_cycle_state' + LifeCycleState CleanRoomTaskRunLifeCycleState // A value indicating the run's result. This field is only available for // terminal lifecycle states. Note: Additional states might be introduced in // future releases. - ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` + // Wire name: 'result_state' + ResultState CleanRoomTaskRunResultState +} + +func (st *CleanRoomTaskRunState) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomTaskRunStatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomTaskRunStateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CleanRoomTaskRunState) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomTaskRunStateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomsNotebookTask struct { // The clean room that the notebook belongs to. - CleanRoomName string `json:"clean_room_name"` + // Wire name: 'clean_room_name' + CleanRoomName string // Checksum to validate the freshness of the notebook resource (i.e. the // notebook being run is the latest version). It can be fetched by calling // the :method:cleanroomassets/get API. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Base parameters to be used for the clean room notebook job. - NotebookBaseParameters map[string]string `json:"notebook_base_parameters,omitempty"` + // Wire name: 'notebook_base_parameters' + NotebookBaseParameters map[string]string // Name of the notebook being run. - NotebookName string `json:"notebook_name"` + // Wire name: 'notebook_name' + NotebookName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CleanRoomsNotebookTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CleanRoomsNotebookTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomsNotebookTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomsNotebookTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CleanRoomsNotebookTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CleanRoomsNotebookTask) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomsNotebookTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput struct { // The run state of the clean rooms notebook task. - CleanRoomJobRunState *CleanRoomTaskRunState `json:"clean_room_job_run_state,omitempty"` + // Wire name: 'clean_room_job_run_state' + CleanRoomJobRunState *CleanRoomTaskRunState // The notebook output for the clean room run - NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + // Wire name: 'notebook_output' + NotebookOutput *NotebookOutput // Information on how to access the output schema for the clean room run - OutputSchemaInfo *OutputSchemaInfo `json:"output_schema_info,omitempty"` + // Wire name: 'output_schema_info' + OutputSchemaInfo *OutputSchemaInfo +} + +func (st *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput) MarshalJSON() ([]byte, error) { + pb, err := cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterInstance struct { @@ -411,7 +708,8 @@ type ClusterInstance struct { // // The response won’t include this field if the identifier is not // available yet. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The canonical identifier for the Spark context used by a run. This field // is filled in once the run begins execution. This value can be used to // view the Spark UI by browsing to @@ -420,17 +718,35 @@ type ClusterInstance struct { // // The response won’t include this field if the identifier is not // available yet. - SparkContextId string `json:"spark_context_id,omitempty"` + // Wire name: 'spark_context_id' + SparkContextId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterInstance) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterInstance) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterInstancePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterInstanceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterInstance) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterInstance) MarshalJSON() ([]byte, error) { + pb, err := clusterInstanceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterSpec struct { @@ -438,48 +754,90 @@ type ClusterSpec struct { // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId string `json:"existing_cluster_id,omitempty"` + // Wire name: 'existing_cluster_id' + ExistingClusterId string // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey string `json:"job_cluster_key,omitempty"` + // Wire name: 'job_cluster_key' + JobClusterKey string // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries []compute.Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []compute.Library // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + // Wire name: 'new_cluster' + NewCluster *compute.ClusterSpec - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterSpec) MarshalJSON() ([]byte, error) { + pb, err := clusterSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ComputeConfig struct { // IDof the GPU pool to use. - GpuNodePoolId string `json:"gpu_node_pool_id,omitempty"` + // Wire name: 'gpu_node_pool_id' + GpuNodePoolId string // GPU type. - GpuType string `json:"gpu_type,omitempty"` + // Wire name: 'gpu_type' + GpuType string // Number of GPUs. - NumGpus int `json:"num_gpus"` + // Wire name: 'num_gpus' + NumGpus int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComputeConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComputeConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &computeConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := computeConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComputeConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComputeConfig) MarshalJSON() ([]byte, error) { + pb, err := computeConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Condition string +type conditionPb string const ConditionAllUpdated Condition = `ALL_UPDATED` @@ -506,10 +864,27 @@ func (f *Condition) Type() string { return "Condition" } +func conditionToPb(st *Condition) (*conditionPb, error) { + if st == nil { + return nil, nil + } + pb := conditionPb(*st) + return &pb, nil +} + +func conditionFromPb(pb *conditionPb) (*Condition, error) { + if pb == nil { + return nil, nil + } + st := Condition(*pb) + return &st, nil +} + type ConditionTask struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left string `json:"left"` + // Wire name: 'left' + Left string // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -520,10 +895,37 @@ type ConditionTask struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op ConditionTaskOp `json:"op"` + // Wire name: 'op' + Op ConditionTaskOp // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right string `json:"right"` + // Wire name: 'right' + Right string +} + +func (st *ConditionTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &conditionTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := conditionTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ConditionTask) MarshalJSON() ([]byte, error) { + pb, err := conditionTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their @@ -537,6 +939,7 @@ type ConditionTask struct { // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it will // be serialized to `“true”` or `“false”` for the comparison. type ConditionTaskOp string +type conditionTaskOpPb string const ConditionTaskOpEqualTo ConditionTaskOp = `EQUAL_TO` @@ -571,48 +974,99 @@ func (f *ConditionTaskOp) Type() string { return "ConditionTaskOp" } +func conditionTaskOpToPb(st *ConditionTaskOp) (*conditionTaskOpPb, error) { + if st == nil { + return nil, nil + } + pb := conditionTaskOpPb(*st) + return &pb, nil +} + +func conditionTaskOpFromPb(pb *conditionTaskOpPb) (*ConditionTaskOp, error) { + if pb == nil { + return nil, nil + } + st := ConditionTaskOp(*pb) + return &st, nil +} + type Continuous struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. - PauseStatus PauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus PauseStatus +} + +func (st *Continuous) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &continuousPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := continuousFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Continuous) MarshalJSON() ([]byte, error) { + pb, err := continuousToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateJob struct { // List of permissions to set on the job. - AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []JobAccessControlRequest // The id of the user specified budget policy to use for this job. If not // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous *Continuous `json:"continuous,omitempty"` + // Wire name: 'continuous' + Continuous *Continuous // Deployment information for jobs managed by external sources. - Deployment *JobDeployment `json:"deployment,omitempty"` + // Wire name: 'deployment' + Deployment *JobDeployment // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode JobEditMode `json:"edit_mode,omitempty"` + // Wire name: 'edit_mode' + EditMode JobEditMode // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *JobEmailNotifications // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments []JobEnvironment `json:"environments,omitempty"` + // Wire name: 'environments' + Environments []JobEnvironment // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format Format `json:"format,omitempty"` + // Wire name: 'format' + Format Format // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -623,13 +1077,16 @@ type CreateJob struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // An optional set of health rules that can be defined for this job. - Health *JobsHealthRules `json:"health,omitempty"` + // Wire name: 'health' + Health *JobsHealthRules // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters []JobCluster `json:"job_clusters,omitempty"` + // Wire name: 'job_clusters' + JobClusters []JobCluster // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -641,40 +1098,49 @@ type CreateJob struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + // Wire name: 'max_concurrent_runs' + MaxConcurrentRuns int // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *JobNotificationSettings // Job-level parameter definitions - Parameters []JobParameterDefinition `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []JobParameterDefinition // The performance mode on a serverless job. This field determines the level // of compute performance or cost-efficiency for the run. // // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + // Wire name: 'performance_target' + PerformanceTarget PerformanceTarget // The queue settings of the job. - Queue *QueueSettings `json:"queue,omitempty"` + // Wire name: 'queue' + Queue *QueueSettings // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs *JobRunAs `json:"run_as,omitempty"` + // Wire name: 'run_as' + RunAs *JobRunAs // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule *CronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *CronSchedule // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags map[string]string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags map[string]string // A list of task specifications to be executed by this job. It supports up // to 1000 elements in write endpoints (:method:jobs/create, // :method:jobs/reset, :method:jobs/update, :method:jobs/submit). Read @@ -682,121 +1148,273 @@ type CreateJob struct { // you can paginate through them using :method:jobs/get. Use the // `next_page_token` field at the object root to determine if more results // are available. - Tasks []Task `json:"tasks,omitempty"` + // Wire name: 'tasks' + Tasks []Task // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger *TriggerSettings `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger *TriggerSettings // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateJob) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateJob) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateJob) MarshalJSON() ([]byte, error) { + pb, err := createJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Job was created successfully type CreateResponse struct { // The canonical identifier for the newly created job. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateResponse) MarshalJSON() ([]byte, error) { + pb, err := createResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CronSchedule struct { // Indicate whether this schedule is paused or not. - PauseStatus PauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus PauseStatus // A Cron expression using Quartz syntax that describes the schedule for a // job. See [Cron Trigger] for details. This field is required. // // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression string `json:"quartz_cron_expression"` + // Wire name: 'quartz_cron_expression' + QuartzCronExpression string // A Java timezone ID. The schedule for a job is resolved with respect to // this timezone. See [Java TimeZone] for details. This field is required. // // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html - TimezoneId string `json:"timezone_id"` + // Wire name: 'timezone_id' + TimezoneId string +} + +func (st *CronSchedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cronSchedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cronScheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CronSchedule) MarshalJSON() ([]byte, error) { + pb, err := cronScheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardPageSnapshot struct { - PageDisplayName string `json:"page_display_name,omitempty"` - WidgetErrorDetails []WidgetErrorDetail `json:"widget_error_details,omitempty"` + // Wire name: 'page_display_name' + PageDisplayName string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'widget_error_details' + WidgetErrorDetails []WidgetErrorDetail + + ForceSendFields []string `tf:"-"` } -func (s *DashboardPageSnapshot) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DashboardPageSnapshot) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardPageSnapshotPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardPageSnapshotFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DashboardPageSnapshot) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DashboardPageSnapshot) MarshalJSON() ([]byte, error) { + pb, err := dashboardPageSnapshotToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Configures the Lakeview Dashboard job task type. type DashboardTask struct { // The identifier of the dashboard to refresh. - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // Optional: subscription configuration for sending the dashboard snapshot. - Subscription *Subscription `json:"subscription,omitempty"` + // Wire name: 'subscription' + Subscription *Subscription // Optional: The warehouse id to execute the dashboard with for the // schedule. If not specified, the default warehouse of the dashboard will // be used. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DashboardTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DashboardTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DashboardTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DashboardTask) MarshalJSON() ([]byte, error) { + pb, err := dashboardTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardTaskOutput struct { // Should only be populated for manual PDF download jobs. - PageSnapshots []DashboardPageSnapshot `json:"page_snapshots,omitempty"` + // Wire name: 'page_snapshots' + PageSnapshots []DashboardPageSnapshot +} + +func (st *DashboardTaskOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardTaskOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardTaskOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DashboardTaskOutput) MarshalJSON() ([]byte, error) { + pb, err := dashboardTaskOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DbtOutput struct { // An optional map of headers to send when retrieving the artifact from the // `artifacts_link`. - ArtifactsHeaders map[string]string `json:"artifacts_headers,omitempty"` + // Wire name: 'artifacts_headers' + ArtifactsHeaders map[string]string // A pre-signed URL to download the (compressed) dbt artifacts. This link is // valid for a limited time (30 minutes). This information is only available // after the run has finished. - ArtifactsLink string `json:"artifacts_link,omitempty"` + // Wire name: 'artifacts_link' + ArtifactsLink string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DbtOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DbtOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dbtOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dbtOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DbtOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DbtOutput) MarshalJSON() ([]byte, error) { + pb, err := dbtOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DbtTask struct { @@ -804,22 +1422,27 @@ type DbtTask struct { // 3-level namespace of Unity Catalog (catalog / schema / relation). The // catalog value can only be specified if a warehouse_id is specified. // Requires dbt-databricks >= 1.1.1. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // A list of dbt commands to execute. All commands must start with `dbt`. // This parameter must not be empty. A maximum of up to 10 commands can be // provided. - Commands []string `json:"commands"` + // Wire name: 'commands' + Commands []string // Optional (relative) path to the profiles directory. Can only be specified // if no warehouse_id is specified. If no warehouse_id is specified and this // folder is unset, the root directory is used. - ProfilesDirectory string `json:"profiles_directory,omitempty"` + // Wire name: 'profiles_directory' + ProfilesDirectory string // Path to the project directory. Optional for Git sourced tasks, in which // case if no value is provided, the root of the Git repository is used. - ProjectDirectory string `json:"project_directory,omitempty"` + // Wire name: 'project_directory' + ProjectDirectory string // Optional schema to write to. This parameter is only used when a // warehouse_id is also provided. If not provided, the `default` schema is // used. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // Optional location type of the project directory. When set to `WORKSPACE`, // the project will be retrieved from the local Databricks workspace. When // set to `GIT`, the project will be retrieved from a Git repository defined @@ -828,111 +1451,291 @@ type DbtTask struct { // // * `WORKSPACE`: Project is located in Databricks workspace. * `GIT`: // Project is located in cloud Git provider. - Source Source `json:"source,omitempty"` + // Wire name: 'source' + Source Source // ID of the SQL warehouse to connect to. If provided, we automatically // generate and provide the profile and connection details to dbt. It can be // overridden on a per-command basis by using the `--profiles-dir` command // line argument. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DbtTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DbtTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dbtTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dbtTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DbtTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DbtTask) MarshalJSON() ([]byte, error) { + pb, err := dbtTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteJob struct { // The canonical identifier of the job to delete. This field is required. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 +} + +func (st *DeleteJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteJob) MarshalJSON() ([]byte, error) { + pb, err := deleteJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteRun struct { // ID of the run to delete. - RunId int64 `json:"run_id"` + // Wire name: 'run_id' + RunId int64 +} + +func (st *DeleteRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRun) MarshalJSON() ([]byte, error) { + pb, err := deleteRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteRunResponse struct { } +func (st *DeleteRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRunResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Represents a change to the job cluster's settings that would be required for // the job clusters to become compliant with their policies. type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange struct { // The field where this change would be made, prepended with the job cluster // key. - Field string `json:"field,omitempty"` + // Wire name: 'field' + Field string // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue string `json:"new_value,omitempty"` + // Wire name: 'new_value' + NewValue string // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue string `json:"previous_value,omitempty"` + // Wire name: 'previous_value' + PreviousValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enforcePolicyComplianceForJobResponseJobClusterSettingsChangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) MarshalJSON() ([]byte, error) { + pb, err := enforcePolicyComplianceForJobResponseJobClusterSettingsChangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnforcePolicyComplianceRequest struct { // The ID of the job you want to enforce policy compliance on. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // If set, previews changes made to the job to comply with its policy, but // does not update the job. - ValidateOnly bool `json:"validate_only,omitempty"` + // Wire name: 'validate_only' + ValidateOnly bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnforcePolicyComplianceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnforcePolicyComplianceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enforcePolicyComplianceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enforcePolicyComplianceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnforcePolicyComplianceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnforcePolicyComplianceRequest) MarshalJSON() ([]byte, error) { + pb, err := enforcePolicyComplianceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnforcePolicyComplianceResponse struct { // Whether any changes have been made to the job cluster settings for the // job to become compliant with its policies. - HasChanges bool `json:"has_changes,omitempty"` + // Wire name: 'has_changes' + HasChanges bool // A list of job cluster changes that have been made to the job’s cluster // settings in order for all job clusters to become compliant with their // policies. - JobClusterChanges []EnforcePolicyComplianceForJobResponseJobClusterSettingsChange `json:"job_cluster_changes,omitempty"` + // Wire name: 'job_cluster_changes' + JobClusterChanges []EnforcePolicyComplianceForJobResponseJobClusterSettingsChange // Updated job settings after policy enforcement. Policy enforcement only // applies to job clusters that are created when running the job (which are // specified in new_cluster) and does not apply to existing all-purpose // clusters. Updated job settings are derived by applying policy default // values to the existing job clusters in order to satisfy policy // requirements. - Settings *JobSettings `json:"settings,omitempty"` + // Wire name: 'settings' + Settings *JobSettings - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnforcePolicyComplianceResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnforcePolicyComplianceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enforcePolicyComplianceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enforcePolicyComplianceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnforcePolicyComplianceResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnforcePolicyComplianceResponse) MarshalJSON() ([]byte, error) { + pb, err := enforcePolicyComplianceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run was exported successfully. @@ -942,118 +1745,282 @@ type ExportRunOutput struct { // script]. // // [Python script]: https://docs.databricks.com/en/_static/examples/extract.py - Views []ViewItem `json:"views,omitempty"` + // Wire name: 'views' + Views []ViewItem +} + +func (st *ExportRunOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportRunOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportRunOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExportRunOutput) MarshalJSON() ([]byte, error) { + pb, err := exportRunOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Export and retrieve a job run type ExportRunRequest struct { // The canonical identifier for the run. This field is required. - RunId int64 `json:"-" url:"run_id"` + // Wire name: 'run_id' + RunId int64 `tf:"-"` // Which views to export (CODE, DASHBOARDS, or ALL). Defaults to CODE. - ViewsToExport ViewsToExport `json:"-" url:"views_to_export,omitempty"` + // Wire name: 'views_to_export' + ViewsToExport ViewsToExport `tf:"-"` +} + +func (st *ExportRunRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportRunRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportRunRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExportRunRequest) MarshalJSON() ([]byte, error) { + pb, err := exportRunRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileArrivalTriggerConfiguration struct { // If set, the trigger starts a run only after the specified amount of time // passed since the last time the trigger fired. The minimum allowed value // is 60 seconds - MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + // Wire name: 'min_time_between_triggers_seconds' + MinTimeBetweenTriggersSeconds int // URL to be monitored for file arrivals. The path must point to the root or // a subpath of the external location. - Url string `json:"url"` + // Wire name: 'url' + Url string // If set, the trigger starts a run only after no file activity has occurred // for the specified amount of time. This makes it possible to wait for a // batch of incoming files to arrive before triggering a run. The minimum // allowed value is 60 seconds. - WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + // Wire name: 'wait_after_last_change_seconds' + WaitAfterLastChangeSeconds int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileArrivalTriggerConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileArrivalTriggerConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileArrivalTriggerConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileArrivalTriggerConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileArrivalTriggerConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileArrivalTriggerConfiguration) MarshalJSON() ([]byte, error) { + pb, err := fileArrivalTriggerConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForEachStats struct { // Sample of 3 most common error messages occurred during the iteration. - ErrorMessageStats []ForEachTaskErrorMessageStats `json:"error_message_stats,omitempty"` + // Wire name: 'error_message_stats' + ErrorMessageStats []ForEachTaskErrorMessageStats // Describes stats of the iteration. Only latest retries are considered. - TaskRunStats *ForEachTaskTaskRunStats `json:"task_run_stats,omitempty"` + // Wire name: 'task_run_stats' + TaskRunStats *ForEachTaskTaskRunStats +} + +func (st *ForEachStats) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &forEachStatsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := forEachStatsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ForEachStats) MarshalJSON() ([]byte, error) { + pb, err := forEachStatsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForEachTask struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency int `json:"concurrency,omitempty"` + // Wire name: 'concurrency' + Concurrency int // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs string `json:"inputs"` + // Wire name: 'inputs' + Inputs string // Configuration for the task that will be run for each element in the array - Task Task `json:"task"` + // Wire name: 'task' + Task Task - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ForEachTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ForEachTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &forEachTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := forEachTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ForEachTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ForEachTask) MarshalJSON() ([]byte, error) { + pb, err := forEachTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForEachTaskErrorMessageStats struct { // Describes the count of such error message encountered during the // iterations. - Count int `json:"count,omitempty"` + // Wire name: 'count' + Count int // Describes the error message occured during the iterations. - ErrorMessage string `json:"error_message,omitempty"` + // Wire name: 'error_message' + ErrorMessage string // Describes the termination reason for the error message. - TerminationCategory string `json:"termination_category,omitempty"` + // Wire name: 'termination_category' + TerminationCategory string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ForEachTaskErrorMessageStats) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ForEachTaskErrorMessageStats) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &forEachTaskErrorMessageStatsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := forEachTaskErrorMessageStatsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ForEachTaskErrorMessageStats) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ForEachTaskErrorMessageStats) MarshalJSON() ([]byte, error) { + pb, err := forEachTaskErrorMessageStatsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForEachTaskTaskRunStats struct { // Describes the iteration runs having an active lifecycle state or an // active run sub state. - ActiveIterations int `json:"active_iterations,omitempty"` + // Wire name: 'active_iterations' + ActiveIterations int // Describes the number of failed and succeeded iteration runs. - CompletedIterations int `json:"completed_iterations,omitempty"` + // Wire name: 'completed_iterations' + CompletedIterations int // Describes the number of failed iteration runs. - FailedIterations int `json:"failed_iterations,omitempty"` + // Wire name: 'failed_iterations' + FailedIterations int // Describes the number of iteration runs that have been scheduled. - ScheduledIterations int `json:"scheduled_iterations,omitempty"` + // Wire name: 'scheduled_iterations' + ScheduledIterations int // Describes the number of succeeded iteration runs. - SucceededIterations int `json:"succeeded_iterations,omitempty"` + // Wire name: 'succeeded_iterations' + SucceededIterations int // Describes the length of the list of items to iterate over. - TotalIterations int `json:"total_iterations,omitempty"` + // Wire name: 'total_iterations' + TotalIterations int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ForEachTaskTaskRunStats) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ForEachTaskTaskRunStats) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &forEachTaskTaskRunStatsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := forEachTaskTaskRunStatsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ForEachTaskTaskRunStats) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ForEachTaskTaskRunStats) MarshalJSON() ([]byte, error) { + pb, err := forEachTaskTaskRunStatsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Format string +type formatPb string const FormatMultiTask Format = `MULTI_TASK` @@ -1080,17 +2047,37 @@ func (f *Format) Type() string { return "Format" } +func formatToPb(st *Format) (*formatPb, error) { + if st == nil { + return nil, nil + } + pb := formatPb(*st) + return &pb, nil +} + +func formatFromPb(pb *formatPb) (*Format, error) { + if pb == nil { + return nil, nil + } + st := Format(*pb) + return &st, nil +} + type GenAiComputeTask struct { // Command launcher to run the actual script, e.g. bash, python etc. - Command string `json:"command,omitempty"` + // Wire name: 'command' + Command string - Compute *ComputeConfig `json:"compute,omitempty"` + // Wire name: 'compute' + Compute *ComputeConfig // Runtime image - DlRuntimeImage string `json:"dl_runtime_image"` + // Wire name: 'dl_runtime_image' + DlRuntimeImage string // Optional string containing the name of the MLflow experiment to log the // run to. If name is not found, backend will create the mlflow experiment // using the name. - MlflowExperimentName string `json:"mlflow_experiment_name,omitempty"` + // Wire name: 'mlflow_experiment_name' + MlflowExperimentName string // Optional location type of the training script. When set to `WORKSPACE`, // the script will be retrieved from the local Databricks workspace. When // set to `GIT`, the script will be retrieved from a Git repository defined @@ -1098,73 +2085,217 @@ type GenAiComputeTask struct { // `git_source` is defined and `WORKSPACE` otherwise. * `WORKSPACE`: Script // is located in Databricks workspace. * `GIT`: Script is located in cloud // Git provider. - Source Source `json:"source,omitempty"` + // Wire name: 'source' + Source Source // The training script file path to be executed. Cloud file URIs (such as // dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For // python files stored in the Databricks workspace, the path must be // absolute and begin with `/`. For files stored in a remote repository, the // path must be relative. This field is required. - TrainingScriptPath string `json:"training_script_path,omitempty"` + // Wire name: 'training_script_path' + TrainingScriptPath string // Optional string containing model parameters passed to the training script // in yaml format. If present, then the content in yaml_parameters_file_path // will be ignored. - YamlParameters string `json:"yaml_parameters,omitempty"` + // Wire name: 'yaml_parameters' + YamlParameters string // Optional path to a YAML file containing model parameters passed to the // training script. - YamlParametersFilePath string `json:"yaml_parameters_file_path,omitempty"` + // Wire name: 'yaml_parameters_file_path' + YamlParametersFilePath string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenAiComputeTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenAiComputeTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genAiComputeTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genAiComputeTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenAiComputeTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenAiComputeTask) MarshalJSON() ([]byte, error) { + pb, err := genAiComputeTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get job permission levels type GetJobPermissionLevelsRequest struct { // The job for which to get or manage permissions. - JobId string `json:"-" url:"-"` + // Wire name: 'job_id' + JobId string `tf:"-"` +} + +func (st *GetJobPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getJobPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getJobPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetJobPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getJobPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetJobPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []JobPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []JobPermissionsDescription +} + +func (st *GetJobPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getJobPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getJobPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetJobPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getJobPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get job permissions type GetJobPermissionsRequest struct { // The job for which to get or manage permissions. - JobId string `json:"-" url:"-"` + // Wire name: 'job_id' + JobId string `tf:"-"` +} + +func (st *GetJobPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getJobPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getJobPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetJobPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getJobPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a single job type GetJobRequest struct { // The canonical identifier of the job to retrieve information about. This // field is required. - JobId int64 `json:"-" url:"job_id"` + // Wire name: 'job_id' + JobId int64 `tf:"-"` // Use `next_page_token` returned from the previous GetJob response to // request the next page of the job's array properties. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetJobRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetJobRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getJobRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getJobRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetJobRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetJobRequest) MarshalJSON() ([]byte, error) { + pb, err := getJobRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get job policy compliance type GetPolicyComplianceRequest struct { // The ID of the job whose compliance status you are requesting. - JobId int64 `json:"-" url:"job_id"` + // Wire name: 'job_id' + JobId int64 `tf:"-"` +} + +func (st *GetPolicyComplianceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPolicyComplianceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPolicyComplianceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPolicyComplianceRequest) MarshalJSON() ([]byte, error) { + pb, err := getPolicyComplianceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPolicyComplianceResponse struct { @@ -1172,56 +2303,123 @@ type GetPolicyComplianceResponse struct { // of compliance if a policy they are using was updated after the job was // last edited and some of its job clusters no longer comply with their // updated policies. - IsCompliant bool `json:"is_compliant,omitempty"` + // Wire name: 'is_compliant' + IsCompliant bool // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations map[string]string `json:"violations,omitempty"` + // Wire name: 'violations' + Violations map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPolicyComplianceResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPolicyComplianceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPolicyComplianceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPolicyComplianceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPolicyComplianceResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPolicyComplianceResponse) MarshalJSON() ([]byte, error) { + pb, err := getPolicyComplianceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the output for a single run type GetRunOutputRequest struct { // The canonical identifier for the run. - RunId int64 `json:"-" url:"run_id"` + // Wire name: 'run_id' + RunId int64 `tf:"-"` +} + +func (st *GetRunOutputRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRunOutputRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRunOutputRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRunOutputRequest) MarshalJSON() ([]byte, error) { + pb, err := getRunOutputRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a single job run type GetRunRequest struct { // Whether to include the repair history in the response. - IncludeHistory bool `json:"-" url:"include_history,omitempty"` + // Wire name: 'include_history' + IncludeHistory bool `tf:"-"` // Whether to include resolved parameter values in the response. - IncludeResolvedValues bool `json:"-" url:"include_resolved_values,omitempty"` + // Wire name: 'include_resolved_values' + IncludeResolvedValues bool `tf:"-"` // Use `next_page_token` returned from the previous GetRun response to // request the next page of the run's array properties. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The canonical identifier of the run for which to retrieve the metadata. // This field is required. - RunId int64 `json:"-" url:"run_id"` + // Wire name: 'run_id' + RunId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRunRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRunRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRunRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRunRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRunRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRunRequest) MarshalJSON() ([]byte, error) { + pb, err := getRunRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GitProvider string +type gitProviderPb string const GitProviderAwsCodeCommit GitProvider = `awsCodeCommit` @@ -1260,23 +2458,57 @@ func (f *GitProvider) Type() string { return "GitProvider" } +func gitProviderToPb(st *GitProvider) (*gitProviderPb, error) { + if st == nil { + return nil, nil + } + pb := gitProviderPb(*st) + return &pb, nil +} + +func gitProviderFromPb(pb *gitProviderPb) (*GitProvider, error) { + if pb == nil { + return nil, nil + } + st := GitProvider(*pb) + return &st, nil +} + // Read-only state of the remote repository at the time the job was run. This // field is only included on job runs. type GitSnapshot struct { // Commit that was used to execute the run. If git_branch was specified, // this points to the HEAD of the branch at the time of the run; if git_tag // was specified, this points to the commit the tag points to. - UsedCommit string `json:"used_commit,omitempty"` + // Wire name: 'used_commit' + UsedCommit string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GitSnapshot) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GitSnapshot) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gitSnapshotPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gitSnapshotFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GitSnapshot) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GitSnapshot) MarshalJSON() ([]byte, error) { + pb, err := gitSnapshotToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An optional specification for a remote Git repository containing the source @@ -1292,60 +2524,90 @@ func (s GitSnapshot) MarshalJSON() ([]byte, error) { type GitSource struct { // Name of the branch to be checked out and used by this job. This field // cannot be specified in conjunction with git_tag or git_commit. - GitBranch string `json:"git_branch,omitempty"` + // Wire name: 'git_branch' + GitBranch string // Commit to be checked out and used by this job. This field cannot be // specified in conjunction with git_branch or git_tag. - GitCommit string `json:"git_commit,omitempty"` + // Wire name: 'git_commit' + GitCommit string // Unique identifier of the service used to host the Git repository. The // value is case insensitive. - GitProvider GitProvider `json:"git_provider"` + // Wire name: 'git_provider' + GitProvider GitProvider // Read-only state of the remote repository at the time the job was run. // This field is only included on job runs. - GitSnapshot *GitSnapshot `json:"git_snapshot,omitempty"` + // Wire name: 'git_snapshot' + GitSnapshot *GitSnapshot // Name of the tag to be checked out and used by this job. This field cannot // be specified in conjunction with git_branch or git_commit. - GitTag string `json:"git_tag,omitempty"` + // Wire name: 'git_tag' + GitTag string // URL of the repository to be cloned by this job. - GitUrl string `json:"git_url"` + // Wire name: 'git_url' + GitUrl string // The source of the job specification in the remote repository when the job // is source controlled. - JobSource *JobSource `json:"job_source,omitempty"` + // Wire name: 'job_source' + JobSource *JobSource - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GitSource) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GitSource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gitSourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gitSourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GitSource) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GitSource) MarshalJSON() ([]byte, error) { + pb, err := gitSourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Job was retrieved successfully. type Job struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime int64 `json:"created_time,omitempty"` + // Wire name: 'created_time' + CreatedTime int64 // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string // Indicates if the job has more array properties (`tasks`, `job_clusters`) // that are not shown. They can be accessed via :method:jobs/get endpoint. // It is only relevant for API 2.2 :method:jobs/list requests with // `expand_tasks=true`. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // The canonical identifier for this job. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 // A token that can be used to list the next page of array properties. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // The email of an active workspace user or the application ID of a service // principal that the job runs as. This value can be changed by setting the // `run_as` field when creating or updating a job. @@ -1353,119 +2615,248 @@ type Job struct { // By default, `run_as_user_name` is based on the current job settings and // is set to the creator of the job if job access control is disabled or to // the user with the `is_owner` permission if job access control is enabled. - RunAsUserName string `json:"run_as_user_name,omitempty"` + // Wire name: 'run_as_user_name' + RunAsUserName string // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings *JobSettings `json:"settings,omitempty"` + // Wire name: 'settings' + Settings *JobSettings - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Job) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Job) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Job) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Job) MarshalJSON() ([]byte, error) { + pb, err := jobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel JobPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := jobAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobAccessControlResponse struct { // All permissions. - AllPermissions []JobPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []JobPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := jobAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobCluster struct { // A unique name for the job cluster. This field is required and must be // unique within the job. `JobTaskSettings` may refer to this field to // determine which cluster to launch for the task execution. - JobClusterKey string `json:"job_cluster_key"` + // Wire name: 'job_cluster_key' + JobClusterKey string // If new_cluster, a description of a cluster that is created for each task. - NewCluster compute.ClusterSpec `json:"new_cluster"` + // Wire name: 'new_cluster' + NewCluster compute.ClusterSpec +} + +func (st *JobCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobCluster) MarshalJSON() ([]byte, error) { + pb, err := jobClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobCompliance struct { // Whether this job is in compliance with the latest version of its policy. - IsCompliant bool `json:"is_compliant,omitempty"` + // Wire name: 'is_compliant' + IsCompliant bool // Canonical unique identifier for a job. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations map[string]string `json:"violations,omitempty"` + // Wire name: 'violations' + Violations map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobCompliance) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobCompliance) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobCompliancePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobComplianceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobCompliance) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobCompliance) MarshalJSON() ([]byte, error) { + pb, err := jobComplianceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobDeployment struct { // The kind of deployment that manages the job. // // * `BUNDLE`: The job is managed by Databricks Asset Bundle. - Kind JobDeploymentKind `json:"kind"` + // Wire name: 'kind' + Kind JobDeploymentKind // Path of the file that contains deployment metadata. - MetadataFilePath string `json:"metadata_file_path,omitempty"` + // Wire name: 'metadata_file_path' + MetadataFilePath string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobDeployment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobDeployment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobDeploymentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobDeploymentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobDeployment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobDeployment) MarshalJSON() ([]byte, error) { + pb, err := jobDeploymentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // * `BUNDLE`: The job is managed by Databricks Asset Bundle. type JobDeploymentKind string +type jobDeploymentKindPb string // The job is managed by Databricks Asset Bundle. const JobDeploymentKindBundle JobDeploymentKind = `BUNDLE` @@ -1491,11 +2882,28 @@ func (f *JobDeploymentKind) Type() string { return "JobDeploymentKind" } +func jobDeploymentKindToPb(st *JobDeploymentKind) (*jobDeploymentKindPb, error) { + if st == nil { + return nil, nil + } + pb := jobDeploymentKindPb(*st) + return &pb, nil +} + +func jobDeploymentKindFromPb(pb *jobDeploymentKindPb) (*JobDeploymentKind, error) { + if pb == nil { + return nil, nil + } + st := JobDeploymentKind(*pb) + return &st, nil +} + // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. type JobEditMode string +type jobEditModePb string // The job is in an editable state and can be modified. const JobEditModeEditable JobEditMode = `EDITABLE` @@ -1524,26 +2932,46 @@ func (f *JobEditMode) Type() string { return "JobEditMode" } +func jobEditModeToPb(st *JobEditMode) (*jobEditModePb, error) { + if st == nil { + return nil, nil + } + pb := jobEditModePb(*st) + return &pb, nil +} + +func jobEditModeFromPb(pb *jobEditModePb) (*JobEditMode, error) { + if pb == nil { + return nil, nil + } + st := JobEditMode(*pb) + return &st, nil +} + type JobEmailNotifications struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + // Wire name: 'no_alert_for_skipped_runs' + NoAlertForSkippedRuns bool // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` + // Wire name: 'on_duration_warning_threshold_exceeded' + OnDurationWarningThresholdExceeded []string // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure []string `json:"on_failure,omitempty"` + // Wire name: 'on_failure' + OnFailure []string // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart []string `json:"on_start,omitempty"` + // Wire name: 'on_start' + OnStart []string // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -1551,101 +2979,235 @@ type JobEmailNotifications struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + // Wire name: 'on_streaming_backlog_exceeded' + OnStreamingBacklogExceeded []string // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess []string `json:"on_success,omitempty"` + // Wire name: 'on_success' + OnSuccess []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobEmailNotifications) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobEmailNotifications) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobEmailNotificationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobEmailNotificationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobEmailNotifications) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobEmailNotifications) MarshalJSON() ([]byte, error) { + pb, err := jobEmailNotificationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobEnvironment struct { // The key of an environment. It has to be unique within a job. - EnvironmentKey string `json:"environment_key"` + // Wire name: 'environment_key' + EnvironmentKey string // The environment entity used to preserve serverless environment side // panel, jobs' environment for non-notebook task, and DLT's environment for // classic and serverless pipelines. In this minimal environment spec, only // pip dependencies are supported. - Spec *compute.Environment `json:"spec,omitempty"` + // Wire name: 'spec' + Spec *compute.Environment +} + +func (st *JobEnvironment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobEnvironmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobEnvironmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobEnvironment) MarshalJSON() ([]byte, error) { + pb, err := jobEnvironmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobNotificationSettings struct { // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` + // Wire name: 'no_alert_for_canceled_runs' + NoAlertForCanceledRuns bool // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + // Wire name: 'no_alert_for_skipped_runs' + NoAlertForSkippedRuns bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobNotificationSettings) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobNotificationSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobNotificationSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobNotificationSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobNotificationSettings) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobNotificationSettings) MarshalJSON() ([]byte, error) { + pb, err := jobNotificationSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobParameter struct { // The optional default value of the parameter - Default string `json:"default,omitempty"` + // Wire name: 'default' + Default string // The name of the parameter - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The value used in the run - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobParameter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobParameter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobParameterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobParameterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobParameter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobParameter) MarshalJSON() ([]byte, error) { + pb, err := jobParameterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobParameterDefinition struct { // Default value of the parameter. - Default string `json:"default"` + // Wire name: 'default' + Default string // The name of the defined parameter. May only contain alphanumeric // characters, `_`, `-`, and `.` - Name string `json:"name"` + // Wire name: 'name' + Name string +} + +func (st *JobParameterDefinition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobParameterDefinitionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobParameterDefinitionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobParameterDefinition) MarshalJSON() ([]byte, error) { + pb, err := jobParameterDefinitionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel JobPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobPermission) MarshalJSON() ([]byte, error) { + pb, err := jobPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type JobPermissionLevel string +type jobPermissionLevelPb string const JobPermissionLevelCanManage JobPermissionLevel = `CAN_MANAGE` @@ -1676,44 +3238,129 @@ func (f *JobPermissionLevel) Type() string { return "JobPermissionLevel" } +func jobPermissionLevelToPb(st *JobPermissionLevel) (*jobPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := jobPermissionLevelPb(*st) + return &pb, nil +} + +func jobPermissionLevelFromPb(pb *jobPermissionLevelPb) (*JobPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := JobPermissionLevel(*pb) + return &st, nil +} + type JobPermissions struct { - AccessControlList []JobAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []JobAccessControlResponse - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_id' + ObjectId string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'object_type' + ObjectType string + + ForceSendFields []string `tf:"-"` } -func (s *JobPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobPermissions) MarshalJSON() ([]byte, error) { + pb, err := jobPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel JobPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := jobPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobPermissionsRequest struct { - AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []JobAccessControlRequest // The job for which to get or manage permissions. - JobId string `json:"-" url:"-"` + // Wire name: 'job_id' + JobId string `tf:"-"` +} + +func (st *JobPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := jobPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Write-only setting. Specifies the user or service principal that the job runs @@ -1724,20 +3371,39 @@ type JobPermissionsRequest struct { type JobRunAs struct { // Application ID of an active service principal. Setting this field // requires the `servicePrincipal/user` role. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // The email of an active workspace user. Non-admin users can only set this // field to their own email. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobRunAs) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobRunAs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobRunAsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobRunAsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobRunAs) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobRunAs) MarshalJSON() ([]byte, error) { + pb, err := jobRunAsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobSettings struct { @@ -1745,35 +3411,43 @@ type JobSettings struct { // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous *Continuous `json:"continuous,omitempty"` + // Wire name: 'continuous' + Continuous *Continuous // Deployment information for jobs managed by external sources. - Deployment *JobDeployment `json:"deployment,omitempty"` + // Wire name: 'deployment' + Deployment *JobDeployment // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode JobEditMode `json:"edit_mode,omitempty"` + // Wire name: 'edit_mode' + EditMode JobEditMode // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *JobEmailNotifications // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments []JobEnvironment `json:"environments,omitempty"` + // Wire name: 'environments' + Environments []JobEnvironment // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format Format `json:"format,omitempty"` + // Wire name: 'format' + Format Format // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -1784,13 +3458,16 @@ type JobSettings struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // An optional set of health rules that can be defined for this job. - Health *JobsHealthRules `json:"health,omitempty"` + // Wire name: 'health' + Health *JobsHealthRules // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters []JobCluster `json:"job_clusters,omitempty"` + // Wire name: 'job_clusters' + JobClusters []JobCluster // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -1802,40 +3479,49 @@ type JobSettings struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + // Wire name: 'max_concurrent_runs' + MaxConcurrentRuns int // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *JobNotificationSettings // Job-level parameter definitions - Parameters []JobParameterDefinition `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []JobParameterDefinition // The performance mode on a serverless job. This field determines the level // of compute performance or cost-efficiency for the run. // // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + // Wire name: 'performance_target' + PerformanceTarget PerformanceTarget // The queue settings of the job. - Queue *QueueSettings `json:"queue,omitempty"` + // Wire name: 'queue' + Queue *QueueSettings // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs *JobRunAs `json:"run_as,omitempty"` + // Wire name: 'run_as' + RunAs *JobRunAs // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule *CronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *CronSchedule // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags map[string]string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags map[string]string // A list of task specifications to be executed by this job. It supports up // to 1000 elements in write endpoints (:method:jobs/create, // :method:jobs/reset, :method:jobs/update, :method:jobs/submit). Read @@ -1843,27 +3529,48 @@ type JobSettings struct { // you can paginate through them using :method:jobs/get. Use the // `next_page_token` field at the object root to determine if more results // are available. - Tasks []Task `json:"tasks,omitempty"` + // Wire name: 'tasks' + Tasks []Task // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger *TriggerSettings `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger *TriggerSettings // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobSettings) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobSettings) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobSettings) MarshalJSON() ([]byte, error) { + pb, err := jobSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The source of the job specification in the remote repository when the job is @@ -1878,11 +3585,39 @@ type JobSource struct { // disconnected from the remote job specification and is allowed for live // edit. Import the remote job specification again from UI to make the job // fully synced. - DirtyState JobSourceDirtyState `json:"dirty_state,omitempty"` + // Wire name: 'dirty_state' + DirtyState JobSourceDirtyState // Name of the branch which the job is imported from. - ImportFromGitBranch string `json:"import_from_git_branch"` + // Wire name: 'import_from_git_branch' + ImportFromGitBranch string // Path of the job YAML file that contains the job specification. - JobConfigPath string `json:"job_config_path"` + // Wire name: 'job_config_path' + JobConfigPath string +} + +func (st *JobSource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobSourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobSourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobSource) MarshalJSON() ([]byte, error) { + pb, err := jobSourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Dirty state indicates the job is not fully synced with the job specification @@ -1894,6 +3629,7 @@ type JobSource struct { // from the remote job specification and is allowed for live edit. Import the // remote job specification again from UI to make the job fully synced. type JobSourceDirtyState string +type jobSourceDirtyStatePb string // The job is temporary disconnected from the remote job specification and is // allowed for live edit. Import the remote job specification again from UI to @@ -1925,6 +3661,22 @@ func (f *JobSourceDirtyState) Type() string { return "JobSourceDirtyState" } +func jobSourceDirtyStateToPb(st *JobSourceDirtyState) (*jobSourceDirtyStatePb, error) { + if st == nil { + return nil, nil + } + pb := jobSourceDirtyStatePb(*st) + return &pb, nil +} + +func jobSourceDirtyStateFromPb(pb *jobSourceDirtyStatePb) (*JobSourceDirtyState, error) { + if pb == nil { + return nil, nil + } + st := JobSourceDirtyState(*pb) + return &st, nil +} + // Specifies the health metric that is being evaluated for a particular health // rule. // @@ -1938,6 +3690,7 @@ func (f *JobSourceDirtyState) Type() string { // number of outstanding files across all streams. This metric is in Public // Preview. type JobsHealthMetric string +type jobsHealthMetricPb string // Expected total time for a run in seconds. const JobsHealthMetricRunDurationSeconds JobsHealthMetric = `RUN_DURATION_SECONDS` @@ -1979,9 +3732,26 @@ func (f *JobsHealthMetric) Type() string { return "JobsHealthMetric" } +func jobsHealthMetricToPb(st *JobsHealthMetric) (*jobsHealthMetricPb, error) { + if st == nil { + return nil, nil + } + pb := jobsHealthMetricPb(*st) + return &pb, nil +} + +func jobsHealthMetricFromPb(pb *jobsHealthMetricPb) (*JobsHealthMetric, error) { + if pb == nil { + return nil, nil + } + st := JobsHealthMetric(*pb) + return &st, nil +} + // Specifies the operator used to compare the health metric value with the // specified threshold. type JobsHealthOperator string +type jobsHealthOperatorPb string const JobsHealthOperatorGreaterThan JobsHealthOperator = `GREATER_THAN` @@ -2006,6 +3776,22 @@ func (f *JobsHealthOperator) Type() string { return "JobsHealthOperator" } +func jobsHealthOperatorToPb(st *JobsHealthOperator) (*jobsHealthOperatorPb, error) { + if st == nil { + return nil, nil + } + pb := jobsHealthOperatorPb(*st) + return &pb, nil +} + +func jobsHealthOperatorFromPb(pb *jobsHealthOperatorPb) (*JobsHealthOperator, error) { + if pb == nil { + return nil, nil + } + st := JobsHealthOperator(*pb) + return &st, nil +} + type JobsHealthRule struct { // Specifies the health metric that is being evaluated for a particular // health rule. @@ -2019,41 +3805,116 @@ type JobsHealthRule struct { // across all streams. This metric is in Public Preview. * // `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of // outstanding files across all streams. This metric is in Public Preview. - Metric JobsHealthMetric `json:"metric"` + // Wire name: 'metric' + Metric JobsHealthMetric // Specifies the operator used to compare the health metric value with the // specified threshold. - Op JobsHealthOperator `json:"op"` + // Wire name: 'op' + Op JobsHealthOperator // Specifies the threshold value that the health metric should obey to // satisfy the health rule. - Value int64 `json:"value"` + // Wire name: 'value' + Value int64 +} + +func (st *JobsHealthRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobsHealthRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobsHealthRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobsHealthRule) MarshalJSON() ([]byte, error) { + pb, err := jobsHealthRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An optional set of health rules that can be defined for this job. type JobsHealthRules struct { - Rules []JobsHealthRule `json:"rules,omitempty"` + + // Wire name: 'rules' + Rules []JobsHealthRule +} + +func (st *JobsHealthRules) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobsHealthRulesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobsHealthRulesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st JobsHealthRules) MarshalJSON() ([]byte, error) { + pb, err := jobsHealthRulesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListJobComplianceForPolicyResponse struct { // A list of jobs and their policy compliance statuses. - Jobs []JobCompliance `json:"jobs,omitempty"` + // Wire name: 'jobs' + Jobs []JobCompliance // This field represents the pagination token to retrieve the next page of // results. If this field is not in the response, it means no further // results for the request. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // This field represents the pagination token to retrieve the previous page // of results. If this field is not in the response, it means no further // results for the request. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListJobComplianceForPolicyResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListJobComplianceForPolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listJobComplianceForPolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listJobComplianceForPolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListJobComplianceForPolicyResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListJobComplianceForPolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := listJobComplianceForPolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List job policy compliance @@ -2061,22 +3922,42 @@ type ListJobComplianceRequest struct { // Use this field to specify the maximum number of results to be returned by // the server. The server may further constrain the maximum number of // results returned in a single page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A page token that can be used to navigate to the next page or previous // page as returned by `next_page_token` or `prev_page_token`. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Canonical unique identifier for the cluster policy. - PolicyId string `json:"-" url:"policy_id"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListJobComplianceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListJobComplianceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listJobComplianceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listJobComplianceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListJobComplianceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListJobComplianceRequest) MarshalJSON() ([]byte, error) { + pb, err := listJobComplianceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List jobs @@ -2084,54 +3965,97 @@ type ListJobsRequest struct { // Whether to include task and cluster details in the response. Note that // only the first 100 elements will be shown. Use :method:jobs/get to // paginate through all tasks and clusters. - ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + // Wire name: 'expand_tasks' + ExpandTasks bool `tf:"-"` // The number of jobs to return. This value must be greater than 0 and less // or equal to 100. The default value is 20. - Limit int `json:"-" url:"limit,omitempty"` + // Wire name: 'limit' + Limit int `tf:"-"` // A filter on the list based on the exact (case insensitive) job name. - Name string `json:"-" url:"name,omitempty"` + // Wire name: 'name' + Name string `tf:"-"` // The offset of the first job to return, relative to the most recently // created job. Deprecated since June 2023. Use `page_token` to iterate // through the pages instead. - Offset int `json:"-" url:"offset,omitempty"` + // Wire name: 'offset' + Offset int `tf:"-"` // Use `next_page_token` or `prev_page_token` returned from the previous // request to list the next or previous page of jobs respectively. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListJobsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListJobsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listJobsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listJobsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListJobsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListJobsRequest) MarshalJSON() ([]byte, error) { + pb, err := listJobsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List of jobs was retrieved successfully. type ListJobsResponse struct { // If true, additional jobs matching the provided filter are available for // listing. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // The list of jobs. Only included in the response if there are jobs to // list. - Jobs []BaseJob `json:"jobs,omitempty"` + // Wire name: 'jobs' + Jobs []BaseJob // A token that can be used to list the next page of jobs (if applicable). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // A token that can be used to list the previous page of jobs (if // applicable). - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListJobsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListJobsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listJobsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listJobsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListJobsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListJobsResponse) MarshalJSON() ([]byte, error) { + pb, err := listJobsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List job runs @@ -2140,75 +4064,123 @@ type ListRunsRequest struct { // otherwise, lists both active and completed runs. An active run is a run // in the `QUEUED`, `PENDING`, `RUNNING`, or `TERMINATING`. This field // cannot be `true` when completed_only is `true`. - ActiveOnly bool `json:"-" url:"active_only,omitempty"` + // Wire name: 'active_only' + ActiveOnly bool `tf:"-"` // If completed_only is `true`, only completed runs are included in the // results; otherwise, lists both active and completed runs. This field // cannot be `true` when active_only is `true`. - CompletedOnly bool `json:"-" url:"completed_only,omitempty"` + // Wire name: 'completed_only' + CompletedOnly bool `tf:"-"` // Whether to include task and cluster details in the response. Note that // only the first 100 elements will be shown. Use :method:jobs/getrun to // paginate through all tasks and clusters. - ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + // Wire name: 'expand_tasks' + ExpandTasks bool `tf:"-"` // The job for which to list runs. If omitted, the Jobs service lists runs // from all jobs. - JobId int64 `json:"-" url:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 `tf:"-"` // The number of runs to return. This value must be greater than 0 and less // than 25. The default value is 20. If a request specifies a limit of 0, // the service instead uses the maximum limit. - Limit int `json:"-" url:"limit,omitempty"` + // Wire name: 'limit' + Limit int `tf:"-"` // The offset of the first run to return, relative to the most recent run. // Deprecated since June 2023. Use `page_token` to iterate through the pages // instead. - Offset int `json:"-" url:"offset,omitempty"` + // Wire name: 'offset' + Offset int `tf:"-"` // Use `next_page_token` or `prev_page_token` returned from the previous // request to list the next or previous page of runs respectively. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The type of runs to return. For a description of run types, see // :method:jobs/getRun. - RunType RunType `json:"-" url:"run_type,omitempty"` + // Wire name: 'run_type' + RunType RunType `tf:"-"` // Show runs that started _at or after_ this value. The value must be a UTC // timestamp in milliseconds. Can be combined with _start_time_to_ to filter // by a time range. - StartTimeFrom int64 `json:"-" url:"start_time_from,omitempty"` + // Wire name: 'start_time_from' + StartTimeFrom int64 `tf:"-"` // Show runs that started _at or before_ this value. The value must be a UTC // timestamp in milliseconds. Can be combined with _start_time_from_ to // filter by a time range. - StartTimeTo int64 `json:"-" url:"start_time_to,omitempty"` + // Wire name: 'start_time_to' + StartTimeTo int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRunsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRunsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRunsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRunsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRunsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRunsRequest) MarshalJSON() ([]byte, error) { + pb, err := listRunsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List of runs was retrieved successfully. type ListRunsResponse struct { // If true, additional runs matching the provided filter are available for // listing. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // A token that can be used to list the next page of runs (if applicable). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // A token that can be used to list the previous page of runs (if // applicable). - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string // A list of runs, from most recently started to least. Only included in the // response if there are runs to list. - Runs []BaseRun `json:"runs,omitempty"` + // Wire name: 'runs' + Runs []BaseRun - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRunsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRunsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := listRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NotebookOutput struct { @@ -2218,19 +4190,38 @@ type NotebookOutput struct { // a larger result, your job can store the results in a cloud storage // service. This field is absent if `dbutils.notebook.exit()` was never // called. - Result string `json:"result,omitempty"` + // Wire name: 'result' + Result string // Whether or not the result was truncated. - Truncated bool `json:"truncated,omitempty"` + // Wire name: 'truncated' + Truncated bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NotebookOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NotebookOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ebookOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notebookOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NotebookOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NotebookOutput) MarshalJSON() ([]byte, error) { + pb, err := notebookOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NotebookTask struct { @@ -2251,12 +4242,14 @@ type NotebookTask struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets - BaseParameters map[string]string `json:"base_parameters,omitempty"` + // Wire name: 'base_parameters' + BaseParameters map[string]string // The path of the notebook to be run in the Databricks workspace or remote // repository. For notebooks stored in the Databricks workspace, the path // must be absolute and begin with a slash. For notebooks stored in a remote // repository, the path must be relative. This field is required. - NotebookPath string `json:"notebook_path"` + // Wire name: 'notebook_path' + NotebookPath string // Optional location type of the notebook. When set to `WORKSPACE`, the // notebook will be retrieved from the local Databricks workspace. When set // to `GIT`, the notebook will be retrieved from a Git repository defined in @@ -2264,48 +4257,89 @@ type NotebookTask struct { // `git_source` is defined and `WORKSPACE` otherwise. * `WORKSPACE`: // Notebook is located in Databricks workspace. * `GIT`: Notebook is located // in cloud Git provider. - Source Source `json:"source,omitempty"` + // Wire name: 'source' + Source Source // Optional `warehouse_id` to run the notebook on a SQL warehouse. Classic // SQL warehouses are NOT supported, please use serverless or pro SQL // warehouses. // // Note that SQL warehouses only support SQL cells; if the notebook contains // non-SQL cells, the run will fail. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NotebookTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NotebookTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ebookTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notebookTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NotebookTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NotebookTask) MarshalJSON() ([]byte, error) { + pb, err := notebookTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Stores the catalog name, schema name, and the output schema expiration time // for the clean room run. type OutputSchemaInfo struct { - CatalogName string `json:"catalog_name,omitempty"` + + // Wire name: 'catalog_name' + CatalogName string // The expiration time for the output schema as a Unix timestamp in // milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OutputSchemaInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OutputSchemaInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &outputSchemaInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := outputSchemaInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OutputSchemaInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OutputSchemaInfo) MarshalJSON() ([]byte, error) { + pb, err := outputSchemaInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PauseStatus string +type pauseStatusPb string const PauseStatusPaused PauseStatus = `PAUSED` @@ -2332,11 +4366,28 @@ func (f *PauseStatus) Type() string { return "PauseStatus" } +func pauseStatusToPb(st *PauseStatus) (*pauseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := pauseStatusPb(*st) + return &pb, nil +} + +func pauseStatusFromPb(pb *pauseStatusPb) (*PauseStatus, error) { + if pb == nil { + return nil, nil + } + st := PauseStatus(*pb) + return &st, nil +} + // PerformanceTarget defines how performant (lower latency) or cost efficient // the execution of run on serverless compute should be. The performance mode on // the job or pipeline should map to a performance setting that is passed to // Cluster Manager (see cluster-common PerformanceTarget). type PerformanceTarget string +type performanceTargetPb string const PerformanceTargetPerformanceOptimized PerformanceTarget = `PERFORMANCE_OPTIMIZED` @@ -2363,14 +4414,58 @@ func (f *PerformanceTarget) Type() string { return "PerformanceTarget" } -type PeriodicTriggerConfiguration struct { - // The interval at which the trigger should run. - Interval int `json:"interval"` - // The unit of time for the interval. - Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` +func performanceTargetToPb(st *PerformanceTarget) (*performanceTargetPb, error) { + if st == nil { + return nil, nil + } + pb := performanceTargetPb(*st) + return &pb, nil +} + +func performanceTargetFromPb(pb *performanceTargetPb) (*PerformanceTarget, error) { + if pb == nil { + return nil, nil + } + st := PerformanceTarget(*pb) + return &st, nil +} + +type PeriodicTriggerConfiguration struct { + // The interval at which the trigger should run. + // Wire name: 'interval' + Interval int + // The unit of time for the interval. + // Wire name: 'unit' + Unit PeriodicTriggerConfigurationTimeUnit +} + +func (st *PeriodicTriggerConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &periodicTriggerConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := periodicTriggerConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PeriodicTriggerConfiguration) MarshalJSON() ([]byte, error) { + pb, err := periodicTriggerConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PeriodicTriggerConfigurationTimeUnit string +type periodicTriggerConfigurationTimeUnitPb string const PeriodicTriggerConfigurationTimeUnitDays PeriodicTriggerConfigurationTimeUnit = `DAYS` @@ -2399,120 +4494,267 @@ func (f *PeriodicTriggerConfigurationTimeUnit) Type() string { return "PeriodicTriggerConfigurationTimeUnit" } +func periodicTriggerConfigurationTimeUnitToPb(st *PeriodicTriggerConfigurationTimeUnit) (*periodicTriggerConfigurationTimeUnitPb, error) { + if st == nil { + return nil, nil + } + pb := periodicTriggerConfigurationTimeUnitPb(*st) + return &pb, nil +} + +func periodicTriggerConfigurationTimeUnitFromPb(pb *periodicTriggerConfigurationTimeUnitPb) (*PeriodicTriggerConfigurationTimeUnit, error) { + if pb == nil { + return nil, nil + } + st := PeriodicTriggerConfigurationTimeUnit(*pb) + return &st, nil +} + type PipelineParams struct { // If true, triggers a full refresh on the delta live table. - FullRefresh bool `json:"full_refresh,omitempty"` + // Wire name: 'full_refresh' + FullRefresh bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineParams) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineParams) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineParamsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineParamsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineParams) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineParams) MarshalJSON() ([]byte, error) { + pb, err := pipelineParamsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineTask struct { // If true, triggers a full refresh on the delta live table. - FullRefresh bool `json:"full_refresh,omitempty"` + // Wire name: 'full_refresh' + FullRefresh bool // The full name of the pipeline task to execute. - PipelineId string `json:"pipeline_id"` + // Wire name: 'pipeline_id' + PipelineId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineTask) MarshalJSON() ([]byte, error) { + pb, err := pipelineTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PowerBiModel struct { // How the published Power BI model authenticates to Databricks - AuthenticationMethod AuthenticationMethod `json:"authentication_method,omitempty"` + // Wire name: 'authentication_method' + AuthenticationMethod AuthenticationMethod // The name of the Power BI model - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string // Whether to overwrite existing Power BI models - OverwriteExisting bool `json:"overwrite_existing,omitempty"` + // Wire name: 'overwrite_existing' + OverwriteExisting bool // The default storage mode of the Power BI model - StorageMode StorageMode `json:"storage_mode,omitempty"` + // Wire name: 'storage_mode' + StorageMode StorageMode // The name of the Power BI workspace of the model - WorkspaceName string `json:"workspace_name,omitempty"` + // Wire name: 'workspace_name' + WorkspaceName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PowerBiModel) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PowerBiModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &powerBiModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := powerBiModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PowerBiModel) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PowerBiModel) MarshalJSON() ([]byte, error) { + pb, err := powerBiModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PowerBiTable struct { // The catalog name in Databricks - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // The table name in Databricks - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The schema name in Databricks - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // The Power BI storage mode of the table - StorageMode StorageMode `json:"storage_mode,omitempty"` + // Wire name: 'storage_mode' + StorageMode StorageMode - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PowerBiTable) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PowerBiTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &powerBiTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := powerBiTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PowerBiTable) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PowerBiTable) MarshalJSON() ([]byte, error) { + pb, err := powerBiTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PowerBiTask struct { // The resource name of the UC connection to authenticate from Databricks to // Power BI - ConnectionResourceName string `json:"connection_resource_name,omitempty"` + // Wire name: 'connection_resource_name' + ConnectionResourceName string // The semantic model to update - PowerBiModel *PowerBiModel `json:"power_bi_model,omitempty"` + // Wire name: 'power_bi_model' + PowerBiModel *PowerBiModel // Whether the model should be refreshed after the update - RefreshAfterUpdate bool `json:"refresh_after_update,omitempty"` + // Wire name: 'refresh_after_update' + RefreshAfterUpdate bool // The tables to be exported to Power BI - Tables []PowerBiTable `json:"tables,omitempty"` + // Wire name: 'tables' + Tables []PowerBiTable // The SQL warehouse ID to use as the Power BI data source - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PowerBiTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PowerBiTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &powerBiTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := powerBiTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PowerBiTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PowerBiTask) MarshalJSON() ([]byte, error) { + pb, err := powerBiTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PythonWheelTask struct { // Named entry point to use, if it does not exist in the metadata of the // package it executes the function from the package directly using // `$packageName.$entryPoint()` - EntryPoint string `json:"entry_point"` + // Wire name: 'entry_point' + EntryPoint string // Command-line parameters passed to Python wheel task in the form of // `["--name=task", "--data=dbfs:/path/to/data.json"]`. Leave it empty if // `parameters` is not null. - NamedParameters map[string]string `json:"named_parameters,omitempty"` + // Wire name: 'named_parameters' + NamedParameters map[string]string // Name of the package to execute - PackageName string `json:"package_name"` + // Wire name: 'package_name' + PackageName string // Command-line parameters passed to Python wheel task. Leave it empty if // `named_parameters` is not null. - Parameters []string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []string +} + +func (st *PythonWheelTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pythonWheelTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pythonWheelTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PythonWheelTask) MarshalJSON() ([]byte, error) { + pb, err := pythonWheelTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueueDetails struct { @@ -2522,20 +4764,39 @@ type QueueDetails struct { // per-job limit of concurrent job runs. * // `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run was queued due to reaching // the workspace limit of active run job tasks. - Code QueueDetailsCodeCode `json:"code,omitempty"` + // Wire name: 'code' + Code QueueDetailsCodeCode // A descriptive message with the queuing details. This field is // unstructured, and its exact format is subject to change. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueueDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueueDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queueDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queueDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueueDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueueDetails) MarshalJSON() ([]byte, error) { + pb, err := queueDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The reason for queuing the run. * `ACTIVE_RUNS_LIMIT_REACHED`: The run was @@ -2544,6 +4805,7 @@ func (s QueueDetails) MarshalJSON() ([]byte, error) { // limit of concurrent job runs. * `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run // was queued due to reaching the workspace limit of active run job tasks. type QueueDetailsCodeCode string +type queueDetailsCodeCodePb string // The run was queued due to reaching the workspace limit of active task runs. const QueueDetailsCodeCodeActiveRunsLimitReached QueueDetailsCodeCode = `ACTIVE_RUNS_LIMIT_REACHED` @@ -2576,9 +4838,51 @@ func (f *QueueDetailsCodeCode) Type() string { return "QueueDetailsCodeCode" } +func queueDetailsCodeCodeToPb(st *QueueDetailsCodeCode) (*queueDetailsCodeCodePb, error) { + if st == nil { + return nil, nil + } + pb := queueDetailsCodeCodePb(*st) + return &pb, nil +} + +func queueDetailsCodeCodeFromPb(pb *queueDetailsCodeCodePb) (*QueueDetailsCodeCode, error) { + if pb == nil { + return nil, nil + } + st := QueueDetailsCodeCode(*pb) + return &st, nil +} + type QueueSettings struct { // If true, enable queueing for the job. This is a required field. - Enabled bool `json:"enabled"` + // Wire name: 'enabled' + Enabled bool +} + +func (st *QueueSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queueSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queueSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st QueueSettings) MarshalJSON() ([]byte, error) { + pb, err := queueSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepairHistoryItem struct { @@ -2590,39 +4894,65 @@ type RepairHistoryItem struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + // Wire name: 'effective_performance_target' + EffectivePerformanceTarget PerformanceTarget // The end time of the (repaired) run. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The ID of the repair. Only returned for the items that represent a repair // in `repair_history`. - Id int64 `json:"id,omitempty"` + // Wire name: 'id' + Id int64 // The start time of the (repaired) run. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Deprecated. Please use the `status` field instead. - State *RunState `json:"state,omitempty"` + // Wire name: 'state' + State *RunState // The current status of the run - Status *RunStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *RunStatus // The run IDs of the task runs that ran as part of this repair history // item. - TaskRunIds []int64 `json:"task_run_ids,omitempty"` + // Wire name: 'task_run_ids' + TaskRunIds []int64 // The repair history item type. Indicates whether a run is the original run // or a repair run. - Type RepairHistoryItemType `json:"type,omitempty"` + // Wire name: 'type' + Type RepairHistoryItemType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepairHistoryItem) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepairHistoryItem) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repairHistoryItemPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repairHistoryItemFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepairHistoryItem) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepairHistoryItem) MarshalJSON() ([]byte, error) { + pb, err := repairHistoryItemToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The repair history item type. Indicates whether a run is the original run or // a repair run. type RepairHistoryItemType string +type repairHistoryItemTypePb string const RepairHistoryItemTypeOriginal RepairHistoryItemType = `ORIGINAL` @@ -2649,11 +4979,28 @@ func (f *RepairHistoryItemType) Type() string { return "RepairHistoryItemType" } +func repairHistoryItemTypeToPb(st *RepairHistoryItemType) (*repairHistoryItemTypePb, error) { + if st == nil { + return nil, nil + } + pb := repairHistoryItemTypePb(*st) + return &pb, nil +} + +func repairHistoryItemTypeFromPb(pb *repairHistoryItemTypePb) (*RepairHistoryItemType, error) { + if pb == nil { + return nil, nil + } + st := RepairHistoryItemType(*pb) + return &st, nil +} + type RepairRun struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands []string `json:"dbt_commands,omitempty"` + // Wire name: 'dbt_commands' + DbtCommands []string // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -2666,14 +5013,17 @@ type RepairRun struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams []string `json:"jar_params,omitempty"` + // Wire name: 'jar_params' + JarParams []string // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters map[string]string `json:"job_parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters map[string]string // The ID of the latest repair. This parameter is not required when // repairing a run for the first time, but must be provided on subsequent // requests to repair the same run. - LatestRepairId int64 `json:"latest_repair_id,omitempty"` + // Wire name: 'latest_repair_id' + LatestRepairId int64 // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -2693,7 +5043,8 @@ type RepairRun struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams map[string]string `json:"notebook_params,omitempty"` + // Wire name: 'notebook_params' + NotebookParams map[string]string // The performance mode on a serverless job. The performance target // determines the level of compute performance or cost-efficiency for the // run. This field overrides the performance target defined on the job @@ -2702,11 +5053,14 @@ type RepairRun struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + // Wire name: 'performance_target' + PerformanceTarget PerformanceTarget // Controls whether the pipeline should perform a full refresh - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + // Wire name: 'pipeline_params' + PipelineParams *PipelineParams - PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + // Wire name: 'python_named_params' + PythonNamedParams map[string]string // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -2724,18 +5078,23 @@ type RepairRun struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams []string `json:"python_params,omitempty"` + // Wire name: 'python_params' + PythonParams []string // If true, repair all failed tasks. Only one of `rerun_tasks` or // `rerun_all_failed_tasks` can be used. - RerunAllFailedTasks bool `json:"rerun_all_failed_tasks,omitempty"` + // Wire name: 'rerun_all_failed_tasks' + RerunAllFailedTasks bool // If true, repair all tasks that depend on the tasks in `rerun_tasks`, even // if they were previously successful. Can be also used in combination with // `rerun_all_failed_tasks`. - RerunDependentTasks bool `json:"rerun_dependent_tasks,omitempty"` + // Wire name: 'rerun_dependent_tasks' + RerunDependentTasks bool // The task keys of the task runs to repair. - RerunTasks []string `json:"rerun_tasks,omitempty"` + // Wire name: 'rerun_tasks' + RerunTasks []string // The job run ID of the run to repair. The run must not be in progress. - RunId int64 `json:"run_id"` + // Wire name: 'run_id' + RunId int64 // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -2754,118 +5113,427 @@ type RepairRun struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + // Wire name: 'spark_submit_params' + SparkSubmitParams []string // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams map[string]string `json:"sql_params,omitempty"` + // Wire name: 'sql_params' + SqlParams map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepairRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepairRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repairRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repairRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepairRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepairRun) MarshalJSON() ([]byte, error) { + pb, err := repairRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run repair was initiated. type RepairRunResponse struct { // The ID of the repair. Must be provided in subsequent repairs using the // `latest_repair_id` field to ensure sequential repairs. - RepairId int64 `json:"repair_id,omitempty"` + // Wire name: 'repair_id' + RepairId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepairRunResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepairRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repairRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repairRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepairRunResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepairRunResponse) MarshalJSON() ([]byte, error) { + pb, err := repairRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResetJob struct { // The canonical identifier of the job to reset. This field is required. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // The new settings of the job. These settings completely replace the old // settings. // // Changes to the field `JobBaseSettings.timeout_seconds` are applied to // active runs. Changes to other fields are applied to future runs only. - NewSettings JobSettings `json:"new_settings"` + // Wire name: 'new_settings' + NewSettings JobSettings +} + +func (st *ResetJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resetJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resetJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResetJob) MarshalJSON() ([]byte, error) { + pb, err := resetJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResetResponse struct { } +func (st *ResetResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resetResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resetResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResetResponse) MarshalJSON() ([]byte, error) { + pb, err := resetResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ResolvedConditionTaskValues struct { - Left string `json:"left,omitempty"` - Right string `json:"right,omitempty"` + // Wire name: 'left' + Left string + + // Wire name: 'right' + Right string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResolvedConditionTaskValues) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResolvedConditionTaskValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedConditionTaskValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedConditionTaskValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResolvedConditionTaskValues) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResolvedConditionTaskValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedConditionTaskValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedDbtTaskValues struct { - Commands []string `json:"commands,omitempty"` + + // Wire name: 'commands' + Commands []string +} + +func (st *ResolvedDbtTaskValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedDbtTaskValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedDbtTaskValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedDbtTaskValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedDbtTaskValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedNotebookTaskValues struct { - BaseParameters map[string]string `json:"base_parameters,omitempty"` + + // Wire name: 'base_parameters' + BaseParameters map[string]string +} + +func (st *ResolvedNotebookTaskValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedNotebookTaskValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedNotebookTaskValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedNotebookTaskValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedNotebookTaskValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedParamPairValues struct { - Parameters map[string]string `json:"parameters,omitempty"` + + // Wire name: 'parameters' + Parameters map[string]string +} + +func (st *ResolvedParamPairValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedParamPairValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedParamPairValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedParamPairValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedParamPairValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedPythonWheelTaskValues struct { - NamedParameters map[string]string `json:"named_parameters,omitempty"` - Parameters []string `json:"parameters,omitempty"` + // Wire name: 'named_parameters' + NamedParameters map[string]string + + // Wire name: 'parameters' + Parameters []string +} + +func (st *ResolvedPythonWheelTaskValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedPythonWheelTaskValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedPythonWheelTaskValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedPythonWheelTaskValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedPythonWheelTaskValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedRunJobTaskValues struct { - JobParameters map[string]string `json:"job_parameters,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters map[string]string + + // Wire name: 'parameters' + Parameters map[string]string +} + +func (st *ResolvedRunJobTaskValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedRunJobTaskValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedRunJobTaskValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedRunJobTaskValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedRunJobTaskValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedStringParamsValues struct { - Parameters []string `json:"parameters,omitempty"` + + // Wire name: 'parameters' + Parameters []string +} + +func (st *ResolvedStringParamsValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedStringParamsValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedStringParamsValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ResolvedStringParamsValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedStringParamsValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ResolvedValues struct { - ConditionTask *ResolvedConditionTaskValues `json:"condition_task,omitempty"` - DbtTask *ResolvedDbtTaskValues `json:"dbt_task,omitempty"` + // Wire name: 'condition_task' + ConditionTask *ResolvedConditionTaskValues - NotebookTask *ResolvedNotebookTaskValues `json:"notebook_task,omitempty"` + // Wire name: 'dbt_task' + DbtTask *ResolvedDbtTaskValues - PythonWheelTask *ResolvedPythonWheelTaskValues `json:"python_wheel_task,omitempty"` + // Wire name: 'notebook_task' + NotebookTask *ResolvedNotebookTaskValues - RunJobTask *ResolvedRunJobTaskValues `json:"run_job_task,omitempty"` + // Wire name: 'python_wheel_task' + PythonWheelTask *ResolvedPythonWheelTaskValues - SimulationTask *ResolvedParamPairValues `json:"simulation_task,omitempty"` + // Wire name: 'run_job_task' + RunJobTask *ResolvedRunJobTaskValues - SparkJarTask *ResolvedStringParamsValues `json:"spark_jar_task,omitempty"` + // Wire name: 'simulation_task' + SimulationTask *ResolvedParamPairValues - SparkPythonTask *ResolvedStringParamsValues `json:"spark_python_task,omitempty"` + // Wire name: 'spark_jar_task' + SparkJarTask *ResolvedStringParamsValues - SparkSubmitTask *ResolvedStringParamsValues `json:"spark_submit_task,omitempty"` + // Wire name: 'spark_python_task' + SparkPythonTask *ResolvedStringParamsValues + + // Wire name: 'spark_submit_task' + SparkSubmitTask *ResolvedStringParamsValues + + // Wire name: 'sql_task' + SqlTask *ResolvedParamPairValues +} + +func (st *ResolvedValues) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resolvedValuesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resolvedValuesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - SqlTask *ResolvedParamPairValues `json:"sql_task,omitempty"` +func (st ResolvedValues) MarshalJSON() ([]byte, error) { + pb, err := resolvedValuesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run was retrieved successfully @@ -2877,25 +5545,31 @@ type Run struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber int `json:"attempt_number,omitempty"` + // Wire name: 'attempt_number' + AttemptNumber int // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration int64 `json:"cleanup_duration,omitempty"` + // Wire name: 'cleanup_duration' + CleanupDuration int64 // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + // Wire name: 'cluster_instance' + ClusterInstance *ClusterInstance // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + // Wire name: 'cluster_spec' + ClusterSpec *ClusterSpec // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // Description of the run - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The actual performance target used by the serverless run during // execution. This can differ from the client-set performance target on the // request depending on whether the performance mode is supported by the job @@ -2904,10 +5578,12 @@ type Run struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + // Wire name: 'effective_performance_target' + EffectivePerformanceTarget PerformanceTarget // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -2915,7 +5591,8 @@ type Run struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration int64 `json:"execution_duration,omitempty"` + // Wire name: 'execution_duration' + ExecutionDuration int64 // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -2926,65 +5603,84 @@ type Run struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // Indicates if the run has more array properties (`tasks`, `job_clusters`) // that are not shown. They can be accessed via :method:jobs/getrun // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests // with `expand_tasks=true`. - HasMore bool `json:"has_more,omitempty"` + // Wire name: 'has_more' + HasMore bool // Only populated by for-each iterations. The parent for-each task is // located in tasks array. - Iterations []RunTask `json:"iterations,omitempty"` + // Wire name: 'iterations' + Iterations []RunTask // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. If more than 100 // job clusters are available, you can paginate through them using // :method:jobs/getrun. - JobClusters []JobCluster `json:"job_clusters,omitempty"` + // Wire name: 'job_clusters' + JobClusters []JobCluster // The canonical identifier of the job that contains this run. - JobId int64 `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId int64 // Job-level parameters used in the run - JobParameters []JobParameter `json:"job_parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters []JobParameter // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId int64 `json:"job_run_id,omitempty"` + // Wire name: 'job_run_id' + JobRunId int64 // A token that can be used to list the next page of array properties. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob int64 `json:"number_in_job,omitempty"` + // Wire name: 'number_in_job' + NumberInJob int64 // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + // Wire name: 'original_attempt_run_id' + OriginalAttemptRunId int64 // The parameters used for this run. - OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + // Wire name: 'overriding_parameters' + OverridingParameters *RunParameters // The time in milliseconds that the run has spent in the queue. - QueueDuration int64 `json:"queue_duration,omitempty"` + // Wire name: 'queue_duration' + QueueDuration int64 // The repair history of the run. - RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + // Wire name: 'repair_history' + RepairHistory []RepairHistoryItem // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration int64 `json:"run_duration,omitempty"` + // Wire name: 'run_duration' + RunDuration int64 // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string // The URL to the detail page of the run. - RunPageUrl string `json:"run_page_url,omitempty"` + // Wire name: 'run_page_url' + RunPageUrl string // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType RunType `json:"run_type,omitempty"` + // Wire name: 'run_type' + RunType RunType // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule *CronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *CronSchedule // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -2992,22 +5688,27 @@ type Run struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration int64 `json:"setup_duration,omitempty"` + // Wire name: 'setup_duration' + SetupDuration int64 // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Deprecated. Please use the `status` field instead. - State *RunState `json:"state,omitempty"` + // Wire name: 'state' + State *RunState // The current status of the run - Status *RunStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *RunStatus // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. If // more than 100 tasks are available, you can paginate through them using // :method:jobs/getrun. Use the `next_page_token` field at the object root // to determine if more results are available. - Tasks []RunTask `json:"tasks,omitempty"` + // Wire name: 'tasks' + Tasks []RunTask // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -3020,25 +5721,45 @@ type Run struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger TriggerType `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger TriggerType // Additional details about what triggered the run - TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + // Wire name: 'trigger_info' + TriggerInfo *TriggerInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Run) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Run) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Run) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Run) MarshalJSON() ([]byte, error) { + pb, err := runToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RunConditionTask struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left string `json:"left"` + // Wire name: 'left' + Left string // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -3049,48 +5770,89 @@ type RunConditionTask struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op ConditionTaskOp `json:"op"` + // Wire name: 'op' + Op ConditionTaskOp // The condition expression evaluation result. Filled in if the task was // successfully completed. Can be `"true"` or `"false"` - Outcome string `json:"outcome,omitempty"` + // Wire name: 'outcome' + Outcome string // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right string `json:"right"` + // Wire name: 'right' + Right string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunConditionTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunConditionTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runConditionTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runConditionTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunConditionTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunConditionTask) MarshalJSON() ([]byte, error) { + pb, err := runConditionTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RunForEachTask struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency int `json:"concurrency,omitempty"` + // Wire name: 'concurrency' + Concurrency int // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs string `json:"inputs"` + // Wire name: 'inputs' + Inputs string // Read only field. Populated for GetRun and ListRuns RPC calls and stores // the execution stats of an For each task - Stats *ForEachStats `json:"stats,omitempty"` + // Wire name: 'stats' + Stats *ForEachStats // Configuration for the task that will be run for each element in the array - Task Task `json:"task"` + // Wire name: 'task' + Task Task - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunForEachTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunForEachTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runForEachTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runForEachTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunForEachTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunForEachTask) MarshalJSON() ([]byte, error) { + pb, err := runForEachTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An optional value indicating the condition that determines whether the task @@ -3104,6 +5866,7 @@ func (s RunForEachTask) MarshalJSON() ([]byte, error) { // `AT_LEAST_ONE_FAILED`: At least one dependency failed * `ALL_FAILED`: ALl // dependencies have failed type RunIf string +type runIfPb string // All dependencies have been completed const RunIfAllDone RunIf = `ALL_DONE` @@ -3144,26 +5907,61 @@ func (f *RunIf) Type() string { return "RunIf" } +func runIfToPb(st *RunIf) (*runIfPb, error) { + if st == nil { + return nil, nil + } + pb := runIfPb(*st) + return &pb, nil +} + +func runIfFromPb(pb *runIfPb) (*RunIf, error) { + if pb == nil { + return nil, nil + } + st := RunIf(*pb) + return &st, nil +} + type RunJobOutput struct { // The run id of the triggered job run - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunJobOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunJobOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runJobOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runJobOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunJobOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunJobOutput) MarshalJSON() ([]byte, error) { + pb, err := runJobOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RunJobTask struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands []string `json:"dbt_commands,omitempty"` + // Wire name: 'dbt_commands' + DbtCommands []string // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -3176,11 +5974,14 @@ type RunJobTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams []string `json:"jar_params,omitempty"` + // Wire name: 'jar_params' + JarParams []string // ID of the job to trigger. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // Job-level parameters used to trigger the job. - JobParameters map[string]string `json:"job_parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters map[string]string // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -3200,11 +6001,14 @@ type RunJobTask struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams map[string]string `json:"notebook_params,omitempty"` + // Wire name: 'notebook_params' + NotebookParams map[string]string // Controls whether the pipeline should perform a full refresh - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + // Wire name: 'pipeline_params' + PipelineParams *PipelineParams - PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + // Wire name: 'python_named_params' + PythonNamedParams map[string]string // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -3222,7 +6026,8 @@ type RunJobTask struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams []string `json:"python_params,omitempty"` + // Wire name: 'python_params' + PythonParams []string // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -3241,11 +6046,38 @@ type RunJobTask struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + // Wire name: 'spark_submit_params' + SparkSubmitParams []string // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams map[string]string `json:"sql_params,omitempty"` + // Wire name: 'sql_params' + SqlParams map[string]string +} + +func (st *RunJobTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runJobTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runJobTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunJobTask) MarshalJSON() ([]byte, error) { + pb, err := runJobTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A value indicating the run's lifecycle state. The possible values are: * @@ -3263,6 +6095,7 @@ type RunJobTask struct { // terminal. * `BLOCKED`: The run is blocked on an upstream dependency. * // `WAITING_FOR_RETRY`: The run is waiting for a retry. type RunLifeCycleState string +type runLifeCycleStatePb string // The run is blocked on an upstream dependency. const RunLifeCycleStateBlocked RunLifeCycleState = `BLOCKED` @@ -3319,8 +6152,25 @@ func (f *RunLifeCycleState) Type() string { return "RunLifeCycleState" } +func runLifeCycleStateToPb(st *RunLifeCycleState) (*runLifeCycleStatePb, error) { + if st == nil { + return nil, nil + } + pb := runLifeCycleStatePb(*st) + return &pb, nil +} + +func runLifeCycleStateFromPb(pb *runLifeCycleStatePb) (*RunLifeCycleState, error) { + if pb == nil { + return nil, nil + } + st := RunLifeCycleState(*pb) + return &st, nil +} + // The current state of the run. type RunLifecycleStateV2State string +type runLifecycleStateV2StatePb string const RunLifecycleStateV2StateBlocked RunLifecycleStateV2State = `BLOCKED` @@ -3357,11 +6207,28 @@ func (f *RunLifecycleStateV2State) Type() string { return "RunLifecycleStateV2State" } +func runLifecycleStateV2StateToPb(st *RunLifecycleStateV2State) (*runLifecycleStateV2StatePb, error) { + if st == nil { + return nil, nil + } + pb := runLifecycleStateV2StatePb(*st) + return &pb, nil +} + +func runLifecycleStateV2StateFromPb(pb *runLifecycleStateV2StatePb) (*RunLifecycleStateV2State, error) { + if pb == nil { + return nil, nil + } + st := RunLifecycleStateV2State(*pb) + return &st, nil +} + type RunNow struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands []string `json:"dbt_commands,omitempty"` + // Wire name: 'dbt_commands' + DbtCommands []string // An optional token to guarantee the idempotency of job run requests. If a // run with the provided token already exists, the request does not create a // new run but returns the ID of the existing run instead. If a run with the @@ -3376,7 +6243,8 @@ type RunNow struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken string `json:"idempotency_token,omitempty"` + // Wire name: 'idempotency_token' + IdempotencyToken string // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -3389,12 +6257,15 @@ type RunNow struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams []string `json:"jar_params,omitempty"` + // Wire name: 'jar_params' + JarParams []string // The ID of the job to be executed - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters map[string]string `json:"job_parameters,omitempty"` + // Wire name: 'job_parameters' + JobParameters map[string]string // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -3414,10 +6285,12 @@ type RunNow struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams map[string]string `json:"notebook_params,omitempty"` + // Wire name: 'notebook_params' + NotebookParams map[string]string // A list of task keys to run inside of the job. If this field is not // provided, all tasks in the job will be run. - Only []string `json:"only,omitempty"` + // Wire name: 'only' + Only []string // The performance mode on a serverless job. The performance target // determines the level of compute performance or cost-efficiency for the // run. This field overrides the performance target defined on the job @@ -3426,11 +6299,14 @@ type RunNow struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + // Wire name: 'performance_target' + PerformanceTarget PerformanceTarget // Controls whether the pipeline should perform a full refresh - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + // Wire name: 'pipeline_params' + PipelineParams *PipelineParams - PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + // Wire name: 'python_named_params' + PythonNamedParams map[string]string // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -3448,9 +6324,11 @@ type RunNow struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams []string `json:"python_params,omitempty"` + // Wire name: 'python_params' + PythonParams []string // The queue settings of the run. - Queue *QueueSettings `json:"queue,omitempty"` + // Wire name: 'queue' + Queue *QueueSettings // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -3469,59 +6347,103 @@ type RunNow struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + // Wire name: 'spark_submit_params' + SparkSubmitParams []string // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams map[string]string `json:"sql_params,omitempty"` + // Wire name: 'sql_params' + SqlParams map[string]string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunNow) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunNow) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runNowPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runNowFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunNow) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunNow) MarshalJSON() ([]byte, error) { + pb, err := runNowToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run was started successfully. type RunNowResponse struct { // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob int64 `json:"number_in_job,omitempty"` + // Wire name: 'number_in_job' + NumberInJob int64 // The globally unique ID of the newly triggered run. - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunNowResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunNowResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runNowResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runNowResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunNowResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunNowResponse) MarshalJSON() ([]byte, error) { + pb, err := runNowResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run output was retrieved successfully. type RunOutput struct { // The output of a clean rooms notebook task, if available - CleanRoomsNotebookOutput *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput `json:"clean_rooms_notebook_output,omitempty"` + // Wire name: 'clean_rooms_notebook_output' + CleanRoomsNotebookOutput *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput // The output of a dashboard task, if available - DashboardOutput *DashboardTaskOutput `json:"dashboard_output,omitempty"` + // Wire name: 'dashboard_output' + DashboardOutput *DashboardTaskOutput // The output of a dbt task, if available. - DbtOutput *DbtOutput `json:"dbt_output,omitempty"` + // Wire name: 'dbt_output' + DbtOutput *DbtOutput // An error message indicating why a task failed or why output is not // available. The message is unstructured, and its exact format is subject // to change. - Error string `json:"error,omitempty"` + // Wire name: 'error' + Error string // If there was an error executing the run, this field contains any // available stack traces. - ErrorTrace string `json:"error_trace,omitempty"` + // Wire name: 'error_trace' + ErrorTrace string - Info string `json:"info,omitempty"` + // Wire name: 'info' + Info string // The output from tasks that write to standard streams (stdout/stderr) such // as spark_jar_task, spark_python_task, python_wheel_task. // @@ -3529,11 +6451,14 @@ type RunOutput struct { // spark_submit_task. // // Databricks restricts this API to return the last 5 MB of these logs. - Logs string `json:"logs,omitempty"` + // Wire name: 'logs' + Logs string // Whether the logs are truncated. - LogsTruncated bool `json:"logs_truncated,omitempty"` + // Wire name: 'logs_truncated' + LogsTruncated bool // All details of the run except for its output. - Metadata *Run `json:"metadata,omitempty"` + // Wire name: 'metadata' + Metadata *Run // The output of a notebook task, if available. A notebook task that // terminates (either successfully or with a failure) without calling // `dbutils.notebook.exit()` is considered to have an empty output. This @@ -3542,28 +6467,49 @@ type RunOutput struct { // the [ClusterLogConf] field to configure log storage for the job cluster. // // [ClusterLogConf]: https://docs.databricks.com/dev-tools/api/latest/clusters.html#clusterlogconf - NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + // Wire name: 'notebook_output' + NotebookOutput *NotebookOutput // The output of a run job task, if available - RunJobOutput *RunJobOutput `json:"run_job_output,omitempty"` + // Wire name: 'run_job_output' + RunJobOutput *RunJobOutput // The output of a SQL task, if available. - SqlOutput *SqlOutput `json:"sql_output,omitempty"` + // Wire name: 'sql_output' + SqlOutput *SqlOutput - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunOutput) MarshalJSON() ([]byte, error) { + pb, err := runOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RunParameters struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands []string `json:"dbt_commands,omitempty"` + // Wire name: 'dbt_commands' + DbtCommands []string // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -3576,7 +6522,8 @@ type RunParameters struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams []string `json:"jar_params,omitempty"` + // Wire name: 'jar_params' + JarParams []string // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -3596,11 +6543,14 @@ type RunParameters struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams map[string]string `json:"notebook_params,omitempty"` + // Wire name: 'notebook_params' + NotebookParams map[string]string // Controls whether the pipeline should perform a full refresh - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + // Wire name: 'pipeline_params' + PipelineParams *PipelineParams - PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + // Wire name: 'python_named_params' + PythonNamedParams map[string]string // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -3618,7 +6568,8 @@ type RunParameters struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams []string `json:"python_params,omitempty"` + // Wire name: 'python_params' + PythonParams []string // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -3637,11 +6588,38 @@ type RunParameters struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + // Wire name: 'spark_submit_params' + SparkSubmitParams []string // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams map[string]string `json:"sql_params,omitempty"` + // Wire name: 'sql_params' + SqlParams map[string]string +} + +func (st *RunParameters) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runParametersPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runParametersFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunParameters) MarshalJSON() ([]byte, error) { + pb, err := runParametersToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A value indicating the run's result. The possible values are: * `SUCCESS`: @@ -3657,6 +6635,7 @@ type RunParameters struct { // canceled. * `DISABLED`: The run was skipped because it was disabled // explicitly by the user. type RunResultState string +type runResultStatePb string // The run was canceled at user request. const RunResultStateCanceled RunResultState = `CANCELED` @@ -3710,45 +6689,111 @@ func (f *RunResultState) Type() string { return "RunResultState" } +func runResultStateToPb(st *RunResultState) (*runResultStatePb, error) { + if st == nil { + return nil, nil + } + pb := runResultStatePb(*st) + return &pb, nil +} + +func runResultStateFromPb(pb *runResultStatePb) (*RunResultState, error) { + if pb == nil { + return nil, nil + } + st := RunResultState(*pb) + return &st, nil +} + // The current state of the run. type RunState struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. Note: Additional states might be // introduced in future releases. - LifeCycleState RunLifeCycleState `json:"life_cycle_state,omitempty"` + // Wire name: 'life_cycle_state' + LifeCycleState RunLifeCycleState // The reason indicating why the run was queued. - QueueReason string `json:"queue_reason,omitempty"` + // Wire name: 'queue_reason' + QueueReason string // A value indicating the run's result. This field is only available for // terminal lifecycle states. Note: Additional states might be introduced in // future releases. - ResultState RunResultState `json:"result_state,omitempty"` + // Wire name: 'result_state' + ResultState RunResultState // A descriptive message for the current state. This field is unstructured, // and its exact format is subject to change. - StateMessage string `json:"state_message,omitempty"` + // Wire name: 'state_message' + StateMessage string // A value indicating whether a run was canceled manually by a user or by // the scheduler because the run timed out. - UserCancelledOrTimedout bool `json:"user_cancelled_or_timedout,omitempty"` + // Wire name: 'user_cancelled_or_timedout' + UserCancelledOrTimedout bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunState) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunState) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runStatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runStateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunState) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunState) MarshalJSON() ([]byte, error) { + pb, err := runStateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The current status of the run type RunStatus struct { // If the run was queued, details about the reason for queuing the run. - QueueDetails *QueueDetails `json:"queue_details,omitempty"` + // Wire name: 'queue_details' + QueueDetails *QueueDetails // The current state of the run. - State RunLifecycleStateV2State `json:"state,omitempty"` + // Wire name: 'state' + State RunLifecycleStateV2State // If the run is in a TERMINATING or TERMINATED state, details about the // reason for terminating the run. - TerminationDetails *TerminationDetails `json:"termination_details,omitempty"` + // Wire name: 'termination_details' + TerminationDetails *TerminationDetails +} + +func (st *RunStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunStatus) MarshalJSON() ([]byte, error) { + pb, err := runStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Used when outputting a child run, in GetRun or ListRuns. @@ -3760,42 +6805,52 @@ type RunTask struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber int `json:"attempt_number,omitempty"` + // Wire name: 'attempt_number' + AttemptNumber int // The task runs a [clean rooms] notebook when the // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + // Wire name: 'clean_rooms_notebook_task' + CleanRoomsNotebookTask *CleanRoomsNotebookTask // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration int64 `json:"cleanup_duration,omitempty"` + // Wire name: 'cleanup_duration' + CleanupDuration int64 // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + // Wire name: 'cluster_instance' + ClusterInstance *ClusterInstance // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask *RunConditionTask `json:"condition_task,omitempty"` + // Wire name: 'condition_task' + ConditionTask *RunConditionTask // The task refreshes a dashboard and sends a snapshot to subscribers. - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + // Wire name: 'dashboard_task' + DashboardTask *DashboardTask // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask *DbtTask `json:"dbt_task,omitempty"` + // Wire name: 'dbt_task' + DbtTask *DbtTask // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn []TaskDependency `json:"depends_on,omitempty"` + // Wire name: 'depends_on' + DependsOn []TaskDependency // An optional description for this task. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Deprecated, field was never used in production. - Disabled bool `json:"disabled,omitempty"` + // Wire name: 'disabled' + Disabled bool // The actual performance target used by the serverless run during // execution. This can differ from the client-set performance target on the // request depending on whether the performance mode is supported by the job @@ -3804,17 +6859,21 @@ type RunTask struct { // * `STANDARD`: Enables cost-efficient execution of serverless workloads. * // `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times // through rapid scaling and optimized cluster performance. - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + // Wire name: 'effective_performance_target' + EffectivePerformanceTarget PerformanceTarget // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *JobEmailNotifications // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey string `json:"environment_key,omitempty"` + // Wire name: 'environment_key' + EnvironmentKey string // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -3822,17 +6881,21 @@ type RunTask struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration int64 `json:"execution_duration,omitempty"` + // Wire name: 'execution_duration' + ExecutionDuration int64 // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId string `json:"existing_cluster_id,omitempty"` + // Wire name: 'existing_cluster_id' + ExistingClusterId string // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask *RunForEachTask `json:"for_each_task,omitempty"` + // Wire name: 'for_each_task' + ForEachTask *RunForEachTask - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + // Wire name: 'gen_ai_compute_task' + GenAiComputeTask *GenAiComputeTask // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, @@ -3841,49 +6904,65 @@ type RunTask struct { // `WORKSPACE` on the task. Note: dbt and SQL File tasks support only // version-controlled sources. If dbt or SQL File tasks are used, // `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey string `json:"job_cluster_key,omitempty"` + // Wire name: 'job_cluster_key' + JobClusterKey string // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries []compute.Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []compute.Library // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + // Wire name: 'new_cluster' + NewCluster *compute.ClusterSpec // The task runs a notebook when the `notebook_task` field is present. - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + // Wire name: 'notebook_task' + NotebookTask *NotebookTask // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *TaskNotificationSettings // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + // Wire name: 'pipeline_task' + PipelineTask *PipelineTask // The task triggers a Power BI semantic model update when the // `power_bi_task` field is present. - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + // Wire name: 'power_bi_task' + PowerBiTask *PowerBiTask // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + // Wire name: 'python_wheel_task' + PythonWheelTask *PythonWheelTask // The time in milliseconds that the run has spent in the queue. - QueueDuration int64 `json:"queue_duration,omitempty"` + // Wire name: 'queue_duration' + QueueDuration int64 // Parameter values including resolved references - ResolvedValues *ResolvedValues `json:"resolved_values,omitempty"` + // Wire name: 'resolved_values' + ResolvedValues *ResolvedValues // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration int64 `json:"run_duration,omitempty"` + // Wire name: 'run_duration' + RunDuration int64 // The ID of the task run. - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf RunIf `json:"run_if,omitempty"` + // Wire name: 'run_if' + RunIf RunIf // The task triggers another job when the `run_job_task` field is present. - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + // Wire name: 'run_job_task' + RunJobTask *RunJobTask - RunPageUrl string `json:"run_page_url,omitempty"` + // Wire name: 'run_page_url' + RunPageUrl string // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -3891,12 +6970,15 @@ type RunTask struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration int64 `json:"setup_duration,omitempty"` + // Wire name: 'setup_duration' + SetupDuration int64 // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + // Wire name: 'spark_jar_task' + SparkJarTask *SparkJarTask // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + // Wire name: 'spark_python_task' + SparkPythonTask *SparkPythonTask // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -3915,41 +6997,66 @@ type RunTask struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + // Wire name: 'spark_submit_task' + SparkSubmitTask *SparkSubmitTask // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask *SqlTask `json:"sql_task,omitempty"` + // Wire name: 'sql_task' + SqlTask *SqlTask // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Deprecated. Please use the `status` field instead. - State *RunState `json:"state,omitempty"` + // Wire name: 'state' + State *RunState // The current status of the run - Status *RunStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *RunStatus // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey string `json:"task_key"` + // Wire name: 'task_key' + TaskKey string // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunTask) MarshalJSON() ([]byte, error) { + pb, err := runTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of a run. * `JOB_RUN`: Normal job run. A run created with @@ -3959,6 +7066,7 @@ func (s RunTask) MarshalJSON() ([]byte, error) { // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow type RunType string +type runTypePb string // Normal job run. A run created with :method:jobs/runNow. const RunTypeJobRun RunType = `JOB_RUN` @@ -3992,6 +7100,22 @@ func (f *RunType) Type() string { return "RunType" } +func runTypeToPb(st *RunType) (*runTypePb, error) { + if st == nil { + return nil, nil + } + pb := runTypePb(*st) + return &pb, nil +} + +func runTypeFromPb(pb *runTypePb) (*RunType, error) { + if pb == nil { + return nil, nil + } + st := RunType(*pb) + return &st, nil +} + // Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file // will be retrieved\ from the local Databricks workspace. When set to `GIT`, // the SQL file will be retrieved from a Git repository defined in `git_source`. @@ -4001,6 +7125,7 @@ func (f *RunType) Type() string { // * `WORKSPACE`: SQL file is located in Databricks workspace. * `GIT`: SQL file // is located in cloud Git provider. type Source string +type sourcePb string // SQL file is located in cloud Git provider. const SourceGit Source = `GIT` @@ -4029,35 +7154,72 @@ func (f *Source) Type() string { return "Source" } +func sourceToPb(st *Source) (*sourcePb, error) { + if st == nil { + return nil, nil + } + pb := sourcePb(*st) + return &pb, nil +} + +func sourceFromPb(pb *sourcePb) (*Source, error) { + if pb == nil { + return nil, nil + } + st := Source(*pb) + return &st, nil +} + type SparkJarTask struct { // Deprecated since 04/2016. Provide a `jar` through the `libraries` field // instead. For an example, see :method:jobs/create. - JarUri string `json:"jar_uri,omitempty"` + // Wire name: 'jar_uri' + JarUri string // The full name of the class containing the main method to be executed. // This class must be contained in a JAR provided as a library. // // The code must use `SparkContext.getOrCreate` to obtain a Spark context; // otherwise, runs of the job fail. - MainClassName string `json:"main_class_name,omitempty"` + // Wire name: 'main_class_name' + MainClassName string // Parameters passed to the main method. // // Use [Task parameter variables] to set parameters containing information // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters []string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []string // Deprecated. A value of `false` is no longer supported. - RunAsRepl bool `json:"run_as_repl,omitempty"` + // Wire name: 'run_as_repl' + RunAsRepl bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SparkJarTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SparkJarTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkJarTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkJarTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SparkJarTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SparkJarTask) MarshalJSON() ([]byte, error) { + pb, err := sparkJarTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SparkPythonTask struct { @@ -4067,13 +7229,15 @@ type SparkPythonTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters []string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []string // The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, // adls:/, gcs:/) and workspace paths are supported. For python files stored // in the Databricks workspace, the path must be absolute and begin with // `/`. For files stored in a remote repository, the path must be relative. // This field is required. - PythonFile string `json:"python_file"` + // Wire name: 'python_file' + PythonFile string // Optional location type of the Python file. When set to `WORKSPACE` or not // specified, the file will be retrieved from the local Databricks workspace // or cloud location (if the `python_file` has a URI format). When set to @@ -4083,7 +7247,33 @@ type SparkPythonTask struct { // * `WORKSPACE`: The Python file is located in a Databricks workspace or at // a cloud filesystem URI. * `GIT`: The Python file is located in a remote // Git repository. - Source Source `json:"source,omitempty"` + // Wire name: 'source' + Source Source +} + +func (st *SparkPythonTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkPythonTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkPythonTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SparkPythonTask) MarshalJSON() ([]byte, error) { + pb, err := sparkPythonTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SparkSubmitTask struct { @@ -4093,7 +7283,33 @@ type SparkSubmitTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters []string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []string +} + +func (st *SparkSubmitTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparkSubmitTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparkSubmitTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SparkSubmitTask) MarshalJSON() ([]byte, error) { + pb, err := sparkSubmitTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlAlertOutput struct { @@ -4102,26 +7318,48 @@ type SqlAlertOutput struct { // * UNKNOWN: alert yet to be evaluated * OK: alert evaluated and did not // fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled // trigger conditions - AlertState SqlAlertState `json:"alert_state,omitempty"` + // Wire name: 'alert_state' + AlertState SqlAlertState // The link to find the output results. - OutputLink string `json:"output_link,omitempty"` + // Wire name: 'output_link' + OutputLink string // The text of the SQL query. Can Run permission of the SQL query associated // with the SQL alert is required to view this field. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Information about SQL statements executed in the run. - SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` + // Wire name: 'sql_statements' + SqlStatements []SqlStatementOutput // The canonical identifier of the SQL warehouse. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlAlertOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlAlertOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlAlertOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlAlertOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlAlertOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlAlertOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlAlertOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The state of the SQL alert. @@ -4130,6 +7368,7 @@ func (s SqlAlertOutput) MarshalJSON() ([]byte, error) { // fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled trigger // conditions type SqlAlertState string +type sqlAlertStatePb string const SqlAlertStateOk SqlAlertState = `OK` @@ -4158,51 +7397,111 @@ func (f *SqlAlertState) Type() string { return "SqlAlertState" } +func sqlAlertStateToPb(st *SqlAlertState) (*sqlAlertStatePb, error) { + if st == nil { + return nil, nil + } + pb := sqlAlertStatePb(*st) + return &pb, nil +} + +func sqlAlertStateFromPb(pb *sqlAlertStatePb) (*SqlAlertState, error) { + if pb == nil { + return nil, nil + } + st := SqlAlertState(*pb) + return &st, nil +} + type SqlDashboardOutput struct { // The canonical identifier of the SQL warehouse. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string // Widgets executed in the run. Only SQL query based widgets are listed. - Widgets []SqlDashboardWidgetOutput `json:"widgets,omitempty"` + // Wire name: 'widgets' + Widgets []SqlDashboardWidgetOutput - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlDashboardOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlDashboardOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlDashboardOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlDashboardOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlDashboardOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlDashboardOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlDashboardOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlDashboardWidgetOutput struct { // Time (in epoch milliseconds) when execution of the SQL widget ends. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The information about the error when execution fails. - Error *SqlOutputError `json:"error,omitempty"` + // Wire name: 'error' + Error *SqlOutputError // The link to find the output results. - OutputLink string `json:"output_link,omitempty"` + // Wire name: 'output_link' + OutputLink string // Time (in epoch milliseconds) when execution of the SQL widget starts. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // The execution status of the SQL widget. - Status SqlDashboardWidgetOutputStatus `json:"status,omitempty"` + // Wire name: 'status' + Status SqlDashboardWidgetOutputStatus // The canonical identifier of the SQL widget. - WidgetId string `json:"widget_id,omitempty"` + // Wire name: 'widget_id' + WidgetId string // The title of the SQL widget. - WidgetTitle string `json:"widget_title,omitempty"` + // Wire name: 'widget_title' + WidgetTitle string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlDashboardWidgetOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlDashboardWidgetOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlDashboardWidgetOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlDashboardWidgetOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlDashboardWidgetOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlDashboardWidgetOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlDashboardWidgetOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlDashboardWidgetOutputStatus string +type sqlDashboardWidgetOutputStatusPb string const SqlDashboardWidgetOutputStatusCancelled SqlDashboardWidgetOutputStatus = `CANCELLED` @@ -4235,133 +7534,309 @@ func (f *SqlDashboardWidgetOutputStatus) Type() string { return "SqlDashboardWidgetOutputStatus" } +func sqlDashboardWidgetOutputStatusToPb(st *SqlDashboardWidgetOutputStatus) (*sqlDashboardWidgetOutputStatusPb, error) { + if st == nil { + return nil, nil + } + pb := sqlDashboardWidgetOutputStatusPb(*st) + return &pb, nil +} + +func sqlDashboardWidgetOutputStatusFromPb(pb *sqlDashboardWidgetOutputStatusPb) (*SqlDashboardWidgetOutputStatus, error) { + if pb == nil { + return nil, nil + } + st := SqlDashboardWidgetOutputStatus(*pb) + return &st, nil +} + type SqlOutput struct { // The output of a SQL alert task, if available. - AlertOutput *SqlAlertOutput `json:"alert_output,omitempty"` + // Wire name: 'alert_output' + AlertOutput *SqlAlertOutput // The output of a SQL dashboard task, if available. - DashboardOutput *SqlDashboardOutput `json:"dashboard_output,omitempty"` + // Wire name: 'dashboard_output' + DashboardOutput *SqlDashboardOutput // The output of a SQL query task, if available. - QueryOutput *SqlQueryOutput `json:"query_output,omitempty"` + // Wire name: 'query_output' + QueryOutput *SqlQueryOutput +} + +func (st *SqlOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SqlOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlOutputError struct { // The error message when execution fails. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlOutputError) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlOutputError) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlOutputErrorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlOutputErrorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlOutputError) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlOutputError) MarshalJSON() ([]byte, error) { + pb, err := sqlOutputErrorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlQueryOutput struct { - EndpointId string `json:"endpoint_id,omitempty"` + + // Wire name: 'endpoint_id' + EndpointId string // The link to find the output results. - OutputLink string `json:"output_link,omitempty"` + // Wire name: 'output_link' + OutputLink string // The text of the SQL query. Can Run permission of the SQL query is // required to view this field. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Information about SQL statements executed in the run. - SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` + // Wire name: 'sql_statements' + SqlStatements []SqlStatementOutput // The canonical identifier of the SQL warehouse. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlQueryOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlQueryOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlQueryOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlQueryOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlQueryOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlQueryOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlQueryOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlStatementOutput struct { // A key that can be used to look up query details. - LookupKey string `json:"lookup_key,omitempty"` + // Wire name: 'lookup_key' + LookupKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlStatementOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlStatementOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlStatementOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlStatementOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlStatementOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlStatementOutput) MarshalJSON() ([]byte, error) { + pb, err := sqlStatementOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTask struct { // If alert, indicates that this job must refresh a SQL alert. - Alert *SqlTaskAlert `json:"alert,omitempty"` + // Wire name: 'alert' + Alert *SqlTaskAlert // If dashboard, indicates that this job must refresh a SQL dashboard. - Dashboard *SqlTaskDashboard `json:"dashboard,omitempty"` + // Wire name: 'dashboard' + Dashboard *SqlTaskDashboard // If file, indicates that this job runs a SQL file in a remote Git // repository. - File *SqlTaskFile `json:"file,omitempty"` + // Wire name: 'file' + File *SqlTaskFile // Parameters to be used for each run of this job. The SQL alert task does // not support custom parameters. - Parameters map[string]string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters map[string]string // If query, indicates that this job must execute a SQL query. - Query *SqlTaskQuery `json:"query,omitempty"` + // Wire name: 'query' + Query *SqlTaskQuery // The canonical identifier of the SQL warehouse. Recommended to use with // serverless or pro SQL warehouses. Classic SQL warehouses are only // supported for SQL alert, dashboard and query tasks and are limited to // scheduled single-task jobs. - WarehouseId string `json:"warehouse_id"` + // Wire name: 'warehouse_id' + WarehouseId string +} + +func (st *SqlTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SqlTask) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTaskAlert struct { // The canonical identifier of the SQL alert. - AlertId string `json:"alert_id"` + // Wire name: 'alert_id' + AlertId string // If true, the alert notifications are not sent to subscribers. - PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + // Wire name: 'pause_subscriptions' + PauseSubscriptions bool // If specified, alert notifications are sent to subscribers. - Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + // Wire name: 'subscriptions' + Subscriptions []SqlTaskSubscription - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlTaskAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlTaskAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlTaskAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlTaskAlert) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTaskDashboard struct { // Subject of the email sent to subscribers of this task. - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // The canonical identifier of the SQL dashboard. - DashboardId string `json:"dashboard_id"` + // Wire name: 'dashboard_id' + DashboardId string // If true, the dashboard snapshot is not taken, and emails are not sent to // subscribers. - PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + // Wire name: 'pause_subscriptions' + PauseSubscriptions bool // If specified, dashboard snapshots are sent to subscriptions. - Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + // Wire name: 'subscriptions' + Subscriptions []SqlTaskSubscription - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlTaskDashboard) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlTaskDashboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskDashboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskDashboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlTaskDashboard) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlTaskDashboard) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskDashboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTaskFile struct { // Path of the SQL file. Must be relative if the source is a remote Git // repository and absolute for workspace paths. - Path string `json:"path"` + // Wire name: 'path' + Path string // Optional location type of the SQL file. When set to `WORKSPACE`, the SQL // file will be retrieved from the local Databricks workspace. When set to // `GIT`, the SQL file will be retrieved from a Git repository defined in @@ -4370,12 +7845,64 @@ type SqlTaskFile struct { // // * `WORKSPACE`: SQL file is located in Databricks workspace. * `GIT`: SQL // file is located in cloud Git provider. - Source Source `json:"source,omitempty"` + // Wire name: 'source' + Source Source +} + +func (st *SqlTaskFile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskFilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskFileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SqlTaskFile) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskFileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTaskQuery struct { // The canonical identifier of the SQL query. - QueryId string `json:"query_id"` + // Wire name: 'query_id' + QueryId string +} + +func (st *SqlTaskQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SqlTaskQuery) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SqlTaskSubscription struct { @@ -4383,24 +7910,44 @@ type SqlTaskSubscription struct { // notification. This parameter is mutually exclusive with user_name. You // cannot set both destination_id and user_name for subscription // notifications. - DestinationId string `json:"destination_id,omitempty"` + // Wire name: 'destination_id' + DestinationId string // The user name to receive the subscription email. This parameter is // mutually exclusive with destination_id. You cannot set both // destination_id and user_name for subscription notifications. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SqlTaskSubscription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SqlTaskSubscription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sqlTaskSubscriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sqlTaskSubscriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SqlTaskSubscription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SqlTaskSubscription) MarshalJSON() ([]byte, error) { + pb, err := sqlTaskSubscriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StorageMode string +type storageModePb string const StorageModeDirectQuery StorageMode = `DIRECT_QUERY` @@ -4429,18 +7976,38 @@ func (f *StorageMode) Type() string { return "StorageMode" } +func storageModeToPb(st *StorageMode) (*storageModePb, error) { + if st == nil { + return nil, nil + } + pb := storageModePb(*st) + return &pb, nil +} + +func storageModeFromPb(pb *storageModePb) (*StorageMode, error) { + if pb == nil { + return nil, nil + } + st := StorageMode(*pb) + return &st, nil +} + type SubmitRun struct { // List of permissions to set on the job. - AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []JobAccessControlRequest // The user specified id of the budget policy to use for this one-time run. // If not specified, the run will be not be attributed to any budget policy. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // An optional set of email addresses notified when the run begins or // completes. - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *JobEmailNotifications // A list of task execution environment specifications that can be // referenced by tasks of this run. - Environments []JobEnvironment `json:"environments,omitempty"` + // Wire name: 'environments' + Environments []JobEnvironment // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -4451,9 +8018,11 @@ type SubmitRun struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource *GitSource `json:"git_source,omitempty"` + // Wire name: 'git_source' + GitSource *GitSource // An optional set of health rules that can be defined for this job. - Health *JobsHealthRules `json:"health,omitempty"` + // Wire name: 'health' + Health *JobsHealthRules // An optional token that can be used to guarantee the idempotency of job // run requests. If a run with the provided token already exists, the // request does not create a new run but returns the ID of the existing run @@ -4469,52 +8038,95 @@ type SubmitRun struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken string `json:"idempotency_token,omitempty"` + // Wire name: 'idempotency_token' + IdempotencyToken string // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // run. - NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *JobNotificationSettings // The queue settings of the one-time run. - Queue *QueueSettings `json:"queue,omitempty"` + // Wire name: 'queue' + Queue *QueueSettings // Specifies the user or service principal that the job runs as. If not // specified, the job runs as the user who submits the request. - RunAs *JobRunAs `json:"run_as,omitempty"` + // Wire name: 'run_as' + RunAs *JobRunAs // An optional name for the run. The default value is `Untitled`. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string - Tasks []SubmitTask `json:"tasks,omitempty"` + // Wire name: 'tasks' + Tasks []SubmitTask // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A collection of system notification IDs to notify when the run begins or // completes. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SubmitRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SubmitRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &submitRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := submitRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SubmitRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SubmitRun) MarshalJSON() ([]byte, error) { + pb, err := submitRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run was created and started successfully. type SubmitRunResponse struct { // The canonical identifier for the newly submitted run. - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SubmitRunResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SubmitRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &submitRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := submitRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SubmitRunResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SubmitRunResponse) MarshalJSON() ([]byte, error) { + pb, err := submitRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SubmitTask struct { @@ -4522,77 +8134,100 @@ type SubmitTask struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + // Wire name: 'clean_rooms_notebook_task' + CleanRoomsNotebookTask *CleanRoomsNotebookTask // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask *ConditionTask `json:"condition_task,omitempty"` + // Wire name: 'condition_task' + ConditionTask *ConditionTask // The task refreshes a dashboard and sends a snapshot to subscribers. - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + // Wire name: 'dashboard_task' + DashboardTask *DashboardTask // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask *DbtTask `json:"dbt_task,omitempty"` + // Wire name: 'dbt_task' + DbtTask *DbtTask // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn []TaskDependency `json:"depends_on,omitempty"` + // Wire name: 'depends_on' + DependsOn []TaskDependency // An optional description for this task. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *JobEmailNotifications // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey string `json:"environment_key,omitempty"` + // Wire name: 'environment_key' + EnvironmentKey string // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId string `json:"existing_cluster_id,omitempty"` + // Wire name: 'existing_cluster_id' + ExistingClusterId string // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + // Wire name: 'for_each_task' + ForEachTask *ForEachTask - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + // Wire name: 'gen_ai_compute_task' + GenAiComputeTask *GenAiComputeTask // An optional set of health rules that can be defined for this job. - Health *JobsHealthRules `json:"health,omitempty"` + // Wire name: 'health' + Health *JobsHealthRules // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries []compute.Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []compute.Library // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + // Wire name: 'new_cluster' + NewCluster *compute.ClusterSpec // The task runs a notebook when the `notebook_task` field is present. - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + // Wire name: 'notebook_task' + NotebookTask *NotebookTask // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *TaskNotificationSettings // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + // Wire name: 'pipeline_task' + PipelineTask *PipelineTask // The task triggers a Power BI semantic model update when the // `power_bi_task` field is present. - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + // Wire name: 'power_bi_task' + PowerBiTask *PowerBiTask // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + // Wire name: 'python_wheel_task' + PythonWheelTask *PythonWheelTask // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf RunIf `json:"run_if,omitempty"` + // Wire name: 'run_if' + RunIf RunIf // The task triggers another job when the `run_job_task` field is present. - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + // Wire name: 'run_job_task' + RunJobTask *RunJobTask // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + // Wire name: 'spark_jar_task' + SparkJarTask *SparkJarTask // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + // Wire name: 'spark_python_task' + SparkPythonTask *SparkPythonTask // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -4611,98 +8246,180 @@ type SubmitTask struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + // Wire name: 'spark_submit_task' + SparkSubmitTask *SparkSubmitTask // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask *SqlTask `json:"sql_task,omitempty"` + // Wire name: 'sql_task' + SqlTask *SqlTask // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey string `json:"task_key"` + // Wire name: 'task_key' + TaskKey string // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SubmitTask) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SubmitTask) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &submitTaskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := submitTaskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SubmitTask) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SubmitTask) MarshalJSON() ([]byte, error) { + pb, err := submitTaskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Subscription struct { // Optional: Allows users to specify a custom subject line on the email sent // to subscribers. - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // When true, the subscription will not send emails. - Paused bool `json:"paused,omitempty"` + // Wire name: 'paused' + Paused bool // The list of subscribers to send the snapshot of the dashboard to. - Subscribers []SubscriptionSubscriber `json:"subscribers,omitempty"` + // Wire name: 'subscribers' + Subscribers []SubscriptionSubscriber - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Subscription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Subscription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Subscription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Subscription) MarshalJSON() ([]byte, error) { + pb, err := subscriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SubscriptionSubscriber struct { // A snapshot of the dashboard will be sent to the destination when the // `destination_id` field is present. - DestinationId string `json:"destination_id,omitempty"` + // Wire name: 'destination_id' + DestinationId string // A snapshot of the dashboard will be sent to the user's email when the // `user_name` field is present. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SubscriptionSubscriber) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SubscriptionSubscriber) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &subscriptionSubscriberPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := subscriptionSubscriberFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SubscriptionSubscriber) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SubscriptionSubscriber) MarshalJSON() ([]byte, error) { + pb, err := subscriptionSubscriberToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableUpdateTriggerConfiguration struct { // The table(s) condition based on which to trigger a job run. - Condition Condition `json:"condition,omitempty"` + // Wire name: 'condition' + Condition Condition // If set, the trigger starts a run only after the specified amount of time // has passed since the last time the trigger fired. The minimum allowed // value is 60 seconds. - MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + // Wire name: 'min_time_between_triggers_seconds' + MinTimeBetweenTriggersSeconds int // A list of Delta tables to monitor for changes. The table name must be in // the format `catalog_name.schema_name.table_name`. - TableNames []string `json:"table_names,omitempty"` + // Wire name: 'table_names' + TableNames []string // If set, the trigger starts a run only after no table updates have // occurred for the specified time and can be used to wait for a series of // table updates before triggering a run. The minimum allowed value is 60 // seconds. - WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + // Wire name: 'wait_after_last_change_seconds' + WaitAfterLastChangeSeconds int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableUpdateTriggerConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableUpdateTriggerConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableUpdateTriggerConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableUpdateTriggerConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableUpdateTriggerConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableUpdateTriggerConfiguration) MarshalJSON() ([]byte, error) { + pb, err := tableUpdateTriggerConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Task struct { @@ -4710,83 +8427,107 @@ type Task struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + // Wire name: 'clean_rooms_notebook_task' + CleanRoomsNotebookTask *CleanRoomsNotebookTask // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask *ConditionTask `json:"condition_task,omitempty"` + // Wire name: 'condition_task' + ConditionTask *ConditionTask // The task refreshes a dashboard and sends a snapshot to subscribers. - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + // Wire name: 'dashboard_task' + DashboardTask *DashboardTask // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask *DbtTask `json:"dbt_task,omitempty"` + // Wire name: 'dbt_task' + DbtTask *DbtTask // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete before executing this // task. The task will run only if the `run_if` condition is true. The key // is `task_key`, and the value is the name assigned to the dependent task. - DependsOn []TaskDependency `json:"depends_on,omitempty"` + // Wire name: 'depends_on' + DependsOn []TaskDependency // An optional description for this task. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // An option to disable auto optimization in serverless - DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"` + // Wire name: 'disable_auto_optimization' + DisableAutoOptimization bool // An optional set of email addresses that is notified when runs of this // task begin or complete as well as when this task is deleted. The default // behavior is to not send any emails. - EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"` + // Wire name: 'email_notifications' + EmailNotifications *TaskEmailNotifications // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey string `json:"environment_key,omitempty"` + // Wire name: 'environment_key' + EnvironmentKey string // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId string `json:"existing_cluster_id,omitempty"` + // Wire name: 'existing_cluster_id' + ExistingClusterId string // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + // Wire name: 'for_each_task' + ForEachTask *ForEachTask - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + // Wire name: 'gen_ai_compute_task' + GenAiComputeTask *GenAiComputeTask // An optional set of health rules that can be defined for this job. - Health *JobsHealthRules `json:"health,omitempty"` + // Wire name: 'health' + Health *JobsHealthRules // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey string `json:"job_cluster_key,omitempty"` + // Wire name: 'job_cluster_key' + JobClusterKey string // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries []compute.Library `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []compute.Library // An optional maximum number of times to retry an unsuccessful run. A run // is considered to be unsuccessful if it completes with the `FAILED` // result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means // to retry indefinitely and the value `0` means to never retry. - MaxRetries int `json:"max_retries,omitempty"` + // Wire name: 'max_retries' + MaxRetries int // An optional minimal interval in milliseconds between the start of the // failed run and the subsequent retry run. The default behavior is that // unsuccessful runs are immediately retried. - MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"` + // Wire name: 'min_retry_interval_millis' + MinRetryIntervalMillis int // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + // Wire name: 'new_cluster' + NewCluster *compute.ClusterSpec // The task runs a notebook when the `notebook_task` field is present. - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + // Wire name: 'notebook_task' + NotebookTask *NotebookTask // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task. - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + // Wire name: 'notification_settings' + NotificationSettings *TaskNotificationSettings // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + // Wire name: 'pipeline_task' + PipelineTask *PipelineTask // The task triggers a Power BI semantic model update when the // `power_bi_task` field is present. - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + // Wire name: 'power_bi_task' + PowerBiTask *PowerBiTask // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + // Wire name: 'python_wheel_task' + PythonWheelTask *PythonWheelTask // An optional policy to specify whether to retry a job when it times out. // The default behavior is to not retry on timeout. - RetryOnTimeout bool `json:"retry_on_timeout,omitempty"` + // Wire name: 'retry_on_timeout' + RetryOnTimeout bool // An optional value specifying the condition determining whether the task // is run once its dependencies have been completed. // @@ -4796,14 +8537,18 @@ type Task struct { // executed * `ALL_DONE`: All dependencies have been completed * // `AT_LEAST_ONE_FAILED`: At least one dependency failed * `ALL_FAILED`: ALl // dependencies have failed - RunIf RunIf `json:"run_if,omitempty"` + // Wire name: 'run_if' + RunIf RunIf // The task triggers another job when the `run_job_task` field is present. - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + // Wire name: 'run_job_task' + RunJobTask *RunJobTask // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + // Wire name: 'spark_jar_task' + SparkJarTask *SparkJarTask // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + // Wire name: 'spark_python_task' + SparkPythonTask *SparkPythonTask // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -4822,72 +8567,117 @@ type Task struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + // Wire name: 'spark_submit_task' + SparkSubmitTask *SparkSubmitTask // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask *SqlTask `json:"sql_task,omitempty"` + // Wire name: 'sql_task' + SqlTask *SqlTask // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey string `json:"task_key"` + // Wire name: 'task_key' + TaskKey string // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds int `json:"timeout_seconds,omitempty"` + // Wire name: 'timeout_seconds' + TimeoutSeconds int // A collection of system notification IDs to notify when runs of this task // begin or complete. The default behavior is to not send any system // notifications. - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + // Wire name: 'webhook_notifications' + WebhookNotifications *WebhookNotifications - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Task) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Task) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &taskPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := taskFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Task) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Task) MarshalJSON() ([]byte, error) { + pb, err := taskToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TaskDependency struct { // Can only be specified on condition task dependencies. The outcome of the // dependent task that must be met for this task to run. - Outcome string `json:"outcome,omitempty"` + // Wire name: 'outcome' + Outcome string // The name of the task this task depends on. - TaskKey string `json:"task_key"` + // Wire name: 'task_key' + TaskKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TaskDependency) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TaskDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &taskDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := taskDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TaskDependency) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TaskDependency) MarshalJSON() ([]byte, error) { + pb, err := taskDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TaskEmailNotifications struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + // Wire name: 'no_alert_for_skipped_runs' + NoAlertForSkippedRuns bool // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` + // Wire name: 'on_duration_warning_threshold_exceeded' + OnDurationWarningThresholdExceeded []string // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure []string `json:"on_failure,omitempty"` + // Wire name: 'on_failure' + OnFailure []string // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart []string `json:"on_start,omitempty"` + // Wire name: 'on_start' + OnStart []string // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -4895,46 +8685,85 @@ type TaskEmailNotifications struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + // Wire name: 'on_streaming_backlog_exceeded' + OnStreamingBacklogExceeded []string // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess []string `json:"on_success,omitempty"` + // Wire name: 'on_success' + OnSuccess []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TaskEmailNotifications) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TaskEmailNotifications) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &taskEmailNotificationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := taskEmailNotificationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TaskEmailNotifications) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TaskEmailNotifications) MarshalJSON() ([]byte, error) { + pb, err := taskEmailNotificationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TaskNotificationSettings struct { // If true, do not send notifications to recipients specified in `on_start` // for the retried runs and do not send notifications to recipients // specified in `on_failure` until the last retry of the run. - AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` + // Wire name: 'alert_on_last_attempt' + AlertOnLastAttempt bool // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` + // Wire name: 'no_alert_for_canceled_runs' + NoAlertForCanceledRuns bool // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + // Wire name: 'no_alert_for_skipped_runs' + NoAlertForSkippedRuns bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TaskNotificationSettings) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TaskNotificationSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &taskNotificationSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := taskNotificationSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TaskNotificationSettings) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TaskNotificationSettings) MarshalJSON() ([]byte, error) { + pb, err := taskNotificationSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The code indicates why the run was terminated. Additional codes might be @@ -4984,6 +8813,7 @@ func (s TaskNotificationSettings) MarshalJSON() ([]byte, error) { // // [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now type TerminationCodeCode string +type terminationCodeCodePb string const TerminationCodeCodeBudgetPolicyLimitExceeded TerminationCodeCode = `BUDGET_POLICY_LIMIT_EXCEEDED` @@ -5103,6 +8933,22 @@ func (f *TerminationCodeCode) Type() string { return "TerminationCodeCode" } +func terminationCodeCodeToPb(st *TerminationCodeCode) (*terminationCodeCodePb, error) { + if st == nil { + return nil, nil + } + pb := terminationCodeCodePb(*st) + return &pb, nil +} + +func terminationCodeCodeFromPb(pb *terminationCodeCodePb) (*TerminationCodeCode, error) { + if pb == nil { + return nil, nil + } + st := TerminationCodeCode(*pb) + return &st, nil +} + type TerminationDetails struct { // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed @@ -5152,10 +8998,12 @@ type TerminationDetails struct { // by the user. // // [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now - Code TerminationCodeCode `json:"code,omitempty"` + // Wire name: 'code' + Code TerminationCodeCode // A descriptive message with the termination details. This field is // unstructured and the format might change. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // * `SUCCESS`: The run terminated without any issues * `INTERNAL_ERROR`: An // error occurred in the Databricks platform. Please look at the [status // page] or contact support if the issue persists. * `CLIENT_ERROR`: The run @@ -5164,17 +9012,35 @@ type TerminationDetails struct { // issue with your cloud provider. // // [status page]: https://status.databricks.com/ - Type TerminationTypeType `json:"type,omitempty"` + // Wire name: 'type' + Type TerminationTypeType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TerminationDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TerminationDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &terminationDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := terminationDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TerminationDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TerminationDetails) MarshalJSON() ([]byte, error) { + pb, err := terminationDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // * `SUCCESS`: The run terminated without any issues * `INTERNAL_ERROR`: An @@ -5186,6 +9052,7 @@ func (s TerminationDetails) MarshalJSON() ([]byte, error) { // // [status page]: https://status.databricks.com/ type TerminationTypeType string +type terminationTypeTypePb string // The run was terminated because of an error caused by user input or the job // configuration. @@ -5224,33 +9091,97 @@ func (f *TerminationTypeType) Type() string { return "TerminationTypeType" } +func terminationTypeTypeToPb(st *TerminationTypeType) (*terminationTypeTypePb, error) { + if st == nil { + return nil, nil + } + pb := terminationTypeTypePb(*st) + return &pb, nil +} + +func terminationTypeTypeFromPb(pb *terminationTypeTypePb) (*TerminationTypeType, error) { + if pb == nil { + return nil, nil + } + st := TerminationTypeType(*pb) + return &st, nil +} + // Additional details about what triggered the run type TriggerInfo struct { // The run id of the Run Job task run - RunId int64 `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TriggerInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TriggerInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &triggerInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := triggerInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TriggerInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TriggerInfo) MarshalJSON() ([]byte, error) { + pb, err := triggerInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TriggerSettings struct { // File arrival trigger settings. - FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` + // Wire name: 'file_arrival' + FileArrival *FileArrivalTriggerConfiguration // Whether this trigger is paused or not. - PauseStatus PauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus PauseStatus // Periodic trigger settings. - Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` + // Wire name: 'periodic' + Periodic *PeriodicTriggerConfiguration // Old table trigger settings name. Deprecated in favor of `table_update`. - Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` + // Wire name: 'table' + Table *TableUpdateTriggerConfiguration - TableUpdate *TableUpdateTriggerConfiguration `json:"table_update,omitempty"` + // Wire name: 'table_update' + TableUpdate *TableUpdateTriggerConfiguration +} + +func (st *TriggerSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &triggerSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := triggerSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TriggerSettings) MarshalJSON() ([]byte, error) { + pb, err := triggerSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of trigger that fired this run. @@ -5266,6 +9197,7 @@ type TriggerSettings struct { // `CONTINUOUS_RESTART`: Indicates a run created by user to manually restart a // continuous job run. type TriggerType string +type triggerTypePb string // Indicates a run that is triggered by a file arrival. const TriggerTypeFileArrival TriggerType = `FILE_ARRIVAL` @@ -5308,13 +9240,31 @@ func (f *TriggerType) Type() string { return "TriggerType" } +func triggerTypeToPb(st *TriggerType) (*triggerTypePb, error) { + if st == nil { + return nil, nil + } + pb := triggerTypePb(*st) + return &pb, nil +} + +func triggerTypeFromPb(pb *triggerTypePb) (*TriggerType, error) { + if pb == nil { + return nil, nil + } + st := TriggerType(*pb) + return &st, nil +} + type UpdateJob struct { // Remove top-level fields in the job settings. Removing nested fields is // not supported, except for tasks and job clusters (`tasks/task_1`). This // field is optional. - FieldsToRemove []string `json:"fields_to_remove,omitempty"` + // Wire name: 'fields_to_remove' + FieldsToRemove []string // The canonical identifier of the job to update. This field is required. - JobId int64 `json:"job_id"` + // Wire name: 'job_id' + JobId int64 // The new settings for the job. // // Top-level fields specified in `new_settings` are completely replaced, @@ -5326,35 +9276,107 @@ type UpdateJob struct { // // Changes to the field `JobSettings.timeout_seconds` are applied to active // runs. Changes to other fields are applied to future runs only. - NewSettings *JobSettings `json:"new_settings,omitempty"` + // Wire name: 'new_settings' + NewSettings *JobSettings +} + +func (st *UpdateJob) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateJobPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateJobFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateJob) MarshalJSON() ([]byte, error) { + pb, err := updateJobToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ViewItem struct { // Content of the view. - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string // Name of the view item. In the case of code view, it would be the // notebook’s name. In the case of dashboard view, it would be the // dashboard’s name. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Type of the view item. - Type ViewType `json:"type,omitempty"` + // Wire name: 'type' + Type ViewType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ViewItem) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ViewItem) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &viewItemPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := viewItemFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ViewItem) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ViewItem) MarshalJSON() ([]byte, error) { + pb, err := viewItemToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // * `NOTEBOOK`: Notebook view item. * `DASHBOARD`: Dashboard view item. type ViewType string +type viewTypePb string // Dashboard view item. const ViewTypeDashboard ViewType = `DASHBOARD` @@ -5383,9 +9405,26 @@ func (f *ViewType) Type() string { return "ViewType" } +func viewTypeToPb(st *ViewType) (*viewTypePb, error) { + if st == nil { + return nil, nil + } + pb := viewTypePb(*st) + return &pb, nil +} + +func viewTypeFromPb(pb *viewTypePb) (*ViewType, error) { + if pb == nil { + return nil, nil + } + st := ViewType(*pb) + return &st, nil +} + // * `CODE`: Code view of the notebook. * `DASHBOARDS`: All dashboard views of // the notebook. * `ALL`: All views of the notebook. type ViewsToExport string +type viewsToExportPb string // All views of the notebook. const ViewsToExportAll ViewsToExport = `ALL` @@ -5417,8 +9456,51 @@ func (f *ViewsToExport) Type() string { return "ViewsToExport" } +func viewsToExportToPb(st *ViewsToExport) (*viewsToExportPb, error) { + if st == nil { + return nil, nil + } + pb := viewsToExportPb(*st) + return &pb, nil +} + +func viewsToExportFromPb(pb *viewsToExportPb) (*ViewsToExport, error) { + if pb == nil { + return nil, nil + } + st := ViewsToExport(*pb) + return &st, nil +} + type Webhook struct { - Id string `json:"id"` + + // Wire name: 'id' + Id string +} + +func (st *Webhook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &webhookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := webhookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Webhook) MarshalJSON() ([]byte, error) { + pb, err := webhookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WebhookNotifications struct { @@ -5426,13 +9508,16 @@ type WebhookNotifications struct { // a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` // metric in the `health` field. A maximum of 3 destinations can be // specified for the `on_duration_warning_threshold_exceeded` property. - OnDurationWarningThresholdExceeded []Webhook `json:"on_duration_warning_threshold_exceeded,omitempty"` + // Wire name: 'on_duration_warning_threshold_exceeded' + OnDurationWarningThresholdExceeded []Webhook // An optional list of system notification IDs to call when the run fails. A // maximum of 3 destinations can be specified for the `on_failure` property. - OnFailure []Webhook `json:"on_failure,omitempty"` + // Wire name: 'on_failure' + OnFailure []Webhook // An optional list of system notification IDs to call when the run starts. // A maximum of 3 destinations can be specified for the `on_start` property. - OnStart []Webhook `json:"on_start,omitempty"` + // Wire name: 'on_start' + OnStart []Webhook // An optional list of system notification IDs to call when any streaming // backlog thresholds are exceeded for any stream. Streaming backlog // thresholds can be set in the `health` field using the following metrics: @@ -5441,23 +9526,123 @@ type WebhookNotifications struct { // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. A maximum of 3 destinations // can be specified for the `on_streaming_backlog_exceeded` property. - OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"` + // Wire name: 'on_streaming_backlog_exceeded' + OnStreamingBacklogExceeded []Webhook // An optional list of system notification IDs to call when the run // completes successfully. A maximum of 3 destinations can be specified for // the `on_success` property. - OnSuccess []Webhook `json:"on_success,omitempty"` + // Wire name: 'on_success' + OnSuccess []Webhook +} + +func (st *WebhookNotifications) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &webhookNotificationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := webhookNotificationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WebhookNotifications) MarshalJSON() ([]byte, error) { + pb, err := webhookNotificationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WidgetErrorDetail struct { - Message string `json:"message,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'message' + Message string + + ForceSendFields []string `tf:"-"` +} + +func (st *WidgetErrorDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &widgetErrorDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := widgetErrorDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WidgetErrorDetail) MarshalJSON() ([]byte, error) { + pb, err := widgetErrorDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil } -func (s *WidgetErrorDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil } -func (s WidgetErrorDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/marketplace/impl.go b/service/marketplace/impl.go index 0b54a882d..eac581625 100755 --- a/service/marketplace/impl.go +++ b/service/marketplace/impl.go @@ -53,13 +53,35 @@ func (a *consumerFulfillmentsImpl) GetAll(ctx context.Context, request GetListin } func (a *consumerFulfillmentsImpl) internalGet(ctx context.Context, request GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) { - var getListingContentMetadataResponse GetListingContentMetadataResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/content", request.ListingId) + + requestPb, pbErr := getListingContentMetadataRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getListingContentMetadataResponsePb getListingContentMetadataResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/content", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingContentMetadataResponse) - return &getListingContentMetadataResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getListingContentMetadataResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getListingContentMetadataResponseFromPb(&getListingContentMetadataResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List all listing fulfillments. @@ -106,13 +128,35 @@ func (a *consumerFulfillmentsImpl) ListAll(ctx context.Context, request ListFulf } func (a *consumerFulfillmentsImpl) internalList(ctx context.Context, request ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) { - var listFulfillmentsResponse ListFulfillmentsResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/fulfillments", request.ListingId) + + requestPb, pbErr := listFulfillmentsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFulfillmentsResponsePb listFulfillmentsResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/fulfillments", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFulfillmentsResponse) - return &listFulfillmentsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFulfillmentsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFulfillmentsResponseFromPb(&listFulfillmentsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ConsumerInstallations API methods @@ -121,23 +165,63 @@ type consumerInstallationsImpl struct { } func (a *consumerInstallationsImpl) Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) { - var installation Installation - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + + requestPb, pbErr := createInstallationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var installationPb installationPb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &installation) - return &installation, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &installationPb, + ) + if err != nil { + return nil, err + } + resp, err := installationFromPb(&installationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *consumerInstallationsImpl) Delete(ctx context.Context, request DeleteInstallationRequest) error { - var deleteInstallationResponse DeleteInstallationResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + + requestPb, pbErr := deleteInstallationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteInstallationResponsePb deleteInstallationResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", requestPb.ListingId, requestPb.InstallationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteInstallationResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteInstallationResponsePb, + ) + if err != nil { + return err + } + return err } @@ -177,13 +261,35 @@ func (a *consumerInstallationsImpl) ListAll(ctx context.Context, request ListAll } func (a *consumerInstallationsImpl) internalList(ctx context.Context, request ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) { - var listAllInstallationsResponse ListAllInstallationsResponse + + requestPb, pbErr := listAllInstallationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAllInstallationsResponsePb listAllInstallationsResponsePb path := "/api/2.1/marketplace-consumer/installations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllInstallationsResponse) - return &listAllInstallationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAllInstallationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAllInstallationsResponseFromPb(&listAllInstallationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List installations for a listing. @@ -222,24 +328,68 @@ func (a *consumerInstallationsImpl) ListListingInstallationsAll(ctx context.Cont } func (a *consumerInstallationsImpl) internalListListingInstallations(ctx context.Context, request ListInstallationsRequest) (*ListInstallationsResponse, error) { - var listInstallationsResponse ListInstallationsResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + + requestPb, pbErr := listInstallationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listInstallationsResponsePb listInstallationsResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listInstallationsResponse) - return &listInstallationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listInstallationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listInstallationsResponseFromPb(&listInstallationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *consumerInstallationsImpl) Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) { - var updateInstallationResponse UpdateInstallationResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + + requestPb, pbErr := updateInstallationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateInstallationResponsePb updateInstallationResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", requestPb.ListingId, requestPb.InstallationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateInstallationResponse) - return &updateInstallationResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateInstallationResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateInstallationResponseFromPb(&updateInstallationResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ConsumerListings API methods @@ -248,23 +398,67 @@ type consumerListingsImpl struct { } func (a *consumerListingsImpl) BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) { - var batchGetListingsResponse BatchGetListingsResponse + + requestPb, pbErr := batchGetListingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var batchGetListingsResponsePb batchGetListingsResponsePb path := "/api/2.1/marketplace-consumer/listings:batchGet" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &batchGetListingsResponse) - return &batchGetListingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &batchGetListingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := batchGetListingsResponseFromPb(&batchGetListingsResponsePb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := getListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getListingResponsePb getListingResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingResponse) - return &getListingResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getListingResponseFromPb(&getListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List listings. @@ -305,13 +499,35 @@ func (a *consumerListingsImpl) ListAll(ctx context.Context, request ListListings } func (a *consumerListingsImpl) internalList(ctx context.Context, request ListListingsRequest) (*ListListingsResponse, error) { - var listListingsResponse ListListingsResponse + + requestPb, pbErr := listListingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listListingsResponsePb listListingsResponsePb path := "/api/2.1/marketplace-consumer/listings" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listListingsResponse) - return &listListingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listListingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listListingsResponseFromPb(&listListingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Search listings. @@ -354,13 +570,35 @@ func (a *consumerListingsImpl) SearchAll(ctx context.Context, request SearchList } func (a *consumerListingsImpl) internalSearch(ctx context.Context, request SearchListingsRequest) (*SearchListingsResponse, error) { - var searchListingsResponse SearchListingsResponse + + requestPb, pbErr := searchListingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchListingsResponsePb searchListingsResponsePb path := "/api/2.1/marketplace-consumer/search-listings" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchListingsResponse) - return &searchListingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &searchListingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchListingsResponseFromPb(&searchListingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ConsumerPersonalizationRequests API methods @@ -369,24 +607,68 @@ type consumerPersonalizationRequestsImpl struct { } func (a *consumerPersonalizationRequestsImpl) Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) { - var createPersonalizationRequestResponse CreatePersonalizationRequestResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + + requestPb, pbErr := createPersonalizationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createPersonalizationRequestResponsePb createPersonalizationRequestResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPersonalizationRequestResponse) - return &createPersonalizationRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createPersonalizationRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createPersonalizationRequestResponseFromPb(&createPersonalizationRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *consumerPersonalizationRequestsImpl) Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) { - var getPersonalizationRequestResponse GetPersonalizationRequestResponse - path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + + requestPb, pbErr := getPersonalizationRequestRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPersonalizationRequestResponsePb getPersonalizationRequestResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", requestPb.ListingId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPersonalizationRequestResponse) - return &getPersonalizationRequestResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPersonalizationRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPersonalizationRequestResponseFromPb(&getPersonalizationRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List all personalization requests. @@ -425,13 +707,35 @@ func (a *consumerPersonalizationRequestsImpl) ListAll(ctx context.Context, reque } func (a *consumerPersonalizationRequestsImpl) internalList(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { - var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse + + requestPb, pbErr := listAllPersonalizationRequestsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAllPersonalizationRequestsResponsePb listAllPersonalizationRequestsResponsePb path := "/api/2.1/marketplace-consumer/personalization-requests" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllPersonalizationRequestsResponse) - return &listAllPersonalizationRequestsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAllPersonalizationRequestsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAllPersonalizationRequestsResponseFromPb(&listAllPersonalizationRequestsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ConsumerProviders API methods @@ -440,23 +744,67 @@ type consumerProvidersImpl struct { } func (a *consumerProvidersImpl) BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) { - var batchGetProvidersResponse BatchGetProvidersResponse + + requestPb, pbErr := batchGetProvidersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var batchGetProvidersResponsePb batchGetProvidersResponsePb path := "/api/2.1/marketplace-consumer/providers:batchGet" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &batchGetProvidersResponse) - return &batchGetProvidersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &batchGetProvidersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := batchGetProvidersResponseFromPb(&batchGetProvidersResponsePb) + if err != nil { + return nil, err + } + + return resp, 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) + + requestPb, pbErr := getProviderRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getProviderResponsePb getProviderResponsePb + path := fmt.Sprintf("/api/2.1/marketplace-consumer/providers/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getProviderResponse) - return &getProviderResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getProviderResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getProviderResponseFromPb(&getProviderResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List providers. @@ -497,13 +845,35 @@ func (a *consumerProvidersImpl) ListAll(ctx context.Context, request ListProvide } func (a *consumerProvidersImpl) internalList(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { - var listProvidersResponse ListProvidersResponse + + requestPb, pbErr := listProvidersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listProvidersResponsePb listProvidersResponsePb path := "/api/2.1/marketplace-consumer/providers" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) - return &listProvidersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listProvidersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProvidersResponseFromPb(&listProvidersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderExchangeFilters API methods @@ -512,23 +882,63 @@ type providerExchangeFiltersImpl struct { } func (a *providerExchangeFiltersImpl) Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) { - var createExchangeFilterResponse CreateExchangeFilterResponse + + requestPb, pbErr := createExchangeFilterRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createExchangeFilterResponsePb createExchangeFilterResponsePb path := "/api/2.0/marketplace-exchange/filters" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExchangeFilterResponse) - return &createExchangeFilterResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createExchangeFilterResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createExchangeFilterResponseFromPb(&createExchangeFilterResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerExchangeFiltersImpl) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error { - var deleteExchangeFilterResponse DeleteExchangeFilterResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + + requestPb, pbErr := deleteExchangeFilterRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteExchangeFilterResponsePb deleteExchangeFilterResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeFilterResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteExchangeFilterResponsePb, + ) + if err != nil { + return err + } + return err } @@ -568,24 +978,68 @@ func (a *providerExchangeFiltersImpl) ListAll(ctx context.Context, request ListE } func (a *providerExchangeFiltersImpl) internalList(ctx context.Context, request ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) { - var listExchangeFiltersResponse ListExchangeFiltersResponse + + requestPb, pbErr := listExchangeFiltersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listExchangeFiltersResponsePb listExchangeFiltersResponsePb path := "/api/2.0/marketplace-exchange/filters" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangeFiltersResponse) - return &listExchangeFiltersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listExchangeFiltersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listExchangeFiltersResponseFromPb(&listExchangeFiltersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerExchangeFiltersImpl) Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) { - var updateExchangeFilterResponse UpdateExchangeFilterResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + + requestPb, pbErr := updateExchangeFilterRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateExchangeFilterResponsePb updateExchangeFilterResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateExchangeFilterResponse) - return &updateExchangeFilterResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateExchangeFilterResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateExchangeFilterResponseFromPb(&updateExchangeFilterResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderExchanges API methods @@ -594,55 +1048,157 @@ type providerExchangesImpl struct { } func (a *providerExchangesImpl) AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) { - var addExchangeForListingResponse AddExchangeForListingResponse + + requestPb, pbErr := addExchangeForListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var addExchangeForListingResponsePb addExchangeForListingResponsePb path := "/api/2.0/marketplace-exchange/exchanges-for-listing" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addExchangeForListingResponse) - return &addExchangeForListingResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &addExchangeForListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := addExchangeForListingResponseFromPb(&addExchangeForListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerExchangesImpl) Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) { - var createExchangeResponse CreateExchangeResponse + + requestPb, pbErr := createExchangeRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createExchangeResponsePb createExchangeResponsePb path := "/api/2.0/marketplace-exchange/exchanges" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExchangeResponse) - return &createExchangeResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createExchangeResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createExchangeResponseFromPb(&createExchangeResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerExchangesImpl) Delete(ctx context.Context, request DeleteExchangeRequest) error { - var deleteExchangeResponse DeleteExchangeResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + + requestPb, pbErr := deleteExchangeRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteExchangeResponsePb deleteExchangeResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteExchangeResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providerExchangesImpl) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error { - var removeExchangeForListingResponse RemoveExchangeForListingResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", request.Id) + + requestPb, pbErr := removeExchangeForListingRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var removeExchangeForListingResponsePb removeExchangeForListingResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &removeExchangeForListingResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &removeExchangeForListingResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providerExchangesImpl) Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) { - var getExchangeResponse GetExchangeResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + + requestPb, pbErr := getExchangeRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getExchangeResponsePb getExchangeResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExchangeResponse) - return &getExchangeResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getExchangeResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getExchangeResponseFromPb(&getExchangeResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List exchanges. @@ -681,13 +1237,35 @@ func (a *providerExchangesImpl) ListAll(ctx context.Context, request ListExchang } func (a *providerExchangesImpl) internalList(ctx context.Context, request ListExchangesRequest) (*ListExchangesResponse, error) { - var listExchangesResponse ListExchangesResponse + + requestPb, pbErr := listExchangesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listExchangesResponsePb listExchangesResponsePb path := "/api/2.0/marketplace-exchange/exchanges" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangesResponse) - return &listExchangesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listExchangesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listExchangesResponseFromPb(&listExchangesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List exchanges for listing. @@ -726,13 +1304,35 @@ func (a *providerExchangesImpl) ListExchangesForListingAll(ctx context.Context, } func (a *providerExchangesImpl) internalListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) { - var listExchangesForListingResponse ListExchangesForListingResponse + + requestPb, pbErr := listExchangesForListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listExchangesForListingResponsePb listExchangesForListingResponsePb path := "/api/2.0/marketplace-exchange/exchanges-for-listing" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangesForListingResponse) - return &listExchangesForListingResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listExchangesForListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listExchangesForListingResponseFromPb(&listExchangesForListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List listings for exchange. @@ -771,24 +1371,68 @@ func (a *providerExchangesImpl) ListListingsForExchangeAll(ctx context.Context, } func (a *providerExchangesImpl) internalListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) { - var listListingsForExchangeResponse ListListingsForExchangeResponse + + requestPb, pbErr := listListingsForExchangeRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listListingsForExchangeResponsePb listListingsForExchangeResponsePb path := "/api/2.0/marketplace-exchange/listings-for-exchange" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listListingsForExchangeResponse) - return &listListingsForExchangeResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listListingsForExchangeResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listListingsForExchangeResponseFromPb(&listListingsForExchangeResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerExchangesImpl) Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) { - var updateExchangeResponse UpdateExchangeResponse - path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + + requestPb, pbErr := updateExchangeRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateExchangeResponsePb updateExchangeResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateExchangeResponse) - return &updateExchangeResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateExchangeResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateExchangeResponseFromPb(&updateExchangeResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderFiles API methods @@ -797,34 +1441,96 @@ type providerFilesImpl struct { } func (a *providerFilesImpl) Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) { - var createFileResponse CreateFileResponse + + requestPb, pbErr := createFileRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createFileResponsePb createFileResponsePb path := "/api/2.0/marketplace-provider/files" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createFileResponse) - return &createFileResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createFileResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createFileResponseFromPb(&createFileResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerFilesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { - var deleteFileResponse DeleteFileResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + + requestPb, pbErr := deleteFileRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteFileResponsePb deleteFileResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", requestPb.FileId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteFileResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteFileResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providerFilesImpl) Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) { - var getFileResponse GetFileResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + + requestPb, pbErr := getFileRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getFileResponsePb getFileResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", requestPb.FileId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getFileResponse) - return &getFileResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getFileResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getFileResponseFromPb(&getFileResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List files. @@ -863,13 +1569,35 @@ func (a *providerFilesImpl) ListAll(ctx context.Context, request ListFilesReques } func (a *providerFilesImpl) internalList(ctx context.Context, request ListFilesRequest) (*ListFilesResponse, error) { - var listFilesResponse ListFilesResponse + + requestPb, pbErr := listFilesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFilesResponsePb listFilesResponsePb path := "/api/2.0/marketplace-provider/files" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFilesResponse) - return &listFilesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFilesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFilesResponseFromPb(&listFilesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderListings API methods @@ -878,34 +1606,96 @@ type providerListingsImpl struct { } func (a *providerListingsImpl) Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) { - var createListingResponse CreateListingResponse + + requestPb, pbErr := createListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createListingResponsePb createListingResponsePb path := "/api/2.0/marketplace-provider/listing" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createListingResponse) - return &createListingResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createListingResponseFromPb(&createListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerListingsImpl) Delete(ctx context.Context, request DeleteListingRequest) error { - var deleteListingResponse DeleteListingResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + + requestPb, pbErr := deleteListingRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteListingResponsePb deleteListingResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteListingResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteListingResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { - var getListingResponse GetListingResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + + requestPb, pbErr := getListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getListingResponsePb getListingResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingResponse) - return &getListingResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getListingResponseFromPb(&getListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List listings. @@ -944,24 +1734,68 @@ func (a *providerListingsImpl) ListAll(ctx context.Context, request GetListingsR } func (a *providerListingsImpl) internalList(ctx context.Context, request GetListingsRequest) (*GetListingsResponse, error) { - var getListingsResponse GetListingsResponse + + requestPb, pbErr := getListingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getListingsResponsePb getListingsResponsePb path := "/api/2.0/marketplace-provider/listings" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingsResponse) - return &getListingsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getListingsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getListingsResponseFromPb(&getListingsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerListingsImpl) Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) { - var updateListingResponse UpdateListingResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + + requestPb, pbErr := updateListingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateListingResponsePb updateListingResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateListingResponse) - return &updateListingResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateListingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateListingResponseFromPb(&updateListingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderPersonalizationRequests API methods @@ -1007,24 +1841,68 @@ func (a *providerPersonalizationRequestsImpl) ListAll(ctx context.Context, reque } func (a *providerPersonalizationRequestsImpl) internalList(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { - var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse + + requestPb, pbErr := listAllPersonalizationRequestsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAllPersonalizationRequestsResponsePb listAllPersonalizationRequestsResponsePb path := "/api/2.0/marketplace-provider/personalization-requests" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllPersonalizationRequestsResponse) - return &listAllPersonalizationRequestsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAllPersonalizationRequestsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAllPersonalizationRequestsResponseFromPb(&listAllPersonalizationRequestsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerPersonalizationRequestsImpl) Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) { - var updatePersonalizationRequestResponse UpdatePersonalizationRequestResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v/personalization-requests/%v/request-status", request.ListingId, request.RequestId) + + requestPb, pbErr := updatePersonalizationRequestRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updatePersonalizationRequestResponsePb updatePersonalizationRequestResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v/personalization-requests/%v/request-status", requestPb.ListingId, requestPb.RequestId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updatePersonalizationRequestResponse) - return &updatePersonalizationRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updatePersonalizationRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updatePersonalizationRequestResponseFromPb(&updatePersonalizationRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderProviderAnalyticsDashboards API methods @@ -1033,44 +1911,117 @@ type providerProviderAnalyticsDashboardsImpl struct { } func (a *providerProviderAnalyticsDashboardsImpl) Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) { - var providerAnalyticsDashboard ProviderAnalyticsDashboard + + var providerAnalyticsDashboardPb providerAnalyticsDashboardPb path := "/api/2.0/marketplace-provider/analytics_dashboard" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, nil, &providerAnalyticsDashboard) - return &providerAnalyticsDashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + nil, + nil, + &providerAnalyticsDashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := providerAnalyticsDashboardFromPb(&providerAnalyticsDashboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerProviderAnalyticsDashboardsImpl) Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) { - var listProviderAnalyticsDashboardResponse ListProviderAnalyticsDashboardResponse + + var listProviderAnalyticsDashboardResponsePb listProviderAnalyticsDashboardResponsePb path := "/api/2.0/marketplace-provider/analytics_dashboard" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listProviderAnalyticsDashboardResponse) - return &listProviderAnalyticsDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listProviderAnalyticsDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProviderAnalyticsDashboardResponseFromPb(&listProviderAnalyticsDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerProviderAnalyticsDashboardsImpl) GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) { - var getLatestVersionProviderAnalyticsDashboardResponse GetLatestVersionProviderAnalyticsDashboardResponse + + var getLatestVersionProviderAnalyticsDashboardResponsePb getLatestVersionProviderAnalyticsDashboardResponsePb path := "/api/2.0/marketplace-provider/analytics_dashboard/latest" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getLatestVersionProviderAnalyticsDashboardResponse) - return &getLatestVersionProviderAnalyticsDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getLatestVersionProviderAnalyticsDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getLatestVersionProviderAnalyticsDashboardResponseFromPb(&getLatestVersionProviderAnalyticsDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerProviderAnalyticsDashboardsImpl) Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) { - var updateProviderAnalyticsDashboardResponse UpdateProviderAnalyticsDashboardResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/analytics_dashboard/%v", request.Id) + + requestPb, pbErr := updateProviderAnalyticsDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateProviderAnalyticsDashboardResponsePb updateProviderAnalyticsDashboardResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/analytics_dashboard/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateProviderAnalyticsDashboardResponse) - return &updateProviderAnalyticsDashboardResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateProviderAnalyticsDashboardResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateProviderAnalyticsDashboardResponseFromPb(&updateProviderAnalyticsDashboardResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ProviderProviders API methods @@ -1079,34 +2030,96 @@ type providerProvidersImpl struct { } func (a *providerProvidersImpl) Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) { - var createProviderResponse CreateProviderResponse + + requestPb, pbErr := createProviderRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createProviderResponsePb createProviderResponsePb path := "/api/2.0/marketplace-provider/provider" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createProviderResponse) - return &createProviderResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createProviderResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createProviderResponseFromPb(&createProviderResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerProvidersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { - var deleteProviderResponse DeleteProviderResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + + requestPb, pbErr := deleteProviderRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteProviderResponsePb deleteProviderResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteProviderResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteProviderResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { - var getProviderResponse GetProviderResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + + requestPb, pbErr := getProviderRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getProviderResponsePb getProviderResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getProviderResponse) - return &getProviderResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getProviderResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getProviderResponseFromPb(&getProviderResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List providers. @@ -1145,22 +2158,66 @@ func (a *providerProvidersImpl) ListAll(ctx context.Context, request ListProvide } func (a *providerProvidersImpl) internalList(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { - var listProvidersResponse ListProvidersResponse + + requestPb, pbErr := listProvidersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listProvidersResponsePb listProvidersResponsePb path := "/api/2.0/marketplace-provider/providers" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) - return &listProvidersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listProvidersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProvidersResponseFromPb(&listProvidersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providerProvidersImpl) Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) { - var updateProviderResponse UpdateProviderResponse - path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + + requestPb, pbErr := updateProviderRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateProviderResponsePb updateProviderResponsePb + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateProviderResponse) - return &updateProviderResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateProviderResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateProviderResponseFromPb(&updateProviderResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/marketplace/internal.go b/service/marketplace/internal.go new file mode 100755 index 000000000..adb49814b --- /dev/null +++ b/service/marketplace/internal.go @@ -0,0 +1,4486 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package marketplace + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func addExchangeForListingRequestToPb(st *AddExchangeForListingRequest) (*addExchangeForListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &addExchangeForListingRequestPb{} + pb.ExchangeId = st.ExchangeId + + pb.ListingId = st.ListingId + + return pb, nil +} + +type addExchangeForListingRequestPb struct { + ExchangeId string `json:"exchange_id"` + + ListingId string `json:"listing_id"` +} + +func addExchangeForListingRequestFromPb(pb *addExchangeForListingRequestPb) (*AddExchangeForListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &AddExchangeForListingRequest{} + st.ExchangeId = pb.ExchangeId + st.ListingId = pb.ListingId + + return st, nil +} + +func addExchangeForListingResponseToPb(st *AddExchangeForListingResponse) (*addExchangeForListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &addExchangeForListingResponsePb{} + pb.ExchangeForListing = st.ExchangeForListing + + return pb, nil +} + +type addExchangeForListingResponsePb struct { + ExchangeForListing *ExchangeListing `json:"exchange_for_listing,omitempty"` +} + +func addExchangeForListingResponseFromPb(pb *addExchangeForListingResponsePb) (*AddExchangeForListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &AddExchangeForListingResponse{} + st.ExchangeForListing = pb.ExchangeForListing + + return st, nil +} + +func batchGetListingsRequestToPb(st *BatchGetListingsRequest) (*batchGetListingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &batchGetListingsRequestPb{} + pb.Ids = st.Ids + + return pb, nil +} + +type batchGetListingsRequestPb struct { + Ids []string `json:"-" url:"ids,omitempty"` +} + +func batchGetListingsRequestFromPb(pb *batchGetListingsRequestPb) (*BatchGetListingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &BatchGetListingsRequest{} + st.Ids = pb.Ids + + return st, nil +} + +func batchGetListingsResponseToPb(st *BatchGetListingsResponse) (*batchGetListingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &batchGetListingsResponsePb{} + pb.Listings = st.Listings + + return pb, nil +} + +type batchGetListingsResponsePb struct { + Listings []Listing `json:"listings,omitempty"` +} + +func batchGetListingsResponseFromPb(pb *batchGetListingsResponsePb) (*BatchGetListingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &BatchGetListingsResponse{} + st.Listings = pb.Listings + + return st, nil +} + +func batchGetProvidersRequestToPb(st *BatchGetProvidersRequest) (*batchGetProvidersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &batchGetProvidersRequestPb{} + pb.Ids = st.Ids + + return pb, nil +} + +type batchGetProvidersRequestPb struct { + Ids []string `json:"-" url:"ids,omitempty"` +} + +func batchGetProvidersRequestFromPb(pb *batchGetProvidersRequestPb) (*BatchGetProvidersRequest, error) { + if pb == nil { + return nil, nil + } + st := &BatchGetProvidersRequest{} + st.Ids = pb.Ids + + return st, nil +} + +func batchGetProvidersResponseToPb(st *BatchGetProvidersResponse) (*batchGetProvidersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &batchGetProvidersResponsePb{} + pb.Providers = st.Providers + + return pb, nil +} + +type batchGetProvidersResponsePb struct { + Providers []ProviderInfo `json:"providers,omitempty"` +} + +func batchGetProvidersResponseFromPb(pb *batchGetProvidersResponsePb) (*BatchGetProvidersResponse, error) { + if pb == nil { + return nil, nil + } + st := &BatchGetProvidersResponse{} + st.Providers = pb.Providers + + return st, nil +} + +func consumerTermsToPb(st *ConsumerTerms) (*consumerTermsPb, error) { + if st == nil { + return nil, nil + } + pb := &consumerTermsPb{} + pb.Version = st.Version + + return pb, nil +} + +type consumerTermsPb struct { + Version string `json:"version"` +} + +func consumerTermsFromPb(pb *consumerTermsPb) (*ConsumerTerms, error) { + if pb == nil { + return nil, nil + } + st := &ConsumerTerms{} + st.Version = pb.Version + + return st, nil +} + +func contactInfoToPb(st *ContactInfo) (*contactInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &contactInfoPb{} + pb.Company = st.Company + + pb.Email = st.Email + + pb.FirstName = st.FirstName + + pb.LastName = st.LastName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type contactInfoPb struct { + Company string `json:"company,omitempty"` + + Email string `json:"email,omitempty"` + + FirstName string `json:"first_name,omitempty"` + + LastName string `json:"last_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func contactInfoFromPb(pb *contactInfoPb) (*ContactInfo, error) { + if pb == nil { + return nil, nil + } + st := &ContactInfo{} + st.Company = pb.Company + st.Email = pb.Email + st.FirstName = pb.FirstName + st.LastName = pb.LastName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *contactInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st contactInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createExchangeFilterRequestToPb(st *CreateExchangeFilterRequest) (*createExchangeFilterRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createExchangeFilterRequestPb{} + pb.Filter = st.Filter + + return pb, nil +} + +type createExchangeFilterRequestPb struct { + Filter ExchangeFilter `json:"filter"` +} + +func createExchangeFilterRequestFromPb(pb *createExchangeFilterRequestPb) (*CreateExchangeFilterRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateExchangeFilterRequest{} + st.Filter = pb.Filter + + return st, nil +} + +func createExchangeFilterResponseToPb(st *CreateExchangeFilterResponse) (*createExchangeFilterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createExchangeFilterResponsePb{} + pb.FilterId = st.FilterId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createExchangeFilterResponsePb struct { + FilterId string `json:"filter_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createExchangeFilterResponseFromPb(pb *createExchangeFilterResponsePb) (*CreateExchangeFilterResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateExchangeFilterResponse{} + st.FilterId = pb.FilterId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createExchangeFilterResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createExchangeFilterResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createExchangeRequestToPb(st *CreateExchangeRequest) (*createExchangeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createExchangeRequestPb{} + pb.Exchange = st.Exchange + + return pb, nil +} + +type createExchangeRequestPb struct { + Exchange Exchange `json:"exchange"` +} + +func createExchangeRequestFromPb(pb *createExchangeRequestPb) (*CreateExchangeRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateExchangeRequest{} + st.Exchange = pb.Exchange + + return st, nil +} + +func createExchangeResponseToPb(st *CreateExchangeResponse) (*createExchangeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createExchangeResponsePb{} + pb.ExchangeId = st.ExchangeId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createExchangeResponsePb struct { + ExchangeId string `json:"exchange_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createExchangeResponseFromPb(pb *createExchangeResponsePb) (*CreateExchangeResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateExchangeResponse{} + st.ExchangeId = pb.ExchangeId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createExchangeResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createExchangeResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createFileRequestToPb(st *CreateFileRequest) (*createFileRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createFileRequestPb{} + pb.DisplayName = st.DisplayName + + pb.FileParent = st.FileParent + + pb.MarketplaceFileType = st.MarketplaceFileType + + pb.MimeType = st.MimeType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createFileRequestPb struct { + DisplayName string `json:"display_name,omitempty"` + + FileParent FileParent `json:"file_parent"` + + MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type"` + + MimeType string `json:"mime_type"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createFileRequestFromPb(pb *createFileRequestPb) (*CreateFileRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateFileRequest{} + st.DisplayName = pb.DisplayName + st.FileParent = pb.FileParent + st.MarketplaceFileType = pb.MarketplaceFileType + st.MimeType = pb.MimeType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createFileRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createFileRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createFileResponseToPb(st *CreateFileResponse) (*createFileResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createFileResponsePb{} + pb.FileInfo = st.FileInfo + + pb.UploadUrl = st.UploadUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createFileResponsePb struct { + FileInfo *FileInfo `json:"file_info,omitempty"` + + UploadUrl string `json:"upload_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createFileResponseFromPb(pb *createFileResponsePb) (*CreateFileResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateFileResponse{} + st.FileInfo = pb.FileInfo + st.UploadUrl = pb.UploadUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createFileResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createFileResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createInstallationRequestToPb(st *CreateInstallationRequest) (*createInstallationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createInstallationRequestPb{} + pb.AcceptedConsumerTerms = st.AcceptedConsumerTerms + + pb.CatalogName = st.CatalogName + + pb.ListingId = st.ListingId + + pb.RecipientType = st.RecipientType + + pb.RepoDetail = st.RepoDetail + + pb.ShareName = st.ShareName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createInstallationRequestPb struct { + AcceptedConsumerTerms *ConsumerTerms `json:"accepted_consumer_terms,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + ListingId string `json:"-" url:"-"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + RepoDetail *RepoInstallation `json:"repo_detail,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createInstallationRequestFromPb(pb *createInstallationRequestPb) (*CreateInstallationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateInstallationRequest{} + st.AcceptedConsumerTerms = pb.AcceptedConsumerTerms + st.CatalogName = pb.CatalogName + st.ListingId = pb.ListingId + st.RecipientType = pb.RecipientType + st.RepoDetail = pb.RepoDetail + st.ShareName = pb.ShareName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createInstallationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createInstallationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createListingRequestToPb(st *CreateListingRequest) (*createListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createListingRequestPb{} + pb.Listing = st.Listing + + return pb, nil +} + +type createListingRequestPb struct { + Listing Listing `json:"listing"` +} + +func createListingRequestFromPb(pb *createListingRequestPb) (*CreateListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateListingRequest{} + st.Listing = pb.Listing + + return st, nil +} + +func createListingResponseToPb(st *CreateListingResponse) (*createListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createListingResponsePb{} + pb.ListingId = st.ListingId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createListingResponsePb struct { + ListingId string `json:"listing_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createListingResponseFromPb(pb *createListingResponsePb) (*CreateListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateListingResponse{} + st.ListingId = pb.ListingId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createListingResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createListingResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPersonalizationRequestToPb(st *CreatePersonalizationRequest) (*createPersonalizationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createPersonalizationRequestPb{} + pb.AcceptedConsumerTerms = st.AcceptedConsumerTerms + + pb.Comment = st.Comment + + pb.Company = st.Company + + pb.FirstName = st.FirstName + + pb.IntendedUse = st.IntendedUse + + pb.IsFromLighthouse = st.IsFromLighthouse + + pb.LastName = st.LastName + + pb.ListingId = st.ListingId + + pb.RecipientType = st.RecipientType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPersonalizationRequestPb struct { + AcceptedConsumerTerms ConsumerTerms `json:"accepted_consumer_terms"` + + Comment string `json:"comment,omitempty"` + + Company string `json:"company,omitempty"` + + FirstName string `json:"first_name,omitempty"` + + IntendedUse string `json:"intended_use"` + + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + + LastName string `json:"last_name,omitempty"` + + ListingId string `json:"-" url:"-"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPersonalizationRequestFromPb(pb *createPersonalizationRequestPb) (*CreatePersonalizationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreatePersonalizationRequest{} + st.AcceptedConsumerTerms = pb.AcceptedConsumerTerms + st.Comment = pb.Comment + st.Company = pb.Company + st.FirstName = pb.FirstName + st.IntendedUse = pb.IntendedUse + st.IsFromLighthouse = pb.IsFromLighthouse + st.LastName = pb.LastName + st.ListingId = pb.ListingId + st.RecipientType = pb.RecipientType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPersonalizationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPersonalizationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPersonalizationRequestResponseToPb(st *CreatePersonalizationRequestResponse) (*createPersonalizationRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createPersonalizationRequestResponsePb{} + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPersonalizationRequestResponsePb struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPersonalizationRequestResponseFromPb(pb *createPersonalizationRequestResponsePb) (*CreatePersonalizationRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreatePersonalizationRequestResponse{} + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPersonalizationRequestResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPersonalizationRequestResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createProviderRequestToPb(st *CreateProviderRequest) (*createProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createProviderRequestPb{} + pb.Provider = st.Provider + + return pb, nil +} + +type createProviderRequestPb struct { + Provider ProviderInfo `json:"provider"` +} + +func createProviderRequestFromPb(pb *createProviderRequestPb) (*CreateProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateProviderRequest{} + st.Provider = pb.Provider + + return st, nil +} + +func createProviderResponseToPb(st *CreateProviderResponse) (*createProviderResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createProviderResponsePb{} + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createProviderResponsePb struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createProviderResponseFromPb(pb *createProviderResponsePb) (*CreateProviderResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateProviderResponse{} + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createProviderResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createProviderResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dataRefreshInfoToPb(st *DataRefreshInfo) (*dataRefreshInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &dataRefreshInfoPb{} + pb.Interval = st.Interval + + pb.Unit = st.Unit + + return pb, nil +} + +type dataRefreshInfoPb struct { + Interval int64 `json:"interval"` + + Unit DataRefresh `json:"unit"` +} + +func dataRefreshInfoFromPb(pb *dataRefreshInfoPb) (*DataRefreshInfo, error) { + if pb == nil { + return nil, nil + } + st := &DataRefreshInfo{} + st.Interval = pb.Interval + st.Unit = pb.Unit + + return st, nil +} + +func deleteExchangeFilterRequestToPb(st *DeleteExchangeFilterRequest) (*deleteExchangeFilterRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExchangeFilterRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteExchangeFilterRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteExchangeFilterRequestFromPb(pb *deleteExchangeFilterRequestPb) (*DeleteExchangeFilterRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExchangeFilterRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteExchangeFilterResponseToPb(st *DeleteExchangeFilterResponse) (*deleteExchangeFilterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExchangeFilterResponsePb{} + + return pb, nil +} + +type deleteExchangeFilterResponsePb struct { +} + +func deleteExchangeFilterResponseFromPb(pb *deleteExchangeFilterResponsePb) (*DeleteExchangeFilterResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExchangeFilterResponse{} + + return st, nil +} + +func deleteExchangeRequestToPb(st *DeleteExchangeRequest) (*deleteExchangeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExchangeRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteExchangeRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteExchangeRequestFromPb(pb *deleteExchangeRequestPb) (*DeleteExchangeRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExchangeRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteExchangeResponseToPb(st *DeleteExchangeResponse) (*deleteExchangeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExchangeResponsePb{} + + return pb, nil +} + +type deleteExchangeResponsePb struct { +} + +func deleteExchangeResponseFromPb(pb *deleteExchangeResponsePb) (*DeleteExchangeResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExchangeResponse{} + + return st, nil +} + +func deleteFileRequestToPb(st *DeleteFileRequest) (*deleteFileRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteFileRequestPb{} + pb.FileId = st.FileId + + return pb, nil +} + +type deleteFileRequestPb struct { + FileId string `json:"-" url:"-"` +} + +func deleteFileRequestFromPb(pb *deleteFileRequestPb) (*DeleteFileRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteFileRequest{} + st.FileId = pb.FileId + + return st, nil +} + +func deleteFileResponseToPb(st *DeleteFileResponse) (*deleteFileResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteFileResponsePb{} + + return pb, nil +} + +type deleteFileResponsePb struct { +} + +func deleteFileResponseFromPb(pb *deleteFileResponsePb) (*DeleteFileResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteFileResponse{} + + return st, nil +} + +func deleteInstallationRequestToPb(st *DeleteInstallationRequest) (*deleteInstallationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteInstallationRequestPb{} + pb.InstallationId = st.InstallationId + + pb.ListingId = st.ListingId + + return pb, nil +} + +type deleteInstallationRequestPb struct { + InstallationId string `json:"-" url:"-"` + + ListingId string `json:"-" url:"-"` +} + +func deleteInstallationRequestFromPb(pb *deleteInstallationRequestPb) (*DeleteInstallationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteInstallationRequest{} + st.InstallationId = pb.InstallationId + st.ListingId = pb.ListingId + + return st, nil +} + +func deleteInstallationResponseToPb(st *DeleteInstallationResponse) (*deleteInstallationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteInstallationResponsePb{} + + return pb, nil +} + +type deleteInstallationResponsePb struct { +} + +func deleteInstallationResponseFromPb(pb *deleteInstallationResponsePb) (*DeleteInstallationResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteInstallationResponse{} + + return st, nil +} + +func deleteListingRequestToPb(st *DeleteListingRequest) (*deleteListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteListingRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteListingRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteListingRequestFromPb(pb *deleteListingRequestPb) (*DeleteListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteListingRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteListingResponseToPb(st *DeleteListingResponse) (*deleteListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteListingResponsePb{} + + return pb, nil +} + +type deleteListingResponsePb struct { +} + +func deleteListingResponseFromPb(pb *deleteListingResponsePb) (*DeleteListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteListingResponse{} + + return st, nil +} + +func deleteProviderRequestToPb(st *DeleteProviderRequest) (*deleteProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteProviderRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteProviderRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteProviderRequestFromPb(pb *deleteProviderRequestPb) (*DeleteProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteProviderRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteProviderResponseToPb(st *DeleteProviderResponse) (*deleteProviderResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteProviderResponsePb{} + + return pb, nil +} + +type deleteProviderResponsePb struct { +} + +func deleteProviderResponseFromPb(pb *deleteProviderResponsePb) (*DeleteProviderResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteProviderResponse{} + + return st, nil +} + +func exchangeToPb(st *Exchange) (*exchangePb, error) { + if st == nil { + return nil, nil + } + pb := &exchangePb{} + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Filters = st.Filters + + pb.Id = st.Id + + pb.LinkedListings = st.LinkedListings + + pb.Name = st.Name + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type exchangePb struct { + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Filters []ExchangeFilter `json:"filters,omitempty"` + + Id string `json:"id,omitempty"` + + LinkedListings []ExchangeListing `json:"linked_listings,omitempty"` + + Name string `json:"name"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func exchangeFromPb(pb *exchangePb) (*Exchange, error) { + if pb == nil { + return nil, nil + } + st := &Exchange{} + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Filters = pb.Filters + st.Id = pb.Id + st.LinkedListings = pb.LinkedListings + st.Name = pb.Name + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *exchangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st exchangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func exchangeFilterToPb(st *ExchangeFilter) (*exchangeFilterPb, error) { + if st == nil { + return nil, nil + } + pb := &exchangeFilterPb{} + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.ExchangeId = st.ExchangeId + + pb.FilterType = st.FilterType + + pb.FilterValue = st.FilterValue + + pb.Id = st.Id + + pb.Name = st.Name + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type exchangeFilterPb struct { + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExchangeId string `json:"exchange_id"` + + FilterType ExchangeFilterType `json:"filter_type"` + + FilterValue string `json:"filter_value"` + + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func exchangeFilterFromPb(pb *exchangeFilterPb) (*ExchangeFilter, error) { + if pb == nil { + return nil, nil + } + st := &ExchangeFilter{} + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.ExchangeId = pb.ExchangeId + st.FilterType = pb.FilterType + st.FilterValue = pb.FilterValue + st.Id = pb.Id + st.Name = pb.Name + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *exchangeFilterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st exchangeFilterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func exchangeListingToPb(st *ExchangeListing) (*exchangeListingPb, error) { + if st == nil { + return nil, nil + } + pb := &exchangeListingPb{} + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.ExchangeId = st.ExchangeId + + pb.ExchangeName = st.ExchangeName + + pb.Id = st.Id + + pb.ListingId = st.ListingId + + pb.ListingName = st.ListingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type exchangeListingPb struct { + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExchangeId string `json:"exchange_id,omitempty"` + + ExchangeName string `json:"exchange_name,omitempty"` + + Id string `json:"id,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func exchangeListingFromPb(pb *exchangeListingPb) (*ExchangeListing, error) { + if pb == nil { + return nil, nil + } + st := &ExchangeListing{} + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.ExchangeId = pb.ExchangeId + st.ExchangeName = pb.ExchangeName + st.Id = pb.Id + st.ListingId = pb.ListingId + st.ListingName = pb.ListingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *exchangeListingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st exchangeListingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &fileInfoPb{} + pb.CreatedAt = st.CreatedAt + + pb.DisplayName = st.DisplayName + + pb.DownloadLink = st.DownloadLink + + pb.FileParent = st.FileParent + + pb.Id = st.Id + + pb.MarketplaceFileType = st.MarketplaceFileType + + pb.MimeType = st.MimeType + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.UpdatedAt = st.UpdatedAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileInfoPb struct { + CreatedAt int64 `json:"created_at,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + DownloadLink string `json:"download_link,omitempty"` + + FileParent *FileParent `json:"file_parent,omitempty"` + + Id string `json:"id,omitempty"` + + MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` + + MimeType string `json:"mime_type,omitempty"` + + Status FileStatus `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileInfoFromPb(pb *fileInfoPb) (*FileInfo, error) { + if pb == nil { + return nil, nil + } + st := &FileInfo{} + st.CreatedAt = pb.CreatedAt + st.DisplayName = pb.DisplayName + st.DownloadLink = pb.DownloadLink + st.FileParent = pb.FileParent + st.Id = pb.Id + st.MarketplaceFileType = pb.MarketplaceFileType + st.MimeType = pb.MimeType + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + st.UpdatedAt = pb.UpdatedAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileParentToPb(st *FileParent) (*fileParentPb, error) { + if st == nil { + return nil, nil + } + pb := &fileParentPb{} + pb.FileParentType = st.FileParentType + + pb.ParentId = st.ParentId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileParentPb struct { + FileParentType FileParentType `json:"file_parent_type,omitempty"` + + ParentId string `json:"parent_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileParentFromPb(pb *fileParentPb) (*FileParent, error) { + if pb == nil { + return nil, nil + } + st := &FileParent{} + st.FileParentType = pb.FileParentType + st.ParentId = pb.ParentId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileParentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileParentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getExchangeRequestToPb(st *GetExchangeRequest) (*getExchangeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getExchangeRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getExchangeRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getExchangeRequestFromPb(pb *getExchangeRequestPb) (*GetExchangeRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetExchangeRequest{} + st.Id = pb.Id + + return st, nil +} + +func getExchangeResponseToPb(st *GetExchangeResponse) (*getExchangeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getExchangeResponsePb{} + pb.Exchange = st.Exchange + + return pb, nil +} + +type getExchangeResponsePb struct { + Exchange *Exchange `json:"exchange,omitempty"` +} + +func getExchangeResponseFromPb(pb *getExchangeResponsePb) (*GetExchangeResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetExchangeResponse{} + st.Exchange = pb.Exchange + + return st, nil +} + +func getFileRequestToPb(st *GetFileRequest) (*getFileRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getFileRequestPb{} + pb.FileId = st.FileId + + return pb, nil +} + +type getFileRequestPb struct { + FileId string `json:"-" url:"-"` +} + +func getFileRequestFromPb(pb *getFileRequestPb) (*GetFileRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetFileRequest{} + st.FileId = pb.FileId + + return st, nil +} + +func getFileResponseToPb(st *GetFileResponse) (*getFileResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getFileResponsePb{} + pb.FileInfo = st.FileInfo + + return pb, nil +} + +type getFileResponsePb struct { + FileInfo *FileInfo `json:"file_info,omitempty"` +} + +func getFileResponseFromPb(pb *getFileResponsePb) (*GetFileResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetFileResponse{} + st.FileInfo = pb.FileInfo + + return st, nil +} + +func getLatestVersionProviderAnalyticsDashboardResponseToPb(st *GetLatestVersionProviderAnalyticsDashboardResponse) (*getLatestVersionProviderAnalyticsDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getLatestVersionProviderAnalyticsDashboardResponsePb{} + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getLatestVersionProviderAnalyticsDashboardResponsePb struct { + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getLatestVersionProviderAnalyticsDashboardResponseFromPb(pb *getLatestVersionProviderAnalyticsDashboardResponsePb) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetLatestVersionProviderAnalyticsDashboardResponse{} + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getLatestVersionProviderAnalyticsDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getLatestVersionProviderAnalyticsDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getListingContentMetadataRequestToPb(st *GetListingContentMetadataRequest) (*getListingContentMetadataRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getListingContentMetadataRequestPb{} + pb.ListingId = st.ListingId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getListingContentMetadataRequestPb struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getListingContentMetadataRequestFromPb(pb *getListingContentMetadataRequestPb) (*GetListingContentMetadataRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetListingContentMetadataRequest{} + st.ListingId = pb.ListingId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getListingContentMetadataRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getListingContentMetadataRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getListingContentMetadataResponseToPb(st *GetListingContentMetadataResponse) (*getListingContentMetadataResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getListingContentMetadataResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.SharedDataObjects = st.SharedDataObjects + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getListingContentMetadataResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + SharedDataObjects []SharedDataObject `json:"shared_data_objects,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getListingContentMetadataResponseFromPb(pb *getListingContentMetadataResponsePb) (*GetListingContentMetadataResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetListingContentMetadataResponse{} + st.NextPageToken = pb.NextPageToken + st.SharedDataObjects = pb.SharedDataObjects + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getListingContentMetadataResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getListingContentMetadataResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getListingRequestToPb(st *GetListingRequest) (*getListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getListingRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getListingRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getListingRequestFromPb(pb *getListingRequestPb) (*GetListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetListingRequest{} + st.Id = pb.Id + + return st, nil +} + +func getListingResponseToPb(st *GetListingResponse) (*getListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getListingResponsePb{} + pb.Listing = st.Listing + + return pb, nil +} + +type getListingResponsePb struct { + Listing *Listing `json:"listing,omitempty"` +} + +func getListingResponseFromPb(pb *getListingResponsePb) (*GetListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetListingResponse{} + st.Listing = pb.Listing + + return st, nil +} + +func getListingsRequestToPb(st *GetListingsRequest) (*getListingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getListingsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getListingsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getListingsRequestFromPb(pb *getListingsRequestPb) (*GetListingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetListingsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getListingsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getListingsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getListingsResponseToPb(st *GetListingsResponse) (*getListingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getListingsResponsePb{} + pb.Listings = st.Listings + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getListingsResponsePb struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getListingsResponseFromPb(pb *getListingsResponsePb) (*GetListingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetListingsResponse{} + st.Listings = pb.Listings + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getListingsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getListingsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPersonalizationRequestRequestToPb(st *GetPersonalizationRequestRequest) (*getPersonalizationRequestRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPersonalizationRequestRequestPb{} + pb.ListingId = st.ListingId + + return pb, nil +} + +type getPersonalizationRequestRequestPb struct { + ListingId string `json:"-" url:"-"` +} + +func getPersonalizationRequestRequestFromPb(pb *getPersonalizationRequestRequestPb) (*GetPersonalizationRequestRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPersonalizationRequestRequest{} + st.ListingId = pb.ListingId + + return st, nil +} + +func getPersonalizationRequestResponseToPb(st *GetPersonalizationRequestResponse) (*getPersonalizationRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPersonalizationRequestResponsePb{} + pb.PersonalizationRequests = st.PersonalizationRequests + + return pb, nil +} + +type getPersonalizationRequestResponsePb struct { + PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` +} + +func getPersonalizationRequestResponseFromPb(pb *getPersonalizationRequestResponsePb) (*GetPersonalizationRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPersonalizationRequestResponse{} + st.PersonalizationRequests = pb.PersonalizationRequests + + return st, nil +} + +func getProviderRequestToPb(st *GetProviderRequest) (*getProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getProviderRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getProviderRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getProviderRequestFromPb(pb *getProviderRequestPb) (*GetProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetProviderRequest{} + st.Id = pb.Id + + return st, nil +} + +func getProviderResponseToPb(st *GetProviderResponse) (*getProviderResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getProviderResponsePb{} + pb.Provider = st.Provider + + return pb, nil +} + +type getProviderResponsePb struct { + Provider *ProviderInfo `json:"provider,omitempty"` +} + +func getProviderResponseFromPb(pb *getProviderResponsePb) (*GetProviderResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetProviderResponse{} + st.Provider = pb.Provider + + return st, nil +} + +func installationToPb(st *Installation) (*installationPb, error) { + if st == nil { + return nil, nil + } + pb := &installationPb{} + pb.Installation = st.Installation + + return pb, nil +} + +type installationPb struct { + Installation *InstallationDetail `json:"installation,omitempty"` +} + +func installationFromPb(pb *installationPb) (*Installation, error) { + if pb == nil { + return nil, nil + } + st := &Installation{} + st.Installation = pb.Installation + + return st, nil +} + +func installationDetailToPb(st *InstallationDetail) (*installationDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &installationDetailPb{} + pb.CatalogName = st.CatalogName + + pb.ErrorMessage = st.ErrorMessage + + pb.Id = st.Id + + pb.InstalledOn = st.InstalledOn + + pb.ListingId = st.ListingId + + pb.ListingName = st.ListingName + + pb.RecipientType = st.RecipientType + + pb.RepoName = st.RepoName + + pb.RepoPath = st.RepoPath + + pb.ShareName = st.ShareName + + pb.Status = st.Status + + pb.TokenDetail = st.TokenDetail + + pb.Tokens = st.Tokens + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type installationDetailPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + ErrorMessage string `json:"error_message,omitempty"` + + Id string `json:"id,omitempty"` + + InstalledOn int64 `json:"installed_on,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + RepoName string `json:"repo_name,omitempty"` + + RepoPath string `json:"repo_path,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + Status InstallationStatus `json:"status,omitempty"` + + TokenDetail *TokenDetail `json:"token_detail,omitempty"` + + Tokens []TokenInfo `json:"tokens,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func installationDetailFromPb(pb *installationDetailPb) (*InstallationDetail, error) { + if pb == nil { + return nil, nil + } + st := &InstallationDetail{} + st.CatalogName = pb.CatalogName + st.ErrorMessage = pb.ErrorMessage + st.Id = pb.Id + st.InstalledOn = pb.InstalledOn + st.ListingId = pb.ListingId + st.ListingName = pb.ListingName + st.RecipientType = pb.RecipientType + st.RepoName = pb.RepoName + st.RepoPath = pb.RepoPath + st.ShareName = pb.ShareName + st.Status = pb.Status + st.TokenDetail = pb.TokenDetail + st.Tokens = pb.Tokens + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *installationDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st installationDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAllInstallationsRequestToPb(st *ListAllInstallationsRequest) (*listAllInstallationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAllInstallationsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAllInstallationsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAllInstallationsRequestFromPb(pb *listAllInstallationsRequestPb) (*ListAllInstallationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAllInstallationsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAllInstallationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAllInstallationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAllInstallationsResponseToPb(st *ListAllInstallationsResponse) (*listAllInstallationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAllInstallationsResponsePb{} + pb.Installations = st.Installations + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAllInstallationsResponsePb struct { + Installations []InstallationDetail `json:"installations,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAllInstallationsResponseFromPb(pb *listAllInstallationsResponsePb) (*ListAllInstallationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAllInstallationsResponse{} + st.Installations = pb.Installations + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAllInstallationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAllInstallationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAllPersonalizationRequestsRequestToPb(st *ListAllPersonalizationRequestsRequest) (*listAllPersonalizationRequestsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAllPersonalizationRequestsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAllPersonalizationRequestsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAllPersonalizationRequestsRequestFromPb(pb *listAllPersonalizationRequestsRequestPb) (*ListAllPersonalizationRequestsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAllPersonalizationRequestsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAllPersonalizationRequestsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAllPersonalizationRequestsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAllPersonalizationRequestsResponseToPb(st *ListAllPersonalizationRequestsResponse) (*listAllPersonalizationRequestsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAllPersonalizationRequestsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.PersonalizationRequests = st.PersonalizationRequests + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAllPersonalizationRequestsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAllPersonalizationRequestsResponseFromPb(pb *listAllPersonalizationRequestsResponsePb) (*ListAllPersonalizationRequestsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAllPersonalizationRequestsResponse{} + st.NextPageToken = pb.NextPageToken + st.PersonalizationRequests = pb.PersonalizationRequests + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAllPersonalizationRequestsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAllPersonalizationRequestsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangeFiltersRequestToPb(st *ListExchangeFiltersRequest) (*listExchangeFiltersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangeFiltersRequestPb{} + pb.ExchangeId = st.ExchangeId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangeFiltersRequestPb struct { + ExchangeId string `json:"-" url:"exchange_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangeFiltersRequestFromPb(pb *listExchangeFiltersRequestPb) (*ListExchangeFiltersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangeFiltersRequest{} + st.ExchangeId = pb.ExchangeId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangeFiltersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangeFiltersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangeFiltersResponseToPb(st *ListExchangeFiltersResponse) (*listExchangeFiltersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangeFiltersResponsePb{} + pb.Filters = st.Filters + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangeFiltersResponsePb struct { + Filters []ExchangeFilter `json:"filters,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangeFiltersResponseFromPb(pb *listExchangeFiltersResponsePb) (*ListExchangeFiltersResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangeFiltersResponse{} + st.Filters = pb.Filters + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangeFiltersResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangeFiltersResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangesForListingRequestToPb(st *ListExchangesForListingRequest) (*listExchangesForListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangesForListingRequestPb{} + pb.ListingId = st.ListingId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangesForListingRequestPb struct { + ListingId string `json:"-" url:"listing_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangesForListingRequestFromPb(pb *listExchangesForListingRequestPb) (*ListExchangesForListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangesForListingRequest{} + st.ListingId = pb.ListingId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangesForListingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangesForListingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangesForListingResponseToPb(st *ListExchangesForListingResponse) (*listExchangesForListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangesForListingResponsePb{} + pb.ExchangeListing = st.ExchangeListing + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangesForListingResponsePb struct { + ExchangeListing []ExchangeListing `json:"exchange_listing,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangesForListingResponseFromPb(pb *listExchangesForListingResponsePb) (*ListExchangesForListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangesForListingResponse{} + st.ExchangeListing = pb.ExchangeListing + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangesForListingResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangesForListingResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangesRequestToPb(st *ListExchangesRequest) (*listExchangesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangesRequestFromPb(pb *listExchangesRequestPb) (*ListExchangesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExchangesResponseToPb(st *ListExchangesResponse) (*listExchangesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listExchangesResponsePb{} + pb.Exchanges = st.Exchanges + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExchangesResponsePb struct { + Exchanges []Exchange `json:"exchanges,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExchangesResponseFromPb(pb *listExchangesResponsePb) (*ListExchangesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListExchangesResponse{} + st.Exchanges = pb.Exchanges + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExchangesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExchangesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFilesRequestToPb(st *ListFilesRequest) (*listFilesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listFilesRequestPb{} + pb.FileParent = st.FileParent + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFilesRequestPb struct { + FileParent FileParent `json:"-" url:"file_parent"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFilesRequestFromPb(pb *listFilesRequestPb) (*ListFilesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListFilesRequest{} + st.FileParent = pb.FileParent + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFilesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFilesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFilesResponseToPb(st *ListFilesResponse) (*listFilesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listFilesResponsePb{} + pb.FileInfos = st.FileInfos + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFilesResponsePb struct { + FileInfos []FileInfo `json:"file_infos,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFilesResponseFromPb(pb *listFilesResponsePb) (*ListFilesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListFilesResponse{} + st.FileInfos = pb.FileInfos + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFilesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFilesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFulfillmentsRequestToPb(st *ListFulfillmentsRequest) (*listFulfillmentsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listFulfillmentsRequestPb{} + pb.ListingId = st.ListingId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFulfillmentsRequestPb struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFulfillmentsRequestFromPb(pb *listFulfillmentsRequestPb) (*ListFulfillmentsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListFulfillmentsRequest{} + st.ListingId = pb.ListingId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFulfillmentsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFulfillmentsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFulfillmentsResponseToPb(st *ListFulfillmentsResponse) (*listFulfillmentsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listFulfillmentsResponsePb{} + pb.Fulfillments = st.Fulfillments + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFulfillmentsResponsePb struct { + Fulfillments []ListingFulfillment `json:"fulfillments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFulfillmentsResponseFromPb(pb *listFulfillmentsResponsePb) (*ListFulfillmentsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListFulfillmentsResponse{} + st.Fulfillments = pb.Fulfillments + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFulfillmentsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFulfillmentsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listInstallationsRequestToPb(st *ListInstallationsRequest) (*listInstallationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listInstallationsRequestPb{} + pb.ListingId = st.ListingId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listInstallationsRequestPb struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listInstallationsRequestFromPb(pb *listInstallationsRequestPb) (*ListInstallationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListInstallationsRequest{} + st.ListingId = pb.ListingId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listInstallationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listInstallationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listInstallationsResponseToPb(st *ListInstallationsResponse) (*listInstallationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listInstallationsResponsePb{} + pb.Installations = st.Installations + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listInstallationsResponsePb struct { + Installations []InstallationDetail `json:"installations,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listInstallationsResponseFromPb(pb *listInstallationsResponsePb) (*ListInstallationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListInstallationsResponse{} + st.Installations = pb.Installations + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listInstallationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listInstallationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listListingsForExchangeRequestToPb(st *ListListingsForExchangeRequest) (*listListingsForExchangeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listListingsForExchangeRequestPb{} + pb.ExchangeId = st.ExchangeId + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listListingsForExchangeRequestPb struct { + ExchangeId string `json:"-" url:"exchange_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listListingsForExchangeRequestFromPb(pb *listListingsForExchangeRequestPb) (*ListListingsForExchangeRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListListingsForExchangeRequest{} + st.ExchangeId = pb.ExchangeId + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listListingsForExchangeRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listListingsForExchangeRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listListingsForExchangeResponseToPb(st *ListListingsForExchangeResponse) (*listListingsForExchangeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listListingsForExchangeResponsePb{} + pb.ExchangeListings = st.ExchangeListings + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listListingsForExchangeResponsePb struct { + ExchangeListings []ExchangeListing `json:"exchange_listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listListingsForExchangeResponseFromPb(pb *listListingsForExchangeResponsePb) (*ListListingsForExchangeResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListListingsForExchangeResponse{} + st.ExchangeListings = pb.ExchangeListings + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listListingsForExchangeResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listListingsForExchangeResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listListingsRequestToPb(st *ListListingsRequest) (*listListingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listListingsRequestPb{} + pb.Assets = st.Assets + + pb.Categories = st.Categories + + pb.IsFree = st.IsFree + + pb.IsPrivateExchange = st.IsPrivateExchange + + pb.IsStaffPick = st.IsStaffPick + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ProviderIds = st.ProviderIds + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listListingsRequestPb struct { + Assets []AssetType `json:"-" url:"assets,omitempty"` + + Categories []Category `json:"-" url:"categories,omitempty"` + + IsFree bool `json:"-" url:"is_free,omitempty"` + + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + + IsStaffPick bool `json:"-" url:"is_staff_pick,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + + Tags []ListingTag `json:"-" url:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listListingsRequestFromPb(pb *listListingsRequestPb) (*ListListingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListListingsRequest{} + st.Assets = pb.Assets + st.Categories = pb.Categories + st.IsFree = pb.IsFree + st.IsPrivateExchange = pb.IsPrivateExchange + st.IsStaffPick = pb.IsStaffPick + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.ProviderIds = pb.ProviderIds + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listListingsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listListingsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listListingsResponseToPb(st *ListListingsResponse) (*listListingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listListingsResponsePb{} + pb.Listings = st.Listings + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listListingsResponsePb struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listListingsResponseFromPb(pb *listListingsResponsePb) (*ListListingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListListingsResponse{} + st.Listings = pb.Listings + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listListingsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listListingsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProviderAnalyticsDashboardResponseToPb(st *ListProviderAnalyticsDashboardResponse) (*listProviderAnalyticsDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listProviderAnalyticsDashboardResponsePb{} + pb.DashboardId = st.DashboardId + + pb.Id = st.Id + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProviderAnalyticsDashboardResponsePb struct { + DashboardId string `json:"dashboard_id"` + + Id string `json:"id"` + + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProviderAnalyticsDashboardResponseFromPb(pb *listProviderAnalyticsDashboardResponsePb) (*ListProviderAnalyticsDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListProviderAnalyticsDashboardResponse{} + st.DashboardId = pb.DashboardId + st.Id = pb.Id + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProviderAnalyticsDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProviderAnalyticsDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listProvidersRequestPb{} + pb.IsFeatured = st.IsFeatured + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProvidersRequestPb struct { + IsFeatured bool `json:"-" url:"is_featured,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProvidersRequestFromPb(pb *listProvidersRequestPb) (*ListProvidersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListProvidersRequest{} + st.IsFeatured = pb.IsFeatured + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProvidersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProvidersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listProvidersResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Providers = st.Providers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProvidersResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Providers []ProviderInfo `json:"providers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProvidersResponseFromPb(pb *listProvidersResponsePb) (*ListProvidersResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListProvidersResponse{} + st.NextPageToken = pb.NextPageToken + st.Providers = pb.Providers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProvidersResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProvidersResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listingToPb(st *Listing) (*listingPb, error) { + if st == nil { + return nil, nil + } + pb := &listingPb{} + pb.Detail = st.Detail + + pb.Id = st.Id + + pb.Summary = st.Summary + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listingPb struct { + Detail *ListingDetail `json:"detail,omitempty"` + + Id string `json:"id,omitempty"` + + Summary ListingSummary `json:"summary"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listingFromPb(pb *listingPb) (*Listing, error) { + if pb == nil { + return nil, nil + } + st := &Listing{} + st.Detail = pb.Detail + st.Id = pb.Id + st.Summary = pb.Summary + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listingDetailToPb(st *ListingDetail) (*listingDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &listingDetailPb{} + pb.Assets = st.Assets + + pb.CollectionDateEnd = st.CollectionDateEnd + + pb.CollectionDateStart = st.CollectionDateStart + + pb.CollectionGranularity = st.CollectionGranularity + + pb.Cost = st.Cost + + pb.DataSource = st.DataSource + + pb.Description = st.Description + + pb.DocumentationLink = st.DocumentationLink + + pb.EmbeddedNotebookFileInfos = st.EmbeddedNotebookFileInfos + + pb.FileIds = st.FileIds + + pb.GeographicalCoverage = st.GeographicalCoverage + + pb.License = st.License + + pb.PricingModel = st.PricingModel + + pb.PrivacyPolicyLink = st.PrivacyPolicyLink + + pb.Size = st.Size + + pb.SupportLink = st.SupportLink + + pb.Tags = st.Tags + + pb.TermsOfService = st.TermsOfService + + pb.UpdateFrequency = st.UpdateFrequency + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listingDetailPb struct { + Assets []AssetType `json:"assets,omitempty"` + + CollectionDateEnd int64 `json:"collection_date_end,omitempty"` + + CollectionDateStart int64 `json:"collection_date_start,omitempty"` + + CollectionGranularity *DataRefreshInfo `json:"collection_granularity,omitempty"` + + Cost Cost `json:"cost,omitempty"` + + DataSource string `json:"data_source,omitempty"` + + Description string `json:"description,omitempty"` + + DocumentationLink string `json:"documentation_link,omitempty"` + + EmbeddedNotebookFileInfos []FileInfo `json:"embedded_notebook_file_infos,omitempty"` + + FileIds []string `json:"file_ids,omitempty"` + + GeographicalCoverage string `json:"geographical_coverage,omitempty"` + + License string `json:"license,omitempty"` + + PricingModel string `json:"pricing_model,omitempty"` + + PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` + + Size float64 `json:"size,omitempty"` + + SupportLink string `json:"support_link,omitempty"` + + Tags []ListingTag `json:"tags,omitempty"` + + TermsOfService string `json:"terms_of_service,omitempty"` + + UpdateFrequency *DataRefreshInfo `json:"update_frequency,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listingDetailFromPb(pb *listingDetailPb) (*ListingDetail, error) { + if pb == nil { + return nil, nil + } + st := &ListingDetail{} + st.Assets = pb.Assets + st.CollectionDateEnd = pb.CollectionDateEnd + st.CollectionDateStart = pb.CollectionDateStart + st.CollectionGranularity = pb.CollectionGranularity + st.Cost = pb.Cost + st.DataSource = pb.DataSource + st.Description = pb.Description + st.DocumentationLink = pb.DocumentationLink + st.EmbeddedNotebookFileInfos = pb.EmbeddedNotebookFileInfos + st.FileIds = pb.FileIds + st.GeographicalCoverage = pb.GeographicalCoverage + st.License = pb.License + st.PricingModel = pb.PricingModel + st.PrivacyPolicyLink = pb.PrivacyPolicyLink + st.Size = pb.Size + st.SupportLink = pb.SupportLink + st.Tags = pb.Tags + st.TermsOfService = pb.TermsOfService + st.UpdateFrequency = pb.UpdateFrequency + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listingDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listingDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listingFulfillmentToPb(st *ListingFulfillment) (*listingFulfillmentPb, error) { + if st == nil { + return nil, nil + } + pb := &listingFulfillmentPb{} + pb.FulfillmentType = st.FulfillmentType + + pb.ListingId = st.ListingId + + pb.RecipientType = st.RecipientType + + pb.RepoInfo = st.RepoInfo + + pb.ShareInfo = st.ShareInfo + + return pb, nil +} + +type listingFulfillmentPb struct { + FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` + + ListingId string `json:"listing_id"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + RepoInfo *RepoInfo `json:"repo_info,omitempty"` + + ShareInfo *ShareInfo `json:"share_info,omitempty"` +} + +func listingFulfillmentFromPb(pb *listingFulfillmentPb) (*ListingFulfillment, error) { + if pb == nil { + return nil, nil + } + st := &ListingFulfillment{} + st.FulfillmentType = pb.FulfillmentType + st.ListingId = pb.ListingId + st.RecipientType = pb.RecipientType + st.RepoInfo = pb.RepoInfo + st.ShareInfo = pb.ShareInfo + + return st, nil +} + +func listingSettingToPb(st *ListingSetting) (*listingSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &listingSettingPb{} + pb.Visibility = st.Visibility + + return pb, nil +} + +type listingSettingPb struct { + Visibility Visibility `json:"visibility,omitempty"` +} + +func listingSettingFromPb(pb *listingSettingPb) (*ListingSetting, error) { + if pb == nil { + return nil, nil + } + st := &ListingSetting{} + st.Visibility = pb.Visibility + + return st, nil +} + +func listingSummaryToPb(st *ListingSummary) (*listingSummaryPb, error) { + if st == nil { + return nil, nil + } + pb := &listingSummaryPb{} + pb.Categories = st.Categories + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.CreatedById = st.CreatedById + + pb.ExchangeIds = st.ExchangeIds + + pb.GitRepo = st.GitRepo + + pb.ListingType = st.ListingType + + pb.Name = st.Name + + pb.ProviderId = st.ProviderId + + pb.ProviderRegion = st.ProviderRegion + + pb.PublishedAt = st.PublishedAt + + pb.PublishedBy = st.PublishedBy + + pb.Setting = st.Setting + + pb.Share = st.Share + + pb.Status = st.Status + + pb.Subtitle = st.Subtitle + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.UpdatedById = st.UpdatedById + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listingSummaryPb struct { + Categories []Category `json:"categories,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + CreatedById int64 `json:"created_by_id,omitempty"` + + ExchangeIds []string `json:"exchange_ids,omitempty"` + + GitRepo *RepoInfo `json:"git_repo,omitempty"` + + ListingType ListingType `json:"listingType"` + + Name string `json:"name"` + + ProviderId string `json:"provider_id,omitempty"` + + ProviderRegion *RegionInfo `json:"provider_region,omitempty"` + + PublishedAt int64 `json:"published_at,omitempty"` + + PublishedBy string `json:"published_by,omitempty"` + + Setting *ListingSetting `json:"setting,omitempty"` + + Share *ShareInfo `json:"share,omitempty"` + + Status ListingStatus `json:"status,omitempty"` + + Subtitle string `json:"subtitle,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + UpdatedById int64 `json:"updated_by_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listingSummaryFromPb(pb *listingSummaryPb) (*ListingSummary, error) { + if pb == nil { + return nil, nil + } + st := &ListingSummary{} + st.Categories = pb.Categories + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.CreatedById = pb.CreatedById + st.ExchangeIds = pb.ExchangeIds + st.GitRepo = pb.GitRepo + st.ListingType = pb.ListingType + st.Name = pb.Name + st.ProviderId = pb.ProviderId + st.ProviderRegion = pb.ProviderRegion + st.PublishedAt = pb.PublishedAt + st.PublishedBy = pb.PublishedBy + st.Setting = pb.Setting + st.Share = pb.Share + st.Status = pb.Status + st.Subtitle = pb.Subtitle + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + st.UpdatedById = pb.UpdatedById + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listingSummaryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listingSummaryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listingTagToPb(st *ListingTag) (*listingTagPb, error) { + if st == nil { + return nil, nil + } + pb := &listingTagPb{} + pb.TagName = st.TagName + + pb.TagValues = st.TagValues + + return pb, nil +} + +type listingTagPb struct { + TagName ListingTagType `json:"tag_name,omitempty"` + + TagValues []string `json:"tag_values,omitempty"` +} + +func listingTagFromPb(pb *listingTagPb) (*ListingTag, error) { + if pb == nil { + return nil, nil + } + st := &ListingTag{} + st.TagName = pb.TagName + st.TagValues = pb.TagValues + + return st, nil +} + +func personalizationRequestToPb(st *PersonalizationRequest) (*personalizationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &personalizationRequestPb{} + pb.Comment = st.Comment + + pb.ConsumerRegion = st.ConsumerRegion + + pb.ContactInfo = st.ContactInfo + + pb.CreatedAt = st.CreatedAt + + pb.Id = st.Id + + pb.IntendedUse = st.IntendedUse + + pb.IsFromLighthouse = st.IsFromLighthouse + + pb.ListingId = st.ListingId + + pb.ListingName = st.ListingName + + pb.MetastoreId = st.MetastoreId + + pb.ProviderId = st.ProviderId + + pb.RecipientType = st.RecipientType + + pb.Share = st.Share + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.UpdatedAt = st.UpdatedAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type personalizationRequestPb struct { + Comment string `json:"comment,omitempty"` + + ConsumerRegion RegionInfo `json:"consumer_region"` + + ContactInfo *ContactInfo `json:"contact_info,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + Id string `json:"id,omitempty"` + + IntendedUse string `json:"intended_use,omitempty"` + + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + ProviderId string `json:"provider_id,omitempty"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + Share *ShareInfo `json:"share,omitempty"` + + Status PersonalizationRequestStatus `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func personalizationRequestFromPb(pb *personalizationRequestPb) (*PersonalizationRequest, error) { + if pb == nil { + return nil, nil + } + st := &PersonalizationRequest{} + st.Comment = pb.Comment + st.ConsumerRegion = pb.ConsumerRegion + st.ContactInfo = pb.ContactInfo + st.CreatedAt = pb.CreatedAt + st.Id = pb.Id + st.IntendedUse = pb.IntendedUse + st.IsFromLighthouse = pb.IsFromLighthouse + st.ListingId = pb.ListingId + st.ListingName = pb.ListingName + st.MetastoreId = pb.MetastoreId + st.ProviderId = pb.ProviderId + st.RecipientType = pb.RecipientType + st.Share = pb.Share + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + st.UpdatedAt = pb.UpdatedAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *personalizationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st personalizationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func providerAnalyticsDashboardToPb(st *ProviderAnalyticsDashboard) (*providerAnalyticsDashboardPb, error) { + if st == nil { + return nil, nil + } + pb := &providerAnalyticsDashboardPb{} + pb.Id = st.Id + + return pb, nil +} + +type providerAnalyticsDashboardPb struct { + Id string `json:"id"` +} + +func providerAnalyticsDashboardFromPb(pb *providerAnalyticsDashboardPb) (*ProviderAnalyticsDashboard, error) { + if pb == nil { + return nil, nil + } + st := &ProviderAnalyticsDashboard{} + st.Id = pb.Id + + return st, nil +} + +func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &providerInfoPb{} + pb.BusinessContactEmail = st.BusinessContactEmail + + pb.CompanyWebsiteLink = st.CompanyWebsiteLink + + pb.DarkModeIconFileId = st.DarkModeIconFileId + + pb.DarkModeIconFilePath = st.DarkModeIconFilePath + + pb.Description = st.Description + + pb.IconFileId = st.IconFileId + + pb.IconFilePath = st.IconFilePath + + pb.Id = st.Id + + pb.IsFeatured = st.IsFeatured + + pb.Name = st.Name + + pb.PrivacyPolicyLink = st.PrivacyPolicyLink + + pb.PublishedBy = st.PublishedBy + + pb.SupportContactEmail = st.SupportContactEmail + + pb.TermOfServiceLink = st.TermOfServiceLink + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type providerInfoPb struct { + BusinessContactEmail string `json:"business_contact_email"` + + CompanyWebsiteLink string `json:"company_website_link,omitempty"` + + DarkModeIconFileId string `json:"dark_mode_icon_file_id,omitempty"` + + DarkModeIconFilePath string `json:"dark_mode_icon_file_path,omitempty"` + + Description string `json:"description,omitempty"` + + IconFileId string `json:"icon_file_id,omitempty"` + + IconFilePath string `json:"icon_file_path,omitempty"` + + Id string `json:"id,omitempty"` + + IsFeatured bool `json:"is_featured,omitempty"` + + Name string `json:"name"` + + PrivacyPolicyLink string `json:"privacy_policy_link"` + + PublishedBy string `json:"published_by,omitempty"` + + SupportContactEmail string `json:"support_contact_email,omitempty"` + + TermOfServiceLink string `json:"term_of_service_link"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func providerInfoFromPb(pb *providerInfoPb) (*ProviderInfo, error) { + if pb == nil { + return nil, nil + } + st := &ProviderInfo{} + st.BusinessContactEmail = pb.BusinessContactEmail + st.CompanyWebsiteLink = pb.CompanyWebsiteLink + st.DarkModeIconFileId = pb.DarkModeIconFileId + st.DarkModeIconFilePath = pb.DarkModeIconFilePath + st.Description = pb.Description + st.IconFileId = pb.IconFileId + st.IconFilePath = pb.IconFilePath + st.Id = pb.Id + st.IsFeatured = pb.IsFeatured + st.Name = pb.Name + st.PrivacyPolicyLink = pb.PrivacyPolicyLink + st.PublishedBy = pb.PublishedBy + st.SupportContactEmail = pb.SupportContactEmail + st.TermOfServiceLink = pb.TermOfServiceLink + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *providerInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st providerInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func regionInfoToPb(st *RegionInfo) (*regionInfoPb, error) { + if st == nil { + return nil, nil + } + pb := ®ionInfoPb{} + pb.Cloud = st.Cloud + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type regionInfoPb struct { + Cloud string `json:"cloud,omitempty"` + + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func regionInfoFromPb(pb *regionInfoPb) (*RegionInfo, error) { + if pb == nil { + return nil, nil + } + st := &RegionInfo{} + st.Cloud = pb.Cloud + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *regionInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st regionInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func removeExchangeForListingRequestToPb(st *RemoveExchangeForListingRequest) (*removeExchangeForListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &removeExchangeForListingRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type removeExchangeForListingRequestPb struct { + Id string `json:"-" url:"-"` +} + +func removeExchangeForListingRequestFromPb(pb *removeExchangeForListingRequestPb) (*RemoveExchangeForListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &RemoveExchangeForListingRequest{} + st.Id = pb.Id + + return st, nil +} + +func removeExchangeForListingResponseToPb(st *RemoveExchangeForListingResponse) (*removeExchangeForListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &removeExchangeForListingResponsePb{} + + return pb, nil +} + +type removeExchangeForListingResponsePb struct { +} + +func removeExchangeForListingResponseFromPb(pb *removeExchangeForListingResponsePb) (*RemoveExchangeForListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &RemoveExchangeForListingResponse{} + + return st, nil +} + +func repoInfoToPb(st *RepoInfo) (*repoInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &repoInfoPb{} + pb.GitRepoUrl = st.GitRepoUrl + + return pb, nil +} + +type repoInfoPb struct { + GitRepoUrl string `json:"git_repo_url"` +} + +func repoInfoFromPb(pb *repoInfoPb) (*RepoInfo, error) { + if pb == nil { + return nil, nil + } + st := &RepoInfo{} + st.GitRepoUrl = pb.GitRepoUrl + + return st, nil +} + +func repoInstallationToPb(st *RepoInstallation) (*repoInstallationPb, error) { + if st == nil { + return nil, nil + } + pb := &repoInstallationPb{} + pb.RepoName = st.RepoName + + pb.RepoPath = st.RepoPath + + return pb, nil +} + +type repoInstallationPb struct { + RepoName string `json:"repo_name"` + + RepoPath string `json:"repo_path"` +} + +func repoInstallationFromPb(pb *repoInstallationPb) (*RepoInstallation, error) { + if pb == nil { + return nil, nil + } + st := &RepoInstallation{} + st.RepoName = pb.RepoName + st.RepoPath = pb.RepoPath + + return st, nil +} + +func searchListingsRequestToPb(st *SearchListingsRequest) (*searchListingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &searchListingsRequestPb{} + pb.Assets = st.Assets + + pb.Categories = st.Categories + + pb.IsFree = st.IsFree + + pb.IsPrivateExchange = st.IsPrivateExchange + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ProviderIds = st.ProviderIds + + pb.Query = st.Query + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchListingsRequestPb struct { + Assets []AssetType `json:"-" url:"assets,omitempty"` + + Categories []Category `json:"-" url:"categories,omitempty"` + + IsFree bool `json:"-" url:"is_free,omitempty"` + + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + + Query string `json:"-" url:"query"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchListingsRequestFromPb(pb *searchListingsRequestPb) (*SearchListingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SearchListingsRequest{} + st.Assets = pb.Assets + st.Categories = pb.Categories + st.IsFree = pb.IsFree + st.IsPrivateExchange = pb.IsPrivateExchange + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.ProviderIds = pb.ProviderIds + st.Query = pb.Query + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchListingsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchListingsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchListingsResponseToPb(st *SearchListingsResponse) (*searchListingsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchListingsResponsePb{} + pb.Listings = st.Listings + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchListingsResponsePb struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchListingsResponseFromPb(pb *searchListingsResponsePb) (*SearchListingsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchListingsResponse{} + st.Listings = pb.Listings + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchListingsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchListingsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func shareInfoToPb(st *ShareInfo) (*shareInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &shareInfoPb{} + pb.Name = st.Name + + pb.Type = st.Type + + return pb, nil +} + +type shareInfoPb struct { + Name string `json:"name"` + + Type ListingShareType `json:"type"` +} + +func shareInfoFromPb(pb *shareInfoPb) (*ShareInfo, error) { + if pb == nil { + return nil, nil + } + st := &ShareInfo{} + st.Name = pb.Name + st.Type = pb.Type + + return st, nil +} + +func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { + if st == nil { + return nil, nil + } + pb := &sharedDataObjectPb{} + pb.DataObjectType = st.DataObjectType + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sharedDataObjectPb struct { + DataObjectType string `json:"data_object_type,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sharedDataObjectFromPb(pb *sharedDataObjectPb) (*SharedDataObject, error) { + if pb == nil { + return nil, nil + } + st := &SharedDataObject{} + st.DataObjectType = pb.DataObjectType + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sharedDataObjectPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sharedDataObjectPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenDetailToPb(st *TokenDetail) (*tokenDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenDetailPb{} + pb.BearerToken = st.BearerToken + + pb.Endpoint = st.Endpoint + + pb.ExpirationTime = st.ExpirationTime + + pb.ShareCredentialsVersion = st.ShareCredentialsVersion + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenDetailPb struct { + BearerToken string `json:"bearerToken,omitempty"` + + Endpoint string `json:"endpoint,omitempty"` + + ExpirationTime string `json:"expirationTime,omitempty"` + + ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenDetailFromPb(pb *tokenDetailPb) (*TokenDetail, error) { + if pb == nil { + return nil, nil + } + st := &TokenDetail{} + st.BearerToken = pb.BearerToken + st.Endpoint = pb.Endpoint + st.ExpirationTime = pb.ExpirationTime + st.ShareCredentialsVersion = pb.ShareCredentialsVersion + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenInfoPb{} + pb.ActivationUrl = st.ActivationUrl + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.ExpirationTime = st.ExpirationTime + + pb.Id = st.Id + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenInfoPb struct { + ActivationUrl string `json:"activation_url,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + Id string `json:"id,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenInfoFromPb(pb *tokenInfoPb) (*TokenInfo, error) { + if pb == nil { + return nil, nil + } + st := &TokenInfo{} + st.ActivationUrl = pb.ActivationUrl + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.ExpirationTime = pb.ExpirationTime + st.Id = pb.Id + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateExchangeFilterRequestToPb(st *UpdateExchangeFilterRequest) (*updateExchangeFilterRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateExchangeFilterRequestPb{} + pb.Filter = st.Filter + + pb.Id = st.Id + + return pb, nil +} + +type updateExchangeFilterRequestPb struct { + Filter ExchangeFilter `json:"filter"` + + Id string `json:"-" url:"-"` +} + +func updateExchangeFilterRequestFromPb(pb *updateExchangeFilterRequestPb) (*UpdateExchangeFilterRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExchangeFilterRequest{} + st.Filter = pb.Filter + st.Id = pb.Id + + return st, nil +} + +func updateExchangeFilterResponseToPb(st *UpdateExchangeFilterResponse) (*updateExchangeFilterResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateExchangeFilterResponsePb{} + pb.Filter = st.Filter + + return pb, nil +} + +type updateExchangeFilterResponsePb struct { + Filter *ExchangeFilter `json:"filter,omitempty"` +} + +func updateExchangeFilterResponseFromPb(pb *updateExchangeFilterResponsePb) (*UpdateExchangeFilterResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExchangeFilterResponse{} + st.Filter = pb.Filter + + return st, nil +} + +func updateExchangeRequestToPb(st *UpdateExchangeRequest) (*updateExchangeRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateExchangeRequestPb{} + pb.Exchange = st.Exchange + + pb.Id = st.Id + + return pb, nil +} + +type updateExchangeRequestPb struct { + Exchange Exchange `json:"exchange"` + + Id string `json:"-" url:"-"` +} + +func updateExchangeRequestFromPb(pb *updateExchangeRequestPb) (*UpdateExchangeRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExchangeRequest{} + st.Exchange = pb.Exchange + st.Id = pb.Id + + return st, nil +} + +func updateExchangeResponseToPb(st *UpdateExchangeResponse) (*updateExchangeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateExchangeResponsePb{} + pb.Exchange = st.Exchange + + return pb, nil +} + +type updateExchangeResponsePb struct { + Exchange *Exchange `json:"exchange,omitempty"` +} + +func updateExchangeResponseFromPb(pb *updateExchangeResponsePb) (*UpdateExchangeResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExchangeResponse{} + st.Exchange = pb.Exchange + + return st, nil +} + +func updateInstallationRequestToPb(st *UpdateInstallationRequest) (*updateInstallationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateInstallationRequestPb{} + pb.Installation = st.Installation + + pb.InstallationId = st.InstallationId + + pb.ListingId = st.ListingId + + pb.RotateToken = st.RotateToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateInstallationRequestPb struct { + Installation InstallationDetail `json:"installation"` + + InstallationId string `json:"-" url:"-"` + + ListingId string `json:"-" url:"-"` + + RotateToken bool `json:"rotate_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateInstallationRequestFromPb(pb *updateInstallationRequestPb) (*UpdateInstallationRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateInstallationRequest{} + st.Installation = pb.Installation + st.InstallationId = pb.InstallationId + st.ListingId = pb.ListingId + st.RotateToken = pb.RotateToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateInstallationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateInstallationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateInstallationResponseToPb(st *UpdateInstallationResponse) (*updateInstallationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateInstallationResponsePb{} + pb.Installation = st.Installation + + return pb, nil +} + +type updateInstallationResponsePb struct { + Installation *InstallationDetail `json:"installation,omitempty"` +} + +func updateInstallationResponseFromPb(pb *updateInstallationResponsePb) (*UpdateInstallationResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateInstallationResponse{} + st.Installation = pb.Installation + + return st, nil +} + +func updateListingRequestToPb(st *UpdateListingRequest) (*updateListingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateListingRequestPb{} + pb.Id = st.Id + + pb.Listing = st.Listing + + return pb, nil +} + +type updateListingRequestPb struct { + Id string `json:"-" url:"-"` + + Listing Listing `json:"listing"` +} + +func updateListingRequestFromPb(pb *updateListingRequestPb) (*UpdateListingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateListingRequest{} + st.Id = pb.Id + st.Listing = pb.Listing + + return st, nil +} + +func updateListingResponseToPb(st *UpdateListingResponse) (*updateListingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateListingResponsePb{} + pb.Listing = st.Listing + + return pb, nil +} + +type updateListingResponsePb struct { + Listing *Listing `json:"listing,omitempty"` +} + +func updateListingResponseFromPb(pb *updateListingResponsePb) (*UpdateListingResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateListingResponse{} + st.Listing = pb.Listing + + return st, nil +} + +func updatePersonalizationRequestRequestToPb(st *UpdatePersonalizationRequestRequest) (*updatePersonalizationRequestRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updatePersonalizationRequestRequestPb{} + pb.ListingId = st.ListingId + + pb.Reason = st.Reason + + pb.RequestId = st.RequestId + + pb.Share = st.Share + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updatePersonalizationRequestRequestPb struct { + ListingId string `json:"-" url:"-"` + + Reason string `json:"reason,omitempty"` + + RequestId string `json:"-" url:"-"` + + Share *ShareInfo `json:"share,omitempty"` + + Status PersonalizationRequestStatus `json:"status"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updatePersonalizationRequestRequestFromPb(pb *updatePersonalizationRequestRequestPb) (*UpdatePersonalizationRequestRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePersonalizationRequestRequest{} + st.ListingId = pb.ListingId + st.Reason = pb.Reason + st.RequestId = pb.RequestId + st.Share = pb.Share + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updatePersonalizationRequestRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updatePersonalizationRequestRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updatePersonalizationRequestResponseToPb(st *UpdatePersonalizationRequestResponse) (*updatePersonalizationRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updatePersonalizationRequestResponsePb{} + pb.Request = st.Request + + return pb, nil +} + +type updatePersonalizationRequestResponsePb struct { + Request *PersonalizationRequest `json:"request,omitempty"` +} + +func updatePersonalizationRequestResponseFromPb(pb *updatePersonalizationRequestResponsePb) (*UpdatePersonalizationRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePersonalizationRequestResponse{} + st.Request = pb.Request + + return st, nil +} + +func updateProviderAnalyticsDashboardRequestToPb(st *UpdateProviderAnalyticsDashboardRequest) (*updateProviderAnalyticsDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateProviderAnalyticsDashboardRequestPb{} + pb.Id = st.Id + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateProviderAnalyticsDashboardRequestPb struct { + Id string `json:"-" url:"-"` + + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateProviderAnalyticsDashboardRequestFromPb(pb *updateProviderAnalyticsDashboardRequestPb) (*UpdateProviderAnalyticsDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProviderAnalyticsDashboardRequest{} + st.Id = pb.Id + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateProviderAnalyticsDashboardRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateProviderAnalyticsDashboardRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateProviderAnalyticsDashboardResponseToPb(st *UpdateProviderAnalyticsDashboardResponse) (*updateProviderAnalyticsDashboardResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateProviderAnalyticsDashboardResponsePb{} + pb.DashboardId = st.DashboardId + + pb.Id = st.Id + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateProviderAnalyticsDashboardResponsePb struct { + DashboardId string `json:"dashboard_id"` + + Id string `json:"id"` + + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateProviderAnalyticsDashboardResponseFromPb(pb *updateProviderAnalyticsDashboardResponsePb) (*UpdateProviderAnalyticsDashboardResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProviderAnalyticsDashboardResponse{} + st.DashboardId = pb.DashboardId + st.Id = pb.Id + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateProviderAnalyticsDashboardResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateProviderAnalyticsDashboardResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateProviderRequestToPb(st *UpdateProviderRequest) (*updateProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateProviderRequestPb{} + pb.Id = st.Id + + pb.Provider = st.Provider + + return pb, nil +} + +type updateProviderRequestPb struct { + Id string `json:"-" url:"-"` + + Provider ProviderInfo `json:"provider"` +} + +func updateProviderRequestFromPb(pb *updateProviderRequestPb) (*UpdateProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProviderRequest{} + st.Id = pb.Id + st.Provider = pb.Provider + + return st, nil +} + +func updateProviderResponseToPb(st *UpdateProviderResponse) (*updateProviderResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateProviderResponsePb{} + pb.Provider = st.Provider + + return pb, nil +} + +type updateProviderResponsePb struct { + Provider *ProviderInfo `json:"provider,omitempty"` +} + +func updateProviderResponseFromPb(pb *updateProviderResponsePb) (*UpdateProviderResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProviderResponse{} + st.Provider = pb.Provider + + return st, nil +} diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 62364f223..42e7544a8 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -3,22 +3,79 @@ package marketplace import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AddExchangeForListingRequest struct { - ExchangeId string `json:"exchange_id"` - ListingId string `json:"listing_id"` + // Wire name: 'exchange_id' + ExchangeId string + + // Wire name: 'listing_id' + ListingId string +} + +func (st *AddExchangeForListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addExchangeForListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addExchangeForListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AddExchangeForListingRequest) MarshalJSON() ([]byte, error) { + pb, err := addExchangeForListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AddExchangeForListingResponse struct { - ExchangeForListing *ExchangeListing `json:"exchange_for_listing,omitempty"` + + // Wire name: 'exchange_for_listing' + ExchangeForListing *ExchangeListing +} + +func (st *AddExchangeForListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &addExchangeForListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := addExchangeForListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AddExchangeForListingResponse) MarshalJSON() ([]byte, error) { + pb, err := addExchangeForListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AssetType string +type assetTypePb string const AssetTypeAssetTypeApp AssetType = `ASSET_TYPE_APP` @@ -55,25 +112,150 @@ func (f *AssetType) Type() string { return "AssetType" } +func assetTypeToPb(st *AssetType) (*assetTypePb, error) { + if st == nil { + return nil, nil + } + pb := assetTypePb(*st) + return &pb, nil +} + +func assetTypeFromPb(pb *assetTypePb) (*AssetType, error) { + if pb == nil { + return nil, nil + } + st := AssetType(*pb) + return &st, nil +} + // Get one batch of listings. One may specify up to 50 IDs per request. type BatchGetListingsRequest struct { - Ids []string `json:"-" url:"ids,omitempty"` + + // Wire name: 'ids' + Ids []string `tf:"-"` +} + +func (st *BatchGetListingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &batchGetListingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := batchGetListingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BatchGetListingsRequest) MarshalJSON() ([]byte, error) { + pb, err := batchGetListingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BatchGetListingsResponse struct { - Listings []Listing `json:"listings,omitempty"` + + // Wire name: 'listings' + Listings []Listing +} + +func (st *BatchGetListingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &batchGetListingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := batchGetListingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BatchGetListingsResponse) MarshalJSON() ([]byte, error) { + pb, err := batchGetListingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get one batch of providers. One may specify up to 50 IDs per request. type BatchGetProvidersRequest struct { - Ids []string `json:"-" url:"ids,omitempty"` + + // Wire name: 'ids' + Ids []string `tf:"-"` +} + +func (st *BatchGetProvidersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &batchGetProvidersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := batchGetProvidersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BatchGetProvidersRequest) MarshalJSON() ([]byte, error) { + pb, err := batchGetProvidersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BatchGetProvidersResponse struct { - Providers []ProviderInfo `json:"providers,omitempty"` + + // Wire name: 'providers' + Providers []ProviderInfo +} + +func (st *BatchGetProvidersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &batchGetProvidersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := batchGetProvidersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BatchGetProvidersResponse) MarshalJSON() ([]byte, error) { + pb, err := batchGetProvidersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Category string +type categoryPb string const CategoryAdvertisingAndMarketing Category = `ADVERTISING_AND_MARKETING` @@ -140,33 +322,99 @@ func (f *Category) Type() string { return "Category" } +func categoryToPb(st *Category) (*categoryPb, error) { + if st == nil { + return nil, nil + } + pb := categoryPb(*st) + return &pb, nil +} + +func categoryFromPb(pb *categoryPb) (*Category, error) { + if pb == nil { + return nil, nil + } + st := Category(*pb) + return &st, nil +} + type ConsumerTerms struct { - Version string `json:"version"` + + // Wire name: 'version' + Version string +} + +func (st *ConsumerTerms) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &consumerTermsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := consumerTermsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ConsumerTerms) MarshalJSON() ([]byte, error) { + pb, err := consumerTermsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // contact info for the consumer requesting data or performing a listing // installation type ContactInfo struct { - Company string `json:"company,omitempty"` - Email string `json:"email,omitempty"` + // Wire name: 'company' + Company string + + // Wire name: 'email' + Email string - FirstName string `json:"first_name,omitempty"` + // Wire name: 'first_name' + FirstName string - LastName string `json:"last_name,omitempty"` + // Wire name: 'last_name' + LastName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ContactInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ContactInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &contactInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := contactInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ContactInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ContactInfo) MarshalJSON() ([]byte, error) { + pb, err := contactInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Cost string +type costPb string const CostFree Cost = `FREE` @@ -193,184 +441,497 @@ func (f *Cost) Type() string { return "Cost" } +func costToPb(st *Cost) (*costPb, error) { + if st == nil { + return nil, nil + } + pb := costPb(*st) + return &pb, nil +} + +func costFromPb(pb *costPb) (*Cost, error) { + if pb == nil { + return nil, nil + } + st := Cost(*pb) + return &st, nil +} + type CreateExchangeFilterRequest struct { - Filter ExchangeFilter `json:"filter"` + + // Wire name: 'filter' + Filter ExchangeFilter +} + +func (st *CreateExchangeFilterRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExchangeFilterRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExchangeFilterRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateExchangeFilterRequest) MarshalJSON() ([]byte, error) { + pb, err := createExchangeFilterRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateExchangeFilterResponse struct { - FilterId string `json:"filter_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'filter_id' + FilterId string + + ForceSendFields []string `tf:"-"` } -func (s *CreateExchangeFilterResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateExchangeFilterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExchangeFilterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExchangeFilterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateExchangeFilterResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateExchangeFilterResponse) MarshalJSON() ([]byte, error) { + pb, err := createExchangeFilterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateExchangeRequest struct { - Exchange Exchange `json:"exchange"` + + // Wire name: 'exchange' + Exchange Exchange +} + +func (st *CreateExchangeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExchangeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExchangeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateExchangeRequest) MarshalJSON() ([]byte, error) { + pb, err := createExchangeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateExchangeResponse struct { - ExchangeId string `json:"exchange_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'exchange_id' + ExchangeId string + + ForceSendFields []string `tf:"-"` } -func (s *CreateExchangeResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateExchangeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExchangeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExchangeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateExchangeResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateExchangeResponse) MarshalJSON() ([]byte, error) { + pb, err := createExchangeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateFileRequest struct { - DisplayName string `json:"display_name,omitempty"` - FileParent FileParent `json:"file_parent"` + // Wire name: 'display_name' + DisplayName string - MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type"` + // Wire name: 'file_parent' + FileParent FileParent - MimeType string `json:"mime_type"` + // Wire name: 'marketplace_file_type' + MarketplaceFileType MarketplaceFileType - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'mime_type' + MimeType string + + ForceSendFields []string `tf:"-"` } -func (s *CreateFileRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateFileRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createFileRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFileRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateFileRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateFileRequest) MarshalJSON() ([]byte, error) { + pb, err := createFileRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateFileResponse struct { - FileInfo *FileInfo `json:"file_info,omitempty"` + + // Wire name: 'file_info' + FileInfo *FileInfo // Pre-signed POST URL to blob storage - UploadUrl string `json:"upload_url,omitempty"` + // Wire name: 'upload_url' + UploadUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateFileResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateFileResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createFileResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFileResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateFileResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateFileResponse) MarshalJSON() ([]byte, error) { + pb, err := createFileResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateInstallationRequest struct { - AcceptedConsumerTerms *ConsumerTerms `json:"accepted_consumer_terms,omitempty"` - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'accepted_consumer_terms' + AcceptedConsumerTerms *ConsumerTerms + + // Wire name: 'catalog_name' + CatalogName string - ListingId string `json:"-" url:"-"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // Wire name: 'recipient_type' + RecipientType DeltaSharingRecipientType // for git repo installations - RepoDetail *RepoInstallation `json:"repo_detail,omitempty"` + // Wire name: 'repo_detail' + RepoDetail *RepoInstallation - ShareName string `json:"share_name,omitempty"` + // Wire name: 'share_name' + ShareName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateInstallationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateInstallationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createInstallationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createInstallationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateInstallationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateInstallationRequest) MarshalJSON() ([]byte, error) { + pb, err := createInstallationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateListingRequest struct { - Listing Listing `json:"listing"` + + // Wire name: 'listing' + Listing Listing +} + +func (st *CreateListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateListingRequest) MarshalJSON() ([]byte, error) { + pb, err := createListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateListingResponse struct { - ListingId string `json:"listing_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'listing_id' + ListingId string + + ForceSendFields []string `tf:"-"` } -func (s *CreateListingResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateListingResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateListingResponse) MarshalJSON() ([]byte, error) { + pb, err := createListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Data request messages also creates a lead (maybe) type CreatePersonalizationRequest struct { - AcceptedConsumerTerms ConsumerTerms `json:"accepted_consumer_terms"` - Comment string `json:"comment,omitempty"` + // Wire name: 'accepted_consumer_terms' + AcceptedConsumerTerms ConsumerTerms - Company string `json:"company,omitempty"` + // Wire name: 'comment' + Comment string - FirstName string `json:"first_name,omitempty"` + // Wire name: 'company' + Company string - IntendedUse string `json:"intended_use"` + // Wire name: 'first_name' + FirstName string - IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + // Wire name: 'intended_use' + IntendedUse string - LastName string `json:"last_name,omitempty"` + // Wire name: 'is_from_lighthouse' + IsFromLighthouse bool - ListingId string `json:"-" url:"-"` + // Wire name: 'last_name' + LastName string - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'recipient_type' + RecipientType DeltaSharingRecipientType + + ForceSendFields []string `tf:"-"` } -func (s *CreatePersonalizationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePersonalizationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPersonalizationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPersonalizationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePersonalizationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePersonalizationRequest) MarshalJSON() ([]byte, error) { + pb, err := createPersonalizationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePersonalizationRequestResponse struct { - Id string `json:"id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'id' + Id string + + ForceSendFields []string `tf:"-"` } -func (s *CreatePersonalizationRequestResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePersonalizationRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPersonalizationRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPersonalizationRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePersonalizationRequestResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePersonalizationRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := createPersonalizationRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateProviderRequest struct { - Provider ProviderInfo `json:"provider"` + + // Wire name: 'provider' + Provider ProviderInfo +} + +func (st *CreateProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := createProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateProviderResponse struct { - Id string `json:"id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'id' + Id string + + ForceSendFields []string `tf:"-"` } -func (s *CreateProviderResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateProviderResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createProviderResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createProviderResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateProviderResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateProviderResponse) MarshalJSON() ([]byte, error) { + pb, err := createProviderResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DataRefresh string +type dataRefreshPb string const DataRefreshDaily DataRefresh = `DAILY` @@ -411,63 +972,421 @@ func (f *DataRefresh) Type() string { return "DataRefresh" } +func dataRefreshToPb(st *DataRefresh) (*dataRefreshPb, error) { + if st == nil { + return nil, nil + } + pb := dataRefreshPb(*st) + return &pb, nil +} + +func dataRefreshFromPb(pb *dataRefreshPb) (*DataRefresh, error) { + if pb == nil { + return nil, nil + } + st := DataRefresh(*pb) + return &st, nil +} + type DataRefreshInfo struct { - Interval int64 `json:"interval"` - Unit DataRefresh `json:"unit"` + // Wire name: 'interval' + Interval int64 + + // Wire name: 'unit' + Unit DataRefresh +} + +func (st *DataRefreshInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataRefreshInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataRefreshInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DataRefreshInfo) MarshalJSON() ([]byte, error) { + pb, err := dataRefreshInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an exchange filter type DeleteExchangeFilterRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteExchangeFilterRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExchangeFilterRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExchangeFilterRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExchangeFilterRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteExchangeFilterRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteExchangeFilterResponse struct { } +func (st *DeleteExchangeFilterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExchangeFilterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExchangeFilterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExchangeFilterResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteExchangeFilterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete an exchange type DeleteExchangeRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteExchangeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExchangeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExchangeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExchangeRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteExchangeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteExchangeResponse struct { } +func (st *DeleteExchangeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExchangeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExchangeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExchangeResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteExchangeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a file type DeleteFileRequest struct { - FileId string `json:"-" url:"-"` + + // Wire name: 'file_id' + FileId string `tf:"-"` +} + +func (st *DeleteFileRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteFileRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFileRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteFileRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteFileRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteFileResponse struct { } +func (st *DeleteFileResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteFileResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFileResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteFileResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteFileResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Uninstall from a listing type DeleteInstallationRequest struct { - InstallationId string `json:"-" url:"-"` - ListingId string `json:"-" url:"-"` + // Wire name: 'installation_id' + InstallationId string `tf:"-"` + + // Wire name: 'listing_id' + ListingId string `tf:"-"` +} + +func (st *DeleteInstallationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteInstallationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteInstallationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteInstallationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteInstallationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteInstallationResponse struct { } +func (st *DeleteInstallationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteInstallationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteInstallationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteInstallationResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteInstallationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a listing type DeleteListingRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteListingRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteListingResponse struct { } +func (st *DeleteListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteListingResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete provider type DeleteProviderRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteProviderResponse struct { } +func (st *DeleteProviderResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteProviderResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteProviderResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteProviderResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteProviderResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeltaSharingRecipientType string +type deltaSharingRecipientTypePb string const DeltaSharingRecipientTypeDeltaSharingRecipientTypeDatabricks DeltaSharingRecipientType = `DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS` @@ -494,67 +1413,138 @@ func (f *DeltaSharingRecipientType) Type() string { return "DeltaSharingRecipientType" } +func deltaSharingRecipientTypeToPb(st *DeltaSharingRecipientType) (*deltaSharingRecipientTypePb, error) { + if st == nil { + return nil, nil + } + pb := deltaSharingRecipientTypePb(*st) + return &pb, nil +} + +func deltaSharingRecipientTypeFromPb(pb *deltaSharingRecipientTypePb) (*DeltaSharingRecipientType, error) { + if pb == nil { + return nil, nil + } + st := DeltaSharingRecipientType(*pb) + return &st, nil +} + type Exchange struct { - Comment string `json:"comment,omitempty"` - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'comment' + Comment string - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 - Filters []ExchangeFilter `json:"filters,omitempty"` + // Wire name: 'created_by' + CreatedBy string - Id string `json:"id,omitempty"` + // Wire name: 'filters' + Filters []ExchangeFilter - LinkedListings []ExchangeListing `json:"linked_listings,omitempty"` + // Wire name: 'id' + Id string - Name string `json:"name"` + // Wire name: 'linked_listings' + LinkedListings []ExchangeListing - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'name' + Name string - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'updated_by' + UpdatedBy string + + ForceSendFields []string `tf:"-"` } -func (s *Exchange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Exchange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Exchange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Exchange) MarshalJSON() ([]byte, error) { + pb, err := exchangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExchangeFilter struct { - CreatedAt int64 `json:"created_at,omitempty"` - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 + + // Wire name: 'created_by' + CreatedBy string - ExchangeId string `json:"exchange_id"` + // Wire name: 'exchange_id' + ExchangeId string - FilterType ExchangeFilterType `json:"filter_type"` + // Wire name: 'filter_type' + FilterType ExchangeFilterType - FilterValue string `json:"filter_value"` + // Wire name: 'filter_value' + FilterValue string - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExchangeFilter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExchangeFilter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangeFilterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeFilterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExchangeFilter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExchangeFilter) MarshalJSON() ([]byte, error) { + pb, err := exchangeFilterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExchangeFilterType string +type exchangeFilterTypePb string const ExchangeFilterTypeGlobalMetastoreId ExchangeFilterType = `GLOBAL_METASTORE_ID` @@ -579,82 +1569,172 @@ func (f *ExchangeFilterType) Type() string { return "ExchangeFilterType" } +func exchangeFilterTypeToPb(st *ExchangeFilterType) (*exchangeFilterTypePb, error) { + if st == nil { + return nil, nil + } + pb := exchangeFilterTypePb(*st) + return &pb, nil +} + +func exchangeFilterTypeFromPb(pb *exchangeFilterTypePb) (*ExchangeFilterType, error) { + if pb == nil { + return nil, nil + } + st := ExchangeFilterType(*pb) + return &st, nil +} + type ExchangeListing struct { - CreatedAt int64 `json:"created_at,omitempty"` - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 + + // Wire name: 'created_by' + CreatedBy string - ExchangeId string `json:"exchange_id,omitempty"` + // Wire name: 'exchange_id' + ExchangeId string - ExchangeName string `json:"exchange_name,omitempty"` + // Wire name: 'exchange_name' + ExchangeName string - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - ListingId string `json:"listing_id,omitempty"` + // Wire name: 'listing_id' + ListingId string - ListingName string `json:"listing_name,omitempty"` + // Wire name: 'listing_name' + ListingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExchangeListing) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExchangeListing) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangeListingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeListingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExchangeListing) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExchangeListing) MarshalJSON() ([]byte, error) { + pb, err := exchangeListingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileInfo struct { - CreatedAt int64 `json:"created_at,omitempty"` + + // Wire name: 'created_at' + CreatedAt int64 // Name displayed to users for applicable files, e.g. embedded notebooks - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string - DownloadLink string `json:"download_link,omitempty"` + // Wire name: 'download_link' + DownloadLink string - FileParent *FileParent `json:"file_parent,omitempty"` + // Wire name: 'file_parent' + FileParent *FileParent - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` + // Wire name: 'marketplace_file_type' + MarketplaceFileType MarketplaceFileType - MimeType string `json:"mime_type,omitempty"` + // Wire name: 'mime_type' + MimeType string - Status FileStatus `json:"status,omitempty"` + // Wire name: 'status' + Status FileStatus // Populated if status is in a failed state with more information on reason // for the failure. - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status_message' + StatusMessage string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileInfo) MarshalJSON() ([]byte, error) { + pb, err := fileInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileParent struct { - FileParentType FileParentType `json:"file_parent_type,omitempty"` + + // Wire name: 'file_parent_type' + FileParentType FileParentType // TODO make the following fields required - ParentId string `json:"parent_id,omitempty"` + // Wire name: 'parent_id' + ParentId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileParent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileParent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileParentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileParentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileParent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileParent) MarshalJSON() ([]byte, error) { + pb, err := fileParentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileParentType string +type fileParentTypePb string const FileParentTypeListing FileParentType = `LISTING` @@ -683,7 +1763,24 @@ func (f *FileParentType) Type() string { return "FileParentType" } +func fileParentTypeToPb(st *FileParentType) (*fileParentTypePb, error) { + if st == nil { + return nil, nil + } + pb := fileParentTypePb(*st) + return &pb, nil +} + +func fileParentTypeFromPb(pb *fileParentTypePb) (*FileParentType, error) { + if pb == nil { + return nil, nil + } + st := FileParentType(*pb) + return &st, nil +} + type FileStatus string +type fileStatusPb string const FileStatusFileStatusPublished FileStatus = `FILE_STATUS_PUBLISHED` @@ -714,7 +1811,24 @@ func (f *FileStatus) Type() string { return "FileStatus" } +func fileStatusToPb(st *FileStatus) (*fileStatusPb, error) { + if st == nil { + return nil, nil + } + pb := fileStatusPb(*st) + return &pb, nil +} + +func fileStatusFromPb(pb *fileStatusPb) (*FileStatus, error) { + if pb == nil { + return nil, nil + } + st := FileStatus(*pb) + return &st, nil +} + type FulfillmentType string +type fulfillmentTypePb string const FulfillmentTypeInstall FulfillmentType = `INSTALL` @@ -741,177 +1855,621 @@ func (f *FulfillmentType) Type() string { return "FulfillmentType" } +func fulfillmentTypeToPb(st *FulfillmentType) (*fulfillmentTypePb, error) { + if st == nil { + return nil, nil + } + pb := fulfillmentTypePb(*st) + return &pb, nil +} + +func fulfillmentTypeFromPb(pb *fulfillmentTypePb) (*FulfillmentType, error) { + if pb == nil { + return nil, nil + } + st := FulfillmentType(*pb) + return &st, nil +} + // Get an exchange type GetExchangeRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetExchangeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExchangeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExchangeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExchangeRequest) MarshalJSON() ([]byte, error) { + pb, err := getExchangeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetExchangeResponse struct { - Exchange *Exchange `json:"exchange,omitempty"` + + // Wire name: 'exchange' + Exchange *Exchange +} + +func (st *GetExchangeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExchangeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExchangeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExchangeResponse) MarshalJSON() ([]byte, error) { + pb, err := getExchangeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a file type GetFileRequest struct { - FileId string `json:"-" url:"-"` + + // Wire name: 'file_id' + FileId string `tf:"-"` +} + +func (st *GetFileRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getFileRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getFileRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetFileRequest) MarshalJSON() ([]byte, error) { + pb, err := getFileRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type GetFileResponse struct { + + // Wire name: 'file_info' + FileInfo *FileInfo +} + +func (st *GetFileResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getFileResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getFileResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type GetFileResponse struct { - FileInfo *FileInfo `json:"file_info,omitempty"` +func (st GetFileResponse) MarshalJSON() ([]byte, error) { + pb, err := getFileResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetLatestVersionProviderAnalyticsDashboardResponse struct { // version here is latest logical version of the dashboard template - Version int64 `json:"version,omitempty"` + // Wire name: 'version' + Version int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetLatestVersionProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetLatestVersionProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLatestVersionProviderAnalyticsDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLatestVersionProviderAnalyticsDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetLatestVersionProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetLatestVersionProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := getLatestVersionProviderAnalyticsDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get listing content metadata type GetListingContentMetadataRequest struct { - ListingId string `json:"-" url:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetListingContentMetadataRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetListingContentMetadataRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingContentMetadataRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingContentMetadataRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetListingContentMetadataRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetListingContentMetadataRequest) MarshalJSON() ([]byte, error) { + pb, err := getListingContentMetadataRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetListingContentMetadataResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - SharedDataObjects []SharedDataObject `json:"shared_data_objects,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'shared_data_objects' + SharedDataObjects []SharedDataObject + + ForceSendFields []string `tf:"-"` } -func (s *GetListingContentMetadataResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetListingContentMetadataResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingContentMetadataResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingContentMetadataResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetListingContentMetadataResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetListingContentMetadataResponse) MarshalJSON() ([]byte, error) { + pb, err := getListingContentMetadataResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get listing type GetListingRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetListingRequest) MarshalJSON() ([]byte, error) { + pb, err := getListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetListingResponse struct { - Listing *Listing `json:"listing,omitempty"` + + // Wire name: 'listing' + Listing *Listing +} + +func (st *GetListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetListingResponse) MarshalJSON() ([]byte, error) { + pb, err := getListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List listings type GetListingsRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetListingsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetListingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetListingsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetListingsRequest) MarshalJSON() ([]byte, error) { + pb, err := getListingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetListingsResponse struct { - Listings []Listing `json:"listings,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'listings' + Listings []Listing - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *GetListingsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetListingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getListingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getListingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetListingsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetListingsResponse) MarshalJSON() ([]byte, error) { + pb, err := getListingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the personalization request for a listing type GetPersonalizationRequestRequest struct { - ListingId string `json:"-" url:"-"` + + // Wire name: 'listing_id' + ListingId string `tf:"-"` +} + +func (st *GetPersonalizationRequestRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPersonalizationRequestRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPersonalizationRequestRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPersonalizationRequestRequest) MarshalJSON() ([]byte, error) { + pb, err := getPersonalizationRequestRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPersonalizationRequestResponse struct { - PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` + + // Wire name: 'personalization_requests' + PersonalizationRequests []PersonalizationRequest +} + +func (st *GetPersonalizationRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPersonalizationRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPersonalizationRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPersonalizationRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := getPersonalizationRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a provider type GetProviderRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := getProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetProviderResponse struct { - Provider *ProviderInfo `json:"provider,omitempty"` + + // Wire name: 'provider' + Provider *ProviderInfo +} + +func (st *GetProviderResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getProviderResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getProviderResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetProviderResponse) MarshalJSON() ([]byte, error) { + pb, err := getProviderResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Installation struct { - Installation *InstallationDetail `json:"installation,omitempty"` + + // Wire name: 'installation' + Installation *InstallationDetail +} + +func (st *Installation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &installationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := installationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Installation) MarshalJSON() ([]byte, error) { + pb, err := installationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstallationDetail struct { - CatalogName string `json:"catalog_name,omitempty"` - ErrorMessage string `json:"error_message,omitempty"` + // Wire name: 'catalog_name' + CatalogName string - Id string `json:"id,omitempty"` + // Wire name: 'error_message' + ErrorMessage string - InstalledOn int64 `json:"installed_on,omitempty"` + // Wire name: 'id' + Id string - ListingId string `json:"listing_id,omitempty"` + // Wire name: 'installed_on' + InstalledOn int64 - ListingName string `json:"listing_name,omitempty"` + // Wire name: 'listing_id' + ListingId string - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // Wire name: 'listing_name' + ListingName string - RepoName string `json:"repo_name,omitempty"` + // Wire name: 'recipient_type' + RecipientType DeltaSharingRecipientType - RepoPath string `json:"repo_path,omitempty"` + // Wire name: 'repo_name' + RepoName string - ShareName string `json:"share_name,omitempty"` + // Wire name: 'repo_path' + RepoPath string - Status InstallationStatus `json:"status,omitempty"` + // Wire name: 'share_name' + ShareName string - TokenDetail *TokenDetail `json:"token_detail,omitempty"` + // Wire name: 'status' + Status InstallationStatus - Tokens []TokenInfo `json:"tokens,omitempty"` + // Wire name: 'token_detail' + TokenDetail *TokenDetail - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'tokens' + Tokens []TokenInfo + + ForceSendFields []string `tf:"-"` } -func (s *InstallationDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *InstallationDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &installationDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := installationDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s InstallationDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st InstallationDetail) MarshalJSON() ([]byte, error) { + pb, err := installationDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type InstallationStatus string +type installationStatusPb string const InstallationStatusFailed InstallationStatus = `FAILED` @@ -938,472 +2496,998 @@ func (f *InstallationStatus) Type() string { return "InstallationStatus" } +func installationStatusToPb(st *InstallationStatus) (*installationStatusPb, error) { + if st == nil { + return nil, nil + } + pb := installationStatusPb(*st) + return &pb, nil +} + +func installationStatusFromPb(pb *installationStatusPb) (*InstallationStatus, error) { + if pb == nil { + return nil, nil + } + st := InstallationStatus(*pb) + return &st, nil +} + // List all installations type ListAllInstallationsRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAllInstallationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAllInstallationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAllInstallationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAllInstallationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAllInstallationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAllInstallationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAllInstallationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAllInstallationsResponse struct { - Installations []InstallationDetail `json:"installations,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'installations' + Installations []InstallationDetail - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListAllInstallationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAllInstallationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAllInstallationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAllInstallationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAllInstallationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAllInstallationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAllInstallationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List all personalization requests type ListAllPersonalizationRequestsRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAllPersonalizationRequestsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAllPersonalizationRequestsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAllPersonalizationRequestsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAllPersonalizationRequestsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAllPersonalizationRequestsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAllPersonalizationRequestsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAllPersonalizationRequestsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAllPersonalizationRequestsResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'personalization_requests' + PersonalizationRequests []PersonalizationRequest + + ForceSendFields []string `tf:"-"` } -func (s *ListAllPersonalizationRequestsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAllPersonalizationRequestsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAllPersonalizationRequestsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAllPersonalizationRequestsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAllPersonalizationRequestsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAllPersonalizationRequestsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAllPersonalizationRequestsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List exchange filters type ListExchangeFiltersRequest struct { - ExchangeId string `json:"-" url:"exchange_id"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'exchange_id' + ExchangeId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExchangeFiltersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangeFiltersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangeFiltersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangeFiltersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangeFiltersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangeFiltersRequest) MarshalJSON() ([]byte, error) { + pb, err := listExchangeFiltersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListExchangeFiltersResponse struct { - Filters []ExchangeFilter `json:"filters,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'filters' + Filters []ExchangeFilter - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListExchangeFiltersResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangeFiltersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangeFiltersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangeFiltersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangeFiltersResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangeFiltersResponse) MarshalJSON() ([]byte, error) { + pb, err := listExchangeFiltersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List exchanges for listing type ListExchangesForListingRequest struct { - ListingId string `json:"-" url:"listing_id"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExchangesForListingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangesForListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangesForListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangesForListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangesForListingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangesForListingRequest) MarshalJSON() ([]byte, error) { + pb, err := listExchangesForListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListExchangesForListingResponse struct { - ExchangeListing []ExchangeListing `json:"exchange_listing,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'exchange_listing' + ExchangeListing []ExchangeListing - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListExchangesForListingResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangesForListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangesForListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangesForListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangesForListingResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangesForListingResponse) MarshalJSON() ([]byte, error) { + pb, err := listExchangesForListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List exchanges type ListExchangesRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExchangesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangesRequest) MarshalJSON() ([]byte, error) { + pb, err := listExchangesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListExchangesResponse struct { - Exchanges []Exchange `json:"exchanges,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'exchanges' + Exchanges []Exchange - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListExchangesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExchangesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExchangesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExchangesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExchangesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExchangesResponse) MarshalJSON() ([]byte, error) { + pb, err := listExchangesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List files type ListFilesRequest struct { - FileParent FileParent `json:"-" url:"file_parent"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'file_parent' + FileParent FileParent `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFilesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFilesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFilesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFilesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFilesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFilesRequest) MarshalJSON() ([]byte, error) { + pb, err := listFilesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListFilesResponse struct { - FileInfos []FileInfo `json:"file_infos,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'file_infos' + FileInfos []FileInfo - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListFilesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFilesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFilesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFilesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFilesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFilesResponse) MarshalJSON() ([]byte, error) { + pb, err := listFilesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List all listing fulfillments type ListFulfillmentsRequest struct { - ListingId string `json:"-" url:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFulfillmentsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFulfillmentsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFulfillmentsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFulfillmentsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFulfillmentsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFulfillmentsRequest) MarshalJSON() ([]byte, error) { + pb, err := listFulfillmentsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListFulfillmentsResponse struct { - Fulfillments []ListingFulfillment `json:"fulfillments,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'fulfillments' + Fulfillments []ListingFulfillment - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListFulfillmentsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFulfillmentsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFulfillmentsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFulfillmentsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFulfillmentsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFulfillmentsResponse) MarshalJSON() ([]byte, error) { + pb, err := listFulfillmentsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List installations for a listing type ListInstallationsRequest struct { - ListingId string `json:"-" url:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListInstallationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListInstallationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listInstallationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listInstallationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListInstallationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListInstallationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listInstallationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListInstallationsResponse struct { - Installations []InstallationDetail `json:"installations,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'installations' + Installations []InstallationDetail - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListInstallationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListInstallationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listInstallationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listInstallationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListInstallationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListInstallationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listInstallationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List listings for exchange type ListListingsForExchangeRequest struct { - ExchangeId string `json:"-" url:"exchange_id"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'exchange_id' + ExchangeId string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListListingsForExchangeRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListListingsForExchangeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listListingsForExchangeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listListingsForExchangeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListListingsForExchangeRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListListingsForExchangeRequest) MarshalJSON() ([]byte, error) { + pb, err := listListingsForExchangeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListListingsForExchangeResponse struct { - ExchangeListings []ExchangeListing `json:"exchange_listings,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'exchange_listings' + ExchangeListings []ExchangeListing - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'next_page_token' + NextPageToken string + + ForceSendFields []string `tf:"-"` } -func (s *ListListingsForExchangeResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListListingsForExchangeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listListingsForExchangeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listListingsForExchangeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListListingsForExchangeResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListListingsForExchangeResponse) MarshalJSON() ([]byte, error) { + pb, err := listListingsForExchangeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List listings type ListListingsRequest struct { // Matches any of the following asset types - Assets []AssetType `json:"-" url:"assets,omitempty"` + // Wire name: 'assets' + Assets []AssetType `tf:"-"` // Matches any of the following categories - Categories []Category `json:"-" url:"categories,omitempty"` + // Wire name: 'categories' + Categories []Category `tf:"-"` // Filters each listing based on if it is free. - IsFree bool `json:"-" url:"is_free,omitempty"` + // Wire name: 'is_free' + IsFree bool `tf:"-"` // Filters each listing based on if it is a private exchange. - IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + // Wire name: 'is_private_exchange' + IsPrivateExchange bool `tf:"-"` // Filters each listing based on whether it is a staff pick. - IsStaffPick bool `json:"-" url:"is_staff_pick,omitempty"` + // Wire name: 'is_staff_pick' + IsStaffPick bool `tf:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Matches any of the following provider ids - ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + // Wire name: 'provider_ids' + ProviderIds []string `tf:"-"` // Matches any of the following tags - Tags []ListingTag `json:"-" url:"tags,omitempty"` + // Wire name: 'tags' + Tags []ListingTag `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListListingsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListListingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listListingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listListingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListListingsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListListingsRequest) MarshalJSON() ([]byte, error) { + pb, err := listListingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListListingsResponse struct { - Listings []Listing `json:"listings,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'listings' + Listings []Listing + + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListListingsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListListingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listListingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listListingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListListingsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListListingsResponse) MarshalJSON() ([]byte, error) { + pb, err := listListingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListProviderAnalyticsDashboardResponse struct { // dashboard_id will be used to open Lakeview dashboard. - DashboardId string `json:"dashboard_id"` + // Wire name: 'dashboard_id' + DashboardId string - Id string `json:"id"` + // Wire name: 'id' + Id string - Version int64 `json:"version,omitempty"` + // Wire name: 'version' + Version int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProviderAnalyticsDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProviderAnalyticsDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := listProviderAnalyticsDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List providers type ListProvidersRequest struct { - IsFeatured bool `json:"-" url:"is_featured,omitempty"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'is_featured' + IsFeatured bool `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'page_token' + PageToken string `tf:"-"` + + ForceSendFields []string `tf:"-"` } -func (s *ListProvidersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProvidersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProvidersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProvidersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProvidersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProvidersRequest) MarshalJSON() ([]byte, error) { + pb, err := listProvidersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListProvidersResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Providers []ProviderInfo `json:"providers,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'providers' + Providers []ProviderInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProvidersResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProvidersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProvidersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProvidersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProvidersResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProvidersResponse) MarshalJSON() ([]byte, error) { + pb, err := listProvidersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Listing struct { - Detail *ListingDetail `json:"detail,omitempty"` - Id string `json:"id,omitempty"` + // Wire name: 'detail' + Detail *ListingDetail - Summary ListingSummary `json:"summary"` + // Wire name: 'id' + Id string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'summary' + Summary ListingSummary + + ForceSendFields []string `tf:"-"` } -func (s *Listing) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Listing) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Listing) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Listing) MarshalJSON() ([]byte, error) { + pb, err := listingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingDetail struct { // Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, // NOTEBOOK - Assets []AssetType `json:"assets,omitempty"` + // Wire name: 'assets' + Assets []AssetType // The ending date timestamp for when the data spans - CollectionDateEnd int64 `json:"collection_date_end,omitempty"` + // Wire name: 'collection_date_end' + CollectionDateEnd int64 // The starting date timestamp for when the data spans - CollectionDateStart int64 `json:"collection_date_start,omitempty"` + // Wire name: 'collection_date_start' + CollectionDateStart int64 // Smallest unit of time in the dataset - CollectionGranularity *DataRefreshInfo `json:"collection_granularity,omitempty"` + // Wire name: 'collection_granularity' + CollectionGranularity *DataRefreshInfo // Whether the dataset is free or paid - Cost Cost `json:"cost,omitempty"` + // Wire name: 'cost' + Cost Cost // Where/how the data is sourced - DataSource string `json:"data_source,omitempty"` + // Wire name: 'data_source' + DataSource string - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string - DocumentationLink string `json:"documentation_link,omitempty"` + // Wire name: 'documentation_link' + DocumentationLink string - EmbeddedNotebookFileInfos []FileInfo `json:"embedded_notebook_file_infos,omitempty"` + // Wire name: 'embedded_notebook_file_infos' + EmbeddedNotebookFileInfos []FileInfo - FileIds []string `json:"file_ids,omitempty"` + // Wire name: 'file_ids' + FileIds []string // Which geo region the listing data is collected from - GeographicalCoverage string `json:"geographical_coverage,omitempty"` + // Wire name: 'geographical_coverage' + GeographicalCoverage string // ID 20, 21 removed don't use License of the data asset - Required for // listings with model based assets - License string `json:"license,omitempty"` + // Wire name: 'license' + License string // What the pricing model is (e.g. paid, subscription, paid upfront); should // only be present if cost is paid TODO: Not used yet, should deprecate if // we will never use it - PricingModel string `json:"pricing_model,omitempty"` + // Wire name: 'pricing_model' + PricingModel string - PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` + // Wire name: 'privacy_policy_link' + PrivacyPolicyLink string // size of the dataset in GB - Size float64 `json:"size,omitempty"` + // Wire name: 'size' + Size float64 - SupportLink string `json:"support_link,omitempty"` + // Wire name: 'support_link' + SupportLink string // Listing tags - Simple key value pair to annotate listings. When should I // use tags vs dedicated fields? Using tags avoids the need to add new // columns in the database for new annotations. However, this should be used @@ -1411,40 +3495,119 @@ type ListingDetail struct { // the field is optional and won't need to have NOT NULL integrity check 2. // The value is fairly fixed, static and low cardinality (eg. enums). 3. The // value won't be used in filters or joins with other tables. - Tags []ListingTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ListingTag - TermsOfService string `json:"terms_of_service,omitempty"` + // Wire name: 'terms_of_service' + TermsOfService string // How often data is updated - UpdateFrequency *DataRefreshInfo `json:"update_frequency,omitempty"` + // Wire name: 'update_frequency' + UpdateFrequency *DataRefreshInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListingDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListingDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListingDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListingDetail) MarshalJSON() ([]byte, error) { + pb, err := listingDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingFulfillment struct { - FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` - ListingId string `json:"listing_id"` + // Wire name: 'fulfillment_type' + FulfillmentType FulfillmentType + + // Wire name: 'listing_id' + ListingId string - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // Wire name: 'recipient_type' + RecipientType DeltaSharingRecipientType - RepoInfo *RepoInfo `json:"repo_info,omitempty"` + // Wire name: 'repo_info' + RepoInfo *RepoInfo - ShareInfo *ShareInfo `json:"share_info,omitempty"` + // Wire name: 'share_info' + ShareInfo *ShareInfo +} + +func (st *ListingFulfillment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingFulfillmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingFulfillmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListingFulfillment) MarshalJSON() ([]byte, error) { + pb, err := listingFulfillmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingSetting struct { - Visibility Visibility `json:"visibility,omitempty"` + + // Wire name: 'visibility' + Visibility Visibility +} + +func (st *ListingSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListingSetting) MarshalJSON() ([]byte, error) { + pb, err := listingSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingShareType string +type listingShareTypePb string const ListingShareTypeFull ListingShareType = `FULL` @@ -1471,8 +3634,25 @@ func (f *ListingShareType) Type() string { return "ListingShareType" } +func listingShareTypeToPb(st *ListingShareType) (*listingShareTypePb, error) { + if st == nil { + return nil, nil + } + pb := listingShareTypePb(*st) + return &pb, nil +} + +func listingShareTypeFromPb(pb *listingShareTypePb) (*ListingShareType, error) { + if pb == nil { + return nil, nil + } + st := ListingShareType(*pb) + return &st, nil +} + // Enums type ListingStatus string +type listingStatusPb string const ListingStatusDraft ListingStatus = `DRAFT` @@ -1503,66 +3683,147 @@ func (f *ListingStatus) Type() string { return "ListingStatus" } +func listingStatusToPb(st *ListingStatus) (*listingStatusPb, error) { + if st == nil { + return nil, nil + } + pb := listingStatusPb(*st) + return &pb, nil +} + +func listingStatusFromPb(pb *listingStatusPb) (*ListingStatus, error) { + if pb == nil { + return nil, nil + } + st := ListingStatus(*pb) + return &st, nil +} + type ListingSummary struct { - Categories []Category `json:"categories,omitempty"` - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'categories' + Categories []Category + + // Wire name: 'created_at' + CreatedAt int64 - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string - CreatedById int64 `json:"created_by_id,omitempty"` + // Wire name: 'created_by_id' + CreatedById int64 - ExchangeIds []string `json:"exchange_ids,omitempty"` + // Wire name: 'exchange_ids' + ExchangeIds []string // if a git repo is being created, a listing will be initialized with this // field as opposed to a share - GitRepo *RepoInfo `json:"git_repo,omitempty"` + // Wire name: 'git_repo' + GitRepo *RepoInfo - ListingType ListingType `json:"listingType"` + // Wire name: 'listingType' + ListingType ListingType - Name string `json:"name"` + // Wire name: 'name' + Name string - ProviderId string `json:"provider_id,omitempty"` + // Wire name: 'provider_id' + ProviderId string - ProviderRegion *RegionInfo `json:"provider_region,omitempty"` + // Wire name: 'provider_region' + ProviderRegion *RegionInfo - PublishedAt int64 `json:"published_at,omitempty"` + // Wire name: 'published_at' + PublishedAt int64 - PublishedBy string `json:"published_by,omitempty"` + // Wire name: 'published_by' + PublishedBy string - Setting *ListingSetting `json:"setting,omitempty"` + // Wire name: 'setting' + Setting *ListingSetting - Share *ShareInfo `json:"share,omitempty"` + // Wire name: 'share' + Share *ShareInfo // Enums - Status ListingStatus `json:"status,omitempty"` + // Wire name: 'status' + Status ListingStatus - Subtitle string `json:"subtitle,omitempty"` + // Wire name: 'subtitle' + Subtitle string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - UpdatedById int64 `json:"updated_by_id,omitempty"` + // Wire name: 'updated_by_id' + UpdatedById int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListingSummary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListingSummary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingSummaryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingSummaryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListingSummary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListingSummary) MarshalJSON() ([]byte, error) { + pb, err := listingSummaryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingTag struct { // Tag name (enum) - TagName ListingTagType `json:"tag_name,omitempty"` + // Wire name: 'tag_name' + TagName ListingTagType // String representation of the tag value. Values should be string literals // (no complex types) - TagValues []string `json:"tag_values,omitempty"` + // Wire name: 'tag_values' + TagValues []string +} + +func (st *ListingTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listingTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listingTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListingTag) MarshalJSON() ([]byte, error) { + pb, err := listingTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListingTagType string +type listingTagTypePb string const ListingTagTypeListingTagTypeLanguage ListingTagType = `LISTING_TAG_TYPE_LANGUAGE` @@ -1589,7 +3850,24 @@ func (f *ListingTagType) Type() string { return "ListingTagType" } +func listingTagTypeToPb(st *ListingTagType) (*listingTagTypePb, error) { + if st == nil { + return nil, nil + } + pb := listingTagTypePb(*st) + return &pb, nil +} + +func listingTagTypeFromPb(pb *listingTagTypePb) (*ListingTagType, error) { + if pb == nil { + return nil, nil + } + st := ListingTagType(*pb) + return &st, nil +} + type ListingType string +type listingTypePb string const ListingTypePersonalized ListingType = `PERSONALIZED` @@ -1616,7 +3894,24 @@ func (f *ListingType) Type() string { return "ListingType" } +func listingTypeToPb(st *ListingType) (*listingTypePb, error) { + if st == nil { + return nil, nil + } + pb := listingTypePb(*st) + return &pb, nil +} + +func listingTypeFromPb(pb *listingTypePb) (*ListingType, error) { + if pb == nil { + return nil, nil + } + st := ListingType(*pb) + return &st, nil +} + type MarketplaceFileType string +type marketplaceFileTypePb string const MarketplaceFileTypeApp MarketplaceFileType = `APP` @@ -1645,52 +3940,103 @@ func (f *MarketplaceFileType) Type() string { return "MarketplaceFileType" } +func marketplaceFileTypeToPb(st *MarketplaceFileType) (*marketplaceFileTypePb, error) { + if st == nil { + return nil, nil + } + pb := marketplaceFileTypePb(*st) + return &pb, nil +} + +func marketplaceFileTypeFromPb(pb *marketplaceFileTypePb) (*MarketplaceFileType, error) { + if pb == nil { + return nil, nil + } + st := MarketplaceFileType(*pb) + return &st, nil +} + type PersonalizationRequest struct { - Comment string `json:"comment,omitempty"` - ConsumerRegion RegionInfo `json:"consumer_region"` + // Wire name: 'comment' + Comment string + + // Wire name: 'consumer_region' + ConsumerRegion RegionInfo // contact info for the consumer requesting data or performing a listing // installation - ContactInfo *ContactInfo `json:"contact_info,omitempty"` + // Wire name: 'contact_info' + ContactInfo *ContactInfo - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - IntendedUse string `json:"intended_use,omitempty"` + // Wire name: 'intended_use' + IntendedUse string - IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + // Wire name: 'is_from_lighthouse' + IsFromLighthouse bool - ListingId string `json:"listing_id,omitempty"` + // Wire name: 'listing_id' + ListingId string - ListingName string `json:"listing_name,omitempty"` + // Wire name: 'listing_name' + ListingName string - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string - ProviderId string `json:"provider_id,omitempty"` + // Wire name: 'provider_id' + ProviderId string - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // Wire name: 'recipient_type' + RecipientType DeltaSharingRecipientType - Share *ShareInfo `json:"share,omitempty"` + // Wire name: 'share' + Share *ShareInfo - Status PersonalizationRequestStatus `json:"status,omitempty"` + // Wire name: 'status' + Status PersonalizationRequestStatus - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status_message' + StatusMessage string - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PersonalizationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PersonalizationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &personalizationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := personalizationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PersonalizationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PersonalizationRequest) MarshalJSON() ([]byte, error) { + pb, err := personalizationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PersonalizationRequestStatus string +type personalizationRequestStatusPb string const PersonalizationRequestStatusDenied PersonalizationRequestStatus = `DENIED` @@ -1721,337 +4067,1034 @@ func (f *PersonalizationRequestStatus) Type() string { return "PersonalizationRequestStatus" } +func personalizationRequestStatusToPb(st *PersonalizationRequestStatus) (*personalizationRequestStatusPb, error) { + if st == nil { + return nil, nil + } + pb := personalizationRequestStatusPb(*st) + return &pb, nil +} + +func personalizationRequestStatusFromPb(pb *personalizationRequestStatusPb) (*PersonalizationRequestStatus, error) { + if pb == nil { + return nil, nil + } + st := PersonalizationRequestStatus(*pb) + return &st, nil +} + type ProviderAnalyticsDashboard struct { - Id string `json:"id"` + + // Wire name: 'id' + Id string +} + +func (st *ProviderAnalyticsDashboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &providerAnalyticsDashboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := providerAnalyticsDashboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ProviderAnalyticsDashboard) MarshalJSON() ([]byte, error) { + pb, err := providerAnalyticsDashboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ProviderInfo struct { - BusinessContactEmail string `json:"business_contact_email"` - CompanyWebsiteLink string `json:"company_website_link,omitempty"` + // Wire name: 'business_contact_email' + BusinessContactEmail string - DarkModeIconFileId string `json:"dark_mode_icon_file_id,omitempty"` + // Wire name: 'company_website_link' + CompanyWebsiteLink string - DarkModeIconFilePath string `json:"dark_mode_icon_file_path,omitempty"` + // Wire name: 'dark_mode_icon_file_id' + DarkModeIconFileId string - Description string `json:"description,omitempty"` + // Wire name: 'dark_mode_icon_file_path' + DarkModeIconFilePath string - IconFileId string `json:"icon_file_id,omitempty"` + // Wire name: 'description' + Description string - IconFilePath string `json:"icon_file_path,omitempty"` + // Wire name: 'icon_file_id' + IconFileId string - Id string `json:"id,omitempty"` + // Wire name: 'icon_file_path' + IconFilePath string + + // Wire name: 'id' + Id string // is_featured is accessible by consumers only - IsFeatured bool `json:"is_featured,omitempty"` + // Wire name: 'is_featured' + IsFeatured bool - Name string `json:"name"` + // Wire name: 'name' + Name string - PrivacyPolicyLink string `json:"privacy_policy_link"` + // Wire name: 'privacy_policy_link' + PrivacyPolicyLink string // published_by is only applicable to data aggregators (e.g. Crux) - PublishedBy string `json:"published_by,omitempty"` + // Wire name: 'published_by' + PublishedBy string - SupportContactEmail string `json:"support_contact_email,omitempty"` + // Wire name: 'support_contact_email' + SupportContactEmail string - TermOfServiceLink string `json:"term_of_service_link"` + // Wire name: 'term_of_service_link' + TermOfServiceLink string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ProviderInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ProviderInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &providerInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := providerInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ProviderInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ProviderInfo) MarshalJSON() ([]byte, error) { + pb, err := providerInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegionInfo struct { - Cloud string `json:"cloud,omitempty"` - Region string `json:"region,omitempty"` + // Wire name: 'cloud' + Cloud string + + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegionInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegionInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®ionInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := regionInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegionInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegionInfo) MarshalJSON() ([]byte, error) { + pb, err := regionInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Remove an exchange for listing type RemoveExchangeForListingRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *RemoveExchangeForListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &removeExchangeForListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := removeExchangeForListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RemoveExchangeForListingRequest) MarshalJSON() ([]byte, error) { + pb, err := removeExchangeForListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RemoveExchangeForListingResponse struct { } +func (st *RemoveExchangeForListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &removeExchangeForListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := removeExchangeForListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RemoveExchangeForListingResponse) MarshalJSON() ([]byte, error) { + pb, err := removeExchangeForListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type RepoInfo struct { // the git repo url e.g. https://github.com/databrickslabs/dolly.git - GitRepoUrl string `json:"git_repo_url"` + // Wire name: 'git_repo_url' + GitRepoUrl string +} + +func (st *RepoInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RepoInfo) MarshalJSON() ([]byte, error) { + pb, err := repoInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepoInstallation struct { // the user-specified repo name for their installed git repo listing - RepoName string `json:"repo_name"` + // Wire name: 'repo_name' + RepoName string // refers to the full url file path that navigates the user to the repo's // entrypoint (e.g. a README.md file, or the repo file view in the unified // UI) should just be a relative path - RepoPath string `json:"repo_path"` + // Wire name: 'repo_path' + RepoPath string +} + +func (st *RepoInstallation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoInstallationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoInstallationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RepoInstallation) MarshalJSON() ([]byte, error) { + pb, err := repoInstallationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Search listings type SearchListingsRequest struct { // Matches any of the following asset types - Assets []AssetType `json:"-" url:"assets,omitempty"` + // Wire name: 'assets' + Assets []AssetType `tf:"-"` // Matches any of the following categories - Categories []Category `json:"-" url:"categories,omitempty"` + // Wire name: 'categories' + Categories []Category `tf:"-"` - IsFree bool `json:"-" url:"is_free,omitempty"` + // Wire name: 'is_free' + IsFree bool `tf:"-"` - IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + // Wire name: 'is_private_exchange' + IsPrivateExchange bool `tf:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Matches any of the following provider ids - ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + // Wire name: 'provider_ids' + ProviderIds []string `tf:"-"` // Fuzzy matches query - Query string `json:"-" url:"query"` + // Wire name: 'query' + Query string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchListingsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchListingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchListingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchListingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchListingsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchListingsRequest) MarshalJSON() ([]byte, error) { + pb, err := searchListingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchListingsResponse struct { - Listings []Listing `json:"listings,omitempty"` - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'listings' + Listings []Listing + + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchListingsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchListingsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchListingsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchListingsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchListingsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchListingsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchListingsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ShareInfo struct { - Name string `json:"name"` - Type ListingShareType `json:"type"` + // Wire name: 'name' + Name string + + // Wire name: 'type' + Type ListingShareType +} + +func (st *ShareInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &shareInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := shareInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ShareInfo) MarshalJSON() ([]byte, error) { + pb, err := shareInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SharedDataObject struct { // The type of the data object. Could be one of: TABLE, SCHEMA, // NOTEBOOK_FILE, MODEL, VOLUME - DataObjectType string `json:"data_object_type,omitempty"` + // Wire name: 'data_object_type' + DataObjectType string // Name of the shared object - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SharedDataObject) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SharedDataObject) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sharedDataObjectPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sharedDataObjectFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SharedDataObject) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SharedDataObject) MarshalJSON() ([]byte, error) { + pb, err := sharedDataObjectToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenDetail struct { - BearerToken string `json:"bearerToken,omitempty"` - Endpoint string `json:"endpoint,omitempty"` + // Wire name: 'bearerToken' + BearerToken string + + // Wire name: 'endpoint' + Endpoint string - ExpirationTime string `json:"expirationTime,omitempty"` + // Wire name: 'expirationTime' + ExpirationTime string // These field names must follow the delta sharing protocol. Original // message: RetrieveToken.Response in // managed-catalog/api/messages/recipient.proto - ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + // Wire name: 'shareCredentialsVersion' + ShareCredentialsVersion int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenDetail) MarshalJSON() ([]byte, error) { + pb, err := tokenDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenInfo struct { // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl string `json:"activation_url,omitempty"` + // Wire name: 'activation_url' + ActivationUrl string // Time at which this Recipient Token was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of Recipient Token creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // Unique id of the Recipient Token. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time at which this Recipient Token was updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of Recipient Token updater. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenInfo) MarshalJSON() ([]byte, error) { + pb, err := tokenInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExchangeFilterRequest struct { - Filter ExchangeFilter `json:"filter"` - Id string `json:"-" url:"-"` + // Wire name: 'filter' + Filter ExchangeFilter + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *UpdateExchangeFilterRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExchangeFilterRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExchangeFilterRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateExchangeFilterRequest) MarshalJSON() ([]byte, error) { + pb, err := updateExchangeFilterRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExchangeFilterResponse struct { - Filter *ExchangeFilter `json:"filter,omitempty"` + + // Wire name: 'filter' + Filter *ExchangeFilter +} + +func (st *UpdateExchangeFilterResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExchangeFilterResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExchangeFilterResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateExchangeFilterResponse) MarshalJSON() ([]byte, error) { + pb, err := updateExchangeFilterResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExchangeRequest struct { - Exchange Exchange `json:"exchange"` - Id string `json:"-" url:"-"` + // Wire name: 'exchange' + Exchange Exchange + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *UpdateExchangeRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExchangeRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExchangeRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateExchangeRequest) MarshalJSON() ([]byte, error) { + pb, err := updateExchangeRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExchangeResponse struct { - Exchange *Exchange `json:"exchange,omitempty"` + + // Wire name: 'exchange' + Exchange *Exchange +} + +func (st *UpdateExchangeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExchangeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExchangeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateExchangeResponse) MarshalJSON() ([]byte, error) { + pb, err := updateExchangeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateInstallationRequest struct { - Installation InstallationDetail `json:"installation"` - InstallationId string `json:"-" url:"-"` + // Wire name: 'installation' + Installation InstallationDetail - ListingId string `json:"-" url:"-"` + // Wire name: 'installation_id' + InstallationId string `tf:"-"` - RotateToken bool `json:"rotate_token,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'rotate_token' + RotateToken bool + + ForceSendFields []string `tf:"-"` } -func (s *UpdateInstallationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateInstallationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateInstallationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateInstallationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateInstallationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateInstallationRequest) MarshalJSON() ([]byte, error) { + pb, err := updateInstallationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateInstallationResponse struct { - Installation *InstallationDetail `json:"installation,omitempty"` + + // Wire name: 'installation' + Installation *InstallationDetail +} + +func (st *UpdateInstallationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateInstallationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateInstallationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateInstallationResponse) MarshalJSON() ([]byte, error) { + pb, err := updateInstallationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateListingRequest struct { - Id string `json:"-" url:"-"` - Listing Listing `json:"listing"` + // Wire name: 'id' + Id string `tf:"-"` + + // Wire name: 'listing' + Listing Listing +} + +func (st *UpdateListingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateListingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateListingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateListingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateListingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateListingResponse struct { - Listing *Listing `json:"listing,omitempty"` + + // Wire name: 'listing' + Listing *Listing +} + +func (st *UpdateListingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateListingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateListingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateListingResponse) MarshalJSON() ([]byte, error) { + pb, err := updateListingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdatePersonalizationRequestRequest struct { - ListingId string `json:"-" url:"-"` - Reason string `json:"reason,omitempty"` + // Wire name: 'listing_id' + ListingId string `tf:"-"` - RequestId string `json:"-" url:"-"` + // Wire name: 'reason' + Reason string - Share *ShareInfo `json:"share,omitempty"` + // Wire name: 'request_id' + RequestId string `tf:"-"` - Status PersonalizationRequestStatus `json:"status"` + // Wire name: 'share' + Share *ShareInfo - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'status' + Status PersonalizationRequestStatus + + ForceSendFields []string `tf:"-"` } -func (s *UpdatePersonalizationRequestRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdatePersonalizationRequestRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePersonalizationRequestRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePersonalizationRequestRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdatePersonalizationRequestRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdatePersonalizationRequestRequest) MarshalJSON() ([]byte, error) { + pb, err := updatePersonalizationRequestRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdatePersonalizationRequestResponse struct { - Request *PersonalizationRequest `json:"request,omitempty"` + + // Wire name: 'request' + Request *PersonalizationRequest +} + +func (st *UpdatePersonalizationRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePersonalizationRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePersonalizationRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdatePersonalizationRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := updatePersonalizationRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProviderAnalyticsDashboardRequest struct { // id is immutable property and can't be updated. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // this is the version of the dashboard template we want to update our user // to current expectation is that it should be equal to latest version of // the dashboard template - Version int64 `json:"version,omitempty"` + // Wire name: 'version' + Version int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateProviderAnalyticsDashboardRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateProviderAnalyticsDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProviderAnalyticsDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProviderAnalyticsDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := updateProviderAnalyticsDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProviderAnalyticsDashboardResponse struct { // this is newly created Lakeview dashboard for the user - DashboardId string `json:"dashboard_id"` + // Wire name: 'dashboard_id' + DashboardId string // id & version should be the same as the request - Id string `json:"id"` + // Wire name: 'id' + Id string - Version int64 `json:"version,omitempty"` + // Wire name: 'version' + Version int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProviderAnalyticsDashboardResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProviderAnalyticsDashboardResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + pb, err := updateProviderAnalyticsDashboardResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProviderRequest struct { - Id string `json:"-" url:"-"` - Provider ProviderInfo `json:"provider"` + // Wire name: 'id' + Id string `tf:"-"` + + // Wire name: 'provider' + Provider ProviderInfo +} + +func (st *UpdateProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := updateProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProviderResponse struct { - Provider *ProviderInfo `json:"provider,omitempty"` + + // Wire name: 'provider' + Provider *ProviderInfo +} + +func (st *UpdateProviderResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProviderResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProviderResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateProviderResponse) MarshalJSON() ([]byte, error) { + pb, err := updateProviderResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Visibility string +type visibilityPb string const VisibilityPrivate Visibility = `PRIVATE` @@ -2077,3 +5120,73 @@ func (f *Visibility) Set(v string) error { func (f *Visibility) Type() string { return "Visibility" } + +func visibilityToPb(st *Visibility) (*visibilityPb, error) { + if st == nil { + return nil, nil + } + pb := visibilityPb(*st) + return &pb, nil +} + +func visibilityFromPb(pb *visibilityPb) (*Visibility, error) { + if pb == nil { + return nil, nil + } + st := Visibility(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/ml/impl.go b/service/ml/impl.go index 35364656b..d41a70c84 100755 --- a/service/ml/impl.go +++ b/service/ml/impl.go @@ -18,151 +18,439 @@ type experimentsImpl struct { } func (a *experimentsImpl) CreateExperiment(ctx context.Context, request CreateExperiment) (*CreateExperimentResponse, error) { - var createExperimentResponse CreateExperimentResponse + + requestPb, pbErr := createExperimentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createExperimentResponsePb createExperimentResponsePb path := "/api/2.0/mlflow/experiments/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExperimentResponse) - return &createExperimentResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createExperimentResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createExperimentResponseFromPb(&createExperimentResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) CreateLoggedModel(ctx context.Context, request CreateLoggedModelRequest) (*CreateLoggedModelResponse, error) { - var createLoggedModelResponse CreateLoggedModelResponse + + requestPb, pbErr := createLoggedModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createLoggedModelResponsePb createLoggedModelResponsePb path := "/api/2.0/mlflow/logged-models" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createLoggedModelResponse) - return &createLoggedModelResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createLoggedModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createLoggedModelResponseFromPb(&createLoggedModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) CreateRun(ctx context.Context, request CreateRun) (*CreateRunResponse, error) { - var createRunResponse CreateRunResponse + + requestPb, pbErr := createRunToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createRunResponsePb createRunResponsePb path := "/api/2.0/mlflow/runs/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createRunResponse) - return &createRunResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createRunResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createRunResponseFromPb(&createRunResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) DeleteExperiment(ctx context.Context, request DeleteExperiment) error { - var deleteExperimentResponse DeleteExperimentResponse + + requestPb, pbErr := deleteExperimentToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteExperimentResponsePb deleteExperimentResponsePb path := "/api/2.0/mlflow/experiments/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteExperimentResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteExperimentResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) DeleteLoggedModel(ctx context.Context, request DeleteLoggedModelRequest) error { - var deleteLoggedModelResponse DeleteLoggedModelResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", request.ModelId) + + requestPb, pbErr := deleteLoggedModelRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteLoggedModelResponsePb deleteLoggedModelResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteLoggedModelResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteLoggedModelResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) DeleteLoggedModelTag(ctx context.Context, request DeleteLoggedModelTagRequest) error { - var deleteLoggedModelTagResponse DeleteLoggedModelTagResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags/%v", request.ModelId, request.TagKey) + + requestPb, pbErr := deleteLoggedModelTagRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteLoggedModelTagResponsePb deleteLoggedModelTagResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags/%v", requestPb.ModelId, requestPb.TagKey) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteLoggedModelTagResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteLoggedModelTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { - var deleteRunResponse DeleteRunResponse + + requestPb, pbErr := deleteRunToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteRunResponsePb deleteRunResponsePb path := "/api/2.0/mlflow/runs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteRunResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) DeleteRuns(ctx context.Context, request DeleteRuns) (*DeleteRunsResponse, error) { - var deleteRunsResponse DeleteRunsResponse + + requestPb, pbErr := deleteRunsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteRunsResponsePb deleteRunsResponsePb path := "/api/2.0/mlflow/databricks/runs/delete-runs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunsResponse) - return &deleteRunsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteRunsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteRunsResponseFromPb(&deleteRunsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) DeleteTag(ctx context.Context, request DeleteTag) error { - var deleteTagResponse DeleteTagResponse + + requestPb, pbErr := deleteTagToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteTagResponsePb deleteTagResponsePb path := "/api/2.0/mlflow/runs/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteTagResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) FinalizeLoggedModel(ctx context.Context, request FinalizeLoggedModelRequest) (*FinalizeLoggedModelResponse, error) { - var finalizeLoggedModelResponse FinalizeLoggedModelResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", request.ModelId) + + requestPb, pbErr := finalizeLoggedModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var finalizeLoggedModelResponsePb finalizeLoggedModelResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &finalizeLoggedModelResponse) - return &finalizeLoggedModelResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &finalizeLoggedModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := finalizeLoggedModelResponseFromPb(&finalizeLoggedModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetByName(ctx context.Context, request GetByNameRequest) (*GetExperimentByNameResponse, error) { - var getExperimentByNameResponse GetExperimentByNameResponse + + requestPb, pbErr := getByNameRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getExperimentByNameResponsePb getExperimentByNameResponsePb path := "/api/2.0/mlflow/experiments/get-by-name" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentByNameResponse) - return &getExperimentByNameResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getExperimentByNameResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getExperimentByNameResponseFromPb(&getExperimentByNameResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetCredentialsForTraceDataDownload(ctx context.Context, request GetCredentialsForTraceDataDownloadRequest) (*GetCredentialsForTraceDataDownloadResponse, error) { - var getCredentialsForTraceDataDownloadResponse GetCredentialsForTraceDataDownloadResponse - path := fmt.Sprintf("/api/2.0/mlflow/traces/%v/credentials-for-data-download", request.RequestId) + + requestPb, pbErr := getCredentialsForTraceDataDownloadRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCredentialsForTraceDataDownloadResponsePb getCredentialsForTraceDataDownloadResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/traces/%v/credentials-for-data-download", requestPb.RequestId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCredentialsForTraceDataDownloadResponse) - return &getCredentialsForTraceDataDownloadResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCredentialsForTraceDataDownloadResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getCredentialsForTraceDataDownloadResponseFromPb(&getCredentialsForTraceDataDownloadResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetCredentialsForTraceDataUpload(ctx context.Context, request GetCredentialsForTraceDataUploadRequest) (*GetCredentialsForTraceDataUploadResponse, error) { - var getCredentialsForTraceDataUploadResponse GetCredentialsForTraceDataUploadResponse - path := fmt.Sprintf("/api/2.0/mlflow/traces/%v/credentials-for-data-upload", request.RequestId) + + requestPb, pbErr := getCredentialsForTraceDataUploadRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCredentialsForTraceDataUploadResponsePb getCredentialsForTraceDataUploadResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/traces/%v/credentials-for-data-upload", requestPb.RequestId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCredentialsForTraceDataUploadResponse) - return &getCredentialsForTraceDataUploadResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCredentialsForTraceDataUploadResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getCredentialsForTraceDataUploadResponseFromPb(&getCredentialsForTraceDataUploadResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetExperiment(ctx context.Context, request GetExperimentRequest) (*GetExperimentResponse, error) { - var getExperimentResponse GetExperimentResponse + + requestPb, pbErr := getExperimentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getExperimentResponsePb getExperimentResponsePb path := "/api/2.0/mlflow/experiments/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentResponse) - return &getExperimentResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getExperimentResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getExperimentResponseFromPb(&getExperimentResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get metric history for a run. @@ -201,53 +489,163 @@ func (a *experimentsImpl) GetHistoryAll(ctx context.Context, request GetHistoryR } func (a *experimentsImpl) internalGetHistory(ctx context.Context, request GetHistoryRequest) (*GetMetricHistoryResponse, error) { - var getMetricHistoryResponse GetMetricHistoryResponse + + requestPb, pbErr := getHistoryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getMetricHistoryResponsePb getMetricHistoryResponsePb path := "/api/2.0/mlflow/metrics/get-history" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getMetricHistoryResponse) - return &getMetricHistoryResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getMetricHistoryResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getMetricHistoryResponseFromPb(&getMetricHistoryResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetLoggedModel(ctx context.Context, request GetLoggedModelRequest) (*GetLoggedModelResponse, error) { - var getLoggedModelResponse GetLoggedModelResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", request.ModelId) + + requestPb, pbErr := getLoggedModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getLoggedModelResponsePb getLoggedModelResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getLoggedModelResponse) - return &getLoggedModelResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getLoggedModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getLoggedModelResponseFromPb(&getLoggedModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) { - var getExperimentPermissionLevelsResponse GetExperimentPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/experiments/%v/permissionLevels", request.ExperimentId) + + requestPb, pbErr := getExperimentPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getExperimentPermissionLevelsResponsePb getExperimentPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/experiments/%v/permissionLevels", requestPb.ExperimentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentPermissionLevelsResponse) - return &getExperimentPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getExperimentPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getExperimentPermissionLevelsResponseFromPb(&getExperimentPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetPermissions(ctx context.Context, request GetExperimentPermissionsRequest) (*ExperimentPermissions, error) { - var experimentPermissions ExperimentPermissions - path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + + requestPb, pbErr := getExperimentPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var experimentPermissionsPb experimentPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", requestPb.ExperimentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &experimentPermissions) - return &experimentPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &experimentPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := experimentPermissionsFromPb(&experimentPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) GetRun(ctx context.Context, request GetRunRequest) (*GetRunResponse, error) { - var getRunResponse GetRunResponse + + requestPb, pbErr := getRunRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getRunResponsePb getRunResponsePb path := "/api/2.0/mlflow/runs/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRunResponse) - return &getRunResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getRunResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getRunResponseFromPb(&getRunResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List artifacts. @@ -296,13 +694,35 @@ func (a *experimentsImpl) ListArtifactsAll(ctx context.Context, request ListArti } func (a *experimentsImpl) internalListArtifacts(ctx context.Context, request ListArtifactsRequest) (*ListArtifactsResponse, error) { - var listArtifactsResponse ListArtifactsResponse + + requestPb, pbErr := listArtifactsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listArtifactsResponsePb listArtifactsResponsePb path := "/api/2.0/mlflow/artifacts/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listArtifactsResponse) - return &listArtifactsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listArtifactsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listArtifactsResponseFromPb(&listArtifactsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List experiments. @@ -341,133 +761,361 @@ func (a *experimentsImpl) ListExperimentsAll(ctx context.Context, request ListEx } func (a *experimentsImpl) internalListExperiments(ctx context.Context, request ListExperimentsRequest) (*ListExperimentsResponse, error) { - var listExperimentsResponse ListExperimentsResponse + + requestPb, pbErr := listExperimentsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listExperimentsResponsePb listExperimentsResponsePb path := "/api/2.0/mlflow/experiments/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExperimentsResponse) - return &listExperimentsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listExperimentsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listExperimentsResponseFromPb(&listExperimentsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) ListLoggedModelArtifacts(ctx context.Context, request ListLoggedModelArtifactsRequest) (*ListLoggedModelArtifactsResponse, error) { - var listLoggedModelArtifactsResponse ListLoggedModelArtifactsResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/artifacts/directories", request.ModelId) + + requestPb, pbErr := listLoggedModelArtifactsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listLoggedModelArtifactsResponsePb listLoggedModelArtifactsResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/artifacts/directories", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listLoggedModelArtifactsResponse) - return &listLoggedModelArtifactsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listLoggedModelArtifactsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listLoggedModelArtifactsResponseFromPb(&listLoggedModelArtifactsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) LogBatch(ctx context.Context, request LogBatch) error { - var logBatchResponse LogBatchResponse + + requestPb, pbErr := logBatchToPb(&request) + if pbErr != nil { + return pbErr + } + + var logBatchResponsePb logBatchResponsePb path := "/api/2.0/mlflow/runs/log-batch" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logBatchResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logBatchResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogInputs(ctx context.Context, request LogInputs) error { - var logInputsResponse LogInputsResponse + + requestPb, pbErr := logInputsToPb(&request) + if pbErr != nil { + return pbErr + } + + var logInputsResponsePb logInputsResponsePb path := "/api/2.0/mlflow/runs/log-inputs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logInputsResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logInputsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogLoggedModelParams(ctx context.Context, request LogLoggedModelParamsRequest) error { - var logLoggedModelParamsRequestResponse LogLoggedModelParamsRequestResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/params", request.ModelId) + + requestPb, pbErr := logLoggedModelParamsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var logLoggedModelParamsRequestResponsePb logLoggedModelParamsRequestResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/params", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logLoggedModelParamsRequestResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logLoggedModelParamsRequestResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogMetric(ctx context.Context, request LogMetric) error { - var logMetricResponse LogMetricResponse + + requestPb, pbErr := logMetricToPb(&request) + if pbErr != nil { + return pbErr + } + + var logMetricResponsePb logMetricResponsePb path := "/api/2.0/mlflow/runs/log-metric" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logMetricResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logMetricResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogModel(ctx context.Context, request LogModel) error { - var logModelResponse LogModelResponse + + requestPb, pbErr := logModelToPb(&request) + if pbErr != nil { + return pbErr + } + + var logModelResponsePb logModelResponsePb path := "/api/2.0/mlflow/runs/log-model" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logModelResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logModelResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogOutputs(ctx context.Context, request LogOutputsRequest) error { - var logOutputsResponse LogOutputsResponse + + requestPb, pbErr := logOutputsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var logOutputsResponsePb logOutputsResponsePb path := "/api/2.0/mlflow/runs/outputs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logOutputsResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logOutputsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) LogParam(ctx context.Context, request LogParam) error { - var logParamResponse LogParamResponse + + requestPb, pbErr := logParamToPb(&request) + if pbErr != nil { + return pbErr + } + + var logParamResponsePb logParamResponsePb path := "/api/2.0/mlflow/runs/log-parameter" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logParamResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &logParamResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) RestoreExperiment(ctx context.Context, request RestoreExperiment) error { - var restoreExperimentResponse RestoreExperimentResponse + + requestPb, pbErr := restoreExperimentToPb(&request) + if pbErr != nil { + return pbErr + } + + var restoreExperimentResponsePb restoreExperimentResponsePb path := "/api/2.0/mlflow/experiments/restore" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreExperimentResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &restoreExperimentResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) RestoreRun(ctx context.Context, request RestoreRun) error { - var restoreRunResponse RestoreRunResponse + + requestPb, pbErr := restoreRunToPb(&request) + if pbErr != nil { + return pbErr + } + + var restoreRunResponsePb restoreRunResponsePb path := "/api/2.0/mlflow/runs/restore" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreRunResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &restoreRunResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) RestoreRuns(ctx context.Context, request RestoreRuns) (*RestoreRunsResponse, error) { - var restoreRunsResponse RestoreRunsResponse + + requestPb, pbErr := restoreRunsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var restoreRunsResponsePb restoreRunsResponsePb path := "/api/2.0/mlflow/databricks/runs/restore-runs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreRunsResponse) - return &restoreRunsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &restoreRunsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := restoreRunsResponseFromPb(&restoreRunsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Search experiments. @@ -506,25 +1154,69 @@ func (a *experimentsImpl) SearchExperimentsAll(ctx context.Context, request Sear } func (a *experimentsImpl) internalSearchExperiments(ctx context.Context, request SearchExperiments) (*SearchExperimentsResponse, error) { - var searchExperimentsResponse SearchExperimentsResponse + + requestPb, pbErr := searchExperimentsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchExperimentsResponsePb searchExperimentsResponsePb path := "/api/2.0/mlflow/experiments/search" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &searchExperimentsResponse) - return &searchExperimentsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &searchExperimentsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchExperimentsResponseFromPb(&searchExperimentsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) SearchLoggedModels(ctx context.Context, request SearchLoggedModelsRequest) (*SearchLoggedModelsResponse, error) { - var searchLoggedModelsResponse SearchLoggedModelsResponse + + requestPb, pbErr := searchLoggedModelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchLoggedModelsResponsePb searchLoggedModelsResponsePb path := "/api/2.0/mlflow/logged-models/search" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &searchLoggedModelsResponse) - return &searchLoggedModelsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &searchLoggedModelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchLoggedModelsResponseFromPb(&searchLoggedModelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Search for runs. @@ -567,91 +1259,251 @@ func (a *experimentsImpl) SearchRunsAll(ctx context.Context, request SearchRuns) } func (a *experimentsImpl) internalSearchRuns(ctx context.Context, request SearchRuns) (*SearchRunsResponse, error) { - var searchRunsResponse SearchRunsResponse + + requestPb, pbErr := searchRunsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchRunsResponsePb searchRunsResponsePb path := "/api/2.0/mlflow/runs/search" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &searchRunsResponse) - return &searchRunsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &searchRunsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchRunsResponseFromPb(&searchRunsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) SetExperimentTag(ctx context.Context, request SetExperimentTag) error { - var setExperimentTagResponse SetExperimentTagResponse + + requestPb, pbErr := setExperimentTagToPb(&request) + if pbErr != nil { + return pbErr + } + + var setExperimentTagResponsePb setExperimentTagResponsePb path := "/api/2.0/mlflow/experiments/set-experiment-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setExperimentTagResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &setExperimentTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) SetLoggedModelTags(ctx context.Context, request SetLoggedModelTagsRequest) error { - var setLoggedModelTagsResponse SetLoggedModelTagsResponse - path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags", request.ModelId) + + requestPb, pbErr := setLoggedModelTagsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var setLoggedModelTagsResponsePb setLoggedModelTagsResponsePb + path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags", requestPb.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &setLoggedModelTagsResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &setLoggedModelTagsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) SetPermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error) { - var experimentPermissions ExperimentPermissions - path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + + requestPb, pbErr := experimentPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var experimentPermissionsPb experimentPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", requestPb.ExperimentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &experimentPermissions) - return &experimentPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &experimentPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := experimentPermissionsFromPb(&experimentPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) SetTag(ctx context.Context, request SetTag) error { - var setTagResponse SetTagResponse + + requestPb, pbErr := setTagToPb(&request) + if pbErr != nil { + return pbErr + } + + var setTagResponsePb setTagResponsePb path := "/api/2.0/mlflow/runs/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setTagResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &setTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) UpdateExperiment(ctx context.Context, request UpdateExperiment) error { - var updateExperimentResponse UpdateExperimentResponse + + requestPb, pbErr := updateExperimentToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateExperimentResponsePb updateExperimentResponsePb path := "/api/2.0/mlflow/experiments/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateExperimentResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &updateExperimentResponsePb, + ) + if err != nil { + return err + } + return err } func (a *experimentsImpl) UpdatePermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error) { - var experimentPermissions ExperimentPermissions - path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + + requestPb, pbErr := experimentPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var experimentPermissionsPb experimentPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", requestPb.ExperimentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &experimentPermissions) - return &experimentPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &experimentPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := experimentPermissionsFromPb(&experimentPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *experimentsImpl) UpdateRun(ctx context.Context, request UpdateRun) (*UpdateRunResponse, error) { - var updateRunResponse UpdateRunResponse + + requestPb, pbErr := updateRunToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateRunResponsePb updateRunResponsePb path := "/api/2.0/mlflow/runs/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateRunResponse) - return &updateRunResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &updateRunResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateRunResponseFromPb(&updateRunResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just forecasting API methods @@ -660,24 +1512,68 @@ type forecastingImpl struct { } func (a *forecastingImpl) CreateExperiment(ctx context.Context, request CreateForecastingExperimentRequest) (*CreateForecastingExperimentResponse, error) { - var createForecastingExperimentResponse CreateForecastingExperimentResponse + + requestPb, pbErr := createForecastingExperimentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createForecastingExperimentResponsePb createForecastingExperimentResponsePb path := "/api/2.0/automl/create-forecasting-experiment" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createForecastingExperimentResponse) - return &createForecastingExperimentResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createForecastingExperimentResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createForecastingExperimentResponseFromPb(&createForecastingExperimentResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *forecastingImpl) GetExperiment(ctx context.Context, request GetForecastingExperimentRequest) (*ForecastingExperiment, error) { - var forecastingExperiment ForecastingExperiment - path := fmt.Sprintf("/api/2.0/automl/get-forecasting-experiment/%v", request.ExperimentId) + + requestPb, pbErr := getForecastingExperimentRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var forecastingExperimentPb forecastingExperimentPb + path := fmt.Sprintf("/api/2.0/automl/get-forecasting-experiment/%v", requestPb.ExperimentId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &forecastingExperiment) - return &forecastingExperiment, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &forecastingExperimentPb, + ) + if err != nil { + return nil, err + } + resp, err := forecastingExperimentFromPb(&forecastingExperimentPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ModelRegistry API methods @@ -686,138 +1582,396 @@ type modelRegistryImpl struct { } func (a *modelRegistryImpl) ApproveTransitionRequest(ctx context.Context, request ApproveTransitionRequest) (*ApproveTransitionRequestResponse, error) { - var approveTransitionRequestResponse ApproveTransitionRequestResponse + + requestPb, pbErr := approveTransitionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var approveTransitionRequestResponsePb approveTransitionRequestResponsePb path := "/api/2.0/mlflow/transition-requests/approve" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &approveTransitionRequestResponse) - return &approveTransitionRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &approveTransitionRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := approveTransitionRequestResponseFromPb(&approveTransitionRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) CreateComment(ctx context.Context, request CreateComment) (*CreateCommentResponse, error) { - var createCommentResponse CreateCommentResponse + + requestPb, pbErr := createCommentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createCommentResponsePb createCommentResponsePb path := "/api/2.0/mlflow/comments/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCommentResponse) - return &createCommentResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createCommentResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createCommentResponseFromPb(&createCommentResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) CreateModel(ctx context.Context, request CreateModelRequest) (*CreateModelResponse, error) { - var createModelResponse CreateModelResponse + + requestPb, pbErr := createModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createModelResponsePb createModelResponsePb path := "/api/2.0/mlflow/registered-models/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createModelResponse) - return &createModelResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createModelResponseFromPb(&createModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) CreateModelVersion(ctx context.Context, request CreateModelVersionRequest) (*CreateModelVersionResponse, error) { - var createModelVersionResponse CreateModelVersionResponse + + requestPb, pbErr := createModelVersionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createModelVersionResponsePb createModelVersionResponsePb path := "/api/2.0/mlflow/model-versions/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createModelVersionResponse) - return &createModelVersionResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createModelVersionResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createModelVersionResponseFromPb(&createModelVersionResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) CreateTransitionRequest(ctx context.Context, request CreateTransitionRequest) (*CreateTransitionRequestResponse, error) { - var createTransitionRequestResponse CreateTransitionRequestResponse + + requestPb, pbErr := createTransitionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createTransitionRequestResponsePb createTransitionRequestResponsePb path := "/api/2.0/mlflow/transition-requests/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createTransitionRequestResponse) - return &createTransitionRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createTransitionRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createTransitionRequestResponseFromPb(&createTransitionRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) CreateWebhook(ctx context.Context, request CreateRegistryWebhook) (*CreateWebhookResponse, error) { - var createWebhookResponse CreateWebhookResponse + + requestPb, pbErr := createRegistryWebhookToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createWebhookResponsePb createWebhookResponsePb path := "/api/2.0/mlflow/registry-webhooks/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createWebhookResponse) - return &createWebhookResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createWebhookResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createWebhookResponseFromPb(&createWebhookResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) DeleteComment(ctx context.Context, request DeleteCommentRequest) error { - var deleteCommentResponse DeleteCommentResponse + + requestPb, pbErr := deleteCommentRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteCommentResponsePb deleteCommentResponsePb path := "/api/2.0/mlflow/comments/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCommentResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteCommentResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteModel(ctx context.Context, request DeleteModelRequest) error { - var deleteModelResponse DeleteModelResponse + + requestPb, pbErr := deleteModelRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteModelResponsePb deleteModelResponsePb path := "/api/2.0/mlflow/registered-models/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteModelResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error { - var deleteModelTagResponse DeleteModelTagResponse + + requestPb, pbErr := deleteModelTagRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteModelTagResponsePb deleteModelTagResponsePb path := "/api/2.0/mlflow/registered-models/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelTagResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteModelTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error { - var deleteModelVersionResponse DeleteModelVersionResponse + + requestPb, pbErr := deleteModelVersionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteModelVersionResponsePb deleteModelVersionResponsePb path := "/api/2.0/mlflow/model-versions/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteModelVersionResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error { - var deleteModelVersionTagResponse DeleteModelVersionTagResponse + + requestPb, pbErr := deleteModelVersionTagRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteModelVersionTagResponsePb deleteModelVersionTagResponsePb path := "/api/2.0/mlflow/model-versions/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionTagResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteModelVersionTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error { - var deleteTransitionRequestResponse DeleteTransitionRequestResponse + + requestPb, pbErr := deleteTransitionRequestRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteTransitionRequestResponsePb deleteTransitionRequestResponsePb path := "/api/2.0/mlflow/transition-requests/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteTransitionRequestResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteTransitionRequestResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error { - var deleteWebhookResponse DeleteWebhookResponse + + requestPb, pbErr := deleteWebhookRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteWebhookResponsePb deleteWebhookResponsePb path := "/api/2.0/mlflow/registry-webhooks/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWebhookResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteWebhookResponsePb, + ) + if err != nil { + return err + } + return err } @@ -851,64 +2005,196 @@ func (a *modelRegistryImpl) GetLatestVersionsAll(ctx context.Context, request Ge } func (a *modelRegistryImpl) internalGetLatestVersions(ctx context.Context, request GetLatestVersionsRequest) (*GetLatestVersionsResponse, error) { - var getLatestVersionsResponse GetLatestVersionsResponse + + requestPb, pbErr := getLatestVersionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getLatestVersionsResponsePb getLatestVersionsResponsePb path := "/api/2.0/mlflow/registered-models/get-latest-versions" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &getLatestVersionsResponse) - return &getLatestVersionsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &getLatestVersionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getLatestVersionsResponseFromPb(&getLatestVersionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) GetModel(ctx context.Context, request GetModelRequest) (*GetModelResponse, error) { - var getModelResponse GetModelResponse + + requestPb, pbErr := getModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getModelResponsePb getModelResponsePb path := "/api/2.0/mlflow/databricks/registered-models/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelResponse) - return &getModelResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getModelResponseFromPb(&getModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) GetModelVersion(ctx context.Context, request GetModelVersionRequest) (*GetModelVersionResponse, error) { - var getModelVersionResponse GetModelVersionResponse + + requestPb, pbErr := getModelVersionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getModelVersionResponsePb getModelVersionResponsePb path := "/api/2.0/mlflow/model-versions/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelVersionResponse) - return &getModelVersionResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getModelVersionResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getModelVersionResponseFromPb(&getModelVersionResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) GetModelVersionDownloadUri(ctx context.Context, request GetModelVersionDownloadUriRequest) (*GetModelVersionDownloadUriResponse, error) { - var getModelVersionDownloadUriResponse GetModelVersionDownloadUriResponse + + requestPb, pbErr := getModelVersionDownloadUriRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getModelVersionDownloadUriResponsePb getModelVersionDownloadUriResponsePb path := "/api/2.0/mlflow/model-versions/get-download-uri" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelVersionDownloadUriResponse) - return &getModelVersionDownloadUriResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getModelVersionDownloadUriResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getModelVersionDownloadUriResponseFromPb(&getModelVersionDownloadUriResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) GetPermissionLevels(ctx context.Context, request GetRegisteredModelPermissionLevelsRequest) (*GetRegisteredModelPermissionLevelsResponse, error) { - var getRegisteredModelPermissionLevelsResponse GetRegisteredModelPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v/permissionLevels", request.RegisteredModelId) + + requestPb, pbErr := getRegisteredModelPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getRegisteredModelPermissionLevelsResponsePb getRegisteredModelPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v/permissionLevels", requestPb.RegisteredModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRegisteredModelPermissionLevelsResponse) - return &getRegisteredModelPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getRegisteredModelPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getRegisteredModelPermissionLevelsResponseFromPb(&getRegisteredModelPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) GetPermissions(ctx context.Context, request GetRegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { - var registeredModelPermissions RegisteredModelPermissions - path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + + requestPb, pbErr := getRegisteredModelPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelPermissionsPb registeredModelPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", requestPb.RegisteredModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ®isteredModelPermissions) - return ®isteredModelPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelPermissionsFromPb(®isteredModelPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List models. @@ -950,13 +2236,35 @@ func (a *modelRegistryImpl) ListModelsAll(ctx context.Context, request ListModel } func (a *modelRegistryImpl) internalListModels(ctx context.Context, request ListModelsRequest) (*ListModelsResponse, error) { - var listModelsResponse ListModelsResponse + + requestPb, pbErr := listModelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listModelsResponsePb listModelsResponsePb path := "/api/2.0/mlflow/registered-models/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listModelsResponse) - return &listModelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listModelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listModelsResponseFromPb(&listModelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List transition requests. @@ -989,13 +2297,35 @@ func (a *modelRegistryImpl) ListTransitionRequestsAll(ctx context.Context, reque } func (a *modelRegistryImpl) internalListTransitionRequests(ctx context.Context, request ListTransitionRequestsRequest) (*ListTransitionRequestsResponse, error) { - var listTransitionRequestsResponse ListTransitionRequestsResponse + + requestPb, pbErr := listTransitionRequestsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listTransitionRequestsResponsePb listTransitionRequestsResponsePb path := "/api/2.0/mlflow/transition-requests/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTransitionRequestsResponse) - return &listTransitionRequestsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listTransitionRequestsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listTransitionRequestsResponseFromPb(&listTransitionRequestsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List registry webhooks. @@ -1038,35 +2368,101 @@ func (a *modelRegistryImpl) ListWebhooksAll(ctx context.Context, request ListWeb } func (a *modelRegistryImpl) internalListWebhooks(ctx context.Context, request ListWebhooksRequest) (*ListRegistryWebhooks, error) { - var listRegistryWebhooks ListRegistryWebhooks + + requestPb, pbErr := listWebhooksRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listRegistryWebhooksPb listRegistryWebhooksPb path := "/api/2.0/mlflow/registry-webhooks/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRegistryWebhooks) - return &listRegistryWebhooks, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listRegistryWebhooksPb, + ) + if err != nil { + return nil, err + } + resp, err := listRegistryWebhooksFromPb(&listRegistryWebhooksPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) RejectTransitionRequest(ctx context.Context, request RejectTransitionRequest) (*RejectTransitionRequestResponse, error) { - var rejectTransitionRequestResponse RejectTransitionRequestResponse + + requestPb, pbErr := rejectTransitionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var rejectTransitionRequestResponsePb rejectTransitionRequestResponsePb path := "/api/2.0/mlflow/transition-requests/reject" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &rejectTransitionRequestResponse) - return &rejectTransitionRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &rejectTransitionRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := rejectTransitionRequestResponseFromPb(&rejectTransitionRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) RenameModel(ctx context.Context, request RenameModelRequest) (*RenameModelResponse, error) { - var renameModelResponse RenameModelResponse + + requestPb, pbErr := renameModelRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var renameModelResponsePb renameModelResponsePb path := "/api/2.0/mlflow/registered-models/rename" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &renameModelResponse) - return &renameModelResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &renameModelResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := renameModelResponseFromPb(&renameModelResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Searches model versions. @@ -1106,13 +2502,35 @@ func (a *modelRegistryImpl) SearchModelVersionsAll(ctx context.Context, request } func (a *modelRegistryImpl) internalSearchModelVersions(ctx context.Context, request SearchModelVersionsRequest) (*SearchModelVersionsResponse, error) { - var searchModelVersionsResponse SearchModelVersionsResponse + + requestPb, pbErr := searchModelVersionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchModelVersionsResponsePb searchModelVersionsResponsePb path := "/api/2.0/mlflow/model-versions/search" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchModelVersionsResponse) - return &searchModelVersionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &searchModelVersionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchModelVersionsResponseFromPb(&searchModelVersionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Search models. @@ -1152,121 +2570,343 @@ func (a *modelRegistryImpl) SearchModelsAll(ctx context.Context, request SearchM } func (a *modelRegistryImpl) internalSearchModels(ctx context.Context, request SearchModelsRequest) (*SearchModelsResponse, error) { - var searchModelsResponse SearchModelsResponse + + requestPb, pbErr := searchModelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var searchModelsResponsePb searchModelsResponsePb path := "/api/2.0/mlflow/registered-models/search" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchModelsResponse) - return &searchModelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &searchModelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := searchModelsResponseFromPb(&searchModelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) SetModelTag(ctx context.Context, request SetModelTagRequest) error { - var setModelTagResponse SetModelTagResponse + + requestPb, pbErr := setModelTagRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var setModelTagResponsePb setModelTagResponsePb path := "/api/2.0/mlflow/registered-models/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelTagResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &setModelTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error { - var setModelVersionTagResponse SetModelVersionTagResponse + + requestPb, pbErr := setModelVersionTagRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var setModelVersionTagResponsePb setModelVersionTagResponsePb path := "/api/2.0/mlflow/model-versions/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelVersionTagResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &setModelVersionTagResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) SetPermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { - var registeredModelPermissions RegisteredModelPermissions - path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + + requestPb, pbErr := registeredModelPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelPermissionsPb registeredModelPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", requestPb.RegisteredModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, ®isteredModelPermissions) - return ®isteredModelPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelPermissionsFromPb(®isteredModelPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) TestRegistryWebhook(ctx context.Context, request TestRegistryWebhookRequest) (*TestRegistryWebhookResponse, error) { - var testRegistryWebhookResponse TestRegistryWebhookResponse + + requestPb, pbErr := testRegistryWebhookRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var testRegistryWebhookResponsePb testRegistryWebhookResponsePb path := "/api/2.0/mlflow/registry-webhooks/test" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &testRegistryWebhookResponse) - return &testRegistryWebhookResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &testRegistryWebhookResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := testRegistryWebhookResponseFromPb(&testRegistryWebhookResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) TransitionStage(ctx context.Context, request TransitionModelVersionStageDatabricks) (*TransitionStageResponse, error) { - var transitionStageResponse TransitionStageResponse + + requestPb, pbErr := transitionModelVersionStageDatabricksToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var transitionStageResponsePb transitionStageResponsePb path := "/api/2.0/mlflow/databricks/model-versions/transition-stage" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &transitionStageResponse) - return &transitionStageResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &transitionStageResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := transitionStageResponseFromPb(&transitionStageResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) UpdateComment(ctx context.Context, request UpdateComment) (*UpdateCommentResponse, error) { - var updateCommentResponse UpdateCommentResponse + + requestPb, pbErr := updateCommentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateCommentResponsePb updateCommentResponsePb path := "/api/2.0/mlflow/comments/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCommentResponse) - return &updateCommentResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateCommentResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateCommentResponseFromPb(&updateCommentResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) UpdateModel(ctx context.Context, request UpdateModelRequest) error { - var updateModelResponse UpdateModelResponse + + requestPb, pbErr := updateModelRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateModelResponsePb updateModelResponsePb path := "/api/2.0/mlflow/registered-models/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateModelResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error { - var updateModelVersionResponse UpdateModelVersionResponse + + requestPb, pbErr := updateModelVersionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateModelVersionResponsePb updateModelVersionResponsePb path := "/api/2.0/mlflow/model-versions/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelVersionResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateModelVersionResponsePb, + ) + if err != nil { + return err + } + return err } func (a *modelRegistryImpl) UpdatePermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { - var registeredModelPermissions RegisteredModelPermissions - path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + + requestPb, pbErr := registeredModelPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var registeredModelPermissionsPb registeredModelPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", requestPb.RegisteredModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ®isteredModelPermissions) - return ®isteredModelPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + ®isteredModelPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := registeredModelPermissionsFromPb(®isteredModelPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *modelRegistryImpl) UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error { - var updateWebhookResponse UpdateWebhookResponse + + requestPb, pbErr := updateRegistryWebhookToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateWebhookResponsePb updateWebhookResponsePb path := "/api/2.0/mlflow/registry-webhooks/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateWebhookResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateWebhookResponsePb, + ) + if err != nil { + return err + } + return err } diff --git a/service/ml/internal.go b/service/ml/internal.go new file mode 100755 index 000000000..24066c923 --- /dev/null +++ b/service/ml/internal.go @@ -0,0 +1,7551 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package ml + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func activityToPb(st *Activity) (*activityPb, error) { + if st == nil { + return nil, nil + } + pb := &activityPb{} + pb.ActivityType = st.ActivityType + + pb.Comment = st.Comment + + pb.CreationTimestamp = st.CreationTimestamp + + pb.FromStage = st.FromStage + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.SystemComment = st.SystemComment + + pb.ToStage = st.ToStage + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type activityPb struct { + ActivityType ActivityType `json:"activity_type,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + FromStage Stage `json:"from_stage,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + SystemComment string `json:"system_comment,omitempty"` + + ToStage Stage `json:"to_stage,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func activityFromPb(pb *activityPb) (*Activity, error) { + if pb == nil { + return nil, nil + } + st := &Activity{} + st.ActivityType = pb.ActivityType + st.Comment = pb.Comment + st.CreationTimestamp = pb.CreationTimestamp + st.FromStage = pb.FromStage + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.SystemComment = pb.SystemComment + st.ToStage = pb.ToStage + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *activityPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st activityPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func approveTransitionRequestToPb(st *ApproveTransitionRequest) (*approveTransitionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &approveTransitionRequestPb{} + pb.ArchiveExistingVersions = st.ArchiveExistingVersions + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Stage = st.Stage + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type approveTransitionRequestPb struct { + ArchiveExistingVersions bool `json:"archive_existing_versions"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + Stage Stage `json:"stage"` + + Version string `json:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func approveTransitionRequestFromPb(pb *approveTransitionRequestPb) (*ApproveTransitionRequest, error) { + if pb == nil { + return nil, nil + } + st := &ApproveTransitionRequest{} + st.ArchiveExistingVersions = pb.ArchiveExistingVersions + st.Comment = pb.Comment + st.Name = pb.Name + st.Stage = pb.Stage + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *approveTransitionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st approveTransitionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func approveTransitionRequestResponseToPb(st *ApproveTransitionRequestResponse) (*approveTransitionRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &approveTransitionRequestResponsePb{} + pb.Activity = st.Activity + + return pb, nil +} + +type approveTransitionRequestResponsePb struct { + Activity *Activity `json:"activity,omitempty"` +} + +func approveTransitionRequestResponseFromPb(pb *approveTransitionRequestResponsePb) (*ApproveTransitionRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &ApproveTransitionRequestResponse{} + st.Activity = pb.Activity + + return st, nil +} + +func artifactCredentialInfoToPb(st *ArtifactCredentialInfo) (*artifactCredentialInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &artifactCredentialInfoPb{} + pb.Headers = st.Headers + + pb.Path = st.Path + + pb.RunId = st.RunId + + pb.SignedUri = st.SignedUri + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type artifactCredentialInfoPb struct { + Headers []ArtifactCredentialInfoHttpHeader `json:"headers,omitempty"` + + Path string `json:"path,omitempty"` + + RunId string `json:"run_id,omitempty"` + + SignedUri string `json:"signed_uri,omitempty"` + + Type ArtifactCredentialType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func artifactCredentialInfoFromPb(pb *artifactCredentialInfoPb) (*ArtifactCredentialInfo, error) { + if pb == nil { + return nil, nil + } + st := &ArtifactCredentialInfo{} + st.Headers = pb.Headers + st.Path = pb.Path + st.RunId = pb.RunId + st.SignedUri = pb.SignedUri + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *artifactCredentialInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st artifactCredentialInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func artifactCredentialInfoHttpHeaderToPb(st *ArtifactCredentialInfoHttpHeader) (*artifactCredentialInfoHttpHeaderPb, error) { + if st == nil { + return nil, nil + } + pb := &artifactCredentialInfoHttpHeaderPb{} + pb.Name = st.Name + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type artifactCredentialInfoHttpHeaderPb struct { + Name string `json:"name,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func artifactCredentialInfoHttpHeaderFromPb(pb *artifactCredentialInfoHttpHeaderPb) (*ArtifactCredentialInfoHttpHeader, error) { + if pb == nil { + return nil, nil + } + st := &ArtifactCredentialInfoHttpHeader{} + st.Name = pb.Name + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *artifactCredentialInfoHttpHeaderPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st artifactCredentialInfoHttpHeaderPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func commentObjectToPb(st *CommentObject) (*commentObjectPb, error) { + if st == nil { + return nil, nil + } + pb := &commentObjectPb{} + pb.AvailableActions = st.AvailableActions + + pb.Comment = st.Comment + + pb.CreationTimestamp = st.CreationTimestamp + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type commentObjectPb struct { + AvailableActions []CommentActivityAction `json:"available_actions,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func commentObjectFromPb(pb *commentObjectPb) (*CommentObject, error) { + if pb == nil { + return nil, nil + } + st := &CommentObject{} + st.AvailableActions = pb.AvailableActions + st.Comment = pb.Comment + st.CreationTimestamp = pb.CreationTimestamp + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *commentObjectPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st commentObjectPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCommentToPb(st *CreateComment) (*createCommentPb, error) { + if st == nil { + return nil, nil + } + pb := &createCommentPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type createCommentPb struct { + Comment string `json:"comment"` + + Name string `json:"name"` + + Version string `json:"version"` +} + +func createCommentFromPb(pb *createCommentPb) (*CreateComment, error) { + if pb == nil { + return nil, nil + } + st := &CreateComment{} + st.Comment = pb.Comment + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func createCommentResponseToPb(st *CreateCommentResponse) (*createCommentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createCommentResponsePb{} + pb.Comment = st.Comment + + return pb, nil +} + +type createCommentResponsePb struct { + Comment *CommentObject `json:"comment,omitempty"` +} + +func createCommentResponseFromPb(pb *createCommentResponsePb) (*CreateCommentResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateCommentResponse{} + st.Comment = pb.Comment + + return st, nil +} + +func createExperimentToPb(st *CreateExperiment) (*createExperimentPb, error) { + if st == nil { + return nil, nil + } + pb := &createExperimentPb{} + pb.ArtifactLocation = st.ArtifactLocation + + pb.Name = st.Name + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createExperimentPb struct { + ArtifactLocation string `json:"artifact_location,omitempty"` + + Name string `json:"name"` + + Tags []ExperimentTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createExperimentFromPb(pb *createExperimentPb) (*CreateExperiment, error) { + if pb == nil { + return nil, nil + } + st := &CreateExperiment{} + st.ArtifactLocation = pb.ArtifactLocation + st.Name = pb.Name + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createExperimentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createExperimentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createExperimentResponseToPb(st *CreateExperimentResponse) (*createExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createExperimentResponsePb{} + pb.ExperimentId = st.ExperimentId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createExperimentResponsePb struct { + ExperimentId string `json:"experiment_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createExperimentResponseFromPb(pb *createExperimentResponsePb) (*CreateExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateExperimentResponse{} + st.ExperimentId = pb.ExperimentId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createExperimentResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createExperimentResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createForecastingExperimentRequestToPb(st *CreateForecastingExperimentRequest) (*createForecastingExperimentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createForecastingExperimentRequestPb{} + pb.CustomWeightsColumn = st.CustomWeightsColumn + + pb.ExperimentPath = st.ExperimentPath + + pb.ForecastGranularity = st.ForecastGranularity + + pb.ForecastHorizon = st.ForecastHorizon + + pb.FutureFeatureDataPath = st.FutureFeatureDataPath + + pb.HolidayRegions = st.HolidayRegions + + pb.IncludeFeatures = st.IncludeFeatures + + pb.MaxRuntime = st.MaxRuntime + + pb.PredictionDataPath = st.PredictionDataPath + + pb.PrimaryMetric = st.PrimaryMetric + + pb.RegisterTo = st.RegisterTo + + pb.SplitColumn = st.SplitColumn + + pb.TargetColumn = st.TargetColumn + + pb.TimeColumn = st.TimeColumn + + pb.TimeseriesIdentifierColumns = st.TimeseriesIdentifierColumns + + pb.TrainDataPath = st.TrainDataPath + + pb.TrainingFrameworks = st.TrainingFrameworks + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createForecastingExperimentRequestPb struct { + CustomWeightsColumn string `json:"custom_weights_column,omitempty"` + + ExperimentPath string `json:"experiment_path,omitempty"` + + ForecastGranularity string `json:"forecast_granularity"` + + ForecastHorizon int64 `json:"forecast_horizon"` + + FutureFeatureDataPath string `json:"future_feature_data_path,omitempty"` + + HolidayRegions []string `json:"holiday_regions,omitempty"` + + IncludeFeatures []string `json:"include_features,omitempty"` + + MaxRuntime int64 `json:"max_runtime,omitempty"` + + PredictionDataPath string `json:"prediction_data_path,omitempty"` + + PrimaryMetric string `json:"primary_metric,omitempty"` + + RegisterTo string `json:"register_to,omitempty"` + + SplitColumn string `json:"split_column,omitempty"` + + TargetColumn string `json:"target_column"` + + TimeColumn string `json:"time_column"` + + TimeseriesIdentifierColumns []string `json:"timeseries_identifier_columns,omitempty"` + + TrainDataPath string `json:"train_data_path"` + + TrainingFrameworks []string `json:"training_frameworks,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createForecastingExperimentRequestFromPb(pb *createForecastingExperimentRequestPb) (*CreateForecastingExperimentRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateForecastingExperimentRequest{} + st.CustomWeightsColumn = pb.CustomWeightsColumn + st.ExperimentPath = pb.ExperimentPath + st.ForecastGranularity = pb.ForecastGranularity + st.ForecastHorizon = pb.ForecastHorizon + st.FutureFeatureDataPath = pb.FutureFeatureDataPath + st.HolidayRegions = pb.HolidayRegions + st.IncludeFeatures = pb.IncludeFeatures + st.MaxRuntime = pb.MaxRuntime + st.PredictionDataPath = pb.PredictionDataPath + st.PrimaryMetric = pb.PrimaryMetric + st.RegisterTo = pb.RegisterTo + st.SplitColumn = pb.SplitColumn + st.TargetColumn = pb.TargetColumn + st.TimeColumn = pb.TimeColumn + st.TimeseriesIdentifierColumns = pb.TimeseriesIdentifierColumns + st.TrainDataPath = pb.TrainDataPath + st.TrainingFrameworks = pb.TrainingFrameworks + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createForecastingExperimentRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createForecastingExperimentRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createForecastingExperimentResponseToPb(st *CreateForecastingExperimentResponse) (*createForecastingExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createForecastingExperimentResponsePb{} + pb.ExperimentId = st.ExperimentId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createForecastingExperimentResponsePb struct { + ExperimentId string `json:"experiment_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createForecastingExperimentResponseFromPb(pb *createForecastingExperimentResponsePb) (*CreateForecastingExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateForecastingExperimentResponse{} + st.ExperimentId = pb.ExperimentId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createForecastingExperimentResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createForecastingExperimentResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createLoggedModelRequestToPb(st *CreateLoggedModelRequest) (*createLoggedModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createLoggedModelRequestPb{} + pb.ExperimentId = st.ExperimentId + + pb.ModelType = st.ModelType + + pb.Name = st.Name + + pb.Params = st.Params + + pb.SourceRunId = st.SourceRunId + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createLoggedModelRequestPb struct { + ExperimentId string `json:"experiment_id"` + + ModelType string `json:"model_type,omitempty"` + + Name string `json:"name,omitempty"` + + Params []LoggedModelParameter `json:"params,omitempty"` + + SourceRunId string `json:"source_run_id,omitempty"` + + Tags []LoggedModelTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createLoggedModelRequestFromPb(pb *createLoggedModelRequestPb) (*CreateLoggedModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateLoggedModelRequest{} + st.ExperimentId = pb.ExperimentId + st.ModelType = pb.ModelType + st.Name = pb.Name + st.Params = pb.Params + st.SourceRunId = pb.SourceRunId + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createLoggedModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createLoggedModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createLoggedModelResponseToPb(st *CreateLoggedModelResponse) (*createLoggedModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createLoggedModelResponsePb{} + pb.Model = st.Model + + return pb, nil +} + +type createLoggedModelResponsePb struct { + Model *LoggedModel `json:"model,omitempty"` +} + +func createLoggedModelResponseFromPb(pb *createLoggedModelResponsePb) (*CreateLoggedModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateLoggedModelResponse{} + st.Model = pb.Model + + return st, nil +} + +func createModelRequestToPb(st *CreateModelRequest) (*createModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createModelRequestPb{} + pb.Description = st.Description + + pb.Name = st.Name + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createModelRequestPb struct { + Description string `json:"description,omitempty"` + + Name string `json:"name"` + + Tags []ModelTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createModelRequestFromPb(pb *createModelRequestPb) (*CreateModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateModelRequest{} + st.Description = pb.Description + st.Name = pb.Name + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createModelResponseToPb(st *CreateModelResponse) (*createModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createModelResponsePb{} + pb.RegisteredModel = st.RegisteredModel + + return pb, nil +} + +type createModelResponsePb struct { + RegisteredModel *Model `json:"registered_model,omitempty"` +} + +func createModelResponseFromPb(pb *createModelResponsePb) (*CreateModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateModelResponse{} + st.RegisteredModel = pb.RegisteredModel + + return st, nil +} + +func createModelVersionRequestToPb(st *CreateModelVersionRequest) (*createModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createModelVersionRequestPb{} + pb.Description = st.Description + + pb.Name = st.Name + + pb.RunId = st.RunId + + pb.RunLink = st.RunLink + + pb.Source = st.Source + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createModelVersionRequestPb struct { + Description string `json:"description,omitempty"` + + Name string `json:"name"` + + RunId string `json:"run_id,omitempty"` + + RunLink string `json:"run_link,omitempty"` + + Source string `json:"source"` + + Tags []ModelVersionTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createModelVersionRequestFromPb(pb *createModelVersionRequestPb) (*CreateModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateModelVersionRequest{} + st.Description = pb.Description + st.Name = pb.Name + st.RunId = pb.RunId + st.RunLink = pb.RunLink + st.Source = pb.Source + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createModelVersionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createModelVersionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createModelVersionResponseToPb(st *CreateModelVersionResponse) (*createModelVersionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createModelVersionResponsePb{} + pb.ModelVersion = st.ModelVersion + + return pb, nil +} + +type createModelVersionResponsePb struct { + ModelVersion *ModelVersion `json:"model_version,omitempty"` +} + +func createModelVersionResponseFromPb(pb *createModelVersionResponsePb) (*CreateModelVersionResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateModelVersionResponse{} + st.ModelVersion = pb.ModelVersion + + return st, nil +} + +func createRegistryWebhookToPb(st *CreateRegistryWebhook) (*createRegistryWebhookPb, error) { + if st == nil { + return nil, nil + } + pb := &createRegistryWebhookPb{} + pb.Description = st.Description + + pb.Events = st.Events + + pb.HttpUrlSpec = st.HttpUrlSpec + + pb.JobSpec = st.JobSpec + + pb.ModelName = st.ModelName + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRegistryWebhookPb struct { + Description string `json:"description,omitempty"` + + Events []RegistryWebhookEvent `json:"events"` + + HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + + JobSpec *JobSpec `json:"job_spec,omitempty"` + + ModelName string `json:"model_name,omitempty"` + + Status RegistryWebhookStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRegistryWebhookFromPb(pb *createRegistryWebhookPb) (*CreateRegistryWebhook, error) { + if pb == nil { + return nil, nil + } + st := &CreateRegistryWebhook{} + st.Description = pb.Description + st.Events = pb.Events + st.HttpUrlSpec = pb.HttpUrlSpec + st.JobSpec = pb.JobSpec + st.ModelName = pb.ModelName + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRegistryWebhookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRegistryWebhookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createRunToPb(st *CreateRun) (*createRunPb, error) { + if st == nil { + return nil, nil + } + pb := &createRunPb{} + pb.ExperimentId = st.ExperimentId + + pb.RunName = st.RunName + + pb.StartTime = st.StartTime + + pb.Tags = st.Tags + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRunPb struct { + ExperimentId string `json:"experiment_id,omitempty"` + + RunName string `json:"run_name,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + Tags []RunTag `json:"tags,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRunFromPb(pb *createRunPb) (*CreateRun, error) { + if pb == nil { + return nil, nil + } + st := &CreateRun{} + st.ExperimentId = pb.ExperimentId + st.RunName = pb.RunName + st.StartTime = pb.StartTime + st.Tags = pb.Tags + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createRunResponseToPb(st *CreateRunResponse) (*createRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createRunResponsePb{} + pb.Run = st.Run + + return pb, nil +} + +type createRunResponsePb struct { + Run *Run `json:"run,omitempty"` +} + +func createRunResponseFromPb(pb *createRunResponsePb) (*CreateRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateRunResponse{} + st.Run = pb.Run + + return st, nil +} + +func createTransitionRequestToPb(st *CreateTransitionRequest) (*createTransitionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createTransitionRequestPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Stage = st.Stage + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createTransitionRequestPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + Stage Stage `json:"stage"` + + Version string `json:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createTransitionRequestFromPb(pb *createTransitionRequestPb) (*CreateTransitionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateTransitionRequest{} + st.Comment = pb.Comment + st.Name = pb.Name + st.Stage = pb.Stage + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createTransitionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createTransitionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createTransitionRequestResponseToPb(st *CreateTransitionRequestResponse) (*createTransitionRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createTransitionRequestResponsePb{} + pb.Request = st.Request + + return pb, nil +} + +type createTransitionRequestResponsePb struct { + Request *TransitionRequest `json:"request,omitempty"` +} + +func createTransitionRequestResponseFromPb(pb *createTransitionRequestResponsePb) (*CreateTransitionRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateTransitionRequestResponse{} + st.Request = pb.Request + + return st, nil +} + +func createWebhookResponseToPb(st *CreateWebhookResponse) (*createWebhookResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createWebhookResponsePb{} + pb.Webhook = st.Webhook + + return pb, nil +} + +type createWebhookResponsePb struct { + Webhook *RegistryWebhook `json:"webhook,omitempty"` +} + +func createWebhookResponseFromPb(pb *createWebhookResponsePb) (*CreateWebhookResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateWebhookResponse{} + st.Webhook = pb.Webhook + + return st, nil +} + +func datasetToPb(st *Dataset) (*datasetPb, error) { + if st == nil { + return nil, nil + } + pb := &datasetPb{} + pb.Digest = st.Digest + + pb.Name = st.Name + + pb.Profile = st.Profile + + pb.Schema = st.Schema + + pb.Source = st.Source + + pb.SourceType = st.SourceType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type datasetPb struct { + Digest string `json:"digest"` + + Name string `json:"name"` + + Profile string `json:"profile,omitempty"` + + Schema string `json:"schema,omitempty"` + + Source string `json:"source"` + + SourceType string `json:"source_type"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func datasetFromPb(pb *datasetPb) (*Dataset, error) { + if pb == nil { + return nil, nil + } + st := &Dataset{} + st.Digest = pb.Digest + st.Name = pb.Name + st.Profile = pb.Profile + st.Schema = pb.Schema + st.Source = pb.Source + st.SourceType = pb.SourceType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *datasetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st datasetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func datasetInputToPb(st *DatasetInput) (*datasetInputPb, error) { + if st == nil { + return nil, nil + } + pb := &datasetInputPb{} + pb.Dataset = st.Dataset + + pb.Tags = st.Tags + + return pb, nil +} + +type datasetInputPb struct { + Dataset Dataset `json:"dataset"` + + Tags []InputTag `json:"tags,omitempty"` +} + +func datasetInputFromPb(pb *datasetInputPb) (*DatasetInput, error) { + if pb == nil { + return nil, nil + } + st := &DatasetInput{} + st.Dataset = pb.Dataset + st.Tags = pb.Tags + + return st, nil +} + +func deleteCommentRequestToPb(st *DeleteCommentRequest) (*deleteCommentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCommentRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteCommentRequestPb struct { + Id string `json:"-" url:"id"` +} + +func deleteCommentRequestFromPb(pb *deleteCommentRequestPb) (*DeleteCommentRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCommentRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteCommentResponseToPb(st *DeleteCommentResponse) (*deleteCommentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCommentResponsePb{} + + return pb, nil +} + +type deleteCommentResponsePb struct { +} + +func deleteCommentResponseFromPb(pb *deleteCommentResponsePb) (*DeleteCommentResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCommentResponse{} + + return st, nil +} + +func deleteExperimentToPb(st *DeleteExperiment) (*deleteExperimentPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExperimentPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type deleteExperimentPb struct { + ExperimentId string `json:"experiment_id"` +} + +func deleteExperimentFromPb(pb *deleteExperimentPb) (*DeleteExperiment, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExperiment{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func deleteExperimentResponseToPb(st *DeleteExperimentResponse) (*deleteExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteExperimentResponsePb{} + + return pb, nil +} + +type deleteExperimentResponsePb struct { +} + +func deleteExperimentResponseFromPb(pb *deleteExperimentResponsePb) (*DeleteExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteExperimentResponse{} + + return st, nil +} + +func deleteLoggedModelRequestToPb(st *DeleteLoggedModelRequest) (*deleteLoggedModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLoggedModelRequestPb{} + pb.ModelId = st.ModelId + + return pb, nil +} + +type deleteLoggedModelRequestPb struct { + ModelId string `json:"-" url:"-"` +} + +func deleteLoggedModelRequestFromPb(pb *deleteLoggedModelRequestPb) (*DeleteLoggedModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLoggedModelRequest{} + st.ModelId = pb.ModelId + + return st, nil +} + +func deleteLoggedModelResponseToPb(st *DeleteLoggedModelResponse) (*deleteLoggedModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLoggedModelResponsePb{} + + return pb, nil +} + +type deleteLoggedModelResponsePb struct { +} + +func deleteLoggedModelResponseFromPb(pb *deleteLoggedModelResponsePb) (*DeleteLoggedModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLoggedModelResponse{} + + return st, nil +} + +func deleteLoggedModelTagRequestToPb(st *DeleteLoggedModelTagRequest) (*deleteLoggedModelTagRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLoggedModelTagRequestPb{} + pb.ModelId = st.ModelId + + pb.TagKey = st.TagKey + + return pb, nil +} + +type deleteLoggedModelTagRequestPb struct { + ModelId string `json:"-" url:"-"` + + TagKey string `json:"-" url:"-"` +} + +func deleteLoggedModelTagRequestFromPb(pb *deleteLoggedModelTagRequestPb) (*DeleteLoggedModelTagRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLoggedModelTagRequest{} + st.ModelId = pb.ModelId + st.TagKey = pb.TagKey + + return st, nil +} + +func deleteLoggedModelTagResponseToPb(st *DeleteLoggedModelTagResponse) (*deleteLoggedModelTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLoggedModelTagResponsePb{} + + return pb, nil +} + +type deleteLoggedModelTagResponsePb struct { +} + +func deleteLoggedModelTagResponseFromPb(pb *deleteLoggedModelTagResponsePb) (*DeleteLoggedModelTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLoggedModelTagResponse{} + + return st, nil +} + +func deleteModelRequestToPb(st *DeleteModelRequest) (*deleteModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteModelRequestPb struct { + Name string `json:"-" url:"name"` +} + +func deleteModelRequestFromPb(pb *deleteModelRequestPb) (*DeleteModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteModelResponseToPb(st *DeleteModelResponse) (*deleteModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelResponsePb{} + + return pb, nil +} + +type deleteModelResponsePb struct { +} + +func deleteModelResponseFromPb(pb *deleteModelResponsePb) (*DeleteModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelResponse{} + + return st, nil +} + +func deleteModelTagRequestToPb(st *DeleteModelTagRequest) (*deleteModelTagRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelTagRequestPb{} + pb.Key = st.Key + + pb.Name = st.Name + + return pb, nil +} + +type deleteModelTagRequestPb struct { + Key string `json:"-" url:"key"` + + Name string `json:"-" url:"name"` +} + +func deleteModelTagRequestFromPb(pb *deleteModelTagRequestPb) (*DeleteModelTagRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelTagRequest{} + st.Key = pb.Key + st.Name = pb.Name + + return st, nil +} + +func deleteModelTagResponseToPb(st *DeleteModelTagResponse) (*deleteModelTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelTagResponsePb{} + + return pb, nil +} + +type deleteModelTagResponsePb struct { +} + +func deleteModelTagResponseFromPb(pb *deleteModelTagResponsePb) (*DeleteModelTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelTagResponse{} + + return st, nil +} + +func deleteModelVersionRequestToPb(st *DeleteModelVersionRequest) (*deleteModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelVersionRequestPb{} + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type deleteModelVersionRequestPb struct { + Name string `json:"-" url:"name"` + + Version string `json:"-" url:"version"` +} + +func deleteModelVersionRequestFromPb(pb *deleteModelVersionRequestPb) (*DeleteModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelVersionRequest{} + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func deleteModelVersionResponseToPb(st *DeleteModelVersionResponse) (*deleteModelVersionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelVersionResponsePb{} + + return pb, nil +} + +type deleteModelVersionResponsePb struct { +} + +func deleteModelVersionResponseFromPb(pb *deleteModelVersionResponsePb) (*DeleteModelVersionResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelVersionResponse{} + + return st, nil +} + +func deleteModelVersionTagRequestToPb(st *DeleteModelVersionTagRequest) (*deleteModelVersionTagRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelVersionTagRequestPb{} + pb.Key = st.Key + + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type deleteModelVersionTagRequestPb struct { + Key string `json:"-" url:"key"` + + Name string `json:"-" url:"name"` + + Version string `json:"-" url:"version"` +} + +func deleteModelVersionTagRequestFromPb(pb *deleteModelVersionTagRequestPb) (*DeleteModelVersionTagRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelVersionTagRequest{} + st.Key = pb.Key + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func deleteModelVersionTagResponseToPb(st *DeleteModelVersionTagResponse) (*deleteModelVersionTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteModelVersionTagResponsePb{} + + return pb, nil +} + +type deleteModelVersionTagResponsePb struct { +} + +func deleteModelVersionTagResponseFromPb(pb *deleteModelVersionTagResponsePb) (*DeleteModelVersionTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteModelVersionTagResponse{} + + return st, nil +} + +func deleteRunToPb(st *DeleteRun) (*deleteRunPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunPb{} + pb.RunId = st.RunId + + return pb, nil +} + +type deleteRunPb struct { + RunId string `json:"run_id"` +} + +func deleteRunFromPb(pb *deleteRunPb) (*DeleteRun, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRun{} + st.RunId = pb.RunId + + return st, nil +} + +func deleteRunResponseToPb(st *DeleteRunResponse) (*deleteRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunResponsePb{} + + return pb, nil +} + +type deleteRunResponsePb struct { +} + +func deleteRunResponseFromPb(pb *deleteRunResponsePb) (*DeleteRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRunResponse{} + + return st, nil +} + +func deleteRunsToPb(st *DeleteRuns) (*deleteRunsPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunsPb{} + pb.ExperimentId = st.ExperimentId + + pb.MaxRuns = st.MaxRuns + + pb.MaxTimestampMillis = st.MaxTimestampMillis + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteRunsPb struct { + ExperimentId string `json:"experiment_id"` + + MaxRuns int `json:"max_runs,omitempty"` + + MaxTimestampMillis int64 `json:"max_timestamp_millis"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteRunsFromPb(pb *deleteRunsPb) (*DeleteRuns, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRuns{} + st.ExperimentId = pb.ExperimentId + st.MaxRuns = pb.MaxRuns + st.MaxTimestampMillis = pb.MaxTimestampMillis + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteRunsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteRunsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteRunsResponseToPb(st *DeleteRunsResponse) (*deleteRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRunsResponsePb{} + pb.RunsDeleted = st.RunsDeleted + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteRunsResponsePb struct { + RunsDeleted int `json:"runs_deleted,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteRunsResponseFromPb(pb *deleteRunsResponsePb) (*DeleteRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRunsResponse{} + st.RunsDeleted = pb.RunsDeleted + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteRunsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteRunsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteTagToPb(st *DeleteTag) (*deleteTagPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTagPb{} + pb.Key = st.Key + + pb.RunId = st.RunId + + return pb, nil +} + +type deleteTagPb struct { + Key string `json:"key"` + + RunId string `json:"run_id"` +} + +func deleteTagFromPb(pb *deleteTagPb) (*DeleteTag, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTag{} + st.Key = pb.Key + st.RunId = pb.RunId + + return st, nil +} + +func deleteTagResponseToPb(st *DeleteTagResponse) (*deleteTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTagResponsePb{} + + return pb, nil +} + +type deleteTagResponsePb struct { +} + +func deleteTagResponseFromPb(pb *deleteTagResponsePb) (*DeleteTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTagResponse{} + + return st, nil +} + +func deleteTransitionRequestRequestToPb(st *DeleteTransitionRequestRequest) (*deleteTransitionRequestRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTransitionRequestRequestPb{} + pb.Comment = st.Comment + + pb.Creator = st.Creator + + pb.Name = st.Name + + pb.Stage = st.Stage + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteTransitionRequestRequestPb struct { + Comment string `json:"-" url:"comment,omitempty"` + + Creator string `json:"-" url:"creator"` + + Name string `json:"-" url:"name"` + + Stage DeleteTransitionRequestStage `json:"-" url:"stage"` + + Version string `json:"-" url:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteTransitionRequestRequestFromPb(pb *deleteTransitionRequestRequestPb) (*DeleteTransitionRequestRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTransitionRequestRequest{} + st.Comment = pb.Comment + st.Creator = pb.Creator + st.Name = pb.Name + st.Stage = pb.Stage + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteTransitionRequestRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteTransitionRequestRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteTransitionRequestResponseToPb(st *DeleteTransitionRequestResponse) (*deleteTransitionRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTransitionRequestResponsePb{} + + return pb, nil +} + +type deleteTransitionRequestResponsePb struct { +} + +func deleteTransitionRequestResponseFromPb(pb *deleteTransitionRequestResponsePb) (*DeleteTransitionRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTransitionRequestResponse{} + + return st, nil +} + +func deleteWebhookRequestToPb(st *DeleteWebhookRequest) (*deleteWebhookRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWebhookRequestPb{} + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteWebhookRequestPb struct { + Id string `json:"-" url:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteWebhookRequestFromPb(pb *deleteWebhookRequestPb) (*DeleteWebhookRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWebhookRequest{} + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteWebhookRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteWebhookRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteWebhookResponseToPb(st *DeleteWebhookResponse) (*deleteWebhookResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWebhookResponsePb{} + + return pb, nil +} + +type deleteWebhookResponsePb struct { +} + +func deleteWebhookResponseFromPb(pb *deleteWebhookResponsePb) (*DeleteWebhookResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWebhookResponse{} + + return st, nil +} + +func experimentToPb(st *Experiment) (*experimentPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentPb{} + pb.ArtifactLocation = st.ArtifactLocation + + pb.CreationTime = st.CreationTime + + pb.ExperimentId = st.ExperimentId + + pb.LastUpdateTime = st.LastUpdateTime + + pb.LifecycleStage = st.LifecycleStage + + pb.Name = st.Name + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentPb struct { + ArtifactLocation string `json:"artifact_location,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + ExperimentId string `json:"experiment_id,omitempty"` + + LastUpdateTime int64 `json:"last_update_time,omitempty"` + + LifecycleStage string `json:"lifecycle_stage,omitempty"` + + Name string `json:"name,omitempty"` + + Tags []ExperimentTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentFromPb(pb *experimentPb) (*Experiment, error) { + if pb == nil { + return nil, nil + } + st := &Experiment{} + st.ArtifactLocation = pb.ArtifactLocation + st.CreationTime = pb.CreationTime + st.ExperimentId = pb.ExperimentId + st.LastUpdateTime = pb.LastUpdateTime + st.LifecycleStage = pb.LifecycleStage + st.Name = pb.Name + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentAccessControlRequestToPb(st *ExperimentAccessControlRequest) (*experimentAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentAccessControlRequestFromPb(pb *experimentAccessControlRequestPb) (*ExperimentAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentAccessControlResponseToPb(st *ExperimentAccessControlResponse) (*experimentAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &experimentAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentAccessControlResponsePb struct { + AllPermissions []ExperimentPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentAccessControlResponseFromPb(pb *experimentAccessControlResponsePb) (*ExperimentAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentPermissionToPb(st *ExperimentPermission) (*experimentPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentPermissionFromPb(pb *experimentPermissionPb) (*ExperimentPermission, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentPermissionsToPb(st *ExperimentPermissions) (*experimentPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentPermissionsPb struct { + AccessControlList []ExperimentAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentPermissionsFromPb(pb *experimentPermissionsPb) (*ExperimentPermissions, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentPermissionsDescriptionToPb(st *ExperimentPermissionsDescription) (*experimentPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentPermissionsDescriptionFromPb(pb *experimentPermissionsDescriptionPb) (*ExperimentPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func experimentPermissionsRequestToPb(st *ExperimentPermissionsRequest) (*experimentPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type experimentPermissionsRequestPb struct { + AccessControlList []ExperimentAccessControlRequest `json:"access_control_list,omitempty"` + + ExperimentId string `json:"-" url:"-"` +} + +func experimentPermissionsRequestFromPb(pb *experimentPermissionsRequestPb) (*ExperimentPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func experimentTagToPb(st *ExperimentTag) (*experimentTagPb, error) { + if st == nil { + return nil, nil + } + pb := &experimentTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type experimentTagPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func experimentTagFromPb(pb *experimentTagPb) (*ExperimentTag, error) { + if pb == nil { + return nil, nil + } + st := &ExperimentTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *experimentTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st experimentTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &fileInfoPb{} + pb.FileSize = st.FileSize + + pb.IsDir = st.IsDir + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileInfoPb struct { + FileSize int64 `json:"file_size,omitempty"` + + IsDir bool `json:"is_dir,omitempty"` + + Path string `json:"path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileInfoFromPb(pb *fileInfoPb) (*FileInfo, error) { + if pb == nil { + return nil, nil + } + st := &FileInfo{} + st.FileSize = pb.FileSize + st.IsDir = pb.IsDir + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func finalizeLoggedModelRequestToPb(st *FinalizeLoggedModelRequest) (*finalizeLoggedModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &finalizeLoggedModelRequestPb{} + pb.ModelId = st.ModelId + + pb.Status = st.Status + + return pb, nil +} + +type finalizeLoggedModelRequestPb struct { + ModelId string `json:"-" url:"-"` + + Status LoggedModelStatus `json:"status"` +} + +func finalizeLoggedModelRequestFromPb(pb *finalizeLoggedModelRequestPb) (*FinalizeLoggedModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &FinalizeLoggedModelRequest{} + st.ModelId = pb.ModelId + st.Status = pb.Status + + return st, nil +} + +func finalizeLoggedModelResponseToPb(st *FinalizeLoggedModelResponse) (*finalizeLoggedModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &finalizeLoggedModelResponsePb{} + pb.Model = st.Model + + return pb, nil +} + +type finalizeLoggedModelResponsePb struct { + Model *LoggedModel `json:"model,omitempty"` +} + +func finalizeLoggedModelResponseFromPb(pb *finalizeLoggedModelResponsePb) (*FinalizeLoggedModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &FinalizeLoggedModelResponse{} + st.Model = pb.Model + + return st, nil +} + +func forecastingExperimentToPb(st *ForecastingExperiment) (*forecastingExperimentPb, error) { + if st == nil { + return nil, nil + } + pb := &forecastingExperimentPb{} + pb.ExperimentId = st.ExperimentId + + pb.ExperimentPageUrl = st.ExperimentPageUrl + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type forecastingExperimentPb struct { + ExperimentId string `json:"experiment_id,omitempty"` + + ExperimentPageUrl string `json:"experiment_page_url,omitempty"` + + State ForecastingExperimentState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func forecastingExperimentFromPb(pb *forecastingExperimentPb) (*ForecastingExperiment, error) { + if pb == nil { + return nil, nil + } + st := &ForecastingExperiment{} + st.ExperimentId = pb.ExperimentId + st.ExperimentPageUrl = pb.ExperimentPageUrl + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *forecastingExperimentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st forecastingExperimentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getByNameRequestToPb(st *GetByNameRequest) (*getByNameRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getByNameRequestPb{} + pb.ExperimentName = st.ExperimentName + + return pb, nil +} + +type getByNameRequestPb struct { + ExperimentName string `json:"-" url:"experiment_name"` +} + +func getByNameRequestFromPb(pb *getByNameRequestPb) (*GetByNameRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetByNameRequest{} + st.ExperimentName = pb.ExperimentName + + return st, nil +} + +func getCredentialsForTraceDataDownloadRequestToPb(st *GetCredentialsForTraceDataDownloadRequest) (*getCredentialsForTraceDataDownloadRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsForTraceDataDownloadRequestPb{} + pb.RequestId = st.RequestId + + return pb, nil +} + +type getCredentialsForTraceDataDownloadRequestPb struct { + RequestId string `json:"-" url:"-"` +} + +func getCredentialsForTraceDataDownloadRequestFromPb(pb *getCredentialsForTraceDataDownloadRequestPb) (*GetCredentialsForTraceDataDownloadRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsForTraceDataDownloadRequest{} + st.RequestId = pb.RequestId + + return st, nil +} + +func getCredentialsForTraceDataDownloadResponseToPb(st *GetCredentialsForTraceDataDownloadResponse) (*getCredentialsForTraceDataDownloadResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsForTraceDataDownloadResponsePb{} + pb.CredentialInfo = st.CredentialInfo + + return pb, nil +} + +type getCredentialsForTraceDataDownloadResponsePb struct { + CredentialInfo *ArtifactCredentialInfo `json:"credential_info,omitempty"` +} + +func getCredentialsForTraceDataDownloadResponseFromPb(pb *getCredentialsForTraceDataDownloadResponsePb) (*GetCredentialsForTraceDataDownloadResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsForTraceDataDownloadResponse{} + st.CredentialInfo = pb.CredentialInfo + + return st, nil +} + +func getCredentialsForTraceDataUploadRequestToPb(st *GetCredentialsForTraceDataUploadRequest) (*getCredentialsForTraceDataUploadRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsForTraceDataUploadRequestPb{} + pb.RequestId = st.RequestId + + return pb, nil +} + +type getCredentialsForTraceDataUploadRequestPb struct { + RequestId string `json:"-" url:"-"` +} + +func getCredentialsForTraceDataUploadRequestFromPb(pb *getCredentialsForTraceDataUploadRequestPb) (*GetCredentialsForTraceDataUploadRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsForTraceDataUploadRequest{} + st.RequestId = pb.RequestId + + return st, nil +} + +func getCredentialsForTraceDataUploadResponseToPb(st *GetCredentialsForTraceDataUploadResponse) (*getCredentialsForTraceDataUploadResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsForTraceDataUploadResponsePb{} + pb.CredentialInfo = st.CredentialInfo + + return pb, nil +} + +type getCredentialsForTraceDataUploadResponsePb struct { + CredentialInfo *ArtifactCredentialInfo `json:"credential_info,omitempty"` +} + +func getCredentialsForTraceDataUploadResponseFromPb(pb *getCredentialsForTraceDataUploadResponsePb) (*GetCredentialsForTraceDataUploadResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsForTraceDataUploadResponse{} + st.CredentialInfo = pb.CredentialInfo + + return st, nil +} + +func getExperimentByNameResponseToPb(st *GetExperimentByNameResponse) (*getExperimentByNameResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentByNameResponsePb{} + pb.Experiment = st.Experiment + + return pb, nil +} + +type getExperimentByNameResponsePb struct { + Experiment *Experiment `json:"experiment,omitempty"` +} + +func getExperimentByNameResponseFromPb(pb *getExperimentByNameResponsePb) (*GetExperimentByNameResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentByNameResponse{} + st.Experiment = pb.Experiment + + return st, nil +} + +func getExperimentPermissionLevelsRequestToPb(st *GetExperimentPermissionLevelsRequest) (*getExperimentPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentPermissionLevelsRequestPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type getExperimentPermissionLevelsRequestPb struct { + ExperimentId string `json:"-" url:"-"` +} + +func getExperimentPermissionLevelsRequestFromPb(pb *getExperimentPermissionLevelsRequestPb) (*GetExperimentPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentPermissionLevelsRequest{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func getExperimentPermissionLevelsResponseToPb(st *GetExperimentPermissionLevelsResponse) (*getExperimentPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getExperimentPermissionLevelsResponsePb struct { + PermissionLevels []ExperimentPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getExperimentPermissionLevelsResponseFromPb(pb *getExperimentPermissionLevelsResponsePb) (*GetExperimentPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getExperimentPermissionsRequestToPb(st *GetExperimentPermissionsRequest) (*getExperimentPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentPermissionsRequestPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type getExperimentPermissionsRequestPb struct { + ExperimentId string `json:"-" url:"-"` +} + +func getExperimentPermissionsRequestFromPb(pb *getExperimentPermissionsRequestPb) (*GetExperimentPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentPermissionsRequest{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func getExperimentRequestToPb(st *GetExperimentRequest) (*getExperimentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentRequestPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type getExperimentRequestPb struct { + ExperimentId string `json:"-" url:"experiment_id"` +} + +func getExperimentRequestFromPb(pb *getExperimentRequestPb) (*GetExperimentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentRequest{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func getExperimentResponseToPb(st *GetExperimentResponse) (*getExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getExperimentResponsePb{} + pb.Experiment = st.Experiment + + return pb, nil +} + +type getExperimentResponsePb struct { + Experiment *Experiment `json:"experiment,omitempty"` +} + +func getExperimentResponseFromPb(pb *getExperimentResponsePb) (*GetExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetExperimentResponse{} + st.Experiment = pb.Experiment + + return st, nil +} + +func getForecastingExperimentRequestToPb(st *GetForecastingExperimentRequest) (*getForecastingExperimentRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getForecastingExperimentRequestPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type getForecastingExperimentRequestPb struct { + ExperimentId string `json:"-" url:"-"` +} + +func getForecastingExperimentRequestFromPb(pb *getForecastingExperimentRequestPb) (*GetForecastingExperimentRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetForecastingExperimentRequest{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func getHistoryRequestToPb(st *GetHistoryRequest) (*getHistoryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getHistoryRequestPb{} + pb.MaxResults = st.MaxResults + + pb.MetricKey = st.MetricKey + + pb.PageToken = st.PageToken + + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getHistoryRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + MetricKey string `json:"-" url:"metric_key"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + RunId string `json:"-" url:"run_id,omitempty"` + + RunUuid string `json:"-" url:"run_uuid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getHistoryRequestFromPb(pb *getHistoryRequestPb) (*GetHistoryRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetHistoryRequest{} + st.MaxResults = pb.MaxResults + st.MetricKey = pb.MetricKey + st.PageToken = pb.PageToken + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getHistoryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getHistoryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getLatestVersionsRequestToPb(st *GetLatestVersionsRequest) (*getLatestVersionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLatestVersionsRequestPb{} + pb.Name = st.Name + + pb.Stages = st.Stages + + return pb, nil +} + +type getLatestVersionsRequestPb struct { + Name string `json:"name"` + + Stages []string `json:"stages,omitempty"` +} + +func getLatestVersionsRequestFromPb(pb *getLatestVersionsRequestPb) (*GetLatestVersionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLatestVersionsRequest{} + st.Name = pb.Name + st.Stages = pb.Stages + + return st, nil +} + +func getLatestVersionsResponseToPb(st *GetLatestVersionsResponse) (*getLatestVersionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getLatestVersionsResponsePb{} + pb.ModelVersions = st.ModelVersions + + return pb, nil +} + +type getLatestVersionsResponsePb struct { + ModelVersions []ModelVersion `json:"model_versions,omitempty"` +} + +func getLatestVersionsResponseFromPb(pb *getLatestVersionsResponsePb) (*GetLatestVersionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetLatestVersionsResponse{} + st.ModelVersions = pb.ModelVersions + + return st, nil +} + +func getLoggedModelRequestToPb(st *GetLoggedModelRequest) (*getLoggedModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLoggedModelRequestPb{} + pb.ModelId = st.ModelId + + return pb, nil +} + +type getLoggedModelRequestPb struct { + ModelId string `json:"-" url:"-"` +} + +func getLoggedModelRequestFromPb(pb *getLoggedModelRequestPb) (*GetLoggedModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLoggedModelRequest{} + st.ModelId = pb.ModelId + + return st, nil +} + +func getLoggedModelResponseToPb(st *GetLoggedModelResponse) (*getLoggedModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getLoggedModelResponsePb{} + pb.Model = st.Model + + return pb, nil +} + +type getLoggedModelResponsePb struct { + Model *LoggedModel `json:"model,omitempty"` +} + +func getLoggedModelResponseFromPb(pb *getLoggedModelResponsePb) (*GetLoggedModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetLoggedModelResponse{} + st.Model = pb.Model + + return st, nil +} + +func getMetricHistoryResponseToPb(st *GetMetricHistoryResponse) (*getMetricHistoryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getMetricHistoryResponsePb{} + pb.Metrics = st.Metrics + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getMetricHistoryResponsePb struct { + Metrics []Metric `json:"metrics,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getMetricHistoryResponseFromPb(pb *getMetricHistoryResponsePb) (*GetMetricHistoryResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetMetricHistoryResponse{} + st.Metrics = pb.Metrics + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getMetricHistoryResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getMetricHistoryResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getModelRequestToPb(st *GetModelRequest) (*getModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getModelRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getModelRequestPb struct { + Name string `json:"-" url:"name"` +} + +func getModelRequestFromPb(pb *getModelRequestPb) (*GetModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetModelRequest{} + st.Name = pb.Name + + return st, nil +} + +func getModelResponseToPb(st *GetModelResponse) (*getModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getModelResponsePb{} + pb.RegisteredModelDatabricks = st.RegisteredModelDatabricks + + return pb, nil +} + +type getModelResponsePb struct { + RegisteredModelDatabricks *ModelDatabricks `json:"registered_model_databricks,omitempty"` +} + +func getModelResponseFromPb(pb *getModelResponsePb) (*GetModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetModelResponse{} + st.RegisteredModelDatabricks = pb.RegisteredModelDatabricks + + return st, nil +} + +func getModelVersionDownloadUriRequestToPb(st *GetModelVersionDownloadUriRequest) (*getModelVersionDownloadUriRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getModelVersionDownloadUriRequestPb{} + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type getModelVersionDownloadUriRequestPb struct { + Name string `json:"-" url:"name"` + + Version string `json:"-" url:"version"` +} + +func getModelVersionDownloadUriRequestFromPb(pb *getModelVersionDownloadUriRequestPb) (*GetModelVersionDownloadUriRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetModelVersionDownloadUriRequest{} + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func getModelVersionDownloadUriResponseToPb(st *GetModelVersionDownloadUriResponse) (*getModelVersionDownloadUriResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getModelVersionDownloadUriResponsePb{} + pb.ArtifactUri = st.ArtifactUri + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getModelVersionDownloadUriResponsePb struct { + ArtifactUri string `json:"artifact_uri,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getModelVersionDownloadUriResponseFromPb(pb *getModelVersionDownloadUriResponsePb) (*GetModelVersionDownloadUriResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetModelVersionDownloadUriResponse{} + st.ArtifactUri = pb.ArtifactUri + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getModelVersionDownloadUriResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getModelVersionDownloadUriResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getModelVersionRequestToPb(st *GetModelVersionRequest) (*getModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getModelVersionRequestPb{} + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type getModelVersionRequestPb struct { + Name string `json:"-" url:"name"` + + Version string `json:"-" url:"version"` +} + +func getModelVersionRequestFromPb(pb *getModelVersionRequestPb) (*GetModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetModelVersionRequest{} + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func getModelVersionResponseToPb(st *GetModelVersionResponse) (*getModelVersionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getModelVersionResponsePb{} + pb.ModelVersion = st.ModelVersion + + return pb, nil +} + +type getModelVersionResponsePb struct { + ModelVersion *ModelVersion `json:"model_version,omitempty"` +} + +func getModelVersionResponseFromPb(pb *getModelVersionResponsePb) (*GetModelVersionResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetModelVersionResponse{} + st.ModelVersion = pb.ModelVersion + + return st, nil +} + +func getRegisteredModelPermissionLevelsRequestToPb(st *GetRegisteredModelPermissionLevelsRequest) (*getRegisteredModelPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRegisteredModelPermissionLevelsRequestPb{} + pb.RegisteredModelId = st.RegisteredModelId + + return pb, nil +} + +type getRegisteredModelPermissionLevelsRequestPb struct { + RegisteredModelId string `json:"-" url:"-"` +} + +func getRegisteredModelPermissionLevelsRequestFromPb(pb *getRegisteredModelPermissionLevelsRequestPb) (*GetRegisteredModelPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRegisteredModelPermissionLevelsRequest{} + st.RegisteredModelId = pb.RegisteredModelId + + return st, nil +} + +func getRegisteredModelPermissionLevelsResponseToPb(st *GetRegisteredModelPermissionLevelsResponse) (*getRegisteredModelPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getRegisteredModelPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getRegisteredModelPermissionLevelsResponsePb struct { + PermissionLevels []RegisteredModelPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getRegisteredModelPermissionLevelsResponseFromPb(pb *getRegisteredModelPermissionLevelsResponsePb) (*GetRegisteredModelPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetRegisteredModelPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getRegisteredModelPermissionsRequestToPb(st *GetRegisteredModelPermissionsRequest) (*getRegisteredModelPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRegisteredModelPermissionsRequestPb{} + pb.RegisteredModelId = st.RegisteredModelId + + return pb, nil +} + +type getRegisteredModelPermissionsRequestPb struct { + RegisteredModelId string `json:"-" url:"-"` +} + +func getRegisteredModelPermissionsRequestFromPb(pb *getRegisteredModelPermissionsRequestPb) (*GetRegisteredModelPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRegisteredModelPermissionsRequest{} + st.RegisteredModelId = pb.RegisteredModelId + + return st, nil +} + +func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRunRequestPb{} + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRunRequestPb struct { + RunId string `json:"-" url:"run_id"` + + RunUuid string `json:"-" url:"run_uuid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRunRequestFromPb(pb *getRunRequestPb) (*GetRunRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRunRequest{} + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRunRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRunRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getRunResponseToPb(st *GetRunResponse) (*getRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getRunResponsePb{} + pb.Run = st.Run + + return pb, nil +} + +type getRunResponsePb struct { + Run *Run `json:"run,omitempty"` +} + +func getRunResponseFromPb(pb *getRunResponsePb) (*GetRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetRunResponse{} + st.Run = pb.Run + + return st, nil +} + +func httpUrlSpecToPb(st *HttpUrlSpec) (*httpUrlSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &httpUrlSpecPb{} + pb.Authorization = st.Authorization + + pb.EnableSslVerification = st.EnableSslVerification + + pb.Secret = st.Secret + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type httpUrlSpecPb struct { + Authorization string `json:"authorization,omitempty"` + + EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + + Secret string `json:"secret,omitempty"` + + Url string `json:"url"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func httpUrlSpecFromPb(pb *httpUrlSpecPb) (*HttpUrlSpec, error) { + if pb == nil { + return nil, nil + } + st := &HttpUrlSpec{} + st.Authorization = pb.Authorization + st.EnableSslVerification = pb.EnableSslVerification + st.Secret = pb.Secret + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *httpUrlSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st httpUrlSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func httpUrlSpecWithoutSecretToPb(st *HttpUrlSpecWithoutSecret) (*httpUrlSpecWithoutSecretPb, error) { + if st == nil { + return nil, nil + } + pb := &httpUrlSpecWithoutSecretPb{} + pb.EnableSslVerification = st.EnableSslVerification + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type httpUrlSpecWithoutSecretPb struct { + EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func httpUrlSpecWithoutSecretFromPb(pb *httpUrlSpecWithoutSecretPb) (*HttpUrlSpecWithoutSecret, error) { + if pb == nil { + return nil, nil + } + st := &HttpUrlSpecWithoutSecret{} + st.EnableSslVerification = pb.EnableSslVerification + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *httpUrlSpecWithoutSecretPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st httpUrlSpecWithoutSecretPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func inputTagToPb(st *InputTag) (*inputTagPb, error) { + if st == nil { + return nil, nil + } + pb := &inputTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + return pb, nil +} + +type inputTagPb struct { + Key string `json:"key"` + + Value string `json:"value"` +} + +func inputTagFromPb(pb *inputTagPb) (*InputTag, error) { + if pb == nil { + return nil, nil + } + st := &InputTag{} + st.Key = pb.Key + st.Value = pb.Value + + return st, nil +} + +func jobSpecToPb(st *JobSpec) (*jobSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &jobSpecPb{} + pb.AccessToken = st.AccessToken + + pb.JobId = st.JobId + + pb.WorkspaceUrl = st.WorkspaceUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobSpecPb struct { + AccessToken string `json:"access_token"` + + JobId string `json:"job_id"` + + WorkspaceUrl string `json:"workspace_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobSpecFromPb(pb *jobSpecPb) (*JobSpec, error) { + if pb == nil { + return nil, nil + } + st := &JobSpec{} + st.AccessToken = pb.AccessToken + st.JobId = pb.JobId + st.WorkspaceUrl = pb.WorkspaceUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func jobSpecWithoutSecretToPb(st *JobSpecWithoutSecret) (*jobSpecWithoutSecretPb, error) { + if st == nil { + return nil, nil + } + pb := &jobSpecWithoutSecretPb{} + pb.JobId = st.JobId + + pb.WorkspaceUrl = st.WorkspaceUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type jobSpecWithoutSecretPb struct { + JobId string `json:"job_id,omitempty"` + + WorkspaceUrl string `json:"workspace_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func jobSpecWithoutSecretFromPb(pb *jobSpecWithoutSecretPb) (*JobSpecWithoutSecret, error) { + if pb == nil { + return nil, nil + } + st := &JobSpecWithoutSecret{} + st.JobId = pb.JobId + st.WorkspaceUrl = pb.WorkspaceUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *jobSpecWithoutSecretPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st jobSpecWithoutSecretPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listArtifactsRequestToPb(st *ListArtifactsRequest) (*listArtifactsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listArtifactsRequestPb{} + pb.PageToken = st.PageToken + + pb.Path = st.Path + + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listArtifactsRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + Path string `json:"-" url:"path,omitempty"` + + RunId string `json:"-" url:"run_id,omitempty"` + + RunUuid string `json:"-" url:"run_uuid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listArtifactsRequestFromPb(pb *listArtifactsRequestPb) (*ListArtifactsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListArtifactsRequest{} + st.PageToken = pb.PageToken + st.Path = pb.Path + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listArtifactsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listArtifactsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listArtifactsResponseToPb(st *ListArtifactsResponse) (*listArtifactsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listArtifactsResponsePb{} + pb.Files = st.Files + + pb.NextPageToken = st.NextPageToken + + pb.RootUri = st.RootUri + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listArtifactsResponsePb struct { + Files []FileInfo `json:"files,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + RootUri string `json:"root_uri,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listArtifactsResponseFromPb(pb *listArtifactsResponsePb) (*ListArtifactsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListArtifactsResponse{} + st.Files = pb.Files + st.NextPageToken = pb.NextPageToken + st.RootUri = pb.RootUri + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listArtifactsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listArtifactsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExperimentsRequestToPb(st *ListExperimentsRequest) (*listExperimentsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listExperimentsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ViewType = st.ViewType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExperimentsRequestPb struct { + MaxResults int64 `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ViewType ViewType `json:"-" url:"view_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExperimentsRequestFromPb(pb *listExperimentsRequestPb) (*ListExperimentsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListExperimentsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.ViewType = pb.ViewType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExperimentsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExperimentsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listExperimentsResponseToPb(st *ListExperimentsResponse) (*listExperimentsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listExperimentsResponsePb{} + pb.Experiments = st.Experiments + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listExperimentsResponsePb struct { + Experiments []Experiment `json:"experiments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listExperimentsResponseFromPb(pb *listExperimentsResponsePb) (*ListExperimentsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListExperimentsResponse{} + st.Experiments = pb.Experiments + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listExperimentsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listExperimentsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listLoggedModelArtifactsRequestToPb(st *ListLoggedModelArtifactsRequest) (*listLoggedModelArtifactsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listLoggedModelArtifactsRequestPb{} + pb.ArtifactDirectoryPath = st.ArtifactDirectoryPath + + pb.ModelId = st.ModelId + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listLoggedModelArtifactsRequestPb struct { + ArtifactDirectoryPath string `json:"-" url:"artifact_directory_path,omitempty"` + + ModelId string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listLoggedModelArtifactsRequestFromPb(pb *listLoggedModelArtifactsRequestPb) (*ListLoggedModelArtifactsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListLoggedModelArtifactsRequest{} + st.ArtifactDirectoryPath = pb.ArtifactDirectoryPath + st.ModelId = pb.ModelId + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listLoggedModelArtifactsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listLoggedModelArtifactsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listLoggedModelArtifactsResponseToPb(st *ListLoggedModelArtifactsResponse) (*listLoggedModelArtifactsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listLoggedModelArtifactsResponsePb{} + pb.Files = st.Files + + pb.NextPageToken = st.NextPageToken + + pb.RootUri = st.RootUri + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listLoggedModelArtifactsResponsePb struct { + Files []FileInfo `json:"files,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + RootUri string `json:"root_uri,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listLoggedModelArtifactsResponseFromPb(pb *listLoggedModelArtifactsResponsePb) (*ListLoggedModelArtifactsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListLoggedModelArtifactsResponse{} + st.Files = pb.Files + st.NextPageToken = pb.NextPageToken + st.RootUri = pb.RootUri + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listLoggedModelArtifactsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listLoggedModelArtifactsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listModelsRequestToPb(st *ListModelsRequest) (*listModelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listModelsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listModelsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listModelsRequestFromPb(pb *listModelsRequestPb) (*ListModelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListModelsRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listModelsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listModelsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listModelsResponseToPb(st *ListModelsResponse) (*listModelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listModelsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.RegisteredModels = st.RegisteredModels + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listModelsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + RegisteredModels []Model `json:"registered_models,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listModelsResponseFromPb(pb *listModelsResponsePb) (*ListModelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListModelsResponse{} + st.NextPageToken = pb.NextPageToken + st.RegisteredModels = pb.RegisteredModels + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listModelsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listModelsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRegistryWebhooksToPb(st *ListRegistryWebhooks) (*listRegistryWebhooksPb, error) { + if st == nil { + return nil, nil + } + pb := &listRegistryWebhooksPb{} + pb.NextPageToken = st.NextPageToken + + pb.Webhooks = st.Webhooks + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRegistryWebhooksPb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Webhooks []RegistryWebhook `json:"webhooks,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRegistryWebhooksFromPb(pb *listRegistryWebhooksPb) (*ListRegistryWebhooks, error) { + if pb == nil { + return nil, nil + } + st := &ListRegistryWebhooks{} + st.NextPageToken = pb.NextPageToken + st.Webhooks = pb.Webhooks + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRegistryWebhooksPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRegistryWebhooksPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listTransitionRequestsRequestToPb(st *ListTransitionRequestsRequest) (*listTransitionRequestsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listTransitionRequestsRequestPb{} + pb.Name = st.Name + + pb.Version = st.Version + + return pb, nil +} + +type listTransitionRequestsRequestPb struct { + Name string `json:"-" url:"name"` + + Version string `json:"-" url:"version"` +} + +func listTransitionRequestsRequestFromPb(pb *listTransitionRequestsRequestPb) (*ListTransitionRequestsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListTransitionRequestsRequest{} + st.Name = pb.Name + st.Version = pb.Version + + return st, nil +} + +func listTransitionRequestsResponseToPb(st *ListTransitionRequestsResponse) (*listTransitionRequestsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listTransitionRequestsResponsePb{} + pb.Requests = st.Requests + + return pb, nil +} + +type listTransitionRequestsResponsePb struct { + Requests []Activity `json:"requests,omitempty"` +} + +func listTransitionRequestsResponseFromPb(pb *listTransitionRequestsResponsePb) (*ListTransitionRequestsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListTransitionRequestsResponse{} + st.Requests = pb.Requests + + return st, nil +} + +func listWebhooksRequestToPb(st *ListWebhooksRequest) (*listWebhooksRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listWebhooksRequestPb{} + pb.Events = st.Events + + pb.ModelName = st.ModelName + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listWebhooksRequestPb struct { + Events []RegistryWebhookEvent `json:"-" url:"events,omitempty"` + + ModelName string `json:"-" url:"model_name,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listWebhooksRequestFromPb(pb *listWebhooksRequestPb) (*ListWebhooksRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListWebhooksRequest{} + st.Events = pb.Events + st.ModelName = pb.ModelName + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listWebhooksRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listWebhooksRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logBatchToPb(st *LogBatch) (*logBatchPb, error) { + if st == nil { + return nil, nil + } + pb := &logBatchPb{} + pb.Metrics = st.Metrics + + pb.Params = st.Params + + pb.RunId = st.RunId + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logBatchPb struct { + Metrics []Metric `json:"metrics,omitempty"` + + Params []Param `json:"params,omitempty"` + + RunId string `json:"run_id,omitempty"` + + Tags []RunTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logBatchFromPb(pb *logBatchPb) (*LogBatch, error) { + if pb == nil { + return nil, nil + } + st := &LogBatch{} + st.Metrics = pb.Metrics + st.Params = pb.Params + st.RunId = pb.RunId + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logBatchPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logBatchPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logBatchResponseToPb(st *LogBatchResponse) (*logBatchResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logBatchResponsePb{} + + return pb, nil +} + +type logBatchResponsePb struct { +} + +func logBatchResponseFromPb(pb *logBatchResponsePb) (*LogBatchResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogBatchResponse{} + + return st, nil +} + +func logInputsToPb(st *LogInputs) (*logInputsPb, error) { + if st == nil { + return nil, nil + } + pb := &logInputsPb{} + pb.Datasets = st.Datasets + + pb.Models = st.Models + + pb.RunId = st.RunId + + return pb, nil +} + +type logInputsPb struct { + Datasets []DatasetInput `json:"datasets,omitempty"` + + Models []ModelInput `json:"models,omitempty"` + + RunId string `json:"run_id"` +} + +func logInputsFromPb(pb *logInputsPb) (*LogInputs, error) { + if pb == nil { + return nil, nil + } + st := &LogInputs{} + st.Datasets = pb.Datasets + st.Models = pb.Models + st.RunId = pb.RunId + + return st, nil +} + +func logInputsResponseToPb(st *LogInputsResponse) (*logInputsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logInputsResponsePb{} + + return pb, nil +} + +type logInputsResponsePb struct { +} + +func logInputsResponseFromPb(pb *logInputsResponsePb) (*LogInputsResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogInputsResponse{} + + return st, nil +} + +func logLoggedModelParamsRequestToPb(st *LogLoggedModelParamsRequest) (*logLoggedModelParamsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &logLoggedModelParamsRequestPb{} + pb.ModelId = st.ModelId + + pb.Params = st.Params + + return pb, nil +} + +type logLoggedModelParamsRequestPb struct { + ModelId string `json:"-" url:"-"` + + Params []LoggedModelParameter `json:"params,omitempty"` +} + +func logLoggedModelParamsRequestFromPb(pb *logLoggedModelParamsRequestPb) (*LogLoggedModelParamsRequest, error) { + if pb == nil { + return nil, nil + } + st := &LogLoggedModelParamsRequest{} + st.ModelId = pb.ModelId + st.Params = pb.Params + + return st, nil +} + +func logLoggedModelParamsRequestResponseToPb(st *LogLoggedModelParamsRequestResponse) (*logLoggedModelParamsRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logLoggedModelParamsRequestResponsePb{} + + return pb, nil +} + +type logLoggedModelParamsRequestResponsePb struct { +} + +func logLoggedModelParamsRequestResponseFromPb(pb *logLoggedModelParamsRequestResponsePb) (*LogLoggedModelParamsRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogLoggedModelParamsRequestResponse{} + + return st, nil +} + +func logMetricToPb(st *LogMetric) (*logMetricPb, error) { + if st == nil { + return nil, nil + } + pb := &logMetricPb{} + pb.DatasetDigest = st.DatasetDigest + + pb.DatasetName = st.DatasetName + + pb.Key = st.Key + + pb.ModelId = st.ModelId + + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.Step = st.Step + + pb.Timestamp = st.Timestamp + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logMetricPb struct { + DatasetDigest string `json:"dataset_digest,omitempty"` + + DatasetName string `json:"dataset_name,omitempty"` + + Key string `json:"key"` + + ModelId string `json:"model_id,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunUuid string `json:"run_uuid,omitempty"` + + Step int64 `json:"step,omitempty"` + + Timestamp int64 `json:"timestamp"` + + Value float64 `json:"value"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logMetricFromPb(pb *logMetricPb) (*LogMetric, error) { + if pb == nil { + return nil, nil + } + st := &LogMetric{} + st.DatasetDigest = pb.DatasetDigest + st.DatasetName = pb.DatasetName + st.Key = pb.Key + st.ModelId = pb.ModelId + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + st.Step = pb.Step + st.Timestamp = pb.Timestamp + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logMetricPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logMetricPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logMetricResponseToPb(st *LogMetricResponse) (*logMetricResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logMetricResponsePb{} + + return pb, nil +} + +type logMetricResponsePb struct { +} + +func logMetricResponseFromPb(pb *logMetricResponsePb) (*LogMetricResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogMetricResponse{} + + return st, nil +} + +func logModelToPb(st *LogModel) (*logModelPb, error) { + if st == nil { + return nil, nil + } + pb := &logModelPb{} + pb.ModelJson = st.ModelJson + + pb.RunId = st.RunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logModelPb struct { + ModelJson string `json:"model_json,omitempty"` + + RunId string `json:"run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logModelFromPb(pb *logModelPb) (*LogModel, error) { + if pb == nil { + return nil, nil + } + st := &LogModel{} + st.ModelJson = pb.ModelJson + st.RunId = pb.RunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logModelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logModelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logModelResponseToPb(st *LogModelResponse) (*logModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logModelResponsePb{} + + return pb, nil +} + +type logModelResponsePb struct { +} + +func logModelResponseFromPb(pb *logModelResponsePb) (*LogModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogModelResponse{} + + return st, nil +} + +func logOutputsRequestToPb(st *LogOutputsRequest) (*logOutputsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &logOutputsRequestPb{} + pb.Models = st.Models + + pb.RunId = st.RunId + + return pb, nil +} + +type logOutputsRequestPb struct { + Models []ModelOutput `json:"models,omitempty"` + + RunId string `json:"run_id"` +} + +func logOutputsRequestFromPb(pb *logOutputsRequestPb) (*LogOutputsRequest, error) { + if pb == nil { + return nil, nil + } + st := &LogOutputsRequest{} + st.Models = pb.Models + st.RunId = pb.RunId + + return st, nil +} + +func logOutputsResponseToPb(st *LogOutputsResponse) (*logOutputsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logOutputsResponsePb{} + + return pb, nil +} + +type logOutputsResponsePb struct { +} + +func logOutputsResponseFromPb(pb *logOutputsResponsePb) (*LogOutputsResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogOutputsResponse{} + + return st, nil +} + +func logParamToPb(st *LogParam) (*logParamPb, error) { + if st == nil { + return nil, nil + } + pb := &logParamPb{} + pb.Key = st.Key + + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type logParamPb struct { + Key string `json:"key"` + + RunId string `json:"run_id,omitempty"` + + RunUuid string `json:"run_uuid,omitempty"` + + Value string `json:"value"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func logParamFromPb(pb *logParamPb) (*LogParam, error) { + if pb == nil { + return nil, nil + } + st := &LogParam{} + st.Key = pb.Key + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *logParamPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st logParamPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func logParamResponseToPb(st *LogParamResponse) (*logParamResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &logParamResponsePb{} + + return pb, nil +} + +type logParamResponsePb struct { +} + +func logParamResponseFromPb(pb *logParamResponsePb) (*LogParamResponse, error) { + if pb == nil { + return nil, nil + } + st := &LogParamResponse{} + + return st, nil +} + +func loggedModelToPb(st *LoggedModel) (*loggedModelPb, error) { + if st == nil { + return nil, nil + } + pb := &loggedModelPb{} + pb.Data = st.Data + + pb.Info = st.Info + + return pb, nil +} + +type loggedModelPb struct { + Data *LoggedModelData `json:"data,omitempty"` + + Info *LoggedModelInfo `json:"info,omitempty"` +} + +func loggedModelFromPb(pb *loggedModelPb) (*LoggedModel, error) { + if pb == nil { + return nil, nil + } + st := &LoggedModel{} + st.Data = pb.Data + st.Info = pb.Info + + return st, nil +} + +func loggedModelDataToPb(st *LoggedModelData) (*loggedModelDataPb, error) { + if st == nil { + return nil, nil + } + pb := &loggedModelDataPb{} + pb.Metrics = st.Metrics + + pb.Params = st.Params + + return pb, nil +} + +type loggedModelDataPb struct { + Metrics []Metric `json:"metrics,omitempty"` + + Params []LoggedModelParameter `json:"params,omitempty"` +} + +func loggedModelDataFromPb(pb *loggedModelDataPb) (*LoggedModelData, error) { + if pb == nil { + return nil, nil + } + st := &LoggedModelData{} + st.Metrics = pb.Metrics + st.Params = pb.Params + + return st, nil +} + +func loggedModelInfoToPb(st *LoggedModelInfo) (*loggedModelInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &loggedModelInfoPb{} + pb.ArtifactUri = st.ArtifactUri + + pb.CreationTimestampMs = st.CreationTimestampMs + + pb.CreatorId = st.CreatorId + + pb.ExperimentId = st.ExperimentId + + pb.LastUpdatedTimestampMs = st.LastUpdatedTimestampMs + + pb.ModelId = st.ModelId + + pb.ModelType = st.ModelType + + pb.Name = st.Name + + pb.SourceRunId = st.SourceRunId + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type loggedModelInfoPb struct { + ArtifactUri string `json:"artifact_uri,omitempty"` + + CreationTimestampMs int64 `json:"creation_timestamp_ms,omitempty"` + + CreatorId int64 `json:"creator_id,omitempty"` + + ExperimentId string `json:"experiment_id,omitempty"` + + LastUpdatedTimestampMs int64 `json:"last_updated_timestamp_ms,omitempty"` + + ModelId string `json:"model_id,omitempty"` + + ModelType string `json:"model_type,omitempty"` + + Name string `json:"name,omitempty"` + + SourceRunId string `json:"source_run_id,omitempty"` + + Status LoggedModelStatus `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + Tags []LoggedModelTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func loggedModelInfoFromPb(pb *loggedModelInfoPb) (*LoggedModelInfo, error) { + if pb == nil { + return nil, nil + } + st := &LoggedModelInfo{} + st.ArtifactUri = pb.ArtifactUri + st.CreationTimestampMs = pb.CreationTimestampMs + st.CreatorId = pb.CreatorId + st.ExperimentId = pb.ExperimentId + st.LastUpdatedTimestampMs = pb.LastUpdatedTimestampMs + st.ModelId = pb.ModelId + st.ModelType = pb.ModelType + st.Name = pb.Name + st.SourceRunId = pb.SourceRunId + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *loggedModelInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st loggedModelInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func loggedModelParameterToPb(st *LoggedModelParameter) (*loggedModelParameterPb, error) { + if st == nil { + return nil, nil + } + pb := &loggedModelParameterPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type loggedModelParameterPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func loggedModelParameterFromPb(pb *loggedModelParameterPb) (*LoggedModelParameter, error) { + if pb == nil { + return nil, nil + } + st := &LoggedModelParameter{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *loggedModelParameterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st loggedModelParameterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func loggedModelTagToPb(st *LoggedModelTag) (*loggedModelTagPb, error) { + if st == nil { + return nil, nil + } + pb := &loggedModelTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type loggedModelTagPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func loggedModelTagFromPb(pb *loggedModelTagPb) (*LoggedModelTag, error) { + if pb == nil { + return nil, nil + } + st := &LoggedModelTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *loggedModelTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st loggedModelTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func metricToPb(st *Metric) (*metricPb, error) { + if st == nil { + return nil, nil + } + pb := &metricPb{} + pb.DatasetDigest = st.DatasetDigest + + pb.DatasetName = st.DatasetName + + pb.Key = st.Key + + pb.ModelId = st.ModelId + + pb.RunId = st.RunId + + pb.Step = st.Step + + pb.Timestamp = st.Timestamp + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type metricPb struct { + DatasetDigest string `json:"dataset_digest,omitempty"` + + DatasetName string `json:"dataset_name,omitempty"` + + Key string `json:"key,omitempty"` + + ModelId string `json:"model_id,omitempty"` + + RunId string `json:"run_id,omitempty"` + + Step int64 `json:"step,omitempty"` + + Timestamp int64 `json:"timestamp,omitempty"` + + Value float64 `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func metricFromPb(pb *metricPb) (*Metric, error) { + if pb == nil { + return nil, nil + } + st := &Metric{} + st.DatasetDigest = pb.DatasetDigest + st.DatasetName = pb.DatasetName + st.Key = pb.Key + st.ModelId = pb.ModelId + st.RunId = pb.RunId + st.Step = pb.Step + st.Timestamp = pb.Timestamp + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *metricPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st metricPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelToPb(st *Model) (*modelPb, error) { + if st == nil { + return nil, nil + } + pb := &modelPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Description = st.Description + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.LatestVersions = st.LatestVersions + + pb.Name = st.Name + + pb.Tags = st.Tags + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Description string `json:"description,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + + Name string `json:"name,omitempty"` + + Tags []ModelTag `json:"tags,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelFromPb(pb *modelPb) (*Model, error) { + if pb == nil { + return nil, nil + } + st := &Model{} + st.CreationTimestamp = pb.CreationTimestamp + st.Description = pb.Description + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.LatestVersions = pb.LatestVersions + st.Name = pb.Name + st.Tags = pb.Tags + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelDatabricksToPb(st *ModelDatabricks) (*modelDatabricksPb, error) { + if st == nil { + return nil, nil + } + pb := &modelDatabricksPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Description = st.Description + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.LatestVersions = st.LatestVersions + + pb.Name = st.Name + + pb.PermissionLevel = st.PermissionLevel + + pb.Tags = st.Tags + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelDatabricksPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Description string `json:"description,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + + Name string `json:"name,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + Tags []ModelTag `json:"tags,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelDatabricksFromPb(pb *modelDatabricksPb) (*ModelDatabricks, error) { + if pb == nil { + return nil, nil + } + st := &ModelDatabricks{} + st.CreationTimestamp = pb.CreationTimestamp + st.Description = pb.Description + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.LatestVersions = pb.LatestVersions + st.Name = pb.Name + st.PermissionLevel = pb.PermissionLevel + st.Tags = pb.Tags + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelDatabricksPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelDatabricksPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelInputToPb(st *ModelInput) (*modelInputPb, error) { + if st == nil { + return nil, nil + } + pb := &modelInputPb{} + pb.ModelId = st.ModelId + + return pb, nil +} + +type modelInputPb struct { + ModelId string `json:"model_id"` +} + +func modelInputFromPb(pb *modelInputPb) (*ModelInput, error) { + if pb == nil { + return nil, nil + } + st := &ModelInput{} + st.ModelId = pb.ModelId + + return st, nil +} + +func modelOutputToPb(st *ModelOutput) (*modelOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &modelOutputPb{} + pb.ModelId = st.ModelId + + pb.Step = st.Step + + return pb, nil +} + +type modelOutputPb struct { + ModelId string `json:"model_id"` + + Step int64 `json:"step"` +} + +func modelOutputFromPb(pb *modelOutputPb) (*ModelOutput, error) { + if pb == nil { + return nil, nil + } + st := &ModelOutput{} + st.ModelId = pb.ModelId + st.Step = pb.Step + + return st, nil +} + +func modelTagToPb(st *ModelTag) (*modelTagPb, error) { + if st == nil { + return nil, nil + } + pb := &modelTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelTagPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelTagFromPb(pb *modelTagPb) (*ModelTag, error) { + if pb == nil { + return nil, nil + } + st := &ModelTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelVersionToPb(st *ModelVersion) (*modelVersionPb, error) { + if st == nil { + return nil, nil + } + pb := &modelVersionPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.CurrentStage = st.CurrentStage + + pb.Description = st.Description + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.Name = st.Name + + pb.RunId = st.RunId + + pb.RunLink = st.RunLink + + pb.Source = st.Source + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.Tags = st.Tags + + pb.UserId = st.UserId + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelVersionPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + CurrentStage string `json:"current_stage,omitempty"` + + Description string `json:"description,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + Name string `json:"name,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunLink string `json:"run_link,omitempty"` + + Source string `json:"source,omitempty"` + + Status ModelVersionStatus `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + Tags []ModelVersionTag `json:"tags,omitempty"` + + UserId string `json:"user_id,omitempty"` + + Version string `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelVersionFromPb(pb *modelVersionPb) (*ModelVersion, error) { + if pb == nil { + return nil, nil + } + st := &ModelVersion{} + st.CreationTimestamp = pb.CreationTimestamp + st.CurrentStage = pb.CurrentStage + st.Description = pb.Description + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.Name = pb.Name + st.RunId = pb.RunId + st.RunLink = pb.RunLink + st.Source = pb.Source + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + st.Tags = pb.Tags + st.UserId = pb.UserId + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelVersionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelVersionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelVersionDatabricksToPb(st *ModelVersionDatabricks) (*modelVersionDatabricksPb, error) { + if st == nil { + return nil, nil + } + pb := &modelVersionDatabricksPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.CurrentStage = st.CurrentStage + + pb.Description = st.Description + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.Name = st.Name + + pb.PermissionLevel = st.PermissionLevel + + pb.RunId = st.RunId + + pb.RunLink = st.RunLink + + pb.Source = st.Source + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.Tags = st.Tags + + pb.UserId = st.UserId + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelVersionDatabricksPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + CurrentStage Stage `json:"current_stage,omitempty"` + + Description string `json:"description,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + Name string `json:"name,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunLink string `json:"run_link,omitempty"` + + Source string `json:"source,omitempty"` + + Status Status `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + Tags []ModelVersionTag `json:"tags,omitempty"` + + UserId string `json:"user_id,omitempty"` + + Version string `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelVersionDatabricksFromPb(pb *modelVersionDatabricksPb) (*ModelVersionDatabricks, error) { + if pb == nil { + return nil, nil + } + st := &ModelVersionDatabricks{} + st.CreationTimestamp = pb.CreationTimestamp + st.CurrentStage = pb.CurrentStage + st.Description = pb.Description + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.Name = pb.Name + st.PermissionLevel = pb.PermissionLevel + st.RunId = pb.RunId + st.RunLink = pb.RunLink + st.Source = pb.Source + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + st.Tags = pb.Tags + st.UserId = pb.UserId + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelVersionDatabricksPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelVersionDatabricksPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func modelVersionTagToPb(st *ModelVersionTag) (*modelVersionTagPb, error) { + if st == nil { + return nil, nil + } + pb := &modelVersionTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type modelVersionTagPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func modelVersionTagFromPb(pb *modelVersionTagPb) (*ModelVersionTag, error) { + if pb == nil { + return nil, nil + } + st := &ModelVersionTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *modelVersionTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st modelVersionTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func paramToPb(st *Param) (*paramPb, error) { + if st == nil { + return nil, nil + } + pb := ¶mPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type paramPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func paramFromPb(pb *paramPb) (*Param, error) { + if pb == nil { + return nil, nil + } + st := &Param{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *paramPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st paramPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelAccessControlRequestToPb(st *RegisteredModelAccessControlRequest) (*registeredModelAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelAccessControlRequestFromPb(pb *registeredModelAccessControlRequestPb) (*RegisteredModelAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelAccessControlResponseToPb(st *RegisteredModelAccessControlResponse) (*registeredModelAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelAccessControlResponsePb struct { + AllPermissions []RegisteredModelPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelAccessControlResponseFromPb(pb *registeredModelAccessControlResponsePb) (*RegisteredModelAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelPermissionToPb(st *RegisteredModelPermission) (*registeredModelPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelPermissionFromPb(pb *registeredModelPermissionPb) (*RegisteredModelPermission, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelPermissionsToPb(st *RegisteredModelPermissions) (*registeredModelPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelPermissionsPb struct { + AccessControlList []RegisteredModelAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelPermissionsFromPb(pb *registeredModelPermissionsPb) (*RegisteredModelPermissions, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelPermissionsDescriptionToPb(st *RegisteredModelPermissionsDescription) (*registeredModelPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelPermissionsDescriptionFromPb(pb *registeredModelPermissionsDescriptionPb) (*RegisteredModelPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelPermissionsRequestToPb(st *RegisteredModelPermissionsRequest) (*registeredModelPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.RegisteredModelId = st.RegisteredModelId + + return pb, nil +} + +type registeredModelPermissionsRequestPb struct { + AccessControlList []RegisteredModelAccessControlRequest `json:"access_control_list,omitempty"` + + RegisteredModelId string `json:"-" url:"-"` +} + +func registeredModelPermissionsRequestFromPb(pb *registeredModelPermissionsRequestPb) (*RegisteredModelPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.RegisteredModelId = pb.RegisteredModelId + + return st, nil +} + +func registryWebhookToPb(st *RegistryWebhook) (*registryWebhookPb, error) { + if st == nil { + return nil, nil + } + pb := ®istryWebhookPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Description = st.Description + + pb.Events = st.Events + + pb.HttpUrlSpec = st.HttpUrlSpec + + pb.Id = st.Id + + pb.JobSpec = st.JobSpec + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.ModelName = st.ModelName + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registryWebhookPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Description string `json:"description,omitempty"` + + Events []RegistryWebhookEvent `json:"events,omitempty"` + + HttpUrlSpec *HttpUrlSpecWithoutSecret `json:"http_url_spec,omitempty"` + + Id string `json:"id,omitempty"` + + JobSpec *JobSpecWithoutSecret `json:"job_spec,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + ModelName string `json:"model_name,omitempty"` + + Status RegistryWebhookStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registryWebhookFromPb(pb *registryWebhookPb) (*RegistryWebhook, error) { + if pb == nil { + return nil, nil + } + st := &RegistryWebhook{} + st.CreationTimestamp = pb.CreationTimestamp + st.Description = pb.Description + st.Events = pb.Events + st.HttpUrlSpec = pb.HttpUrlSpec + st.Id = pb.Id + st.JobSpec = pb.JobSpec + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.ModelName = pb.ModelName + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registryWebhookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registryWebhookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func rejectTransitionRequestToPb(st *RejectTransitionRequest) (*rejectTransitionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &rejectTransitionRequestPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Stage = st.Stage + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type rejectTransitionRequestPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + Stage Stage `json:"stage"` + + Version string `json:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func rejectTransitionRequestFromPb(pb *rejectTransitionRequestPb) (*RejectTransitionRequest, error) { + if pb == nil { + return nil, nil + } + st := &RejectTransitionRequest{} + st.Comment = pb.Comment + st.Name = pb.Name + st.Stage = pb.Stage + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *rejectTransitionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st rejectTransitionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func rejectTransitionRequestResponseToPb(st *RejectTransitionRequestResponse) (*rejectTransitionRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &rejectTransitionRequestResponsePb{} + pb.Activity = st.Activity + + return pb, nil +} + +type rejectTransitionRequestResponsePb struct { + Activity *Activity `json:"activity,omitempty"` +} + +func rejectTransitionRequestResponseFromPb(pb *rejectTransitionRequestResponsePb) (*RejectTransitionRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &RejectTransitionRequestResponse{} + st.Activity = pb.Activity + + return st, nil +} + +func renameModelRequestToPb(st *RenameModelRequest) (*renameModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &renameModelRequestPb{} + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type renameModelRequestPb struct { + Name string `json:"name"` + + NewName string `json:"new_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func renameModelRequestFromPb(pb *renameModelRequestPb) (*RenameModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &RenameModelRequest{} + st.Name = pb.Name + st.NewName = pb.NewName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *renameModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st renameModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func renameModelResponseToPb(st *RenameModelResponse) (*renameModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &renameModelResponsePb{} + pb.RegisteredModel = st.RegisteredModel + + return pb, nil +} + +type renameModelResponsePb struct { + RegisteredModel *Model `json:"registered_model,omitempty"` +} + +func renameModelResponseFromPb(pb *renameModelResponsePb) (*RenameModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &RenameModelResponse{} + st.RegisteredModel = pb.RegisteredModel + + return st, nil +} + +func restoreExperimentToPb(st *RestoreExperiment) (*restoreExperimentPb, error) { + if st == nil { + return nil, nil + } + pb := &restoreExperimentPb{} + pb.ExperimentId = st.ExperimentId + + return pb, nil +} + +type restoreExperimentPb struct { + ExperimentId string `json:"experiment_id"` +} + +func restoreExperimentFromPb(pb *restoreExperimentPb) (*RestoreExperiment, error) { + if pb == nil { + return nil, nil + } + st := &RestoreExperiment{} + st.ExperimentId = pb.ExperimentId + + return st, nil +} + +func restoreExperimentResponseToPb(st *RestoreExperimentResponse) (*restoreExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &restoreExperimentResponsePb{} + + return pb, nil +} + +type restoreExperimentResponsePb struct { +} + +func restoreExperimentResponseFromPb(pb *restoreExperimentResponsePb) (*RestoreExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &RestoreExperimentResponse{} + + return st, nil +} + +func restoreRunToPb(st *RestoreRun) (*restoreRunPb, error) { + if st == nil { + return nil, nil + } + pb := &restoreRunPb{} + pb.RunId = st.RunId + + return pb, nil +} + +type restoreRunPb struct { + RunId string `json:"run_id"` +} + +func restoreRunFromPb(pb *restoreRunPb) (*RestoreRun, error) { + if pb == nil { + return nil, nil + } + st := &RestoreRun{} + st.RunId = pb.RunId + + return st, nil +} + +func restoreRunResponseToPb(st *RestoreRunResponse) (*restoreRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &restoreRunResponsePb{} + + return pb, nil +} + +type restoreRunResponsePb struct { +} + +func restoreRunResponseFromPb(pb *restoreRunResponsePb) (*RestoreRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &RestoreRunResponse{} + + return st, nil +} + +func restoreRunsToPb(st *RestoreRuns) (*restoreRunsPb, error) { + if st == nil { + return nil, nil + } + pb := &restoreRunsPb{} + pb.ExperimentId = st.ExperimentId + + pb.MaxRuns = st.MaxRuns + + pb.MinTimestampMillis = st.MinTimestampMillis + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type restoreRunsPb struct { + ExperimentId string `json:"experiment_id"` + + MaxRuns int `json:"max_runs,omitempty"` + + MinTimestampMillis int64 `json:"min_timestamp_millis"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func restoreRunsFromPb(pb *restoreRunsPb) (*RestoreRuns, error) { + if pb == nil { + return nil, nil + } + st := &RestoreRuns{} + st.ExperimentId = pb.ExperimentId + st.MaxRuns = pb.MaxRuns + st.MinTimestampMillis = pb.MinTimestampMillis + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *restoreRunsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st restoreRunsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func restoreRunsResponseToPb(st *RestoreRunsResponse) (*restoreRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &restoreRunsResponsePb{} + pb.RunsRestored = st.RunsRestored + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type restoreRunsResponsePb struct { + RunsRestored int `json:"runs_restored,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func restoreRunsResponseFromPb(pb *restoreRunsResponsePb) (*RestoreRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &RestoreRunsResponse{} + st.RunsRestored = pb.RunsRestored + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *restoreRunsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st restoreRunsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runToPb(st *Run) (*runPb, error) { + if st == nil { + return nil, nil + } + pb := &runPb{} + pb.Data = st.Data + + pb.Info = st.Info + + pb.Inputs = st.Inputs + + return pb, nil +} + +type runPb struct { + Data *RunData `json:"data,omitempty"` + + Info *RunInfo `json:"info,omitempty"` + + Inputs *RunInputs `json:"inputs,omitempty"` +} + +func runFromPb(pb *runPb) (*Run, error) { + if pb == nil { + return nil, nil + } + st := &Run{} + st.Data = pb.Data + st.Info = pb.Info + st.Inputs = pb.Inputs + + return st, nil +} + +func runDataToPb(st *RunData) (*runDataPb, error) { + if st == nil { + return nil, nil + } + pb := &runDataPb{} + pb.Metrics = st.Metrics + + pb.Params = st.Params + + pb.Tags = st.Tags + + return pb, nil +} + +type runDataPb struct { + Metrics []Metric `json:"metrics,omitempty"` + + Params []Param `json:"params,omitempty"` + + Tags []RunTag `json:"tags,omitempty"` +} + +func runDataFromPb(pb *runDataPb) (*RunData, error) { + if pb == nil { + return nil, nil + } + st := &RunData{} + st.Metrics = pb.Metrics + st.Params = pb.Params + st.Tags = pb.Tags + + return st, nil +} + +func runInfoToPb(st *RunInfo) (*runInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &runInfoPb{} + pb.ArtifactUri = st.ArtifactUri + + pb.EndTime = st.EndTime + + pb.ExperimentId = st.ExperimentId + + pb.LifecycleStage = st.LifecycleStage + + pb.RunId = st.RunId + + pb.RunName = st.RunName + + pb.RunUuid = st.RunUuid + + pb.StartTime = st.StartTime + + pb.Status = st.Status + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runInfoPb struct { + ArtifactUri string `json:"artifact_uri,omitempty"` + + EndTime int64 `json:"end_time,omitempty"` + + ExperimentId string `json:"experiment_id,omitempty"` + + LifecycleStage string `json:"lifecycle_stage,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunName string `json:"run_name,omitempty"` + + RunUuid string `json:"run_uuid,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + Status RunInfoStatus `json:"status,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runInfoFromPb(pb *runInfoPb) (*RunInfo, error) { + if pb == nil { + return nil, nil + } + st := &RunInfo{} + st.ArtifactUri = pb.ArtifactUri + st.EndTime = pb.EndTime + st.ExperimentId = pb.ExperimentId + st.LifecycleStage = pb.LifecycleStage + st.RunId = pb.RunId + st.RunName = pb.RunName + st.RunUuid = pb.RunUuid + st.StartTime = pb.StartTime + st.Status = pb.Status + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runInputsToPb(st *RunInputs) (*runInputsPb, error) { + if st == nil { + return nil, nil + } + pb := &runInputsPb{} + pb.DatasetInputs = st.DatasetInputs + + pb.ModelInputs = st.ModelInputs + + return pb, nil +} + +type runInputsPb struct { + DatasetInputs []DatasetInput `json:"dataset_inputs,omitempty"` + + ModelInputs []ModelInput `json:"model_inputs,omitempty"` +} + +func runInputsFromPb(pb *runInputsPb) (*RunInputs, error) { + if pb == nil { + return nil, nil + } + st := &RunInputs{} + st.DatasetInputs = pb.DatasetInputs + st.ModelInputs = pb.ModelInputs + + return st, nil +} + +func runTagToPb(st *RunTag) (*runTagPb, error) { + if st == nil { + return nil, nil + } + pb := &runTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runTagPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runTagFromPb(pb *runTagPb) (*RunTag, error) { + if pb == nil { + return nil, nil + } + st := &RunTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchExperimentsToPb(st *SearchExperiments) (*searchExperimentsPb, error) { + if st == nil { + return nil, nil + } + pb := &searchExperimentsPb{} + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.ViewType = st.ViewType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchExperimentsPb struct { + Filter string `json:"filter,omitempty"` + + MaxResults int64 `json:"max_results,omitempty"` + + OrderBy []string `json:"order_by,omitempty"` + + PageToken string `json:"page_token,omitempty"` + + ViewType ViewType `json:"view_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchExperimentsFromPb(pb *searchExperimentsPb) (*SearchExperiments, error) { + if pb == nil { + return nil, nil + } + st := &SearchExperiments{} + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + st.ViewType = pb.ViewType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchExperimentsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchExperimentsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchExperimentsResponseToPb(st *SearchExperimentsResponse) (*searchExperimentsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchExperimentsResponsePb{} + pb.Experiments = st.Experiments + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchExperimentsResponsePb struct { + Experiments []Experiment `json:"experiments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchExperimentsResponseFromPb(pb *searchExperimentsResponsePb) (*SearchExperimentsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchExperimentsResponse{} + st.Experiments = pb.Experiments + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchExperimentsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchExperimentsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchLoggedModelsDatasetToPb(st *SearchLoggedModelsDataset) (*searchLoggedModelsDatasetPb, error) { + if st == nil { + return nil, nil + } + pb := &searchLoggedModelsDatasetPb{} + pb.DatasetDigest = st.DatasetDigest + + pb.DatasetName = st.DatasetName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchLoggedModelsDatasetPb struct { + DatasetDigest string `json:"dataset_digest,omitempty"` + + DatasetName string `json:"dataset_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchLoggedModelsDatasetFromPb(pb *searchLoggedModelsDatasetPb) (*SearchLoggedModelsDataset, error) { + if pb == nil { + return nil, nil + } + st := &SearchLoggedModelsDataset{} + st.DatasetDigest = pb.DatasetDigest + st.DatasetName = pb.DatasetName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchLoggedModelsDatasetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchLoggedModelsDatasetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchLoggedModelsOrderByToPb(st *SearchLoggedModelsOrderBy) (*searchLoggedModelsOrderByPb, error) { + if st == nil { + return nil, nil + } + pb := &searchLoggedModelsOrderByPb{} + pb.Ascending = st.Ascending + + pb.DatasetDigest = st.DatasetDigest + + pb.DatasetName = st.DatasetName + + pb.FieldName = st.FieldName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchLoggedModelsOrderByPb struct { + Ascending bool `json:"ascending,omitempty"` + + DatasetDigest string `json:"dataset_digest,omitempty"` + + DatasetName string `json:"dataset_name,omitempty"` + + FieldName string `json:"field_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchLoggedModelsOrderByFromPb(pb *searchLoggedModelsOrderByPb) (*SearchLoggedModelsOrderBy, error) { + if pb == nil { + return nil, nil + } + st := &SearchLoggedModelsOrderBy{} + st.Ascending = pb.Ascending + st.DatasetDigest = pb.DatasetDigest + st.DatasetName = pb.DatasetName + st.FieldName = pb.FieldName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchLoggedModelsOrderByPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchLoggedModelsOrderByPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchLoggedModelsRequestToPb(st *SearchLoggedModelsRequest) (*searchLoggedModelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &searchLoggedModelsRequestPb{} + pb.Datasets = st.Datasets + + pb.ExperimentIds = st.ExperimentIds + + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchLoggedModelsRequestPb struct { + Datasets []SearchLoggedModelsDataset `json:"datasets,omitempty"` + + ExperimentIds []string `json:"experiment_ids,omitempty"` + + Filter string `json:"filter,omitempty"` + + MaxResults int `json:"max_results,omitempty"` + + OrderBy []SearchLoggedModelsOrderBy `json:"order_by,omitempty"` + + PageToken string `json:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchLoggedModelsRequestFromPb(pb *searchLoggedModelsRequestPb) (*SearchLoggedModelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SearchLoggedModelsRequest{} + st.Datasets = pb.Datasets + st.ExperimentIds = pb.ExperimentIds + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchLoggedModelsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchLoggedModelsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchLoggedModelsResponseToPb(st *SearchLoggedModelsResponse) (*searchLoggedModelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchLoggedModelsResponsePb{} + pb.Models = st.Models + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchLoggedModelsResponsePb struct { + Models []LoggedModel `json:"models,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchLoggedModelsResponseFromPb(pb *searchLoggedModelsResponsePb) (*SearchLoggedModelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchLoggedModelsResponse{} + st.Models = pb.Models + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchLoggedModelsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchLoggedModelsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchModelVersionsRequestToPb(st *SearchModelVersionsRequest) (*searchModelVersionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &searchModelVersionsRequestPb{} + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchModelVersionsRequestPb struct { + Filter string `json:"-" url:"filter,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + OrderBy []string `json:"-" url:"order_by,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchModelVersionsRequestFromPb(pb *searchModelVersionsRequestPb) (*SearchModelVersionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SearchModelVersionsRequest{} + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchModelVersionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchModelVersionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchModelVersionsResponseToPb(st *SearchModelVersionsResponse) (*searchModelVersionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchModelVersionsResponsePb{} + pb.ModelVersions = st.ModelVersions + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchModelVersionsResponsePb struct { + ModelVersions []ModelVersion `json:"model_versions,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchModelVersionsResponseFromPb(pb *searchModelVersionsResponsePb) (*SearchModelVersionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchModelVersionsResponse{} + st.ModelVersions = pb.ModelVersions + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchModelVersionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchModelVersionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchModelsRequestToPb(st *SearchModelsRequest) (*searchModelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &searchModelsRequestPb{} + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchModelsRequestPb struct { + Filter string `json:"-" url:"filter,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + OrderBy []string `json:"-" url:"order_by,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchModelsRequestFromPb(pb *searchModelsRequestPb) (*SearchModelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SearchModelsRequest{} + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchModelsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchModelsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchModelsResponseToPb(st *SearchModelsResponse) (*searchModelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchModelsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.RegisteredModels = st.RegisteredModels + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchModelsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + RegisteredModels []Model `json:"registered_models,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchModelsResponseFromPb(pb *searchModelsResponsePb) (*SearchModelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchModelsResponse{} + st.NextPageToken = pb.NextPageToken + st.RegisteredModels = pb.RegisteredModels + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchModelsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchModelsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchRunsToPb(st *SearchRuns) (*searchRunsPb, error) { + if st == nil { + return nil, nil + } + pb := &searchRunsPb{} + pb.ExperimentIds = st.ExperimentIds + + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.RunViewType = st.RunViewType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchRunsPb struct { + ExperimentIds []string `json:"experiment_ids,omitempty"` + + Filter string `json:"filter,omitempty"` + + MaxResults int `json:"max_results,omitempty"` + + OrderBy []string `json:"order_by,omitempty"` + + PageToken string `json:"page_token,omitempty"` + + RunViewType ViewType `json:"run_view_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchRunsFromPb(pb *searchRunsPb) (*SearchRuns, error) { + if pb == nil { + return nil, nil + } + st := &SearchRuns{} + st.ExperimentIds = pb.ExperimentIds + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + st.RunViewType = pb.RunViewType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchRunsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchRunsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func searchRunsResponseToPb(st *SearchRunsResponse) (*searchRunsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &searchRunsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Runs = st.Runs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type searchRunsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Runs []Run `json:"runs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func searchRunsResponseFromPb(pb *searchRunsResponsePb) (*SearchRunsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SearchRunsResponse{} + st.NextPageToken = pb.NextPageToken + st.Runs = pb.Runs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *searchRunsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st searchRunsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setExperimentTagToPb(st *SetExperimentTag) (*setExperimentTagPb, error) { + if st == nil { + return nil, nil + } + pb := &setExperimentTagPb{} + pb.ExperimentId = st.ExperimentId + + pb.Key = st.Key + + pb.Value = st.Value + + return pb, nil +} + +type setExperimentTagPb struct { + ExperimentId string `json:"experiment_id"` + + Key string `json:"key"` + + Value string `json:"value"` +} + +func setExperimentTagFromPb(pb *setExperimentTagPb) (*SetExperimentTag, error) { + if pb == nil { + return nil, nil + } + st := &SetExperimentTag{} + st.ExperimentId = pb.ExperimentId + st.Key = pb.Key + st.Value = pb.Value + + return st, nil +} + +func setExperimentTagResponseToPb(st *SetExperimentTagResponse) (*setExperimentTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setExperimentTagResponsePb{} + + return pb, nil +} + +type setExperimentTagResponsePb struct { +} + +func setExperimentTagResponseFromPb(pb *setExperimentTagResponsePb) (*SetExperimentTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetExperimentTagResponse{} + + return st, nil +} + +func setLoggedModelTagsRequestToPb(st *SetLoggedModelTagsRequest) (*setLoggedModelTagsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setLoggedModelTagsRequestPb{} + pb.ModelId = st.ModelId + + pb.Tags = st.Tags + + return pb, nil +} + +type setLoggedModelTagsRequestPb struct { + ModelId string `json:"-" url:"-"` + + Tags []LoggedModelTag `json:"tags,omitempty"` +} + +func setLoggedModelTagsRequestFromPb(pb *setLoggedModelTagsRequestPb) (*SetLoggedModelTagsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetLoggedModelTagsRequest{} + st.ModelId = pb.ModelId + st.Tags = pb.Tags + + return st, nil +} + +func setLoggedModelTagsResponseToPb(st *SetLoggedModelTagsResponse) (*setLoggedModelTagsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setLoggedModelTagsResponsePb{} + + return pb, nil +} + +type setLoggedModelTagsResponsePb struct { +} + +func setLoggedModelTagsResponseFromPb(pb *setLoggedModelTagsResponsePb) (*SetLoggedModelTagsResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetLoggedModelTagsResponse{} + + return st, nil +} + +func setModelTagRequestToPb(st *SetModelTagRequest) (*setModelTagRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setModelTagRequestPb{} + pb.Key = st.Key + + pb.Name = st.Name + + pb.Value = st.Value + + return pb, nil +} + +type setModelTagRequestPb struct { + Key string `json:"key"` + + Name string `json:"name"` + + Value string `json:"value"` +} + +func setModelTagRequestFromPb(pb *setModelTagRequestPb) (*SetModelTagRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetModelTagRequest{} + st.Key = pb.Key + st.Name = pb.Name + st.Value = pb.Value + + return st, nil +} + +func setModelTagResponseToPb(st *SetModelTagResponse) (*setModelTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setModelTagResponsePb{} + + return pb, nil +} + +type setModelTagResponsePb struct { +} + +func setModelTagResponseFromPb(pb *setModelTagResponsePb) (*SetModelTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetModelTagResponse{} + + return st, nil +} + +func setModelVersionTagRequestToPb(st *SetModelVersionTagRequest) (*setModelVersionTagRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setModelVersionTagRequestPb{} + pb.Key = st.Key + + pb.Name = st.Name + + pb.Value = st.Value + + pb.Version = st.Version + + return pb, nil +} + +type setModelVersionTagRequestPb struct { + Key string `json:"key"` + + Name string `json:"name"` + + Value string `json:"value"` + + Version string `json:"version"` +} + +func setModelVersionTagRequestFromPb(pb *setModelVersionTagRequestPb) (*SetModelVersionTagRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetModelVersionTagRequest{} + st.Key = pb.Key + st.Name = pb.Name + st.Value = pb.Value + st.Version = pb.Version + + return st, nil +} + +func setModelVersionTagResponseToPb(st *SetModelVersionTagResponse) (*setModelVersionTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setModelVersionTagResponsePb{} + + return pb, nil +} + +type setModelVersionTagResponsePb struct { +} + +func setModelVersionTagResponseFromPb(pb *setModelVersionTagResponsePb) (*SetModelVersionTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetModelVersionTagResponse{} + + return st, nil +} + +func setTagToPb(st *SetTag) (*setTagPb, error) { + if st == nil { + return nil, nil + } + pb := &setTagPb{} + pb.Key = st.Key + + pb.RunId = st.RunId + + pb.RunUuid = st.RunUuid + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type setTagPb struct { + Key string `json:"key"` + + RunId string `json:"run_id,omitempty"` + + RunUuid string `json:"run_uuid,omitempty"` + + Value string `json:"value"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func setTagFromPb(pb *setTagPb) (*SetTag, error) { + if pb == nil { + return nil, nil + } + st := &SetTag{} + st.Key = pb.Key + st.RunId = pb.RunId + st.RunUuid = pb.RunUuid + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *setTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st setTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setTagResponseToPb(st *SetTagResponse) (*setTagResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setTagResponsePb{} + + return pb, nil +} + +type setTagResponsePb struct { +} + +func setTagResponseFromPb(pb *setTagResponsePb) (*SetTagResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetTagResponse{} + + return st, nil +} + +func testRegistryWebhookToPb(st *TestRegistryWebhook) (*testRegistryWebhookPb, error) { + if st == nil { + return nil, nil + } + pb := &testRegistryWebhookPb{} + pb.Body = st.Body + + pb.StatusCode = st.StatusCode + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type testRegistryWebhookPb struct { + Body string `json:"body,omitempty"` + + StatusCode int `json:"status_code,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func testRegistryWebhookFromPb(pb *testRegistryWebhookPb) (*TestRegistryWebhook, error) { + if pb == nil { + return nil, nil + } + st := &TestRegistryWebhook{} + st.Body = pb.Body + st.StatusCode = pb.StatusCode + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *testRegistryWebhookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st testRegistryWebhookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func testRegistryWebhookRequestToPb(st *TestRegistryWebhookRequest) (*testRegistryWebhookRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &testRegistryWebhookRequestPb{} + pb.Event = st.Event + + pb.Id = st.Id + + return pb, nil +} + +type testRegistryWebhookRequestPb struct { + Event RegistryWebhookEvent `json:"event,omitempty"` + + Id string `json:"id"` +} + +func testRegistryWebhookRequestFromPb(pb *testRegistryWebhookRequestPb) (*TestRegistryWebhookRequest, error) { + if pb == nil { + return nil, nil + } + st := &TestRegistryWebhookRequest{} + st.Event = pb.Event + st.Id = pb.Id + + return st, nil +} + +func testRegistryWebhookResponseToPb(st *TestRegistryWebhookResponse) (*testRegistryWebhookResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &testRegistryWebhookResponsePb{} + pb.Webhook = st.Webhook + + return pb, nil +} + +type testRegistryWebhookResponsePb struct { + Webhook *TestRegistryWebhook `json:"webhook,omitempty"` +} + +func testRegistryWebhookResponseFromPb(pb *testRegistryWebhookResponsePb) (*TestRegistryWebhookResponse, error) { + if pb == nil { + return nil, nil + } + st := &TestRegistryWebhookResponse{} + st.Webhook = pb.Webhook + + return st, nil +} + +func transitionModelVersionStageDatabricksToPb(st *TransitionModelVersionStageDatabricks) (*transitionModelVersionStageDatabricksPb, error) { + if st == nil { + return nil, nil + } + pb := &transitionModelVersionStageDatabricksPb{} + pb.ArchiveExistingVersions = st.ArchiveExistingVersions + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.Stage = st.Stage + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type transitionModelVersionStageDatabricksPb struct { + ArchiveExistingVersions bool `json:"archive_existing_versions"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + Stage Stage `json:"stage"` + + Version string `json:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func transitionModelVersionStageDatabricksFromPb(pb *transitionModelVersionStageDatabricksPb) (*TransitionModelVersionStageDatabricks, error) { + if pb == nil { + return nil, nil + } + st := &TransitionModelVersionStageDatabricks{} + st.ArchiveExistingVersions = pb.ArchiveExistingVersions + st.Comment = pb.Comment + st.Name = pb.Name + st.Stage = pb.Stage + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *transitionModelVersionStageDatabricksPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st transitionModelVersionStageDatabricksPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func transitionRequestToPb(st *TransitionRequest) (*transitionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &transitionRequestPb{} + pb.AvailableActions = st.AvailableActions + + pb.Comment = st.Comment + + pb.CreationTimestamp = st.CreationTimestamp + + pb.ToStage = st.ToStage + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type transitionRequestPb struct { + AvailableActions []ActivityAction `json:"available_actions,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + ToStage Stage `json:"to_stage,omitempty"` + + UserId string `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func transitionRequestFromPb(pb *transitionRequestPb) (*TransitionRequest, error) { + if pb == nil { + return nil, nil + } + st := &TransitionRequest{} + st.AvailableActions = pb.AvailableActions + st.Comment = pb.Comment + st.CreationTimestamp = pb.CreationTimestamp + st.ToStage = pb.ToStage + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *transitionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st transitionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func transitionStageResponseToPb(st *TransitionStageResponse) (*transitionStageResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &transitionStageResponsePb{} + pb.ModelVersion = st.ModelVersion + + return pb, nil +} + +type transitionStageResponsePb struct { + ModelVersion *ModelVersionDatabricks `json:"model_version,omitempty"` +} + +func transitionStageResponseFromPb(pb *transitionStageResponsePb) (*TransitionStageResponse, error) { + if pb == nil { + return nil, nil + } + st := &TransitionStageResponse{} + st.ModelVersion = pb.ModelVersion + + return st, nil +} + +func updateCommentToPb(st *UpdateComment) (*updateCommentPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCommentPb{} + pb.Comment = st.Comment + + pb.Id = st.Id + + return pb, nil +} + +type updateCommentPb struct { + Comment string `json:"comment"` + + Id string `json:"id"` +} + +func updateCommentFromPb(pb *updateCommentPb) (*UpdateComment, error) { + if pb == nil { + return nil, nil + } + st := &UpdateComment{} + st.Comment = pb.Comment + st.Id = pb.Id + + return st, nil +} + +func updateCommentResponseToPb(st *UpdateCommentResponse) (*updateCommentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateCommentResponsePb{} + pb.Comment = st.Comment + + return pb, nil +} + +type updateCommentResponsePb struct { + Comment *CommentObject `json:"comment,omitempty"` +} + +func updateCommentResponseFromPb(pb *updateCommentResponsePb) (*UpdateCommentResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCommentResponse{} + st.Comment = pb.Comment + + return st, nil +} + +func updateExperimentToPb(st *UpdateExperiment) (*updateExperimentPb, error) { + if st == nil { + return nil, nil + } + pb := &updateExperimentPb{} + pb.ExperimentId = st.ExperimentId + + pb.NewName = st.NewName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateExperimentPb struct { + ExperimentId string `json:"experiment_id"` + + NewName string `json:"new_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateExperimentFromPb(pb *updateExperimentPb) (*UpdateExperiment, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExperiment{} + st.ExperimentId = pb.ExperimentId + st.NewName = pb.NewName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateExperimentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateExperimentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateExperimentResponseToPb(st *UpdateExperimentResponse) (*updateExperimentResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateExperimentResponsePb{} + + return pb, nil +} + +type updateExperimentResponsePb struct { +} + +func updateExperimentResponseFromPb(pb *updateExperimentResponsePb) (*UpdateExperimentResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateExperimentResponse{} + + return st, nil +} + +func updateModelRequestToPb(st *UpdateModelRequest) (*updateModelRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateModelRequestPb{} + pb.Description = st.Description + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateModelRequestPb struct { + Description string `json:"description,omitempty"` + + Name string `json:"name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateModelRequestFromPb(pb *updateModelRequestPb) (*UpdateModelRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateModelRequest{} + st.Description = pb.Description + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateModelRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateModelRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateModelResponseToPb(st *UpdateModelResponse) (*updateModelResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateModelResponsePb{} + + return pb, nil +} + +type updateModelResponsePb struct { +} + +func updateModelResponseFromPb(pb *updateModelResponsePb) (*UpdateModelResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateModelResponse{} + + return st, nil +} + +func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelVersionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateModelVersionRequestPb{} + pb.Description = st.Description + + pb.Name = st.Name + + pb.Version = st.Version + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateModelVersionRequestPb struct { + Description string `json:"description,omitempty"` + + Name string `json:"name"` + + Version string `json:"version"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateModelVersionRequestFromPb(pb *updateModelVersionRequestPb) (*UpdateModelVersionRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateModelVersionRequest{} + st.Description = pb.Description + st.Name = pb.Name + st.Version = pb.Version + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateModelVersionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateModelVersionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateModelVersionResponseToPb(st *UpdateModelVersionResponse) (*updateModelVersionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateModelVersionResponsePb{} + + return pb, nil +} + +type updateModelVersionResponsePb struct { +} + +func updateModelVersionResponseFromPb(pb *updateModelVersionResponsePb) (*UpdateModelVersionResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateModelVersionResponse{} + + return st, nil +} + +func updateRegistryWebhookToPb(st *UpdateRegistryWebhook) (*updateRegistryWebhookPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRegistryWebhookPb{} + pb.Description = st.Description + + pb.Events = st.Events + + pb.HttpUrlSpec = st.HttpUrlSpec + + pb.Id = st.Id + + pb.JobSpec = st.JobSpec + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateRegistryWebhookPb struct { + Description string `json:"description,omitempty"` + + Events []RegistryWebhookEvent `json:"events,omitempty"` + + HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + + Id string `json:"id"` + + JobSpec *JobSpec `json:"job_spec,omitempty"` + + Status RegistryWebhookStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateRegistryWebhookFromPb(pb *updateRegistryWebhookPb) (*UpdateRegistryWebhook, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRegistryWebhook{} + st.Description = pb.Description + st.Events = pb.Events + st.HttpUrlSpec = pb.HttpUrlSpec + st.Id = pb.Id + st.JobSpec = pb.JobSpec + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateRegistryWebhookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateRegistryWebhookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateRunToPb(st *UpdateRun) (*updateRunPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRunPb{} + pb.EndTime = st.EndTime + + pb.RunId = st.RunId + + pb.RunName = st.RunName + + pb.RunUuid = st.RunUuid + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateRunPb struct { + EndTime int64 `json:"end_time,omitempty"` + + RunId string `json:"run_id,omitempty"` + + RunName string `json:"run_name,omitempty"` + + RunUuid string `json:"run_uuid,omitempty"` + + Status UpdateRunStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateRunFromPb(pb *updateRunPb) (*UpdateRun, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRun{} + st.EndTime = pb.EndTime + st.RunId = pb.RunId + st.RunName = pb.RunName + st.RunUuid = pb.RunUuid + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateRunPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateRunPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateRunResponseToPb(st *UpdateRunResponse) (*updateRunResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateRunResponsePb{} + pb.RunInfo = st.RunInfo + + return pb, nil +} + +type updateRunResponsePb struct { + RunInfo *RunInfo `json:"run_info,omitempty"` +} + +func updateRunResponseFromPb(pb *updateRunResponsePb) (*UpdateRunResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRunResponse{} + st.RunInfo = pb.RunInfo + + return st, nil +} + +func updateWebhookResponseToPb(st *UpdateWebhookResponse) (*updateWebhookResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateWebhookResponsePb{} + + return pb, nil +} + +type updateWebhookResponsePb struct { +} + +func updateWebhookResponseFromPb(pb *updateWebhookResponsePb) (*UpdateWebhookResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWebhookResponse{} + + return st, nil +} diff --git a/service/ml/model.go b/service/ml/model.go index 46f7d3002..0a7957d66 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -3,9 +3,10 @@ package ml import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) // Activity recorded for the action. @@ -24,11 +25,14 @@ type Activity struct { // // * `SYSTEM_TRANSITION`: For events performed as a side effect, such as // archiving existing model versions in a stage. - ActivityType ActivityType `json:"activity_type,omitempty"` + // Wire name: 'activity_type' + ActivityType ActivityType // User-provided comment associated with the activity. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Source stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -39,16 +43,20 @@ type Activity struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - FromStage Stage `json:"from_stage,omitempty"` + // Wire name: 'from_stage' + FromStage Stage // Unique identifier for the object. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Comment made by system, for example explaining an activity of type // `SYSTEM_TRANSITION`. It usually describes a side effect, such as a // version being archived as part of another version's stage transition, and // may not be returned for some activity types. - SystemComment string `json:"system_comment,omitempty"` + // Wire name: 'system_comment' + SystemComment string // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -59,19 +67,38 @@ type Activity struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage Stage `json:"to_stage,omitempty"` + // Wire name: 'to_stage' + ToStage Stage // The username of the user that created the object. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Activity) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Activity) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &activityPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := activityFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Activity) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Activity) MarshalJSON() ([]byte, error) { + pb, err := activityToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An action that a user (with sufficient permissions) could take on an @@ -82,6 +109,7 @@ func (s Activity) MarshalJSON() ([]byte, error) { // // * `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request type ActivityAction string +type activityActionPb string // Approve a transition request const ActivityActionApproveTransitionRequest ActivityAction = `APPROVE_TRANSITION_REQUEST` @@ -113,6 +141,22 @@ func (f *ActivityAction) Type() string { return "ActivityAction" } +func activityActionToPb(st *ActivityAction) (*activityActionPb, error) { + if st == nil { + return nil, nil + } + pb := activityActionPb(*st) + return &pb, nil +} + +func activityActionFromPb(pb *activityActionPb) (*ActivityAction, error) { + if pb == nil { + return nil, nil + } + st := ActivityAction(*pb) + return &st, nil +} + // Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the // corresponding stage transition. // @@ -127,6 +171,7 @@ func (f *ActivityAction) Type() string { // * `SYSTEM_TRANSITION`: For events performed as a side effect, such as // archiving existing model versions in a stage. type ActivityType string +type activityTypePb string // User applied the corresponding stage transition. const ActivityTypeAppliedTransition ActivityType = `APPLIED_TRANSITION` @@ -170,14 +215,33 @@ func (f *ActivityType) Type() string { return "ActivityType" } +func activityTypeToPb(st *ActivityType) (*activityTypePb, error) { + if st == nil { + return nil, nil + } + pb := activityTypePb(*st) + return &pb, nil +} + +func activityTypeFromPb(pb *activityTypePb) (*ActivityType, error) { + if pb == nil { + return nil, nil + } + st := ActivityType(*pb) + return &st, nil +} + type ApproveTransitionRequest struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions bool `json:"archive_existing_versions"` + // Wire name: 'archive_existing_versions' + ArchiveExistingVersions bool // User-provided comment on the action. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -187,72 +251,159 @@ type ApproveTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage Stage `json:"stage"` + // Wire name: 'stage' + Stage Stage // Version of the model. - Version string `json:"version"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ApproveTransitionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ApproveTransitionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &approveTransitionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := approveTransitionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ApproveTransitionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ApproveTransitionRequest) MarshalJSON() ([]byte, error) { + pb, err := approveTransitionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ApproveTransitionRequestResponse struct { // Activity recorded for the action. - Activity *Activity `json:"activity,omitempty"` + // Wire name: 'activity' + Activity *Activity +} + +func (st *ApproveTransitionRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &approveTransitionRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := approveTransitionRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ApproveTransitionRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := approveTransitionRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ArtifactCredentialInfo struct { // A collection of HTTP headers that should be specified when uploading to // or downloading from the specified `signed_uri`. - Headers []ArtifactCredentialInfoHttpHeader `json:"headers,omitempty"` + // Wire name: 'headers' + Headers []ArtifactCredentialInfoHttpHeader // The path, relative to the Run's artifact root location, of the artifact // that can be accessed with the credential. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // The ID of the MLflow Run containing the artifact that can be accessed // with the credential. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // The signed URI credential that provides access to the artifact. - SignedUri string `json:"signed_uri,omitempty"` + // Wire name: 'signed_uri' + SignedUri string // The type of the signed credential URI (e.g., an AWS presigned URL or an // Azure Shared Access Signature URI). - Type ArtifactCredentialType `json:"type,omitempty"` + // Wire name: 'type' + Type ArtifactCredentialType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ArtifactCredentialInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ArtifactCredentialInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &artifactCredentialInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := artifactCredentialInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ArtifactCredentialInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ArtifactCredentialInfo) MarshalJSON() ([]byte, error) { + pb, err := artifactCredentialInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ArtifactCredentialInfoHttpHeader struct { // The HTTP header name. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The HTTP header value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ArtifactCredentialInfoHttpHeader) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ArtifactCredentialInfoHttpHeader) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &artifactCredentialInfoHttpHeaderPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := artifactCredentialInfoHttpHeaderFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ArtifactCredentialInfoHttpHeader) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ArtifactCredentialInfoHttpHeader) MarshalJSON() ([]byte, error) { + pb, err := artifactCredentialInfoHttpHeaderToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of a given artifact access credential type ArtifactCredentialType string +type artifactCredentialTypePb string const ArtifactCredentialTypeAwsPresignedUrl ArtifactCredentialType = `AWS_PRESIGNED_URL` @@ -283,11 +434,28 @@ func (f *ArtifactCredentialType) Type() string { return "ArtifactCredentialType" } +func artifactCredentialTypeToPb(st *ArtifactCredentialType) (*artifactCredentialTypePb, error) { + if st == nil { + return nil, nil + } + pb := artifactCredentialTypePb(*st) + return &pb, nil +} + +func artifactCredentialTypeFromPb(pb *artifactCredentialTypePb) (*ArtifactCredentialType, error) { + if pb == nil { + return nil, nil + } + st := ArtifactCredentialType(*pb) + return &st, nil +} + // An action that a user (with sufficient permissions) could take on a comment. // Valid values are: * `EDIT_COMMENT`: Edit the comment // // * `DELETE_COMMENT`: Delete the comment type CommentActivityAction string +type commentActivityActionPb string // Delete the comment const CommentActivityActionDeleteComment CommentActivityAction = `DELETE_COMMENT` @@ -316,261 +484,590 @@ func (f *CommentActivityAction) Type() string { return "CommentActivityAction" } +func commentActivityActionToPb(st *CommentActivityAction) (*commentActivityActionPb, error) { + if st == nil { + return nil, nil + } + pb := commentActivityActionPb(*st) + return &pb, nil +} + +func commentActivityActionFromPb(pb *commentActivityActionPb) (*CommentActivityAction, error) { + if pb == nil { + return nil, nil + } + st := CommentActivityAction(*pb) + return &st, nil +} + // Comment details. type CommentObject struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions []CommentActivityAction `json:"available_actions,omitempty"` + // Wire name: 'available_actions' + AvailableActions []CommentActivityAction // User-provided comment on the action. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Comment ID - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // The username of the user that created the object. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CommentObject) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CommentObject) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &commentObjectPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := commentObjectFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CommentObject) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CommentObject) MarshalJSON() ([]byte, error) { + pb, err := commentObjectToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateComment struct { // User-provided comment on the action. - Comment string `json:"comment"` + // Wire name: 'comment' + Comment string // Name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // Version of the model. - Version string `json:"version"` + // Wire name: 'version' + Version string +} + +func (st *CreateComment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCommentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCommentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateComment) MarshalJSON() ([]byte, error) { + pb, err := createCommentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCommentResponse struct { // Comment details. - Comment *CommentObject `json:"comment,omitempty"` + // Wire name: 'comment' + Comment *CommentObject +} + +func (st *CreateCommentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCommentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCommentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCommentResponse) MarshalJSON() ([]byte, error) { + pb, err := createCommentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateExperiment struct { // Location where all artifacts for the experiment are stored. If not // provided, the remote server will select an appropriate default. - ArtifactLocation string `json:"artifact_location,omitempty"` + // Wire name: 'artifact_location' + ArtifactLocation string // Experiment name. - Name string `json:"name"` + // Wire name: 'name' + Name string // A collection of tags to set on the experiment. Maximum tag size and // number of tags per request depends on the storage backend. All storage // backends are guaranteed to support tag keys up to 250 bytes in size and // tag values up to 5000 bytes in size. All storage backends are also // guaranteed to support up to 20 tags per request. - Tags []ExperimentTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ExperimentTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateExperiment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateExperiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExperimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExperimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateExperiment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateExperiment) MarshalJSON() ([]byte, error) { + pb, err := createExperimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateExperimentResponse struct { // Unique identifier for the experiment. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateExperimentResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateExperimentResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := createExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateForecastingExperimentRequest struct { // The column in the training table used to customize weights for each time // series. - CustomWeightsColumn string `json:"custom_weights_column,omitempty"` + // Wire name: 'custom_weights_column' + CustomWeightsColumn string // The path in the workspace to store the created experiment. - ExperimentPath string `json:"experiment_path,omitempty"` + // Wire name: 'experiment_path' + ExperimentPath string // The time interval between consecutive rows in the time series data. // Possible values include: '1 second', '1 minute', '5 minutes', '10 // minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily', 'Weekly', // 'Monthly', 'Quarterly', 'Yearly'. - ForecastGranularity string `json:"forecast_granularity"` + // Wire name: 'forecast_granularity' + ForecastGranularity string // The number of time steps into the future to make predictions, calculated // as a multiple of forecast_granularity. This value represents how far // ahead the model should forecast. - ForecastHorizon int64 `json:"forecast_horizon"` + // Wire name: 'forecast_horizon' + ForecastHorizon int64 // The fully qualified path of a Unity Catalog table, formatted as // catalog_name.schema_name.table_name, used to store future feature data // for predictions. - FutureFeatureDataPath string `json:"future_feature_data_path,omitempty"` + // Wire name: 'future_feature_data_path' + FutureFeatureDataPath string // The region code(s) to automatically add holiday features. Currently // supports only one region. - HolidayRegions []string `json:"holiday_regions,omitempty"` + // Wire name: 'holiday_regions' + HolidayRegions []string // Specifies the list of feature columns to include in model training. These // columns must exist in the training data and be of type string, numerical, // or boolean. If not specified, no additional features will be included. // Note: Certain columns are automatically handled: - Automatically // excluded: split_column, target_column, custom_weights_column. - // Automatically included: time_column. - IncludeFeatures []string `json:"include_features,omitempty"` + // Wire name: 'include_features' + IncludeFeatures []string // The maximum duration for the experiment in minutes. The experiment stops // automatically if it exceeds this limit. - MaxRuntime int64 `json:"max_runtime,omitempty"` + // Wire name: 'max_runtime' + MaxRuntime int64 // The fully qualified path of a Unity Catalog table, formatted as // catalog_name.schema_name.table_name, used to store predictions. - PredictionDataPath string `json:"prediction_data_path,omitempty"` + // Wire name: 'prediction_data_path' + PredictionDataPath string // The evaluation metric used to optimize the forecasting model. - PrimaryMetric string `json:"primary_metric,omitempty"` + // Wire name: 'primary_metric' + PrimaryMetric string // The fully qualified path of a Unity Catalog model, formatted as // catalog_name.schema_name.model_name, used to store the best model. - RegisterTo string `json:"register_to,omitempty"` + // Wire name: 'register_to' + RegisterTo string // // The column in the training table used for custom data splits. Values // must be 'train', 'validate', or 'test'. - SplitColumn string `json:"split_column,omitempty"` + // Wire name: 'split_column' + SplitColumn string // The column in the input training table used as the prediction target for // model training. The values in this column are used as the ground truth // for model training. - TargetColumn string `json:"target_column"` + // Wire name: 'target_column' + TargetColumn string // The column in the input training table that represents each row's // timestamp. - TimeColumn string `json:"time_column"` + // Wire name: 'time_column' + TimeColumn string // The column in the training table used to group the dataset for predicting // individual time series. - TimeseriesIdentifierColumns []string `json:"timeseries_identifier_columns,omitempty"` + // Wire name: 'timeseries_identifier_columns' + TimeseriesIdentifierColumns []string // The fully qualified path of a Unity Catalog table, formatted as // catalog_name.schema_name.table_name, used as training data for the // forecasting model. - TrainDataPath string `json:"train_data_path"` + // Wire name: 'train_data_path' + TrainDataPath string // List of frameworks to include for model tuning. Possible values are // 'Prophet', 'ARIMA', 'DeepAR'. An empty list includes all supported // frameworks. - TrainingFrameworks []string `json:"training_frameworks,omitempty"` + // Wire name: 'training_frameworks' + TrainingFrameworks []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateForecastingExperimentRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateForecastingExperimentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createForecastingExperimentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createForecastingExperimentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateForecastingExperimentRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateForecastingExperimentRequest) MarshalJSON() ([]byte, error) { + pb, err := createForecastingExperimentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateForecastingExperimentResponse struct { // The unique ID of the created forecasting experiment - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateForecastingExperimentResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateForecastingExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createForecastingExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createForecastingExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateForecastingExperimentResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateForecastingExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := createForecastingExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateLoggedModelRequest struct { // The ID of the experiment that owns the model. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string // The type of the model, such as ``"Agent"``, ``"Classifier"``, ``"LLM"``. - ModelType string `json:"model_type,omitempty"` + // Wire name: 'model_type' + ModelType string // The name of the model (optional). If not specified one will be generated. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Parameters attached to the model. - Params []LoggedModelParameter `json:"params,omitempty"` + // Wire name: 'params' + Params []LoggedModelParameter // The ID of the run that created the model. - SourceRunId string `json:"source_run_id,omitempty"` + // Wire name: 'source_run_id' + SourceRunId string // Tags attached to the model. - Tags []LoggedModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []LoggedModelTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateLoggedModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateLoggedModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createLoggedModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createLoggedModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateLoggedModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateLoggedModelRequest) MarshalJSON() ([]byte, error) { + pb, err := createLoggedModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateLoggedModelResponse struct { // The newly created logged model. - Model *LoggedModel `json:"model,omitempty"` + // Wire name: 'model' + Model *LoggedModel +} + +func (st *CreateLoggedModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createLoggedModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createLoggedModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateLoggedModelResponse) MarshalJSON() ([]byte, error) { + pb, err := createLoggedModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateModelRequest struct { // Optional description for registered model. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Register models under this name - Name string `json:"name"` + // Wire name: 'name' + Name string // Additional metadata for registered model. - Tags []ModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateModelRequest) MarshalJSON() ([]byte, error) { + pb, err := createModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateModelResponse struct { - RegisteredModel *Model `json:"registered_model,omitempty"` + + // Wire name: 'registered_model' + RegisteredModel *Model +} + +func (st *CreateModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateModelResponse) MarshalJSON() ([]byte, error) { + pb, err := createModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateModelVersionRequest struct { // Optional description for model version. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Register model under this name - Name string `json:"name"` + // Wire name: 'name' + Name string // MLflow run ID for correlation, if `source` was generated by an experiment // run in MLflow tracking server - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // MLflow run link - this is the exact link of the run that generated this // model version, potentially hosted at another instance of MLflow. - RunLink string `json:"run_link,omitempty"` + // Wire name: 'run_link' + RunLink string // URI indicating the location of the model artifacts. - Source string `json:"source"` + // Wire name: 'source' + Source string // Additional metadata for model version. - Tags []ModelVersionTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelVersionTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateModelVersionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateModelVersionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := createModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateModelVersionResponse struct { // Return new version number generated for this model in registry. - ModelVersion *ModelVersion `json:"model_version,omitempty"` + // Wire name: 'model_version' + ModelVersion *ModelVersion +} + +func (st *CreateModelVersionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createModelVersionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createModelVersionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateModelVersionResponse) MarshalJSON() ([]byte, error) { + pb, err := createModelVersionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRegistryWebhook struct { // User-specified description for the webhook. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -604,13 +1101,17 @@ type CreateRegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events []RegistryWebhookEvent `json:"events"` + // Wire name: 'events' + Events []RegistryWebhookEvent - HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + // Wire name: 'http_url_spec' + HttpUrlSpec *HttpUrlSpec - JobSpec *JobSpec `json:"job_spec,omitempty"` + // Wire name: 'job_spec' + JobSpec *JobSpec // Name of the model whose events would trigger this webhook. - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -619,54 +1120,122 @@ type CreateRegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status RegistryWebhookStatus `json:"status,omitempty"` + // Wire name: 'status' + Status RegistryWebhookStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRegistryWebhook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRegistryWebhook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRegistryWebhookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRegistryWebhookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRegistryWebhook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRegistryWebhook) MarshalJSON() ([]byte, error) { + pb, err := createRegistryWebhookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRun struct { // ID of the associated experiment. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string // The name of the run. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string // Unix timestamp in milliseconds of when the run started. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Additional metadata for run. - Tags []RunTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []RunTag // ID of the user executing the run. This field is deprecated as of MLflow // 1.0, and will be removed in a future MLflow release. Use 'mlflow.user' // tag instead. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRun) MarshalJSON() ([]byte, error) { + pb, err := createRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRunResponse struct { // The newly created run. - Run *Run `json:"run,omitempty"` + // Wire name: 'run' + Run *Run +} + +func (st *CreateRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateRunResponse) MarshalJSON() ([]byte, error) { + pb, err := createRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateTransitionRequest struct { // User-provided comment on the action. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -676,28 +1245,100 @@ type CreateTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage Stage `json:"stage"` + // Wire name: 'stage' + Stage Stage // Version of the model. - Version string `json:"version"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateTransitionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateTransitionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createTransitionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createTransitionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateTransitionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateTransitionRequest) MarshalJSON() ([]byte, error) { + pb, err := createTransitionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateTransitionRequestResponse struct { // Transition request details. - Request *TransitionRequest `json:"request,omitempty"` + // Wire name: 'request' + Request *TransitionRequest +} + +func (st *CreateTransitionRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createTransitionRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createTransitionRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateTransitionRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := createTransitionRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateWebhookResponse struct { - Webhook *RegistryWebhook `json:"webhook,omitempty"` + + // Wire name: 'webhook' + Webhook *RegistryWebhook +} + +func (st *CreateWebhookResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createWebhookResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createWebhookResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateWebhookResponse) MarshalJSON() ([]byte, error) { + pb, err := createWebhookResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Dataset. Represents a reference to data used for training, testing, or @@ -705,192 +1346,800 @@ type CreateWebhookResponse struct { type Dataset struct { // Dataset digest, e.g. an md5 hash of the dataset that uniquely identifies // it within datasets of the same name. - Digest string `json:"digest"` + // Wire name: 'digest' + Digest string // The name of the dataset. E.g. “my.uc.table@2” “nyc-taxi-dataset”, // “fantastic-elk-3” - Name string `json:"name"` + // Wire name: 'name' + Name string // The profile of the dataset. Summary statistics for the dataset, such as // the number of rows in a table, the mean / std / mode of each column in a // table, or the number of elements in an array. - Profile string `json:"profile,omitempty"` + // Wire name: 'profile' + Profile string // The schema of the dataset. E.g., MLflow ColSpec JSON for a dataframe, // MLflow TensorSpec JSON for an ndarray, or another schema format. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // Source information for the dataset. Note that the source may not exactly // reproduce the dataset if it was transformed / modified before use with // MLflow. - Source string `json:"source"` + // Wire name: 'source' + Source string // The type of the dataset source, e.g. ‘databricks-uc-table’, // ‘DBFS’, ‘S3’, ... - SourceType string `json:"source_type"` + // Wire name: 'source_type' + SourceType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Dataset) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Dataset) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &datasetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := datasetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Dataset) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Dataset) MarshalJSON() ([]byte, error) { + pb, err := datasetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // DatasetInput. Represents a dataset and input tags. type DatasetInput struct { // The dataset being used as a Run input. - Dataset Dataset `json:"dataset"` + // Wire name: 'dataset' + Dataset Dataset // A list of tags for the dataset input, e.g. a “context” tag with value // “training” - Tags []InputTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []InputTag +} + +func (st *DatasetInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &datasetInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := datasetInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DatasetInput) MarshalJSON() ([]byte, error) { + pb, err := datasetInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a comment type DeleteCommentRequest struct { - Id string `json:"-" url:"id"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteCommentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCommentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCommentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCommentRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCommentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteCommentResponse struct { } +func (st *DeleteCommentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCommentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCommentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCommentResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteCommentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteExperiment struct { // ID of the associated experiment. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string +} + +func (st *DeleteExperiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExperimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExperimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExperiment) MarshalJSON() ([]byte, error) { + pb, err := deleteExperimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteExperimentResponse struct { } +func (st *DeleteExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a logged model type DeleteLoggedModelRequest struct { // The ID of the logged model to delete. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` +} + +func (st *DeleteLoggedModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLoggedModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLoggedModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteLoggedModelRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteLoggedModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteLoggedModelResponse struct { } +func (st *DeleteLoggedModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLoggedModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLoggedModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteLoggedModelResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteLoggedModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a tag on a logged model type DeleteLoggedModelTagRequest struct { // The ID of the logged model to delete the tag from. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` // The tag key. - TagKey string `json:"-" url:"-"` + // Wire name: 'tag_key' + TagKey string `tf:"-"` +} + +func (st *DeleteLoggedModelTagRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLoggedModelTagRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLoggedModelTagRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteLoggedModelTagRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteLoggedModelTagRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteLoggedModelTagResponse struct { } +func (st *DeleteLoggedModelTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLoggedModelTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLoggedModelTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteLoggedModelTagResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteLoggedModelTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a model type DeleteModelRequest struct { // Registered model unique name identifier. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteModelResponse struct { } +func (st *DeleteModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a model tag type DeleteModelTagRequest struct { // Name of the tag. The name must be an exact match; wild-card deletion is // not supported. Maximum size is 250 bytes. - Key string `json:"-" url:"key"` + // Wire name: 'key' + Key string `tf:"-"` // Name of the registered model that the tag was logged under. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` } -type DeleteModelTagResponse struct { +func (st *DeleteModelTagRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelTagRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelTagRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelTagRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteModelTagRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type DeleteModelTagResponse struct { +} + +func (st *DeleteModelTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelTagResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteModelTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a model version. type DeleteModelVersionRequest struct { // Name of the registered model - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Model version number - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` +} + +func (st *DeleteModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteModelVersionResponse struct { } +func (st *DeleteModelVersionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelVersionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelVersionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelVersionResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteModelVersionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a model version tag type DeleteModelVersionTagRequest struct { // Name of the tag. The name must be an exact match; wild-card deletion is // not supported. Maximum size is 250 bytes. - Key string `json:"-" url:"key"` + // Wire name: 'key' + Key string `tf:"-"` // Name of the registered model that the tag was logged under. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Model version number that the tag was logged under. - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` +} + +func (st *DeleteModelVersionTagRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelVersionTagRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelVersionTagRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelVersionTagRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteModelVersionTagRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteModelVersionTagResponse struct { } +func (st *DeleteModelVersionTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteModelVersionTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteModelVersionTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteModelVersionTagResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteModelVersionTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteRun struct { // ID of the run to delete. - RunId string `json:"run_id"` + // Wire name: 'run_id' + RunId string +} + +func (st *DeleteRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRun) MarshalJSON() ([]byte, error) { + pb, err := deleteRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteRunResponse struct { } +func (st *DeleteRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRunResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteRuns struct { // The ID of the experiment containing the runs to delete. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string // An optional positive integer indicating the maximum number of runs to // delete. The maximum allowed value for max_runs is 10000. - MaxRuns int `json:"max_runs,omitempty"` + // Wire name: 'max_runs' + MaxRuns int // The maximum creation timestamp in milliseconds since the UNIX epoch for // deleting runs. Only runs created prior to or at this timestamp are // deleted. - MaxTimestampMillis int64 `json:"max_timestamp_millis"` + // Wire name: 'max_timestamp_millis' + MaxTimestampMillis int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteRuns) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteRuns) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteRuns) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteRuns) MarshalJSON() ([]byte, error) { + pb, err := deleteRunsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteRunsResponse struct { // The number of runs deleted. - RunsDeleted int `json:"runs_deleted,omitempty"` + // Wire name: 'runs_deleted' + RunsDeleted int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteRunsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteRunsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteTag struct { // Name of the tag. Maximum size is 255 bytes. Must be provided. - Key string `json:"key"` + // Wire name: 'key' + Key string // ID of the run that the tag was logged under. Must be provided. - RunId string `json:"run_id"` + // Wire name: 'run_id' + RunId string +} + +func (st *DeleteTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTag) MarshalJSON() ([]byte, error) { + pb, err := deleteTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteTagResponse struct { } +func (st *DeleteTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTagResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a transition request type DeleteTransitionRequestRequest struct { // User-provided comment on the action. - Comment string `json:"-" url:"comment,omitempty"` + // Wire name: 'comment' + Comment string `tf:"-"` // Username of the user who created this request. Of the transition requests // matching the specified details, only the one transition created by this // user will be deleted. - Creator string `json:"-" url:"creator"` + // Wire name: 'creator' + Creator string `tf:"-"` // Name of the model. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Target stage of the transition request. Valid values are: // // * `None`: The initial stage of a model version. @@ -900,25 +2149,70 @@ type DeleteTransitionRequestRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage DeleteTransitionRequestStage `json:"-" url:"stage"` + // Wire name: 'stage' + Stage DeleteTransitionRequestStage `tf:"-"` // Version of the model. - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteTransitionRequestRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteTransitionRequestRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTransitionRequestRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTransitionRequestRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteTransitionRequestRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteTransitionRequestRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteTransitionRequestRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteTransitionRequestResponse struct { } +func (st *DeleteTransitionRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTransitionRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTransitionRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTransitionRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteTransitionRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteTransitionRequestStage string +type deleteTransitionRequestStagePb string const DeleteTransitionRequestStageArchived DeleteTransitionRequestStage = `Archived` @@ -949,118 +2243,266 @@ func (f *DeleteTransitionRequestStage) Type() string { return "DeleteTransitionRequestStage" } +func deleteTransitionRequestStageToPb(st *DeleteTransitionRequestStage) (*deleteTransitionRequestStagePb, error) { + if st == nil { + return nil, nil + } + pb := deleteTransitionRequestStagePb(*st) + return &pb, nil +} + +func deleteTransitionRequestStageFromPb(pb *deleteTransitionRequestStagePb) (*DeleteTransitionRequestStage, error) { + if pb == nil { + return nil, nil + } + st := DeleteTransitionRequestStage(*pb) + return &st, nil +} + // Delete a webhook type DeleteWebhookRequest struct { // Webhook ID required to delete a registry webhook. - Id string `json:"-" url:"id,omitempty"` + // Wire name: 'id' + Id string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteWebhookRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteWebhookRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWebhookRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWebhookRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteWebhookRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteWebhookRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteWebhookRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteWebhookResponse struct { } +func (st *DeleteWebhookResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWebhookResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWebhookResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWebhookResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteWebhookResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // An experiment and its metadata. type Experiment struct { // Location where artifacts for the experiment are stored. - ArtifactLocation string `json:"artifact_location,omitempty"` + // Wire name: 'artifact_location' + ArtifactLocation string // Creation time - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Unique identifier for the experiment. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string // Last update time - LastUpdateTime int64 `json:"last_update_time,omitempty"` + // Wire name: 'last_update_time' + LastUpdateTime int64 // Current life cycle stage of the experiment: "active" or "deleted". // Deleted experiments are not returned by APIs. - LifecycleStage string `json:"lifecycle_stage,omitempty"` + // Wire name: 'lifecycle_stage' + LifecycleStage string // Human readable name that identifies the experiment. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Tags: Additional metadata key-value pairs. - Tags []ExperimentTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ExperimentTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Experiment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Experiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Experiment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Experiment) MarshalJSON() ([]byte, error) { + pb, err := experimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExperimentAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ExperimentPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := experimentAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExperimentAccessControlResponse struct { // All permissions. - AllPermissions []ExperimentPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []ExperimentPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := experimentAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExperimentPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ExperimentPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentPermission) MarshalJSON() ([]byte, error) { + pb, err := experimentPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type ExperimentPermissionLevel string +type experimentPermissionLevelPb string const ExperimentPermissionLevelCanEdit ExperimentPermissionLevel = `CAN_EDIT` @@ -1089,120 +2531,318 @@ func (f *ExperimentPermissionLevel) Type() string { return "ExperimentPermissionLevel" } +func experimentPermissionLevelToPb(st *ExperimentPermissionLevel) (*experimentPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := experimentPermissionLevelPb(*st) + return &pb, nil +} + +func experimentPermissionLevelFromPb(pb *experimentPermissionLevelPb) (*ExperimentPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := ExperimentPermissionLevel(*pb) + return &st, nil +} + type ExperimentPermissions struct { - AccessControlList []ExperimentAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []ExperimentAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentPermissions) MarshalJSON() ([]byte, error) { + pb, err := experimentPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExperimentPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ExperimentPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := experimentPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExperimentPermissionsRequest struct { - AccessControlList []ExperimentAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []ExperimentAccessControlRequest // The experiment for which to get or manage permissions. - ExperimentId string `json:"-" url:"-"` + // Wire name: 'experiment_id' + ExperimentId string `tf:"-"` +} + +func (st *ExperimentPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExperimentPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := experimentPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A tag for an experiment. type ExperimentTag struct { // The tag key. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExperimentTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExperimentTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &experimentTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := experimentTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExperimentTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExperimentTag) MarshalJSON() ([]byte, error) { + pb, err := experimentTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Metadata of a single artifact file or directory. type FileInfo struct { // The size in bytes of the file. Unset for directories. - FileSize int64 `json:"file_size,omitempty"` + // Wire name: 'file_size' + FileSize int64 // Whether the path is a directory. - IsDir bool `json:"is_dir,omitempty"` + // Wire name: 'is_dir' + IsDir bool // The path relative to the root artifact directory run. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileInfo) MarshalJSON() ([]byte, error) { + pb, err := fileInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FinalizeLoggedModelRequest struct { // The ID of the logged model to finalize. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` // Whether or not the model is ready for use. // ``"LOGGED_MODEL_UPLOAD_FAILED"`` indicates that something went wrong when // logging the model weights / agent code). - Status LoggedModelStatus `json:"status"` + // Wire name: 'status' + Status LoggedModelStatus +} + +func (st *FinalizeLoggedModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &finalizeLoggedModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := finalizeLoggedModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FinalizeLoggedModelRequest) MarshalJSON() ([]byte, error) { + pb, err := finalizeLoggedModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FinalizeLoggedModelResponse struct { // The updated logged model. - Model *LoggedModel `json:"model,omitempty"` + // Wire name: 'model' + Model *LoggedModel +} + +func (st *FinalizeLoggedModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &finalizeLoggedModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := finalizeLoggedModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FinalizeLoggedModelResponse) MarshalJSON() ([]byte, error) { + pb, err := finalizeLoggedModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a forecasting experiment with its unique identifier, URL, and // state. type ForecastingExperiment struct { // The unique ID for the forecasting experiment. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string // The URL to the forecasting experiment page. - ExperimentPageUrl string `json:"experiment_page_url,omitempty"` + // Wire name: 'experiment_page_url' + ExperimentPageUrl string // The current state of the forecasting experiment. - State ForecastingExperimentState `json:"state,omitempty"` + // Wire name: 'state' + State ForecastingExperimentState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ForecastingExperiment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ForecastingExperiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &forecastingExperimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := forecastingExperimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ForecastingExperiment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ForecastingExperiment) MarshalJSON() ([]byte, error) { + pb, err := forecastingExperimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ForecastingExperimentState string +type forecastingExperimentStatePb string const ForecastingExperimentStateCancelled ForecastingExperimentState = `CANCELLED` @@ -1235,71 +2875,399 @@ func (f *ForecastingExperimentState) Type() string { return "ForecastingExperimentState" } +func forecastingExperimentStateToPb(st *ForecastingExperimentState) (*forecastingExperimentStatePb, error) { + if st == nil { + return nil, nil + } + pb := forecastingExperimentStatePb(*st) + return &pb, nil +} + +func forecastingExperimentStateFromPb(pb *forecastingExperimentStatePb) (*ForecastingExperimentState, error) { + if pb == nil { + return nil, nil + } + st := ForecastingExperimentState(*pb) + return &st, nil +} + // Get an experiment by name type GetByNameRequest struct { // Name of the associated experiment. - ExperimentName string `json:"-" url:"experiment_name"` + // Wire name: 'experiment_name' + ExperimentName string `tf:"-"` +} + +func (st *GetByNameRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getByNameRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getByNameRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetByNameRequest) MarshalJSON() ([]byte, error) { + pb, err := getByNameRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get credentials to download trace data type GetCredentialsForTraceDataDownloadRequest struct { // The ID of the trace to fetch artifact download credentials for. - RequestId string `json:"-" url:"-"` + // Wire name: 'request_id' + RequestId string `tf:"-"` +} + +func (st *GetCredentialsForTraceDataDownloadRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsForTraceDataDownloadRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsForTraceDataDownloadRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialsForTraceDataDownloadRequest) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsForTraceDataDownloadRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCredentialsForTraceDataDownloadResponse struct { // The artifact download credentials for the specified trace data. - CredentialInfo *ArtifactCredentialInfo `json:"credential_info,omitempty"` + // Wire name: 'credential_info' + CredentialInfo *ArtifactCredentialInfo +} + +func (st *GetCredentialsForTraceDataDownloadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsForTraceDataDownloadResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsForTraceDataDownloadResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialsForTraceDataDownloadResponse) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsForTraceDataDownloadResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get credentials to upload trace data type GetCredentialsForTraceDataUploadRequest struct { // The ID of the trace to fetch artifact upload credentials for. - RequestId string `json:"-" url:"-"` + // Wire name: 'request_id' + RequestId string `tf:"-"` +} + +func (st *GetCredentialsForTraceDataUploadRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsForTraceDataUploadRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsForTraceDataUploadRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialsForTraceDataUploadRequest) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsForTraceDataUploadRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCredentialsForTraceDataUploadResponse struct { // The artifact upload credentials for the specified trace data. - CredentialInfo *ArtifactCredentialInfo `json:"credential_info,omitempty"` + // Wire name: 'credential_info' + CredentialInfo *ArtifactCredentialInfo +} + +func (st *GetCredentialsForTraceDataUploadResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsForTraceDataUploadResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsForTraceDataUploadResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialsForTraceDataUploadResponse) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsForTraceDataUploadResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetExperimentByNameResponse struct { // Experiment details. - Experiment *Experiment `json:"experiment,omitempty"` + // Wire name: 'experiment' + Experiment *Experiment +} + +func (st *GetExperimentByNameResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentByNameResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentByNameResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentByNameResponse) MarshalJSON() ([]byte, error) { + pb, err := getExperimentByNameResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get experiment permission levels type GetExperimentPermissionLevelsRequest struct { // The experiment for which to get or manage permissions. - ExperimentId string `json:"-" url:"-"` + // Wire name: 'experiment_id' + ExperimentId string `tf:"-"` +} + +func (st *GetExperimentPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getExperimentPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetExperimentPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []ExperimentPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []ExperimentPermissionsDescription +} + +func (st *GetExperimentPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getExperimentPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get experiment permissions type GetExperimentPermissionsRequest struct { // The experiment for which to get or manage permissions. - ExperimentId string `json:"-" url:"-"` + // Wire name: 'experiment_id' + ExperimentId string `tf:"-"` +} + +func (st *GetExperimentPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getExperimentPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an experiment type GetExperimentRequest struct { // ID of the associated experiment. - ExperimentId string `json:"-" url:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string `tf:"-"` +} + +func (st *GetExperimentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentRequest) MarshalJSON() ([]byte, error) { + pb, err := getExperimentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetExperimentResponse struct { // Experiment details. - Experiment *Experiment `json:"experiment,omitempty"` + // Wire name: 'experiment' + Experiment *Experiment +} + +func (st *GetExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := getExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a forecasting experiment type GetForecastingExperimentRequest struct { // The unique ID of a forecasting experiment - ExperimentId string `json:"-" url:"-"` + // Wire name: 'experiment_id' + ExperimentId string `tf:"-"` +} + +func (st *GetForecastingExperimentRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getForecastingExperimentRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getForecastingExperimentRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetForecastingExperimentRequest) MarshalJSON() ([]byte, error) { + pb, err := getForecastingExperimentRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get metric history for a run @@ -1307,51 +3275,178 @@ type GetHistoryRequest struct { // Maximum number of Metric records to return per paginated request. Default // is set to 25,000. If set higher than 25,000, a request Exception will be // raised. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Name of the metric. - MetricKey string `json:"-" url:"metric_key"` + // Wire name: 'metric_key' + MetricKey string `tf:"-"` // Token indicating the page of metric histories to fetch. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // ID of the run from which to fetch metric values. Must be provided. - RunId string `json:"-" url:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string `tf:"-"` // [Deprecated, use `run_id` instead] ID of the run from which to fetch // metric values. This field will be removed in a future MLflow version. - RunUuid string `json:"-" url:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetHistoryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetHistoryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getHistoryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getHistoryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetHistoryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetHistoryRequest) MarshalJSON() ([]byte, error) { + pb, err := getHistoryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetLatestVersionsRequest struct { // Registered model unique name identifier. - Name string `json:"name"` + // Wire name: 'name' + Name string // List of stages. - Stages []string `json:"stages,omitempty"` + // Wire name: 'stages' + Stages []string +} + +func (st *GetLatestVersionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLatestVersionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLatestVersionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetLatestVersionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getLatestVersionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetLatestVersionsResponse struct { // Latest version models for each requests stage. Only return models with // current `READY` status. If no `stages` provided, returns the latest // version for each stage, including `"None"`. - ModelVersions []ModelVersion `json:"model_versions,omitempty"` + // Wire name: 'model_versions' + ModelVersions []ModelVersion +} + +func (st *GetLatestVersionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLatestVersionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLatestVersionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetLatestVersionsResponse) MarshalJSON() ([]byte, error) { + pb, err := getLatestVersionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a logged model type GetLoggedModelRequest struct { // The ID of the logged model to retrieve. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` +} + +func (st *GetLoggedModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLoggedModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLoggedModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetLoggedModelRequest) MarshalJSON() ([]byte, error) { + pb, err := getLoggedModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetLoggedModelResponse struct { // The retrieved logged model. - Model *LoggedModel `json:"model,omitempty"` + // Wire name: 'model' + Model *LoggedModel +} + +func (st *GetLoggedModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLoggedModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLoggedModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetLoggedModelResponse) MarshalJSON() ([]byte, error) { + pb, err := getLoggedModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetMetricHistoryResponse struct { @@ -1359,108 +3454,402 @@ type GetMetricHistoryResponse struct { // the request or if the total count of metrics returned is less than the // service level pagination threshold. Otherwise, this is one page of // results. - Metrics []Metric `json:"metrics,omitempty"` + // Wire name: 'metrics' + Metrics []Metric // A token that can be used to issue a query for the next page of metric // history values. A missing token indicates that no additional metrics are // available to fetch. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetMetricHistoryResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetMetricHistoryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getMetricHistoryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getMetricHistoryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetMetricHistoryResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetMetricHistoryResponse) MarshalJSON() ([]byte, error) { + pb, err := getMetricHistoryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get model type GetModelRequest struct { // Registered model unique name identifier. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetModelRequest) MarshalJSON() ([]byte, error) { + pb, err := getModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetModelResponse struct { - RegisteredModelDatabricks *ModelDatabricks `json:"registered_model_databricks,omitempty"` + + // Wire name: 'registered_model_databricks' + RegisteredModelDatabricks *ModelDatabricks +} + +func (st *GetModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetModelResponse) MarshalJSON() ([]byte, error) { + pb, err := getModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a model version URI type GetModelVersionDownloadUriRequest struct { // Name of the registered model - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Model version number - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` +} + +func (st *GetModelVersionDownloadUriRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelVersionDownloadUriRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelVersionDownloadUriRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetModelVersionDownloadUriRequest) MarshalJSON() ([]byte, error) { + pb, err := getModelVersionDownloadUriRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetModelVersionDownloadUriResponse struct { // URI corresponding to where artifacts for this model version are stored. - ArtifactUri string `json:"artifact_uri,omitempty"` + // Wire name: 'artifact_uri' + ArtifactUri string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetModelVersionDownloadUriResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetModelVersionDownloadUriResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelVersionDownloadUriResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelVersionDownloadUriResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetModelVersionDownloadUriResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetModelVersionDownloadUriResponse) MarshalJSON() ([]byte, error) { + pb, err := getModelVersionDownloadUriResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a model version type GetModelVersionRequest struct { // Name of the registered model - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Model version number - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` +} + +func (st *GetModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := getModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetModelVersionResponse struct { - ModelVersion *ModelVersion `json:"model_version,omitempty"` + + // Wire name: 'model_version' + ModelVersion *ModelVersion +} + +func (st *GetModelVersionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getModelVersionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getModelVersionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetModelVersionResponse) MarshalJSON() ([]byte, error) { + pb, err := getModelVersionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get registered model permission levels type GetRegisteredModelPermissionLevelsRequest struct { // The registered model for which to get or manage permissions. - RegisteredModelId string `json:"-" url:"-"` + // Wire name: 'registered_model_id' + RegisteredModelId string `tf:"-"` +} + +func (st *GetRegisteredModelPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRegisteredModelPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRegisteredModelPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRegisteredModelPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getRegisteredModelPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetRegisteredModelPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []RegisteredModelPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []RegisteredModelPermissionsDescription +} + +func (st *GetRegisteredModelPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRegisteredModelPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRegisteredModelPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRegisteredModelPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getRegisteredModelPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get registered model permissions type GetRegisteredModelPermissionsRequest struct { // The registered model for which to get or manage permissions. - RegisteredModelId string `json:"-" url:"-"` + // Wire name: 'registered_model_id' + RegisteredModelId string `tf:"-"` +} + +func (st *GetRegisteredModelPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRegisteredModelPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRegisteredModelPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRegisteredModelPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getRegisteredModelPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a run type GetRunRequest struct { // ID of the run to fetch. Must be provided. - RunId string `json:"-" url:"run_id"` + // Wire name: 'run_id' + RunId string `tf:"-"` // [Deprecated, use `run_id` instead] ID of the run to fetch. This field // will be removed in a future MLflow version. - RunUuid string `json:"-" url:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRunRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRunRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRunRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRunRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRunRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRunRequest) MarshalJSON() ([]byte, error) { + pb, err := getRunRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetRunResponse struct { // Run metadata (name, start time, etc) and data (metrics, params, and // tags). - Run *Run `json:"run,omitempty"` + // Wire name: 'run' + Run *Run +} + +func (st *GetRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRunResponse) MarshalJSON() ([]byte, error) { + pb, err := getRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type HttpUrlSpec struct { @@ -1468,7 +3857,8 @@ type HttpUrlSpec struct { // by the wehbook. It should be of the form `" "`. // If set to an empty string, no authorization header will be included in // the request. - Authorization string `json:"authorization,omitempty"` + // Wire name: 'authorization' + Authorization string // Enable/disable SSL certificate validation. Default is true. For // self-signed certificates, this field must be false AND the destination // server must disable certificate validation as well. For security @@ -1476,23 +3866,43 @@ type HttpUrlSpec struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + // Wire name: 'enable_ssl_verification' + EnableSslVerification bool // Shared secret required for HMAC encoding payload. The HMAC-encoded // payload will be sent in the header as: { "X-Databricks-Signature": // $encoded_payload }. - Secret string `json:"secret,omitempty"` + // Wire name: 'secret' + Secret string // External HTTPS URL called on event trigger (by using a POST request). - Url string `json:"url"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *HttpUrlSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *HttpUrlSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &httpUrlSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := httpUrlSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s HttpUrlSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st HttpUrlSpec) MarshalJSON() ([]byte, error) { + pb, err := httpUrlSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type HttpUrlSpecWithoutSecret struct { @@ -1503,67 +3913,152 @@ type HttpUrlSpecWithoutSecret struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + // Wire name: 'enable_ssl_verification' + EnableSslVerification bool // External HTTPS URL called on event trigger (by using a POST request). - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *HttpUrlSpecWithoutSecret) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *HttpUrlSpecWithoutSecret) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &httpUrlSpecWithoutSecretPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := httpUrlSpecWithoutSecretFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s HttpUrlSpecWithoutSecret) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st HttpUrlSpecWithoutSecret) MarshalJSON() ([]byte, error) { + pb, err := httpUrlSpecWithoutSecretToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Tag for a dataset input. type InputTag struct { // The tag key. - Key string `json:"key"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value"` + // Wire name: 'value' + Value string +} + +func (st *InputTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &inputTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := inputTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st InputTag) MarshalJSON() ([]byte, error) { + pb, err := inputTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobSpec struct { // The personal access token used to authorize webhook's job runs. - AccessToken string `json:"access_token"` + // Wire name: 'access_token' + AccessToken string // ID of the job that the webhook runs. - JobId string `json:"job_id"` + // Wire name: 'job_id' + JobId string // URL of the workspace containing the job that this webhook runs. If not // specified, the job’s workspace URL is assumed to be the same as the // workspace where the webhook is created. - WorkspaceUrl string `json:"workspace_url,omitempty"` + // Wire name: 'workspace_url' + WorkspaceUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobSpec) MarshalJSON() ([]byte, error) { + pb, err := jobSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type JobSpecWithoutSecret struct { // ID of the job that the webhook runs. - JobId string `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId string // URL of the workspace containing the job that this webhook runs. Defaults // to the workspace URL in which the webhook is created. If not specified, // the job’s workspace is assumed to be the same as the webhook’s. - WorkspaceUrl string `json:"workspace_url,omitempty"` + // Wire name: 'workspace_url' + WorkspaceUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *JobSpecWithoutSecret) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *JobSpecWithoutSecret) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &jobSpecWithoutSecretPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := jobSpecWithoutSecretFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s JobSpecWithoutSecret) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st JobSpecWithoutSecret) MarshalJSON() ([]byte, error) { + pb, err := jobSpecWithoutSecretToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List artifacts @@ -1574,44 +4069,85 @@ type ListArtifactsRequest struct { // `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC // Volumes, which supports pagination. See [List directory contents | Files // API](/api/workspace/files/listdirectorycontents). - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Filter artifacts matching this path (a relative path from the root // artifact directory). - Path string `json:"-" url:"path,omitempty"` + // Wire name: 'path' + Path string `tf:"-"` // ID of the run whose artifacts to list. Must be provided. - RunId string `json:"-" url:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string `tf:"-"` // [Deprecated, use `run_id` instead] ID of the run whose artifacts to list. // This field will be removed in a future MLflow version. - RunUuid string `json:"-" url:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListArtifactsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListArtifactsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listArtifactsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listArtifactsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListArtifactsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListArtifactsRequest) MarshalJSON() ([]byte, error) { + pb, err := listArtifactsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListArtifactsResponse struct { // The file location and metadata for artifacts. - Files []FileInfo `json:"files,omitempty"` + // Wire name: 'files' + Files []FileInfo // The token that can be used to retrieve the next page of artifact results. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // The root artifact directory for the run. - RootUri string `json:"root_uri,omitempty"` + // Wire name: 'root_uri' + RootUri string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListArtifactsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListArtifactsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listArtifactsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listArtifactsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListArtifactsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListArtifactsResponse) MarshalJSON() ([]byte, error) { + pb, err := listArtifactsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List experiments @@ -1621,151 +4157,340 @@ type ListExperimentsRequest struct { // automatically capped at 1000. Callers of this endpoint are encouraged to // pass max_results explicitly and leverage page_token to iterate through // experiments. - MaxResults int64 `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int64 `tf:"-"` // Token indicating the page of experiments to fetch - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // Qualifier for type of experiments to be returned. If unspecified, return // only active experiments. - ViewType ViewType `json:"-" url:"view_type,omitempty"` + // Wire name: 'view_type' + ViewType ViewType `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExperimentsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExperimentsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExperimentsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExperimentsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExperimentsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExperimentsRequest) MarshalJSON() ([]byte, error) { + pb, err := listExperimentsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListExperimentsResponse struct { // Paginated Experiments beginning with the first item on the requested // page. - Experiments []Experiment `json:"experiments,omitempty"` + // Wire name: 'experiments' + Experiments []Experiment // Token that can be used to retrieve the next page of experiments. Empty // token means no more experiment is available for retrieval. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListExperimentsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListExperimentsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listExperimentsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listExperimentsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListExperimentsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListExperimentsResponse) MarshalJSON() ([]byte, error) { + pb, err := listExperimentsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List artifacts for a logged model type ListLoggedModelArtifactsRequest struct { // Filter artifacts matching this path (a relative path from the root // artifact directory). - ArtifactDirectoryPath string `json:"-" url:"artifact_directory_path,omitempty"` + // Wire name: 'artifact_directory_path' + ArtifactDirectoryPath string `tf:"-"` // The ID of the logged model for which to list the artifacts. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` // Token indicating the page of artifact results to fetch. `page_token` is // not supported when listing artifacts in UC Volumes. A maximum of 1000 // artifacts will be retrieved for UC Volumes. Please call // `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC // Volumes, which supports pagination. See [List directory contents | Files // API](/api/workspace/files/listdirectorycontents). - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListLoggedModelArtifactsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListLoggedModelArtifactsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listLoggedModelArtifactsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listLoggedModelArtifactsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListLoggedModelArtifactsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListLoggedModelArtifactsRequest) MarshalJSON() ([]byte, error) { + pb, err := listLoggedModelArtifactsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListLoggedModelArtifactsResponse struct { // File location and metadata for artifacts. - Files []FileInfo `json:"files,omitempty"` + // Wire name: 'files' + Files []FileInfo // Token that can be used to retrieve the next page of artifact results - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Root artifact directory for the logged model. - RootUri string `json:"root_uri,omitempty"` + // Wire name: 'root_uri' + RootUri string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListLoggedModelArtifactsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListLoggedModelArtifactsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listLoggedModelArtifactsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listLoggedModelArtifactsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListLoggedModelArtifactsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListLoggedModelArtifactsResponse) MarshalJSON() ([]byte, error) { + pb, err := listLoggedModelArtifactsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List models type ListModelsRequest struct { // Maximum number of registered models desired. Max threshold is 1000. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Pagination token to go to the next page based on a previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListModelsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListModelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listModelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listModelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListModelsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListModelsRequest) MarshalJSON() ([]byte, error) { + pb, err := listModelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListModelsResponse struct { // Pagination token to request next page of models for the same query. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - RegisteredModels []Model `json:"registered_models,omitempty"` + // Wire name: 'registered_models' + RegisteredModels []Model - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListModelsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListModelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listModelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listModelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListModelsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListModelsResponse) MarshalJSON() ([]byte, error) { + pb, err := listModelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListRegistryWebhooks struct { // Token that can be used to retrieve the next page of artifact results - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Array of registry webhooks. - Webhooks []RegistryWebhook `json:"webhooks,omitempty"` + // Wire name: 'webhooks' + Webhooks []RegistryWebhook - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRegistryWebhooks) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRegistryWebhooks) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRegistryWebhooksPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRegistryWebhooksFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRegistryWebhooks) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRegistryWebhooks) MarshalJSON() ([]byte, error) { + pb, err := listRegistryWebhooksToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List transition requests type ListTransitionRequestsRequest struct { // Name of the model. - Name string `json:"-" url:"name"` + // Wire name: 'name' + Name string `tf:"-"` // Version of the model. - Version string `json:"-" url:"version"` + // Wire name: 'version' + Version string `tf:"-"` +} + +func (st *ListTransitionRequestsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTransitionRequestsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTransitionRequestsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListTransitionRequestsRequest) MarshalJSON() ([]byte, error) { + pb, err := listTransitionRequestsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListTransitionRequestsResponse struct { // Array of open transition requests. - Requests []Activity `json:"requests,omitempty"` + // Wire name: 'requests' + Requests []Activity +} + +func (st *ListTransitionRequestsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTransitionRequestsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTransitionRequestsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListTransitionRequestsResponse) MarshalJSON() ([]byte, error) { + pb, err := listTransitionRequestsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List registry webhooks @@ -1773,244 +4498,711 @@ type ListWebhooksRequest struct { // If `events` is specified, any webhook with one or more of the specified // trigger events is included in the output. If `events` is not specified, // webhooks of all event types are included in the output. - Events []RegistryWebhookEvent `json:"-" url:"events,omitempty"` + // Wire name: 'events' + Events []RegistryWebhookEvent `tf:"-"` // If not specified, all webhooks associated with the specified events are // listed, regardless of their associated model. - ModelName string `json:"-" url:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string `tf:"-"` // Token indicating the page of artifact results to fetch - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListWebhooksRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListWebhooksRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listWebhooksRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listWebhooksRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListWebhooksRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListWebhooksRequest) MarshalJSON() ([]byte, error) { + pb, err := listWebhooksRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogBatch struct { // Metrics to log. A single request can contain up to 1000 metrics, and up // to 1000 metrics, params, and tags in total. - Metrics []Metric `json:"metrics,omitempty"` + // Wire name: 'metrics' + Metrics []Metric // Params to log. A single request can contain up to 100 params, and up to // 1000 metrics, params, and tags in total. - Params []Param `json:"params,omitempty"` + // Wire name: 'params' + Params []Param // ID of the run to log under - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // Tags to log. A single request can contain up to 100 tags, and up to 1000 // metrics, params, and tags in total. - Tags []RunTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []RunTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogBatch) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogBatch) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logBatchPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logBatchFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogBatch) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogBatch) MarshalJSON() ([]byte, error) { + pb, err := logBatchToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogBatchResponse struct { } +func (st *LogBatchResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logBatchResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logBatchResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogBatchResponse) MarshalJSON() ([]byte, error) { + pb, err := logBatchResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogInputs struct { // Dataset inputs - Datasets []DatasetInput `json:"datasets,omitempty"` + // Wire name: 'datasets' + Datasets []DatasetInput // Model inputs - Models []ModelInput `json:"models,omitempty"` + // Wire name: 'models' + Models []ModelInput // ID of the run to log under - RunId string `json:"run_id"` + // Wire name: 'run_id' + RunId string +} + +func (st *LogInputs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logInputsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logInputsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogInputs) MarshalJSON() ([]byte, error) { + pb, err := logInputsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogInputsResponse struct { } +func (st *LogInputsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logInputsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logInputsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogInputsResponse) MarshalJSON() ([]byte, error) { + pb, err := logInputsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogLoggedModelParamsRequest struct { // The ID of the logged model to log params for. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` // Parameters to attach to the model. - Params []LoggedModelParameter `json:"params,omitempty"` + // Wire name: 'params' + Params []LoggedModelParameter +} + +func (st *LogLoggedModelParamsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logLoggedModelParamsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logLoggedModelParamsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogLoggedModelParamsRequest) MarshalJSON() ([]byte, error) { + pb, err := logLoggedModelParamsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogLoggedModelParamsRequestResponse struct { } +func (st *LogLoggedModelParamsRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logLoggedModelParamsRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logLoggedModelParamsRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogLoggedModelParamsRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := logLoggedModelParamsRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogMetric struct { // Dataset digest of the dataset associated with the metric, e.g. an md5 // hash of the dataset that uniquely identifies it within datasets of the // same name. - DatasetDigest string `json:"dataset_digest,omitempty"` + // Wire name: 'dataset_digest' + DatasetDigest string // The name of the dataset associated with the metric. E.g. // “my.uc.table@2” “nyc-taxi-dataset”, “fantastic-elk-3” - DatasetName string `json:"dataset_name,omitempty"` + // Wire name: 'dataset_name' + DatasetName string // Name of the metric. - Key string `json:"key"` + // Wire name: 'key' + Key string // ID of the logged model associated with the metric, if applicable - ModelId string `json:"model_id,omitempty"` + // Wire name: 'model_id' + ModelId string // ID of the run under which to log the metric. Must be provided. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // [Deprecated, use `run_id` instead] ID of the run under which to log the // metric. This field will be removed in a future MLflow version. - RunUuid string `json:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string // Step at which to log the metric - Step int64 `json:"step,omitempty"` + // Wire name: 'step' + Step int64 // Unix timestamp in milliseconds at the time metric was logged. - Timestamp int64 `json:"timestamp"` + // Wire name: 'timestamp' + Timestamp int64 // Double value of the metric being logged. - Value float64 `json:"value"` + // Wire name: 'value' + Value float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogMetric) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogMetric) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logMetricPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logMetricFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogMetric) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogMetric) MarshalJSON() ([]byte, error) { + pb, err := logMetricToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogMetricResponse struct { } +func (st *LogMetricResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logMetricResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logMetricResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogMetricResponse) MarshalJSON() ([]byte, error) { + pb, err := logMetricResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogModel struct { // MLmodel file in json format. - ModelJson string `json:"model_json,omitempty"` + // Wire name: 'model_json' + ModelJson string // ID of the run to log under - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogModel) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogModel) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogModel) MarshalJSON() ([]byte, error) { + pb, err := logModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogModelResponse struct { } +func (st *LogModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogModelResponse) MarshalJSON() ([]byte, error) { + pb, err := logModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogOutputsRequest struct { // The model outputs from the Run. - Models []ModelOutput `json:"models,omitempty"` + // Wire name: 'models' + Models []ModelOutput // The ID of the Run from which to log outputs. - RunId string `json:"run_id"` + // Wire name: 'run_id' + RunId string +} + +func (st *LogOutputsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logOutputsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logOutputsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogOutputsRequest) MarshalJSON() ([]byte, error) { + pb, err := logOutputsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogOutputsResponse struct { } +func (st *LogOutputsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logOutputsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logOutputsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogOutputsResponse) MarshalJSON() ([]byte, error) { + pb, err := logOutputsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type LogParam struct { // Name of the param. Maximum size is 255 bytes. - Key string `json:"key"` + // Wire name: 'key' + Key string // ID of the run under which to log the param. Must be provided. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // [Deprecated, use `run_id` instead] ID of the run under which to log the // param. This field will be removed in a future MLflow version. - RunUuid string `json:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string // String value of the param being logged. Maximum size is 500 bytes. - Value string `json:"value"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LogParam) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LogParam) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logParamPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logParamFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LogParam) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LogParam) MarshalJSON() ([]byte, error) { + pb, err := logParamToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LogParamResponse struct { } +func (st *LogParamResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logParamResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logParamResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogParamResponse) MarshalJSON() ([]byte, error) { + pb, err := logParamResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // A logged model message includes logged model attributes, tags, registration // info, params, and linked run metrics. type LoggedModel struct { // The params and metrics attached to the logged model. - Data *LoggedModelData `json:"data,omitempty"` + // Wire name: 'data' + Data *LoggedModelData // The logged model attributes such as model ID, status, tags, etc. - Info *LoggedModelInfo `json:"info,omitempty"` + // Wire name: 'info' + Info *LoggedModelInfo +} + +func (st *LoggedModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &loggedModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := loggedModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LoggedModel) MarshalJSON() ([]byte, error) { + pb, err := loggedModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A LoggedModelData message includes logged model params and linked metrics. type LoggedModelData struct { // Performance metrics linked to the model. - Metrics []Metric `json:"metrics,omitempty"` + // Wire name: 'metrics' + Metrics []Metric // Immutable string key-value pairs of the model. - Params []LoggedModelParameter `json:"params,omitempty"` + // Wire name: 'params' + Params []LoggedModelParameter +} + +func (st *LoggedModelData) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &loggedModelDataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := loggedModelDataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LoggedModelData) MarshalJSON() ([]byte, error) { + pb, err := loggedModelDataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A LoggedModelInfo includes logged model attributes, tags, and registration // info. type LoggedModelInfo struct { // The URI of the directory where model artifacts are stored. - ArtifactUri string `json:"artifact_uri,omitempty"` + // Wire name: 'artifact_uri' + ArtifactUri string // The timestamp when the model was created in milliseconds since the UNIX // epoch. - CreationTimestampMs int64 `json:"creation_timestamp_ms,omitempty"` + // Wire name: 'creation_timestamp_ms' + CreationTimestampMs int64 // The ID of the user or principal that created the model. - CreatorId int64 `json:"creator_id,omitempty"` + // Wire name: 'creator_id' + CreatorId int64 // The ID of the experiment that owns the model. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string // The timestamp when the model was last updated in milliseconds since the // UNIX epoch. - LastUpdatedTimestampMs int64 `json:"last_updated_timestamp_ms,omitempty"` + // Wire name: 'last_updated_timestamp_ms' + LastUpdatedTimestampMs int64 // The unique identifier for the logged model. - ModelId string `json:"model_id,omitempty"` + // Wire name: 'model_id' + ModelId string // The type of model, such as ``"Agent"``, ``"Classifier"``, ``"LLM"``. - ModelType string `json:"model_type,omitempty"` + // Wire name: 'model_type' + ModelType string // The name of the model. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The ID of the run that created the model. - SourceRunId string `json:"source_run_id,omitempty"` + // Wire name: 'source_run_id' + SourceRunId string // The status of whether or not the model is ready for use. - Status LoggedModelStatus `json:"status,omitempty"` + // Wire name: 'status' + Status LoggedModelStatus // Details on the current model status. - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status_message' + StatusMessage string // Mutable string key-value pairs set on the model. - Tags []LoggedModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []LoggedModelTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LoggedModelInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LoggedModelInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &loggedModelInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := loggedModelInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LoggedModelInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LoggedModelInfo) MarshalJSON() ([]byte, error) { + pb, err := loggedModelInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Parameter associated with a LoggedModel. type LoggedModelParameter struct { // The key identifying this param. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The value of this param. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LoggedModelParameter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LoggedModelParameter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &loggedModelParameterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := loggedModelParameterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LoggedModelParameter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LoggedModelParameter) MarshalJSON() ([]byte, error) { + pb, err := loggedModelParameterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A LoggedModelStatus enum value represents the status of a logged model. type LoggedModelStatus string +type loggedModelStatusPb string const LoggedModelStatusLoggedModelPending LoggedModelStatus = `LOGGED_MODEL_PENDING` @@ -2039,22 +5231,57 @@ func (f *LoggedModelStatus) Type() string { return "LoggedModelStatus" } +func loggedModelStatusToPb(st *LoggedModelStatus) (*loggedModelStatusPb, error) { + if st == nil { + return nil, nil + } + pb := loggedModelStatusPb(*st) + return &pb, nil +} + +func loggedModelStatusFromPb(pb *loggedModelStatusPb) (*LoggedModelStatus, error) { + if pb == nil { + return nil, nil + } + st := LoggedModelStatus(*pb) + return &st, nil +} + // Tag for a LoggedModel. type LoggedModelTag struct { // The tag key. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LoggedModelTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LoggedModelTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &loggedModelTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := loggedModelTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LoggedModelTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LoggedModelTag) MarshalJSON() ([]byte, error) { + pb, err := loggedModelTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Metric associated with a run, represented as a key-value pair. @@ -2062,172 +5289,350 @@ type Metric struct { // The dataset digest of the dataset associated with the metric, e.g. an md5 // hash of the dataset that uniquely identifies it within datasets of the // same name. - DatasetDigest string `json:"dataset_digest,omitempty"` + // Wire name: 'dataset_digest' + DatasetDigest string // The name of the dataset associated with the metric. E.g. // “my.uc.table@2” “nyc-taxi-dataset”, “fantastic-elk-3” - DatasetName string `json:"dataset_name,omitempty"` + // Wire name: 'dataset_name' + DatasetName string // The key identifying the metric. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The ID of the logged model or registered model version associated with // the metric, if applicable. - ModelId string `json:"model_id,omitempty"` + // Wire name: 'model_id' + ModelId string // The ID of the run containing the metric. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // The step at which the metric was logged. - Step int64 `json:"step,omitempty"` + // Wire name: 'step' + Step int64 // The timestamp at which the metric was recorded. - Timestamp int64 `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp int64 // The value of the metric. - Value float64 `json:"value,omitempty"` + // Wire name: 'value' + Value float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Metric) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Metric) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &metricPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := metricFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Metric) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Metric) MarshalJSON() ([]byte, error) { + pb, err := metricToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Model struct { // Timestamp recorded when this `registered_model` was created. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Description of this `registered_model`. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Timestamp recorded when metadata for this `registered_model` was last // updated. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Collection of latest model versions for each stage. Only contains models // with current `READY` status. - LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + // Wire name: 'latest_versions' + LatestVersions []ModelVersion // Unique name for the model. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Tags: Additional metadata key-value pairs for this `registered_model`. - Tags []ModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelTag // User that created this `registered_model` - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Model) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Model) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Model) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Model) MarshalJSON() ([]byte, error) { + pb, err := modelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ModelDatabricks struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // User-specified description for the object. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Unique identifier for the object. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Array of model versions, each the latest version for its stage. - LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + // Wire name: 'latest_versions' + LatestVersions []ModelVersion // Name of the model. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel // Array of tags associated with the model. - Tags []ModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelTag // The username of the user that created the object. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelDatabricks) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelDatabricks) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelDatabricksPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelDatabricksFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelDatabricks) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelDatabricks) MarshalJSON() ([]byte, error) { + pb, err := modelDatabricksToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a LoggedModel or Registered Model Version input to a Run. type ModelInput struct { // The unique identifier of the model. - ModelId string `json:"model_id"` + // Wire name: 'model_id' + ModelId string +} + +func (st *ModelInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ModelInput) MarshalJSON() ([]byte, error) { + pb, err := modelInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a LoggedModel output of a Run. type ModelOutput struct { // The unique identifier of the model. - ModelId string `json:"model_id"` + // Wire name: 'model_id' + ModelId string // The step at which the model was produced. - Step int64 `json:"step"` + // Wire name: 'step' + Step int64 +} + +func (st *ModelOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ModelOutput) MarshalJSON() ([]byte, error) { + pb, err := modelOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ModelTag struct { // The tag key. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelTag) MarshalJSON() ([]byte, error) { + pb, err := modelTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ModelVersion struct { // Timestamp recorded when this `model_version` was created. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Current stage for this `model_version`. - CurrentStage string `json:"current_stage,omitempty"` + // Wire name: 'current_stage' + CurrentStage string // Description of this `model_version`. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Timestamp recorded when metadata for this `model_version` was last // updated. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Unique name of the model - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // MLflow run ID used when creating `model_version`, if `source` was // generated by an experiment run stored in MLflow tracking server. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // Run Link: Direct link to the run that generated this version - RunLink string `json:"run_link,omitempty"` + // Wire name: 'run_link' + RunLink string // URI indicating the location of the source model artifacts, used when // creating `model_version` - Source string `json:"source,omitempty"` + // Wire name: 'source' + Source string // Current status of `model_version` - Status ModelVersionStatus `json:"status,omitempty"` + // Wire name: 'status' + Status ModelVersionStatus // Details on current `status`, if it is pending or failed. - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status_message' + StatusMessage string // Tags: Additional metadata key-value pairs for this `model_version`. - Tags []ModelVersionTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelVersionTag // User that created this `model_version`. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string // Model's version number. - Version string `json:"version,omitempty"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelVersion) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelVersion) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelVersionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelVersionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelVersion) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelVersion) MarshalJSON() ([]byte, error) { + pb, err := modelVersionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ModelVersionDatabricks struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Stage of the model version. Valid values are: // // * `None`: The initial stage of a model version. @@ -2237,26 +5642,34 @@ type ModelVersionDatabricks struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - CurrentStage Stage `json:"current_stage,omitempty"` + // Wire name: 'current_stage' + CurrentStage Stage // User-specified description for the object. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Name of the model. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel // Unique identifier for the MLflow tracking run associated with the source // model artifacts. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // URL of the run associated with the model artifacts. This field is set at // model version creation time only for model versions whose source run is // from a tracking server that is different from the registry server. - RunLink string `json:"run_link,omitempty"` + // Wire name: 'run_link' + RunLink string // URI that indicates the location of the source model artifacts. This is // used when creating the model version. - Source string `json:"source,omitempty"` + // Wire name: 'source' + Source string // The status of the model version. Valid values are: * // `PENDING_REGISTRATION`: Request to register a new model version is // pending as server performs background tasks. @@ -2265,29 +5678,52 @@ type ModelVersionDatabricks struct { // failed. // // * `READY`: Model version is ready for use. - Status Status `json:"status,omitempty"` + // Wire name: 'status' + Status Status // Details on the current status, for example why registration failed. - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status_message' + StatusMessage string // Array of tags that are associated with the model version. - Tags []ModelVersionTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []ModelVersionTag // The username of the user that created the object. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string // Version of the model. - Version string `json:"version,omitempty"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelVersionDatabricks) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelVersionDatabricks) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelVersionDatabricksPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelVersionDatabricksFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelVersionDatabricks) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelVersionDatabricks) MarshalJSON() ([]byte, error) { + pb, err := modelVersionDatabricksToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Current status of `model_version` type ModelVersionStatus string +type modelVersionStatusPb string const ModelVersionStatusFailedRegistration ModelVersionStatus = `FAILED_REGISTRATION` @@ -2316,44 +5752,99 @@ func (f *ModelVersionStatus) Type() string { return "ModelVersionStatus" } +func modelVersionStatusToPb(st *ModelVersionStatus) (*modelVersionStatusPb, error) { + if st == nil { + return nil, nil + } + pb := modelVersionStatusPb(*st) + return &pb, nil +} + +func modelVersionStatusFromPb(pb *modelVersionStatusPb) (*ModelVersionStatus, error) { + if pb == nil { + return nil, nil + } + st := ModelVersionStatus(*pb) + return &st, nil +} + type ModelVersionTag struct { // The tag key. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ModelVersionTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ModelVersionTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelVersionTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelVersionTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ModelVersionTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ModelVersionTag) MarshalJSON() ([]byte, error) { + pb, err := modelVersionTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Param associated with a run. type Param struct { // Key identifying this param. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // Value associated with this param. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Param) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Param) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¶mPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := paramFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Param) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Param) MarshalJSON() ([]byte, error) { + pb, err := paramToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level of the requesting user on the object. For what is allowed at // each level, see [MLflow Model permissions](..). type PermissionLevel string +type permissionLevelPb string const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT` @@ -2386,70 +5877,151 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } +func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := permissionLevelPb(*st) + return &pb, nil +} + +func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := PermissionLevel(*pb) + return &st, nil +} + type RegisteredModelAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RegisteredModelPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := registeredModelAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelAccessControlResponse struct { // All permissions. - AllPermissions []RegisteredModelPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []RegisteredModelPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := registeredModelAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RegisteredModelPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelPermission) MarshalJSON() ([]byte, error) { + pb, err := registeredModelPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type RegisteredModelPermissionLevel string +type registeredModelPermissionLevelPb string const RegisteredModelPermissionLevelCanEdit RegisteredModelPermissionLevel = `CAN_EDIT` @@ -2482,51 +6054,138 @@ func (f *RegisteredModelPermissionLevel) Type() string { return "RegisteredModelPermissionLevel" } +func registeredModelPermissionLevelToPb(st *RegisteredModelPermissionLevel) (*registeredModelPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := registeredModelPermissionLevelPb(*st) + return &pb, nil +} + +func registeredModelPermissionLevelFromPb(pb *registeredModelPermissionLevelPb) (*RegisteredModelPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := RegisteredModelPermissionLevel(*pb) + return &st, nil +} + type RegisteredModelPermissions struct { - AccessControlList []RegisteredModelAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []RegisteredModelAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelPermissions) MarshalJSON() ([]byte, error) { + pb, err := registeredModelPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RegisteredModelPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := registeredModelPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelPermissionsRequest struct { - AccessControlList []RegisteredModelAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []RegisteredModelAccessControlRequest // The registered model for which to get or manage permissions. - RegisteredModelId string `json:"-" url:"-"` + // Wire name: 'registered_model_id' + RegisteredModelId string `tf:"-"` +} + +func (st *RegisteredModelPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RegisteredModelPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := registeredModelPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegistryWebhook struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // User-specified description for the webhook. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -2560,17 +6219,23 @@ type RegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events []RegistryWebhookEvent `json:"events,omitempty"` + // Wire name: 'events' + Events []RegistryWebhookEvent - HttpUrlSpec *HttpUrlSpecWithoutSecret `json:"http_url_spec,omitempty"` + // Wire name: 'http_url_spec' + HttpUrlSpec *HttpUrlSpecWithoutSecret // Webhook ID - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - JobSpec *JobSpecWithoutSecret `json:"job_spec,omitempty"` + // Wire name: 'job_spec' + JobSpec *JobSpecWithoutSecret // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // Name of the model whose events would trigger this webhook. - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -2579,20 +6244,39 @@ type RegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status RegistryWebhookStatus `json:"status,omitempty"` + // Wire name: 'status' + Status RegistryWebhookStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegistryWebhook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegistryWebhook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®istryWebhookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registryWebhookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegistryWebhook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegistryWebhook) MarshalJSON() ([]byte, error) { + pb, err := registryWebhookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegistryWebhookEvent string +type registryWebhookEventPb string const RegistryWebhookEventCommentCreated RegistryWebhookEvent = `COMMENT_CREATED` @@ -2639,6 +6323,22 @@ func (f *RegistryWebhookEvent) Type() string { return "RegistryWebhookEvent" } +func registryWebhookEventToPb(st *RegistryWebhookEvent) (*registryWebhookEventPb, error) { + if st == nil { + return nil, nil + } + pb := registryWebhookEventPb(*st) + return &pb, nil +} + +func registryWebhookEventFromPb(pb *registryWebhookEventPb) (*RegistryWebhookEvent, error) { + if pb == nil { + return nil, nil + } + st := RegistryWebhookEvent(*pb) + return &st, nil +} + // Enable or disable triggering the webhook, or put the webhook into test mode. // The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated // event happens. @@ -2648,6 +6348,7 @@ func (f *RegistryWebhookEvent) Type() string { // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not // triggered on a real event. type RegistryWebhookStatus string +type registryWebhookStatusPb string // Webhook is triggered when an associated event happens. const RegistryWebhookStatusActive RegistryWebhookStatus = `ACTIVE` @@ -2680,11 +6381,29 @@ func (f *RegistryWebhookStatus) Type() string { return "RegistryWebhookStatus" } +func registryWebhookStatusToPb(st *RegistryWebhookStatus) (*registryWebhookStatusPb, error) { + if st == nil { + return nil, nil + } + pb := registryWebhookStatusPb(*st) + return &pb, nil +} + +func registryWebhookStatusFromPb(pb *registryWebhookStatusPb) (*RegistryWebhookStatus, error) { + if pb == nil { + return nil, nil + } + st := RegistryWebhookStatus(*pb) + return &st, nil +} + type RejectTransitionRequest struct { // User-provided comment on the action. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -2694,118 +6413,405 @@ type RejectTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage Stage `json:"stage"` + // Wire name: 'stage' + Stage Stage // Version of the model. - Version string `json:"version"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RejectTransitionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RejectTransitionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rejectTransitionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rejectTransitionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RejectTransitionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RejectTransitionRequest) MarshalJSON() ([]byte, error) { + pb, err := rejectTransitionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RejectTransitionRequestResponse struct { // Activity recorded for the action. - Activity *Activity `json:"activity,omitempty"` + // Wire name: 'activity' + Activity *Activity +} + +func (st *RejectTransitionRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rejectTransitionRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rejectTransitionRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RejectTransitionRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := rejectTransitionRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RenameModelRequest struct { // Registered model unique name identifier. - Name string `json:"name"` + // Wire name: 'name' + Name string // If provided, updates the name for this `registered_model`. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RenameModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RenameModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &renameModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := renameModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RenameModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RenameModelRequest) MarshalJSON() ([]byte, error) { + pb, err := renameModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RenameModelResponse struct { - RegisteredModel *Model `json:"registered_model,omitempty"` + + // Wire name: 'registered_model' + RegisteredModel *Model +} + +func (st *RenameModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &renameModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := renameModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RenameModelResponse) MarshalJSON() ([]byte, error) { + pb, err := renameModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestoreExperiment struct { // ID of the associated experiment. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string +} + +func (st *RestoreExperiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreExperimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreExperimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreExperiment) MarshalJSON() ([]byte, error) { + pb, err := restoreExperimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestoreExperimentResponse struct { } +func (st *RestoreExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := restoreExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type RestoreRun struct { // ID of the run to restore. - RunId string `json:"run_id"` + // Wire name: 'run_id' + RunId string +} + +func (st *RestoreRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreRun) MarshalJSON() ([]byte, error) { + pb, err := restoreRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestoreRunResponse struct { } +func (st *RestoreRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreRunResponse) MarshalJSON() ([]byte, error) { + pb, err := restoreRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type RestoreRuns struct { // The ID of the experiment containing the runs to restore. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string // An optional positive integer indicating the maximum number of runs to // restore. The maximum allowed value for max_runs is 10000. - MaxRuns int `json:"max_runs,omitempty"` + // Wire name: 'max_runs' + MaxRuns int // The minimum deletion timestamp in milliseconds since the UNIX epoch for // restoring runs. Only runs deleted no earlier than this timestamp are // restored. - MinTimestampMillis int64 `json:"min_timestamp_millis"` + // Wire name: 'min_timestamp_millis' + MinTimestampMillis int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RestoreRuns) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RestoreRuns) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreRunsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreRunsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RestoreRuns) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RestoreRuns) MarshalJSON() ([]byte, error) { + pb, err := restoreRunsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestoreRunsResponse struct { // The number of runs restored. - RunsRestored int `json:"runs_restored,omitempty"` + // Wire name: 'runs_restored' + RunsRestored int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RestoreRunsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RestoreRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RestoreRunsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RestoreRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := restoreRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A single run. type Run struct { // Run data. - Data *RunData `json:"data,omitempty"` + // Wire name: 'data' + Data *RunData // Run metadata. - Info *RunInfo `json:"info,omitempty"` + // Wire name: 'info' + Info *RunInfo // Run inputs. - Inputs *RunInputs `json:"inputs,omitempty"` + // Wire name: 'inputs' + Inputs *RunInputs +} + +func (st *Run) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Run) MarshalJSON() ([]byte, error) { + pb, err := runToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Run data (metrics, params, and tags). type RunData struct { // Run metrics. - Metrics []Metric `json:"metrics,omitempty"` + // Wire name: 'metrics' + Metrics []Metric // Run parameters. - Params []Param `json:"params,omitempty"` + // Wire name: 'params' + Params []Param // Additional metadata key-value pairs. - Tags []RunTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []RunTag +} + +func (st *RunData) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runDataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runDataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunData) MarshalJSON() ([]byte, error) { + pb, err := runDataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Metadata of a single run. @@ -2814,42 +6820,70 @@ type RunInfo struct { // local path (starting with "/"), or a distributed file system (DFS) path, // like ``s3://bucket/directory`` or ``dbfs:/my/directory``. If not set, the // local ``./mlruns`` directory is chosen. - ArtifactUri string `json:"artifact_uri,omitempty"` + // Wire name: 'artifact_uri' + ArtifactUri string // Unix timestamp of when the run ended in milliseconds. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // The experiment ID. - ExperimentId string `json:"experiment_id,omitempty"` + // Wire name: 'experiment_id' + ExperimentId string // Current life cycle stage of the experiment : OneOf("active", "deleted") - LifecycleStage string `json:"lifecycle_stage,omitempty"` + // Wire name: 'lifecycle_stage' + LifecycleStage string // Unique identifier for the run. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // The name of the run. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string // [Deprecated, use run_id instead] Unique identifier for the run. This // field will be removed in a future MLflow version. - RunUuid string `json:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string // Unix timestamp of when the run started in milliseconds. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // Current status of the run. - Status RunInfoStatus `json:"status,omitempty"` + // Wire name: 'status' + Status RunInfoStatus // User who initiated the run. This field is deprecated as of MLflow 1.0, // and will be removed in a future MLflow release. Use 'mlflow.user' tag // instead. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunInfo) MarshalJSON() ([]byte, error) { + pb, err := runInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Status of a run. type RunInfoStatus string +type runInfoStatusPb string const RunInfoStatusFailed RunInfoStatus = `FAILED` @@ -2882,123 +6916,266 @@ func (f *RunInfoStatus) Type() string { return "RunInfoStatus" } +func runInfoStatusToPb(st *RunInfoStatus) (*runInfoStatusPb, error) { + if st == nil { + return nil, nil + } + pb := runInfoStatusPb(*st) + return &pb, nil +} + +func runInfoStatusFromPb(pb *runInfoStatusPb) (*RunInfoStatus, error) { + if pb == nil { + return nil, nil + } + st := RunInfoStatus(*pb) + return &st, nil +} + // Run inputs. type RunInputs struct { // Run metrics. - DatasetInputs []DatasetInput `json:"dataset_inputs,omitempty"` + // Wire name: 'dataset_inputs' + DatasetInputs []DatasetInput // **NOTE**: Experimental: This API field may change or be removed in a // future release without warning. // // Model inputs to the Run. - ModelInputs []ModelInput `json:"model_inputs,omitempty"` + // Wire name: 'model_inputs' + ModelInputs []ModelInput +} + +func (st *RunInputs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runInputsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runInputsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RunInputs) MarshalJSON() ([]byte, error) { + pb, err := runInputsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Tag for a run. type RunTag struct { // The tag key. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The tag value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunTag) MarshalJSON() ([]byte, error) { + pb, err := runTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchExperiments struct { // String representing a SQL filter condition (e.g. "name ILIKE // 'my-experiment%'") - Filter string `json:"filter,omitempty"` + // Wire name: 'filter' + Filter string // Maximum number of experiments desired. Max threshold is 3000. - MaxResults int64 `json:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int64 // List of columns for ordering search results, which can include experiment // name and last updated timestamp with an optional "DESC" or "ASC" // annotation, where "ASC" is the default. Tiebreaks are done by experiment // id DESC. - OrderBy []string `json:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string // Token indicating the page of experiments to fetch - PageToken string `json:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string // Qualifier for type of experiments to be returned. If unspecified, return // only active experiments. - ViewType ViewType `json:"view_type,omitempty"` + // Wire name: 'view_type' + ViewType ViewType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchExperiments) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchExperiments) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchExperimentsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchExperimentsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchExperiments) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchExperiments) MarshalJSON() ([]byte, error) { + pb, err := searchExperimentsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchExperimentsResponse struct { // Experiments that match the search criteria - Experiments []Experiment `json:"experiments,omitempty"` + // Wire name: 'experiments' + Experiments []Experiment // Token that can be used to retrieve the next page of experiments. An empty // token means that no more experiments are available for retrieval. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchExperimentsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchExperimentsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchExperimentsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchExperimentsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchExperimentsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchExperimentsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchExperimentsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchLoggedModelsDataset struct { // The digest of the dataset. - DatasetDigest string `json:"dataset_digest,omitempty"` + // Wire name: 'dataset_digest' + DatasetDigest string // The name of the dataset. - DatasetName string `json:"dataset_name"` + // Wire name: 'dataset_name' + DatasetName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchLoggedModelsDataset) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchLoggedModelsDataset) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchLoggedModelsDatasetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchLoggedModelsDatasetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchLoggedModelsDataset) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchLoggedModelsDataset) MarshalJSON() ([]byte, error) { + pb, err := searchLoggedModelsDatasetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchLoggedModelsOrderBy struct { // Whether the search results order is ascending or not. - Ascending bool `json:"ascending,omitempty"` + // Wire name: 'ascending' + Ascending bool // If ``field_name`` refers to a metric, this field specifies the digest of // the dataset associated with the metric. Only metrics associated with the // specified dataset name and digest will be considered for ordering. This // field may only be set if ``dataset_name`` is also set. - DatasetDigest string `json:"dataset_digest,omitempty"` + // Wire name: 'dataset_digest' + DatasetDigest string // If ``field_name`` refers to a metric, this field specifies the name of // the dataset associated with the metric. Only metrics associated with the // specified dataset name will be considered for ordering. This field may // only be set if ``field_name`` refers to a metric. - DatasetName string `json:"dataset_name,omitempty"` + // Wire name: 'dataset_name' + DatasetName string // The name of the field to order by, e.g. "metrics.accuracy". - FieldName string `json:"field_name"` + // Wire name: 'field_name' + FieldName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchLoggedModelsOrderBy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchLoggedModelsOrderBy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchLoggedModelsOrderByPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchLoggedModelsOrderByFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchLoggedModelsOrderBy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchLoggedModelsOrderBy) MarshalJSON() ([]byte, error) { + pb, err := searchLoggedModelsOrderByToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchLoggedModelsRequest struct { @@ -3008,93 +7185,175 @@ type SearchLoggedModelsRequest struct { // > 0.9 on the test_dataset. Metric values from ANY dataset matching the // criteria are considered. If no datasets are specified, then metrics // across all datasets are considered in the filter. - Datasets []SearchLoggedModelsDataset `json:"datasets,omitempty"` + // Wire name: 'datasets' + Datasets []SearchLoggedModelsDataset // The IDs of the experiments in which to search for logged models. - ExperimentIds []string `json:"experiment_ids,omitempty"` + // Wire name: 'experiment_ids' + ExperimentIds []string // A filter expression over logged model info and data that allows returning // a subset of logged models. The syntax is a subset of SQL that supports // AND'ing together binary operations. // // Example: ``params.alpha < 0.3 AND metrics.accuracy > 0.9``. - Filter string `json:"filter,omitempty"` + // Wire name: 'filter' + Filter string // The maximum number of Logged Models to return. The maximum limit is 50. - MaxResults int `json:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int // The list of columns for ordering the results, with additional fields for // sorting criteria. - OrderBy []SearchLoggedModelsOrderBy `json:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []SearchLoggedModelsOrderBy // The token indicating the page of logged models to fetch. - PageToken string `json:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchLoggedModelsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchLoggedModelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchLoggedModelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchLoggedModelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchLoggedModelsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchLoggedModelsRequest) MarshalJSON() ([]byte, error) { + pb, err := searchLoggedModelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchLoggedModelsResponse struct { // Logged models that match the search criteria. - Models []LoggedModel `json:"models,omitempty"` + // Wire name: 'models' + Models []LoggedModel // The token that can be used to retrieve the next page of logged models. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchLoggedModelsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchLoggedModelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchLoggedModelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchLoggedModelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchLoggedModelsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchLoggedModelsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchLoggedModelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Searches model versions type SearchModelVersionsRequest struct { // String filter condition, like "name='my-model-name'". Must be a single // boolean condition, with string values wrapped in single quotes. - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Maximum number of models desired. Max threshold is 10K. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // List of columns to be ordered by including model name, version, stage // with an optional "DESC" or "ASC" annotation, where "ASC" is the default. // Tiebreaks are done by latest stage transition timestamp, followed by name // ASC, followed by version DESC. - OrderBy []string `json:"-" url:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string `tf:"-"` // Pagination token to go to next page based on previous search query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchModelVersionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchModelVersionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchModelVersionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchModelVersionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchModelVersionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchModelVersionsRequest) MarshalJSON() ([]byte, error) { + pb, err := searchModelVersionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchModelVersionsResponse struct { // Models that match the search criteria - ModelVersions []ModelVersion `json:"model_versions,omitempty"` + // Wire name: 'model_versions' + ModelVersions []ModelVersion // Pagination token to request next page of models for the same search // query. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchModelVersionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchModelVersionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchModelVersionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchModelVersionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchModelVersionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchModelVersionsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchModelVersionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Search models @@ -3102,47 +7361,88 @@ type SearchModelsRequest struct { // String filter condition, like "name LIKE 'my-model-name'". Interpreted in // the backend automatically as "name LIKE '%my-model-name%'". Single // boolean condition, with string values wrapped in single quotes. - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Maximum number of models desired. Default is 100. Max threshold is 1000. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // List of columns for ordering search results, which can include model name // and last updated timestamp with an optional "DESC" or "ASC" annotation, // where "ASC" is the default. Tiebreaks are done by model name ASC. - OrderBy []string `json:"-" url:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string `tf:"-"` // Pagination token to go to the next page based on a previous search query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchModelsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchModelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchModelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchModelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchModelsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchModelsRequest) MarshalJSON() ([]byte, error) { + pb, err := searchModelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchModelsResponse struct { // Pagination token to request the next page of models. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Registered Models that match the search criteria. - RegisteredModels []Model `json:"registered_models,omitempty"` + // Wire name: 'registered_models' + RegisteredModels []Model - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchModelsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchModelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchModelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchModelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchModelsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchModelsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchModelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchRuns struct { // List of experiment IDs to search over. - ExperimentIds []string `json:"experiment_ids,omitempty"` + // Wire name: 'experiment_ids' + ExperimentIds []string // A filter expression over params, metrics, and tags, that allows returning // a subset of runs. The syntax is a subset of SQL that supports ANDing // together binary operations between a param, metric, or tag and a @@ -3155,135 +7455,434 @@ type SearchRuns struct { // and tags."user-name" = 'Tomas'` // // Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`. - Filter string `json:"filter,omitempty"` + // Wire name: 'filter' + Filter string // Maximum number of runs desired. Max threshold is 50000 - MaxResults int `json:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int // List of columns to be ordered by, including attributes, params, metrics, // and tags with an optional `"DESC"` or `"ASC"` annotation, where `"ASC"` // is the default. Example: `["params.input DESC", "metrics.alpha ASC", // "metrics.rmse"]`. Tiebreaks are done by start_time `DESC` followed by // `run_id` for runs with the same start time (and this is the default // ordering criterion if order_by is not provided). - OrderBy []string `json:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string // Token for the current page of runs. - PageToken string `json:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string // Whether to display only active, only deleted, or all runs. Defaults to // only active runs. - RunViewType ViewType `json:"run_view_type,omitempty"` + // Wire name: 'run_view_type' + RunViewType ViewType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchRuns) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchRuns) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchRunsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchRunsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchRuns) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchRuns) MarshalJSON() ([]byte, error) { + pb, err := searchRunsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SearchRunsResponse struct { // Token for the next page of runs. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Runs that match the search criteria. - Runs []Run `json:"runs,omitempty"` + // Wire name: 'runs' + Runs []Run - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SearchRunsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SearchRunsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &searchRunsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := searchRunsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SearchRunsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SearchRunsResponse) MarshalJSON() ([]byte, error) { + pb, err := searchRunsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetExperimentTag struct { // ID of the experiment under which to log the tag. Must be provided. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string // Name of the tag. Keys up to 250 bytes in size are supported. - Key string `json:"key"` + // Wire name: 'key' + Key string // String value of the tag being logged. Values up to 64KB in size are // supported. - Value string `json:"value"` + // Wire name: 'value' + Value string +} + +func (st *SetExperimentTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setExperimentTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setExperimentTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetExperimentTag) MarshalJSON() ([]byte, error) { + pb, err := setExperimentTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetExperimentTagResponse struct { } +func (st *SetExperimentTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setExperimentTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setExperimentTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetExperimentTagResponse) MarshalJSON() ([]byte, error) { + pb, err := setExperimentTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SetLoggedModelTagsRequest struct { // The ID of the logged model to set the tags on. - ModelId string `json:"-" url:"-"` + // Wire name: 'model_id' + ModelId string `tf:"-"` // The tags to set on the logged model. - Tags []LoggedModelTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []LoggedModelTag +} + +func (st *SetLoggedModelTagsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setLoggedModelTagsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setLoggedModelTagsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetLoggedModelTagsRequest) MarshalJSON() ([]byte, error) { + pb, err := setLoggedModelTagsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetLoggedModelTagsResponse struct { } +func (st *SetLoggedModelTagsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setLoggedModelTagsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setLoggedModelTagsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetLoggedModelTagsResponse) MarshalJSON() ([]byte, error) { + pb, err := setLoggedModelTagsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SetModelTagRequest struct { // Name of the tag. Maximum size depends on storage backend. If a tag with // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key string `json:"key"` + // Wire name: 'key' + Key string // Unique name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value string `json:"value"` + // Wire name: 'value' + Value string +} + +func (st *SetModelTagRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setModelTagRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setModelTagRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetModelTagRequest) MarshalJSON() ([]byte, error) { + pb, err := setModelTagRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetModelTagResponse struct { } +func (st *SetModelTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setModelTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setModelTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetModelTagResponse) MarshalJSON() ([]byte, error) { + pb, err := setModelTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SetModelVersionTagRequest struct { // Name of the tag. Maximum size depends on storage backend. If a tag with // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key string `json:"key"` + // Wire name: 'key' + Key string // Unique name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value string `json:"value"` + // Wire name: 'value' + Value string // Model version number. - Version string `json:"version"` + // Wire name: 'version' + Version string +} + +func (st *SetModelVersionTagRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setModelVersionTagRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setModelVersionTagRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetModelVersionTagRequest) MarshalJSON() ([]byte, error) { + pb, err := setModelVersionTagRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetModelVersionTagResponse struct { } +func (st *SetModelVersionTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setModelVersionTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setModelVersionTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetModelVersionTagResponse) MarshalJSON() ([]byte, error) { + pb, err := setModelVersionTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SetTag struct { // Name of the tag. Keys up to 250 bytes in size are supported. - Key string `json:"key"` + // Wire name: 'key' + Key string // ID of the run under which to log the tag. Must be provided. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // [Deprecated, use `run_id` instead] ID of the run under which to log the // tag. This field will be removed in a future MLflow version. - RunUuid string `json:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string // String value of the tag being logged. Values up to 64KB in size are // supported. - Value string `json:"value"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SetTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SetTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SetTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SetTag) MarshalJSON() ([]byte, error) { + pb, err := setTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetTagResponse struct { } +func (st *SetTagResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setTagResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setTagResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetTagResponse) MarshalJSON() ([]byte, error) { + pb, err := setTagResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Stage of the model version. Valid values are: // // * `None`: The initial stage of a model version. @@ -3294,6 +7893,7 @@ type SetTagResponse struct { // // * `Archived`: Archived stage. type Stage string +type stagePb string // Archived stage. const StageArchived Stage = `Archived` @@ -3328,6 +7928,22 @@ func (f *Stage) Type() string { return "Stage" } +func stageToPb(st *Stage) (*stagePb, error) { + if st == nil { + return nil, nil + } + pb := stagePb(*st) + return &pb, nil +} + +func stageFromPb(pb *stagePb) (*Stage, error) { + if pb == nil { + return nil, nil + } + st := Stage(*pb) + return &st, nil +} + // The status of the model version. Valid values are: * `PENDING_REGISTRATION`: // Request to register a new model version is pending as server performs // background tasks. @@ -3336,6 +7952,7 @@ func (f *Stage) Type() string { // // * `READY`: Model version is ready for use. type Status string +type statusPb string // Request to register a new model version has failed. const StatusFailedRegistration Status = `FAILED_REGISTRATION` @@ -3368,46 +7985,137 @@ func (f *Status) Type() string { return "Status" } +func statusToPb(st *Status) (*statusPb, error) { + if st == nil { + return nil, nil + } + pb := statusPb(*st) + return &pb, nil +} + +func statusFromPb(pb *statusPb) (*Status, error) { + if pb == nil { + return nil, nil + } + st := Status(*pb) + return &st, nil +} + // Test webhook response object. type TestRegistryWebhook struct { // Body of the response from the webhook URL - Body string `json:"body,omitempty"` + // Wire name: 'body' + Body string // Status code returned by the webhook URL - StatusCode int `json:"status_code,omitempty"` + // Wire name: 'status_code' + StatusCode int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TestRegistryWebhook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TestRegistryWebhook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &testRegistryWebhookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := testRegistryWebhookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TestRegistryWebhook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TestRegistryWebhook) MarshalJSON() ([]byte, error) { + pb, err := testRegistryWebhookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TestRegistryWebhookRequest struct { // If `event` is specified, the test trigger uses the specified event. If // `event` is not specified, the test trigger uses a randomly chosen event // associated with the webhook. - Event RegistryWebhookEvent `json:"event,omitempty"` + // Wire name: 'event' + Event RegistryWebhookEvent // Webhook ID - Id string `json:"id"` + // Wire name: 'id' + Id string +} + +func (st *TestRegistryWebhookRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &testRegistryWebhookRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := testRegistryWebhookRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TestRegistryWebhookRequest) MarshalJSON() ([]byte, error) { + pb, err := testRegistryWebhookRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TestRegistryWebhookResponse struct { // Test webhook response object. - Webhook *TestRegistryWebhook `json:"webhook,omitempty"` + // Wire name: 'webhook' + Webhook *TestRegistryWebhook +} + +func (st *TestRegistryWebhookResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &testRegistryWebhookResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := testRegistryWebhookResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TestRegistryWebhookResponse) MarshalJSON() ([]byte, error) { + pb, err := testRegistryWebhookResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TransitionModelVersionStageDatabricks struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions bool `json:"archive_existing_versions"` + // Wire name: 'archive_existing_versions' + ArchiveExistingVersions bool // User-provided comment on the action. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the model. - Name string `json:"name"` + // Wire name: 'name' + Name string // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -3417,29 +8125,51 @@ type TransitionModelVersionStageDatabricks struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage Stage `json:"stage"` + // Wire name: 'stage' + Stage Stage // Version of the model. - Version string `json:"version"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TransitionModelVersionStageDatabricks) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TransitionModelVersionStageDatabricks) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &transitionModelVersionStageDatabricksPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := transitionModelVersionStageDatabricksFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TransitionModelVersionStageDatabricks) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TransitionModelVersionStageDatabricks) MarshalJSON() ([]byte, error) { + pb, err := transitionModelVersionStageDatabricksToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Transition request details. type TransitionRequest struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions []ActivityAction `json:"available_actions,omitempty"` + // Wire name: 'available_actions' + AvailableActions []ActivityAction // User-provided comment associated with the transition request. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -3450,103 +8180,336 @@ type TransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage Stage `json:"to_stage,omitempty"` + // Wire name: 'to_stage' + ToStage Stage // The username of the user that created the object. - UserId string `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TransitionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TransitionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &transitionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := transitionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TransitionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TransitionRequest) MarshalJSON() ([]byte, error) { + pb, err := transitionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TransitionStageResponse struct { - ModelVersion *ModelVersionDatabricks `json:"model_version,omitempty"` + + // Wire name: 'model_version' + ModelVersion *ModelVersionDatabricks +} + +func (st *TransitionStageResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &transitionStageResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := transitionStageResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TransitionStageResponse) MarshalJSON() ([]byte, error) { + pb, err := transitionStageResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateComment struct { // User-provided comment on the action. - Comment string `json:"comment"` + // Wire name: 'comment' + Comment string // Unique identifier of an activity - Id string `json:"id"` + // Wire name: 'id' + Id string +} + +func (st *UpdateComment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCommentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCommentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateComment) MarshalJSON() ([]byte, error) { + pb, err := updateCommentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCommentResponse struct { // Comment details. - Comment *CommentObject `json:"comment,omitempty"` + // Wire name: 'comment' + Comment *CommentObject +} + +func (st *UpdateCommentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCommentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCommentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCommentResponse) MarshalJSON() ([]byte, error) { + pb, err := updateCommentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExperiment struct { // ID of the associated experiment. - ExperimentId string `json:"experiment_id"` + // Wire name: 'experiment_id' + ExperimentId string // If provided, the experiment's name is changed to the new name. The new // name must be unique. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateExperiment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateExperiment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExperimentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExperimentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateExperiment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateExperiment) MarshalJSON() ([]byte, error) { + pb, err := updateExperimentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateExperimentResponse struct { } +func (st *UpdateExperimentResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateExperimentResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateExperimentResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateExperimentResponse) MarshalJSON() ([]byte, error) { + pb, err := updateExperimentResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateModelRequest struct { // If provided, updates the description for this `registered_model`. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Registered model unique name identifier. - Name string `json:"name"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateModelRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateModelRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateModelRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateModelRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateModelRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateModelRequest) MarshalJSON() ([]byte, error) { + pb, err := updateModelRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateModelResponse struct { } +func (st *UpdateModelResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateModelResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateModelResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateModelResponse) MarshalJSON() ([]byte, error) { + pb, err := updateModelResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateModelVersionRequest struct { // If provided, updates the description for this `registered_model`. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Name of the registered model - Name string `json:"name"` + // Wire name: 'name' + Name string // Model version number - Version string `json:"version"` + // Wire name: 'version' + Version string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateModelVersionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateModelVersionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateModelVersionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateModelVersionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { + pb, err := updateModelVersionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateModelVersionResponse struct { } +func (st *UpdateModelVersionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateModelVersionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateModelVersionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateModelVersionResponse) MarshalJSON() ([]byte, error) { + pb, err := updateModelVersionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateRegistryWebhook struct { // User-specified description for the webhook. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -3580,13 +8543,17 @@ type UpdateRegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events []RegistryWebhookEvent `json:"events,omitempty"` + // Wire name: 'events' + Events []RegistryWebhookEvent - HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + // Wire name: 'http_url_spec' + HttpUrlSpec *HttpUrlSpec // Webhook ID - Id string `json:"id"` + // Wire name: 'id' + Id string - JobSpec *JobSpec `json:"job_spec,omitempty"` + // Wire name: 'job_spec' + JobSpec *JobSpec // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -3595,50 +8562,117 @@ type UpdateRegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status RegistryWebhookStatus `json:"status,omitempty"` + // Wire name: 'status' + Status RegistryWebhookStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateRegistryWebhook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateRegistryWebhook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRegistryWebhookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRegistryWebhookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateRegistryWebhook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateRegistryWebhook) MarshalJSON() ([]byte, error) { + pb, err := updateRegistryWebhookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateRun struct { // Unix timestamp in milliseconds of when the run ended. - EndTime int64 `json:"end_time,omitempty"` + // Wire name: 'end_time' + EndTime int64 // ID of the run to update. Must be provided. - RunId string `json:"run_id,omitempty"` + // Wire name: 'run_id' + RunId string // Updated name of the run. - RunName string `json:"run_name,omitempty"` + // Wire name: 'run_name' + RunName string // [Deprecated, use `run_id` instead] ID of the run to update. This field // will be removed in a future MLflow version. - RunUuid string `json:"run_uuid,omitempty"` + // Wire name: 'run_uuid' + RunUuid string // Updated status of the run. - Status UpdateRunStatus `json:"status,omitempty"` + // Wire name: 'status' + Status UpdateRunStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateRun) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateRun) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRunPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRunFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateRun) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateRun) MarshalJSON() ([]byte, error) { + pb, err := updateRunToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateRunResponse struct { // Updated metadata of the run. - RunInfo *RunInfo `json:"run_info,omitempty"` + // Wire name: 'run_info' + RunInfo *RunInfo +} + +func (st *UpdateRunResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRunResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRunResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateRunResponse) MarshalJSON() ([]byte, error) { + pb, err := updateRunResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Status of a run. type UpdateRunStatus string +type updateRunStatusPb string const UpdateRunStatusFailed UpdateRunStatus = `FAILED` @@ -3671,11 +8705,53 @@ func (f *UpdateRunStatus) Type() string { return "UpdateRunStatus" } +func updateRunStatusToPb(st *UpdateRunStatus) (*updateRunStatusPb, error) { + if st == nil { + return nil, nil + } + pb := updateRunStatusPb(*st) + return &pb, nil +} + +func updateRunStatusFromPb(pb *updateRunStatusPb) (*UpdateRunStatus, error) { + if pb == nil { + return nil, nil + } + st := UpdateRunStatus(*pb) + return &st, nil +} + type UpdateWebhookResponse struct { } +func (st *UpdateWebhookResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWebhookResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWebhookResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateWebhookResponse) MarshalJSON() ([]byte, error) { + pb, err := updateWebhookResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Qualifier for the view type. type ViewType string +type viewTypePb string const ViewTypeActiveOnly ViewType = `ACTIVE_ONLY` @@ -3703,3 +8779,73 @@ func (f *ViewType) Set(v string) error { func (f *ViewType) Type() string { return "ViewType" } + +func viewTypeToPb(st *ViewType) (*viewTypePb, error) { + if st == nil { + return nil, nil + } + pb := viewTypePb(*st) + return &pb, nil +} + +func viewTypeFromPb(pb *viewTypePb) (*ViewType, error) { + if pb == nil { + return nil, nil + } + st := ViewType(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/oauth2/impl.go b/service/oauth2/impl.go index 30c7f1069..90fc21fc3 100755 --- a/service/oauth2/impl.go +++ b/service/oauth2/impl.go @@ -19,37 +19,99 @@ type accountFederationPolicyImpl struct { } func (a *accountFederationPolicyImpl) Create(ctx context.Context, request CreateAccountFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy + + requestPb, pbErr := createAccountFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) - if request.PolicyId != "" || slices.Contains(request.ForceSendFields, "PolicyId") { - queryParams["policy_id"] = request.PolicyId + if requestPb.PolicyId != "" || slices.Contains(requestPb.ForceSendFields, "PolicyId") { + queryParams["policy_id"] = requestPb.PolicyId } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountFederationPolicyImpl) Delete(ctx context.Context, request DeleteAccountFederationPolicyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := deleteAccountFederationPolicyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountFederationPolicyImpl) Get(ctx context.Context, request GetAccountFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := getAccountFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // List account federation policies. @@ -84,27 +146,71 @@ func (a *accountFederationPolicyImpl) ListAll(ctx context.Context, request ListA } func (a *accountFederationPolicyImpl) internalList(ctx context.Context, request ListAccountFederationPoliciesRequest) (*ListFederationPoliciesResponse, error) { - var listFederationPoliciesResponse ListFederationPoliciesResponse + + requestPb, pbErr := listAccountFederationPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFederationPoliciesResponsePb listFederationPoliciesResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFederationPoliciesResponse) - return &listFederationPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFederationPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFederationPoliciesResponseFromPb(&listFederationPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountFederationPolicyImpl) Update(ctx context.Context, request UpdateAccountFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + + requestPb, pbErr := updateAccountFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.PolicyId) queryParams := make(map[string]any) - if request.UpdateMask != "" || slices.Contains(request.ForceSendFields, "UpdateMask") { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" || slices.Contains(requestPb.ForceSendFields, "UpdateMask") { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CustomAppIntegration API methods @@ -113,34 +219,96 @@ type customAppIntegrationImpl struct { } func (a *customAppIntegrationImpl) Create(ctx context.Context, request CreateCustomAppIntegration) (*CreateCustomAppIntegrationOutput, error) { - var createCustomAppIntegrationOutput CreateCustomAppIntegrationOutput + + requestPb, pbErr := createCustomAppIntegrationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createCustomAppIntegrationOutputPb createCustomAppIntegrationOutputPb path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCustomAppIntegrationOutput) - return &createCustomAppIntegrationOutput, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createCustomAppIntegrationOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := createCustomAppIntegrationOutputFromPb(&createCustomAppIntegrationOutputPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *customAppIntegrationImpl) Delete(ctx context.Context, request DeleteCustomAppIntegrationRequest) error { - var deleteCustomAppIntegrationOutput DeleteCustomAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := deleteCustomAppIntegrationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteCustomAppIntegrationOutputPb deleteCustomAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCustomAppIntegrationOutput) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteCustomAppIntegrationOutputPb, + ) + if err != nil { + return err + } + return err } func (a *customAppIntegrationImpl) Get(ctx context.Context, request GetCustomAppIntegrationRequest) (*GetCustomAppIntegrationOutput, error) { - var getCustomAppIntegrationOutput GetCustomAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := getCustomAppIntegrationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCustomAppIntegrationOutputPb getCustomAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCustomAppIntegrationOutput) - return &getCustomAppIntegrationOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCustomAppIntegrationOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := getCustomAppIntegrationOutputFromPb(&getCustomAppIntegrationOutputPb) + if err != nil { + return nil, err + } + + return resp, err } // Get custom oauth app integrations. @@ -181,23 +349,63 @@ func (a *customAppIntegrationImpl) ListAll(ctx context.Context, request ListCust } func (a *customAppIntegrationImpl) internalList(ctx context.Context, request ListCustomAppIntegrationsRequest) (*GetCustomAppIntegrationsOutput, error) { - var getCustomAppIntegrationsOutput GetCustomAppIntegrationsOutput + + requestPb, pbErr := listCustomAppIntegrationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCustomAppIntegrationsOutputPb getCustomAppIntegrationsOutputPb path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCustomAppIntegrationsOutput) - return &getCustomAppIntegrationsOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCustomAppIntegrationsOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := getCustomAppIntegrationsOutputFromPb(&getCustomAppIntegrationsOutputPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *customAppIntegrationImpl) Update(ctx context.Context, request UpdateCustomAppIntegration) error { - var updateCustomAppIntegrationOutput UpdateCustomAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := updateCustomAppIntegrationToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateCustomAppIntegrationOutputPb updateCustomAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCustomAppIntegrationOutput) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateCustomAppIntegrationOutputPb, + ) + if err != nil { + return err + } + return err } @@ -242,13 +450,35 @@ func (a *oAuthPublishedAppsImpl) ListAll(ctx context.Context, request ListOAuthP } func (a *oAuthPublishedAppsImpl) internalList(ctx context.Context, request ListOAuthPublishedAppsRequest) (*GetPublishedAppsOutput, error) { - var getPublishedAppsOutput GetPublishedAppsOutput + + requestPb, pbErr := listOAuthPublishedAppsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPublishedAppsOutputPb getPublishedAppsOutputPb path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-apps", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppsOutput) - return &getPublishedAppsOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPublishedAppsOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := getPublishedAppsOutputFromPb(&getPublishedAppsOutputPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just PublishedAppIntegration API methods @@ -257,34 +487,96 @@ type publishedAppIntegrationImpl struct { } func (a *publishedAppIntegrationImpl) Create(ctx context.Context, request CreatePublishedAppIntegration) (*CreatePublishedAppIntegrationOutput, error) { - var createPublishedAppIntegrationOutput CreatePublishedAppIntegrationOutput + + requestPb, pbErr := createPublishedAppIntegrationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createPublishedAppIntegrationOutputPb createPublishedAppIntegrationOutputPb path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPublishedAppIntegrationOutput) - return &createPublishedAppIntegrationOutput, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createPublishedAppIntegrationOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := createPublishedAppIntegrationOutputFromPb(&createPublishedAppIntegrationOutputPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *publishedAppIntegrationImpl) Delete(ctx context.Context, request DeletePublishedAppIntegrationRequest) error { - var deletePublishedAppIntegrationOutput DeletePublishedAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := deletePublishedAppIntegrationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deletePublishedAppIntegrationOutputPb deletePublishedAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePublishedAppIntegrationOutput) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deletePublishedAppIntegrationOutputPb, + ) + if err != nil { + return err + } + return err } func (a *publishedAppIntegrationImpl) Get(ctx context.Context, request GetPublishedAppIntegrationRequest) (*GetPublishedAppIntegrationOutput, error) { - var getPublishedAppIntegrationOutput GetPublishedAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := getPublishedAppIntegrationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPublishedAppIntegrationOutputPb getPublishedAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppIntegrationOutput) - return &getPublishedAppIntegrationOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPublishedAppIntegrationOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := getPublishedAppIntegrationOutputFromPb(&getPublishedAppIntegrationOutputPb) + if err != nil { + return nil, err + } + + return resp, err } // Get published oauth app integrations. @@ -325,23 +617,63 @@ func (a *publishedAppIntegrationImpl) ListAll(ctx context.Context, request ListP } func (a *publishedAppIntegrationImpl) internalList(ctx context.Context, request ListPublishedAppIntegrationsRequest) (*GetPublishedAppIntegrationsOutput, error) { - var getPublishedAppIntegrationsOutput GetPublishedAppIntegrationsOutput + + requestPb, pbErr := listPublishedAppIntegrationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPublishedAppIntegrationsOutputPb getPublishedAppIntegrationsOutputPb path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppIntegrationsOutput) - return &getPublishedAppIntegrationsOutput, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPublishedAppIntegrationsOutputPb, + ) + if err != nil { + return nil, err + } + resp, err := getPublishedAppIntegrationsOutputFromPb(&getPublishedAppIntegrationsOutputPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *publishedAppIntegrationImpl) Update(ctx context.Context, request UpdatePublishedAppIntegration) error { - var updatePublishedAppIntegrationOutput UpdatePublishedAppIntegrationOutput - path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + + requestPb, pbErr := updatePublishedAppIntegrationToPb(&request) + if pbErr != nil { + return pbErr + } + + var updatePublishedAppIntegrationOutputPb updatePublishedAppIntegrationOutputPb + path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), requestPb.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updatePublishedAppIntegrationOutput) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updatePublishedAppIntegrationOutputPb, + ) + if err != nil { + return err + } + return err } @@ -351,37 +683,99 @@ type servicePrincipalFederationPolicyImpl struct { } func (a *servicePrincipalFederationPolicyImpl) Create(ctx context.Context, request CreateServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + + requestPb, pbErr := createServicePrincipalFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId) queryParams := make(map[string]any) - if request.PolicyId != "" || slices.Contains(request.ForceSendFields, "PolicyId") { - queryParams["policy_id"] = request.PolicyId + if requestPb.PolicyId != "" || slices.Contains(requestPb.ForceSendFields, "PolicyId") { + queryParams["policy_id"] = requestPb.PolicyId } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servicePrincipalFederationPolicyImpl) Delete(ctx context.Context, request DeleteServicePrincipalFederationPolicyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + + requestPb, pbErr := deleteServicePrincipalFederationPolicyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId, requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *servicePrincipalFederationPolicyImpl) Get(ctx context.Context, request GetServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + + requestPb, pbErr := getServicePrincipalFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId, requestPb.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // List service principal federation policies. @@ -416,27 +810,71 @@ func (a *servicePrincipalFederationPolicyImpl) ListAll(ctx context.Context, requ } func (a *servicePrincipalFederationPolicyImpl) internalList(ctx context.Context, request ListServicePrincipalFederationPoliciesRequest) (*ListFederationPoliciesResponse, error) { - var listFederationPoliciesResponse ListFederationPoliciesResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + + requestPb, pbErr := listServicePrincipalFederationPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFederationPoliciesResponsePb listFederationPoliciesResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFederationPoliciesResponse) - return &listFederationPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFederationPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFederationPoliciesResponseFromPb(&listFederationPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servicePrincipalFederationPolicyImpl) Update(ctx context.Context, request UpdateServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + + requestPb, pbErr := updateServicePrincipalFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId, requestPb.PolicyId) queryParams := make(map[string]any) - if request.UpdateMask != "" || slices.Contains(request.ForceSendFields, "UpdateMask") { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" || slices.Contains(requestPb.ForceSendFields, "UpdateMask") { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ServicePrincipalSecrets API methods @@ -445,22 +883,62 @@ type servicePrincipalSecretsImpl struct { } func (a *servicePrincipalSecretsImpl) Create(ctx context.Context, request CreateServicePrincipalSecretRequest) (*CreateServicePrincipalSecretResponse, error) { - var createServicePrincipalSecretResponse CreateServicePrincipalSecretResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + + requestPb, pbErr := createServicePrincipalSecretRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createServicePrincipalSecretResponsePb createServicePrincipalSecretResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createServicePrincipalSecretResponse) - return &createServicePrincipalSecretResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createServicePrincipalSecretResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createServicePrincipalSecretResponseFromPb(&createServicePrincipalSecretResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servicePrincipalSecretsImpl) Delete(ctx context.Context, request DeleteServicePrincipalSecretRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.SecretId) + + requestPb, pbErr := deleteServicePrincipalSecretRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets/%v", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId, requestPb.SecretId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } @@ -504,11 +982,33 @@ func (a *servicePrincipalSecretsImpl) ListAll(ctx context.Context, request ListS } func (a *servicePrincipalSecretsImpl) internalList(ctx context.Context, request ListServicePrincipalSecretsRequest) (*ListServicePrincipalSecretsResponse, error) { - var listServicePrincipalSecretsResponse ListServicePrincipalSecretsResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + + requestPb, pbErr := listServicePrincipalSecretsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listServicePrincipalSecretsResponsePb listServicePrincipalSecretsResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), requestPb.ServicePrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalSecretsResponse) - return &listServicePrincipalSecretsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listServicePrincipalSecretsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listServicePrincipalSecretsResponseFromPb(&listServicePrincipalSecretsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/oauth2/internal.go b/service/oauth2/internal.go new file mode 100755 index 000000000..8fc20567e --- /dev/null +++ b/service/oauth2/internal.go @@ -0,0 +1,1799 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package oauth2 + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func createAccountFederationPolicyRequestToPb(st *CreateAccountFederationPolicyRequest) (*createAccountFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createAccountFederationPolicyRequestPb{} + pb.Policy = st.Policy + + pb.PolicyId = st.PolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAccountFederationPolicyRequestPb struct { + Policy FederationPolicy `json:"policy"` + + PolicyId string `json:"-" url:"policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAccountFederationPolicyRequestFromPb(pb *createAccountFederationPolicyRequestPb) (*CreateAccountFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateAccountFederationPolicyRequest{} + st.Policy = pb.Policy + st.PolicyId = pb.PolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAccountFederationPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAccountFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCustomAppIntegrationToPb(st *CreateCustomAppIntegration) (*createCustomAppIntegrationPb, error) { + if st == nil { + return nil, nil + } + pb := &createCustomAppIntegrationPb{} + pb.Confidential = st.Confidential + + pb.Name = st.Name + + pb.RedirectUrls = st.RedirectUrls + + pb.Scopes = st.Scopes + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + pb.UserAuthorizedScopes = st.UserAuthorizedScopes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCustomAppIntegrationPb struct { + Confidential bool `json:"confidential,omitempty"` + + Name string `json:"name,omitempty"` + + RedirectUrls []string `json:"redirect_urls,omitempty"` + + Scopes []string `json:"scopes,omitempty"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCustomAppIntegrationFromPb(pb *createCustomAppIntegrationPb) (*CreateCustomAppIntegration, error) { + if pb == nil { + return nil, nil + } + st := &CreateCustomAppIntegration{} + st.Confidential = pb.Confidential + st.Name = pb.Name + st.RedirectUrls = pb.RedirectUrls + st.Scopes = pb.Scopes + st.TokenAccessPolicy = pb.TokenAccessPolicy + st.UserAuthorizedScopes = pb.UserAuthorizedScopes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCustomAppIntegrationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCustomAppIntegrationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCustomAppIntegrationOutputToPb(st *CreateCustomAppIntegrationOutput) (*createCustomAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &createCustomAppIntegrationOutputPb{} + pb.ClientId = st.ClientId + + pb.ClientSecret = st.ClientSecret + + pb.IntegrationId = st.IntegrationId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCustomAppIntegrationOutputPb struct { + ClientId string `json:"client_id,omitempty"` + + ClientSecret string `json:"client_secret,omitempty"` + + IntegrationId string `json:"integration_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCustomAppIntegrationOutputFromPb(pb *createCustomAppIntegrationOutputPb) (*CreateCustomAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &CreateCustomAppIntegrationOutput{} + st.ClientId = pb.ClientId + st.ClientSecret = pb.ClientSecret + st.IntegrationId = pb.IntegrationId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCustomAppIntegrationOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCustomAppIntegrationOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPublishedAppIntegrationToPb(st *CreatePublishedAppIntegration) (*createPublishedAppIntegrationPb, error) { + if st == nil { + return nil, nil + } + pb := &createPublishedAppIntegrationPb{} + pb.AppId = st.AppId + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPublishedAppIntegrationPb struct { + AppId string `json:"app_id,omitempty"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPublishedAppIntegrationFromPb(pb *createPublishedAppIntegrationPb) (*CreatePublishedAppIntegration, error) { + if pb == nil { + return nil, nil + } + st := &CreatePublishedAppIntegration{} + st.AppId = pb.AppId + st.TokenAccessPolicy = pb.TokenAccessPolicy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPublishedAppIntegrationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPublishedAppIntegrationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPublishedAppIntegrationOutputToPb(st *CreatePublishedAppIntegrationOutput) (*createPublishedAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &createPublishedAppIntegrationOutputPb{} + pb.IntegrationId = st.IntegrationId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPublishedAppIntegrationOutputPb struct { + IntegrationId string `json:"integration_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPublishedAppIntegrationOutputFromPb(pb *createPublishedAppIntegrationOutputPb) (*CreatePublishedAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &CreatePublishedAppIntegrationOutput{} + st.IntegrationId = pb.IntegrationId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPublishedAppIntegrationOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPublishedAppIntegrationOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createServicePrincipalFederationPolicyRequestToPb(st *CreateServicePrincipalFederationPolicyRequest) (*createServicePrincipalFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createServicePrincipalFederationPolicyRequestPb{} + pb.Policy = st.Policy + + pb.PolicyId = st.PolicyId + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createServicePrincipalFederationPolicyRequestPb struct { + Policy FederationPolicy `json:"policy"` + + PolicyId string `json:"-" url:"policy_id,omitempty"` + + ServicePrincipalId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createServicePrincipalFederationPolicyRequestFromPb(pb *createServicePrincipalFederationPolicyRequestPb) (*CreateServicePrincipalFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateServicePrincipalFederationPolicyRequest{} + st.Policy = pb.Policy + st.PolicyId = pb.PolicyId + st.ServicePrincipalId = pb.ServicePrincipalId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createServicePrincipalFederationPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createServicePrincipalFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createServicePrincipalSecretRequestToPb(st *CreateServicePrincipalSecretRequest) (*createServicePrincipalSecretRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createServicePrincipalSecretRequestPb{} + pb.Lifetime = st.Lifetime + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createServicePrincipalSecretRequestPb struct { + Lifetime string `json:"lifetime,omitempty"` + + ServicePrincipalId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createServicePrincipalSecretRequestFromPb(pb *createServicePrincipalSecretRequestPb) (*CreateServicePrincipalSecretRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateServicePrincipalSecretRequest{} + st.Lifetime = pb.Lifetime + st.ServicePrincipalId = pb.ServicePrincipalId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createServicePrincipalSecretRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createServicePrincipalSecretRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createServicePrincipalSecretResponseToPb(st *CreateServicePrincipalSecretResponse) (*createServicePrincipalSecretResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createServicePrincipalSecretResponsePb{} + pb.CreateTime = st.CreateTime + + pb.ExpireTime = st.ExpireTime + + pb.Id = st.Id + + pb.Secret = st.Secret + + pb.SecretHash = st.SecretHash + + pb.Status = st.Status + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createServicePrincipalSecretResponsePb struct { + CreateTime string `json:"create_time,omitempty"` + + ExpireTime string `json:"expire_time,omitempty"` + + Id string `json:"id,omitempty"` + + Secret string `json:"secret,omitempty"` + + SecretHash string `json:"secret_hash,omitempty"` + + Status string `json:"status,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createServicePrincipalSecretResponseFromPb(pb *createServicePrincipalSecretResponsePb) (*CreateServicePrincipalSecretResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateServicePrincipalSecretResponse{} + st.CreateTime = pb.CreateTime + st.ExpireTime = pb.ExpireTime + st.Id = pb.Id + st.Secret = pb.Secret + st.SecretHash = pb.SecretHash + st.Status = pb.Status + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createServicePrincipalSecretResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createServicePrincipalSecretResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAccountFederationPolicyRequestToPb(st *DeleteAccountFederationPolicyRequest) (*deleteAccountFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountFederationPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type deleteAccountFederationPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` +} + +func deleteAccountFederationPolicyRequestFromPb(pb *deleteAccountFederationPolicyRequestPb) (*DeleteAccountFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountFederationPolicyRequest{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func deleteCustomAppIntegrationOutputToPb(st *DeleteCustomAppIntegrationOutput) (*deleteCustomAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCustomAppIntegrationOutputPb{} + + return pb, nil +} + +type deleteCustomAppIntegrationOutputPb struct { +} + +func deleteCustomAppIntegrationOutputFromPb(pb *deleteCustomAppIntegrationOutputPb) (*DeleteCustomAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCustomAppIntegrationOutput{} + + return st, nil +} + +func deleteCustomAppIntegrationRequestToPb(st *DeleteCustomAppIntegrationRequest) (*deleteCustomAppIntegrationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCustomAppIntegrationRequestPb{} + pb.IntegrationId = st.IntegrationId + + return pb, nil +} + +type deleteCustomAppIntegrationRequestPb struct { + IntegrationId string `json:"-" url:"-"` +} + +func deleteCustomAppIntegrationRequestFromPb(pb *deleteCustomAppIntegrationRequestPb) (*DeleteCustomAppIntegrationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCustomAppIntegrationRequest{} + st.IntegrationId = pb.IntegrationId + + return st, nil +} + +func deletePublishedAppIntegrationOutputToPb(st *DeletePublishedAppIntegrationOutput) (*deletePublishedAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePublishedAppIntegrationOutputPb{} + + return pb, nil +} + +type deletePublishedAppIntegrationOutputPb struct { +} + +func deletePublishedAppIntegrationOutputFromPb(pb *deletePublishedAppIntegrationOutputPb) (*DeletePublishedAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &DeletePublishedAppIntegrationOutput{} + + return st, nil +} + +func deletePublishedAppIntegrationRequestToPb(st *DeletePublishedAppIntegrationRequest) (*deletePublishedAppIntegrationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePublishedAppIntegrationRequestPb{} + pb.IntegrationId = st.IntegrationId + + return pb, nil +} + +type deletePublishedAppIntegrationRequestPb struct { + IntegrationId string `json:"-" url:"-"` +} + +func deletePublishedAppIntegrationRequestFromPb(pb *deletePublishedAppIntegrationRequestPb) (*DeletePublishedAppIntegrationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeletePublishedAppIntegrationRequest{} + st.IntegrationId = pb.IntegrationId + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteServicePrincipalFederationPolicyRequestToPb(st *DeleteServicePrincipalFederationPolicyRequest) (*deleteServicePrincipalFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteServicePrincipalFederationPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + pb.ServicePrincipalId = st.ServicePrincipalId + + return pb, nil +} + +type deleteServicePrincipalFederationPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` + + ServicePrincipalId int64 `json:"-" url:"-"` +} + +func deleteServicePrincipalFederationPolicyRequestFromPb(pb *deleteServicePrincipalFederationPolicyRequestPb) (*DeleteServicePrincipalFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteServicePrincipalFederationPolicyRequest{} + st.PolicyId = pb.PolicyId + st.ServicePrincipalId = pb.ServicePrincipalId + + return st, nil +} + +func deleteServicePrincipalSecretRequestToPb(st *DeleteServicePrincipalSecretRequest) (*deleteServicePrincipalSecretRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteServicePrincipalSecretRequestPb{} + pb.SecretId = st.SecretId + + pb.ServicePrincipalId = st.ServicePrincipalId + + return pb, nil +} + +type deleteServicePrincipalSecretRequestPb struct { + SecretId string `json:"-" url:"-"` + + ServicePrincipalId int64 `json:"-" url:"-"` +} + +func deleteServicePrincipalSecretRequestFromPb(pb *deleteServicePrincipalSecretRequestPb) (*DeleteServicePrincipalSecretRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteServicePrincipalSecretRequest{} + st.SecretId = pb.SecretId + st.ServicePrincipalId = pb.ServicePrincipalId + + return st, nil +} + +func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &federationPolicyPb{} + pb.CreateTime = st.CreateTime + + pb.Description = st.Description + + pb.Name = st.Name + + pb.OidcPolicy = st.OidcPolicy + + pb.PolicyId = st.PolicyId + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.Uid = st.Uid + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type federationPolicyPb struct { + CreateTime string `json:"create_time,omitempty"` + + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + + Uid string `json:"uid,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func federationPolicyFromPb(pb *federationPolicyPb) (*FederationPolicy, error) { + if pb == nil { + return nil, nil + } + st := &FederationPolicy{} + st.CreateTime = pb.CreateTime + st.Description = pb.Description + st.Name = pb.Name + st.OidcPolicy = pb.OidcPolicy + st.PolicyId = pb.PolicyId + st.ServicePrincipalId = pb.ServicePrincipalId + st.Uid = pb.Uid + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *federationPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st federationPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAccountFederationPolicyRequestToPb(st *GetAccountFederationPolicyRequest) (*getAccountFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountFederationPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + return pb, nil +} + +type getAccountFederationPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` +} + +func getAccountFederationPolicyRequestFromPb(pb *getAccountFederationPolicyRequestPb) (*GetAccountFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountFederationPolicyRequest{} + st.PolicyId = pb.PolicyId + + return st, nil +} + +func getCustomAppIntegrationOutputToPb(st *GetCustomAppIntegrationOutput) (*getCustomAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &getCustomAppIntegrationOutputPb{} + pb.ClientId = st.ClientId + + pb.Confidential = st.Confidential + + pb.CreateTime = st.CreateTime + + pb.CreatedBy = st.CreatedBy + + pb.CreatorUsername = st.CreatorUsername + + pb.IntegrationId = st.IntegrationId + + pb.Name = st.Name + + pb.RedirectUrls = st.RedirectUrls + + pb.Scopes = st.Scopes + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + pb.UserAuthorizedScopes = st.UserAuthorizedScopes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getCustomAppIntegrationOutputPb struct { + ClientId string `json:"client_id,omitempty"` + + Confidential bool `json:"confidential,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + CreatedBy int64 `json:"created_by,omitempty"` + + CreatorUsername string `json:"creator_username,omitempty"` + + IntegrationId string `json:"integration_id,omitempty"` + + Name string `json:"name,omitempty"` + + RedirectUrls []string `json:"redirect_urls,omitempty"` + + Scopes []string `json:"scopes,omitempty"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getCustomAppIntegrationOutputFromPb(pb *getCustomAppIntegrationOutputPb) (*GetCustomAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &GetCustomAppIntegrationOutput{} + st.ClientId = pb.ClientId + st.Confidential = pb.Confidential + st.CreateTime = pb.CreateTime + st.CreatedBy = pb.CreatedBy + st.CreatorUsername = pb.CreatorUsername + st.IntegrationId = pb.IntegrationId + st.Name = pb.Name + st.RedirectUrls = pb.RedirectUrls + st.Scopes = pb.Scopes + st.TokenAccessPolicy = pb.TokenAccessPolicy + st.UserAuthorizedScopes = pb.UserAuthorizedScopes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getCustomAppIntegrationOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getCustomAppIntegrationOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getCustomAppIntegrationRequestToPb(st *GetCustomAppIntegrationRequest) (*getCustomAppIntegrationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCustomAppIntegrationRequestPb{} + pb.IntegrationId = st.IntegrationId + + return pb, nil +} + +type getCustomAppIntegrationRequestPb struct { + IntegrationId string `json:"-" url:"-"` +} + +func getCustomAppIntegrationRequestFromPb(pb *getCustomAppIntegrationRequestPb) (*GetCustomAppIntegrationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCustomAppIntegrationRequest{} + st.IntegrationId = pb.IntegrationId + + return st, nil +} + +func getCustomAppIntegrationsOutputToPb(st *GetCustomAppIntegrationsOutput) (*getCustomAppIntegrationsOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &getCustomAppIntegrationsOutputPb{} + pb.Apps = st.Apps + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getCustomAppIntegrationsOutputPb struct { + Apps []GetCustomAppIntegrationOutput `json:"apps,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getCustomAppIntegrationsOutputFromPb(pb *getCustomAppIntegrationsOutputPb) (*GetCustomAppIntegrationsOutput, error) { + if pb == nil { + return nil, nil + } + st := &GetCustomAppIntegrationsOutput{} + st.Apps = pb.Apps + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getCustomAppIntegrationsOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getCustomAppIntegrationsOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPublishedAppIntegrationOutputToPb(st *GetPublishedAppIntegrationOutput) (*getPublishedAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedAppIntegrationOutputPb{} + pb.AppId = st.AppId + + pb.CreateTime = st.CreateTime + + pb.CreatedBy = st.CreatedBy + + pb.IntegrationId = st.IntegrationId + + pb.Name = st.Name + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPublishedAppIntegrationOutputPb struct { + AppId string `json:"app_id,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + CreatedBy int64 `json:"created_by,omitempty"` + + IntegrationId string `json:"integration_id,omitempty"` + + Name string `json:"name,omitempty"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPublishedAppIntegrationOutputFromPb(pb *getPublishedAppIntegrationOutputPb) (*GetPublishedAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedAppIntegrationOutput{} + st.AppId = pb.AppId + st.CreateTime = pb.CreateTime + st.CreatedBy = pb.CreatedBy + st.IntegrationId = pb.IntegrationId + st.Name = pb.Name + st.TokenAccessPolicy = pb.TokenAccessPolicy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPublishedAppIntegrationOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPublishedAppIntegrationOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPublishedAppIntegrationRequestToPb(st *GetPublishedAppIntegrationRequest) (*getPublishedAppIntegrationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedAppIntegrationRequestPb{} + pb.IntegrationId = st.IntegrationId + + return pb, nil +} + +type getPublishedAppIntegrationRequestPb struct { + IntegrationId string `json:"-" url:"-"` +} + +func getPublishedAppIntegrationRequestFromPb(pb *getPublishedAppIntegrationRequestPb) (*GetPublishedAppIntegrationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedAppIntegrationRequest{} + st.IntegrationId = pb.IntegrationId + + return st, nil +} + +func getPublishedAppIntegrationsOutputToPb(st *GetPublishedAppIntegrationsOutput) (*getPublishedAppIntegrationsOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedAppIntegrationsOutputPb{} + pb.Apps = st.Apps + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPublishedAppIntegrationsOutputPb struct { + Apps []GetPublishedAppIntegrationOutput `json:"apps,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPublishedAppIntegrationsOutputFromPb(pb *getPublishedAppIntegrationsOutputPb) (*GetPublishedAppIntegrationsOutput, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedAppIntegrationsOutput{} + st.Apps = pb.Apps + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPublishedAppIntegrationsOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPublishedAppIntegrationsOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPublishedAppsOutputToPb(st *GetPublishedAppsOutput) (*getPublishedAppsOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &getPublishedAppsOutputPb{} + pb.Apps = st.Apps + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPublishedAppsOutputPb struct { + Apps []PublishedAppOutput `json:"apps,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPublishedAppsOutputFromPb(pb *getPublishedAppsOutputPb) (*GetPublishedAppsOutput, error) { + if pb == nil { + return nil, nil + } + st := &GetPublishedAppsOutput{} + st.Apps = pb.Apps + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPublishedAppsOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPublishedAppsOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getServicePrincipalFederationPolicyRequestToPb(st *GetServicePrincipalFederationPolicyRequest) (*getServicePrincipalFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getServicePrincipalFederationPolicyRequestPb{} + pb.PolicyId = st.PolicyId + + pb.ServicePrincipalId = st.ServicePrincipalId + + return pb, nil +} + +type getServicePrincipalFederationPolicyRequestPb struct { + PolicyId string `json:"-" url:"-"` + + ServicePrincipalId int64 `json:"-" url:"-"` +} + +func getServicePrincipalFederationPolicyRequestFromPb(pb *getServicePrincipalFederationPolicyRequestPb) (*GetServicePrincipalFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetServicePrincipalFederationPolicyRequest{} + st.PolicyId = pb.PolicyId + st.ServicePrincipalId = pb.ServicePrincipalId + + return st, nil +} + +func listAccountFederationPoliciesRequestToPb(st *ListAccountFederationPoliciesRequest) (*listAccountFederationPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAccountFederationPoliciesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAccountFederationPoliciesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAccountFederationPoliciesRequestFromPb(pb *listAccountFederationPoliciesRequestPb) (*ListAccountFederationPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAccountFederationPoliciesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAccountFederationPoliciesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAccountFederationPoliciesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listCustomAppIntegrationsRequestToPb(st *ListCustomAppIntegrationsRequest) (*listCustomAppIntegrationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listCustomAppIntegrationsRequestPb{} + pb.IncludeCreatorUsername = st.IncludeCreatorUsername + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listCustomAppIntegrationsRequestPb struct { + IncludeCreatorUsername bool `json:"-" url:"include_creator_username,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listCustomAppIntegrationsRequestFromPb(pb *listCustomAppIntegrationsRequestPb) (*ListCustomAppIntegrationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListCustomAppIntegrationsRequest{} + st.IncludeCreatorUsername = pb.IncludeCreatorUsername + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listCustomAppIntegrationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listCustomAppIntegrationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*listFederationPoliciesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listFederationPoliciesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Policies = st.Policies + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFederationPoliciesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Policies []FederationPolicy `json:"policies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFederationPoliciesResponseFromPb(pb *listFederationPoliciesResponsePb) (*ListFederationPoliciesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListFederationPoliciesResponse{} + st.NextPageToken = pb.NextPageToken + st.Policies = pb.Policies + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFederationPoliciesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFederationPoliciesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listOAuthPublishedAppsRequestToPb(st *ListOAuthPublishedAppsRequest) (*listOAuthPublishedAppsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listOAuthPublishedAppsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listOAuthPublishedAppsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listOAuthPublishedAppsRequestFromPb(pb *listOAuthPublishedAppsRequestPb) (*ListOAuthPublishedAppsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListOAuthPublishedAppsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listOAuthPublishedAppsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listOAuthPublishedAppsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPublishedAppIntegrationsRequestToPb(st *ListPublishedAppIntegrationsRequest) (*listPublishedAppIntegrationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listPublishedAppIntegrationsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPublishedAppIntegrationsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPublishedAppIntegrationsRequestFromPb(pb *listPublishedAppIntegrationsRequestPb) (*ListPublishedAppIntegrationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListPublishedAppIntegrationsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPublishedAppIntegrationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPublishedAppIntegrationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listServicePrincipalFederationPoliciesRequestToPb(st *ListServicePrincipalFederationPoliciesRequest) (*listServicePrincipalFederationPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listServicePrincipalFederationPoliciesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listServicePrincipalFederationPoliciesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ServicePrincipalId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listServicePrincipalFederationPoliciesRequestFromPb(pb *listServicePrincipalFederationPoliciesRequestPb) (*ListServicePrincipalFederationPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListServicePrincipalFederationPoliciesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + st.ServicePrincipalId = pb.ServicePrincipalId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listServicePrincipalFederationPoliciesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listServicePrincipalFederationPoliciesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listServicePrincipalSecretsRequestToPb(st *ListServicePrincipalSecretsRequest) (*listServicePrincipalSecretsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listServicePrincipalSecretsRequestPb{} + pb.PageToken = st.PageToken + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listServicePrincipalSecretsRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + ServicePrincipalId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listServicePrincipalSecretsRequestFromPb(pb *listServicePrincipalSecretsRequestPb) (*ListServicePrincipalSecretsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListServicePrincipalSecretsRequest{} + st.PageToken = pb.PageToken + st.ServicePrincipalId = pb.ServicePrincipalId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listServicePrincipalSecretsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listServicePrincipalSecretsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listServicePrincipalSecretsResponseToPb(st *ListServicePrincipalSecretsResponse) (*listServicePrincipalSecretsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listServicePrincipalSecretsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Secrets = st.Secrets + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listServicePrincipalSecretsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Secrets []SecretInfo `json:"secrets,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listServicePrincipalSecretsResponseFromPb(pb *listServicePrincipalSecretsResponsePb) (*ListServicePrincipalSecretsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListServicePrincipalSecretsResponse{} + st.NextPageToken = pb.NextPageToken + st.Secrets = pb.Secrets + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listServicePrincipalSecretsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listServicePrincipalSecretsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func oidcFederationPolicyToPb(st *OidcFederationPolicy) (*oidcFederationPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &oidcFederationPolicyPb{} + pb.Audiences = st.Audiences + + pb.Issuer = st.Issuer + + pb.JwksJson = st.JwksJson + + pb.JwksUri = st.JwksUri + + pb.Subject = st.Subject + + pb.SubjectClaim = st.SubjectClaim + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type oidcFederationPolicyPb struct { + Audiences []string `json:"audiences,omitempty"` + + Issuer string `json:"issuer,omitempty"` + + JwksJson string `json:"jwks_json,omitempty"` + + JwksUri string `json:"jwks_uri,omitempty"` + + Subject string `json:"subject,omitempty"` + + SubjectClaim string `json:"subject_claim,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func oidcFederationPolicyFromPb(pb *oidcFederationPolicyPb) (*OidcFederationPolicy, error) { + if pb == nil { + return nil, nil + } + st := &OidcFederationPolicy{} + st.Audiences = pb.Audiences + st.Issuer = pb.Issuer + st.JwksJson = pb.JwksJson + st.JwksUri = pb.JwksUri + st.Subject = pb.Subject + st.SubjectClaim = pb.SubjectClaim + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *oidcFederationPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st oidcFederationPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func publishedAppOutputToPb(st *PublishedAppOutput) (*publishedAppOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &publishedAppOutputPb{} + pb.AppId = st.AppId + + pb.ClientId = st.ClientId + + pb.Description = st.Description + + pb.IsConfidentialClient = st.IsConfidentialClient + + pb.Name = st.Name + + pb.RedirectUrls = st.RedirectUrls + + pb.Scopes = st.Scopes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type publishedAppOutputPb struct { + AppId string `json:"app_id,omitempty"` + + ClientId string `json:"client_id,omitempty"` + + Description string `json:"description,omitempty"` + + IsConfidentialClient bool `json:"is_confidential_client,omitempty"` + + Name string `json:"name,omitempty"` + + RedirectUrls []string `json:"redirect_urls,omitempty"` + + Scopes []string `json:"scopes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func publishedAppOutputFromPb(pb *publishedAppOutputPb) (*PublishedAppOutput, error) { + if pb == nil { + return nil, nil + } + st := &PublishedAppOutput{} + st.AppId = pb.AppId + st.ClientId = pb.ClientId + st.Description = pb.Description + st.IsConfidentialClient = pb.IsConfidentialClient + st.Name = pb.Name + st.RedirectUrls = pb.RedirectUrls + st.Scopes = pb.Scopes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *publishedAppOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st publishedAppOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func secretInfoToPb(st *SecretInfo) (*secretInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &secretInfoPb{} + pb.CreateTime = st.CreateTime + + pb.ExpireTime = st.ExpireTime + + pb.Id = st.Id + + pb.SecretHash = st.SecretHash + + pb.Status = st.Status + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type secretInfoPb struct { + CreateTime string `json:"create_time,omitempty"` + + ExpireTime string `json:"expire_time,omitempty"` + + Id string `json:"id,omitempty"` + + SecretHash string `json:"secret_hash,omitempty"` + + Status string `json:"status,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func secretInfoFromPb(pb *secretInfoPb) (*SecretInfo, error) { + if pb == nil { + return nil, nil + } + st := &SecretInfo{} + st.CreateTime = pb.CreateTime + st.ExpireTime = pb.ExpireTime + st.Id = pb.Id + st.SecretHash = pb.SecretHash + st.Status = pb.Status + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *secretInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st secretInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenAccessPolicyToPb(st *TokenAccessPolicy) (*tokenAccessPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenAccessPolicyPb{} + pb.AccessTokenTtlInMinutes = st.AccessTokenTtlInMinutes + + pb.RefreshTokenTtlInMinutes = st.RefreshTokenTtlInMinutes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenAccessPolicyPb struct { + AccessTokenTtlInMinutes int `json:"access_token_ttl_in_minutes,omitempty"` + + RefreshTokenTtlInMinutes int `json:"refresh_token_ttl_in_minutes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenAccessPolicyFromPb(pb *tokenAccessPolicyPb) (*TokenAccessPolicy, error) { + if pb == nil { + return nil, nil + } + st := &TokenAccessPolicy{} + st.AccessTokenTtlInMinutes = pb.AccessTokenTtlInMinutes + st.RefreshTokenTtlInMinutes = pb.RefreshTokenTtlInMinutes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenAccessPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenAccessPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateAccountFederationPolicyRequestToPb(st *UpdateAccountFederationPolicyRequest) (*updateAccountFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAccountFederationPolicyRequestPb{} + pb.Policy = st.Policy + + pb.PolicyId = st.PolicyId + + pb.UpdateMask = st.UpdateMask + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateAccountFederationPolicyRequestPb struct { + Policy FederationPolicy `json:"policy"` + + PolicyId string `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateAccountFederationPolicyRequestFromPb(pb *updateAccountFederationPolicyRequestPb) (*UpdateAccountFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAccountFederationPolicyRequest{} + st.Policy = pb.Policy + st.PolicyId = pb.PolicyId + st.UpdateMask = pb.UpdateMask + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateAccountFederationPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateAccountFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateCustomAppIntegrationToPb(st *UpdateCustomAppIntegration) (*updateCustomAppIntegrationPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCustomAppIntegrationPb{} + pb.IntegrationId = st.IntegrationId + + pb.RedirectUrls = st.RedirectUrls + + pb.Scopes = st.Scopes + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + pb.UserAuthorizedScopes = st.UserAuthorizedScopes + + return pb, nil +} + +type updateCustomAppIntegrationPb struct { + IntegrationId string `json:"-" url:"-"` + + RedirectUrls []string `json:"redirect_urls,omitempty"` + + Scopes []string `json:"scopes,omitempty"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` +} + +func updateCustomAppIntegrationFromPb(pb *updateCustomAppIntegrationPb) (*UpdateCustomAppIntegration, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCustomAppIntegration{} + st.IntegrationId = pb.IntegrationId + st.RedirectUrls = pb.RedirectUrls + st.Scopes = pb.Scopes + st.TokenAccessPolicy = pb.TokenAccessPolicy + st.UserAuthorizedScopes = pb.UserAuthorizedScopes + + return st, nil +} + +func updateCustomAppIntegrationOutputToPb(st *UpdateCustomAppIntegrationOutput) (*updateCustomAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCustomAppIntegrationOutputPb{} + + return pb, nil +} + +type updateCustomAppIntegrationOutputPb struct { +} + +func updateCustomAppIntegrationOutputFromPb(pb *updateCustomAppIntegrationOutputPb) (*UpdateCustomAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCustomAppIntegrationOutput{} + + return st, nil +} + +func updatePublishedAppIntegrationToPb(st *UpdatePublishedAppIntegration) (*updatePublishedAppIntegrationPb, error) { + if st == nil { + return nil, nil + } + pb := &updatePublishedAppIntegrationPb{} + pb.IntegrationId = st.IntegrationId + + pb.TokenAccessPolicy = st.TokenAccessPolicy + + return pb, nil +} + +type updatePublishedAppIntegrationPb struct { + IntegrationId string `json:"-" url:"-"` + + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` +} + +func updatePublishedAppIntegrationFromPb(pb *updatePublishedAppIntegrationPb) (*UpdatePublishedAppIntegration, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePublishedAppIntegration{} + st.IntegrationId = pb.IntegrationId + st.TokenAccessPolicy = pb.TokenAccessPolicy + + return st, nil +} + +func updatePublishedAppIntegrationOutputToPb(st *UpdatePublishedAppIntegrationOutput) (*updatePublishedAppIntegrationOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &updatePublishedAppIntegrationOutputPb{} + + return pb, nil +} + +type updatePublishedAppIntegrationOutputPb struct { +} + +func updatePublishedAppIntegrationOutputFromPb(pb *updatePublishedAppIntegrationOutputPb) (*UpdatePublishedAppIntegrationOutput, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePublishedAppIntegrationOutput{} + + return st, nil +} + +func updateServicePrincipalFederationPolicyRequestToPb(st *UpdateServicePrincipalFederationPolicyRequest) (*updateServicePrincipalFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateServicePrincipalFederationPolicyRequestPb{} + pb.Policy = st.Policy + + pb.PolicyId = st.PolicyId + + pb.ServicePrincipalId = st.ServicePrincipalId + + pb.UpdateMask = st.UpdateMask + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateServicePrincipalFederationPolicyRequestPb struct { + Policy FederationPolicy `json:"policy"` + + PolicyId string `json:"-" url:"-"` + + ServicePrincipalId int64 `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateServicePrincipalFederationPolicyRequestFromPb(pb *updateServicePrincipalFederationPolicyRequestPb) (*UpdateServicePrincipalFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateServicePrincipalFederationPolicyRequest{} + st.Policy = pb.Policy + st.PolicyId = pb.PolicyId + st.ServicePrincipalId = pb.ServicePrincipalId + st.UpdateMask = pb.UpdateMask + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateServicePrincipalFederationPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateServicePrincipalFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/oauth2/model.go b/service/oauth2/model.go index d8ddc772a..a97fdc5d0 100755 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -3,223 +3,601 @@ package oauth2 import ( - "github.com/databricks/databricks-sdk-go/marshal" + "encoding/json" + "fmt" + "strings" + "time" ) // Create account federation policy type CreateAccountFederationPolicyRequest struct { - Policy FederationPolicy `json:"policy"` + + // Wire name: 'policy' + Policy FederationPolicy // The identifier for the federation policy. The identifier must contain // only lowercase alphanumeric characters, numbers, hyphens, and slashes. If // unspecified, the id will be assigned by Databricks. - PolicyId string `json:"-" url:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAccountFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAccountFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := createAccountFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCustomAppIntegration struct { // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential bool `json:"confidential,omitempty"` + // Wire name: 'confidential' + Confidential bool // Name of the custom OAuth app - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // List of OAuth redirect urls - RedirectUrls []string `json:"redirect_urls,omitempty"` + // Wire name: 'redirect_urls' + RedirectUrls []string // OAuth scopes granted to the application. Supported scopes: all-apis, sql, // offline_access, openid, profile, email. - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string // Token access policy - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy // Scopes that will need to be consented by end user to mint the access // token. If the user does not authorize the access token will not be // minted. Must be a subset of scopes. - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + // Wire name: 'user_authorized_scopes' + UserAuthorizedScopes []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCustomAppIntegration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCustomAppIntegration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCustomAppIntegrationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCustomAppIntegrationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCustomAppIntegration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCustomAppIntegration) MarshalJSON() ([]byte, error) { + pb, err := createCustomAppIntegrationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCustomAppIntegrationOutput struct { // OAuth client-id generated by the Databricks - ClientId string `json:"client_id,omitempty"` + // Wire name: 'client_id' + ClientId string // OAuth client-secret generated by the Databricks. If this is a // confidential OAuth app client-secret will be generated. - ClientSecret string `json:"client_secret,omitempty"` + // Wire name: 'client_secret' + ClientSecret string // Unique integration id for the custom OAuth app - IntegrationId string `json:"integration_id,omitempty"` + // Wire name: 'integration_id' + IntegrationId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCustomAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCustomAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := createCustomAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePublishedAppIntegration struct { // App id of the OAuth published app integration. For example power-bi, // tableau-deskop - AppId string `json:"app_id,omitempty"` + // Wire name: 'app_id' + AppId string // Token access policy - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePublishedAppIntegration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePublishedAppIntegration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPublishedAppIntegrationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPublishedAppIntegrationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePublishedAppIntegration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePublishedAppIntegration) MarshalJSON() ([]byte, error) { + pb, err := createPublishedAppIntegrationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePublishedAppIntegrationOutput struct { // Unique integration id for the published OAuth app - IntegrationId string `json:"integration_id,omitempty"` + // Wire name: 'integration_id' + IntegrationId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPublishedAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPublishedAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := createPublishedAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest struct { - Policy FederationPolicy `json:"policy"` + + // Wire name: 'policy' + Policy FederationPolicy // The identifier for the federation policy. The identifier must contain // only lowercase alphanumeric characters, numbers, hyphens, and slashes. If // unspecified, the id will be assigned by Databricks. - PolicyId string `json:"-" url:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` // The service principal id for the federation policy. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createServicePrincipalFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createServicePrincipalFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := createServicePrincipalFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateServicePrincipalSecretRequest struct { // The lifetime of the secret in seconds. If this parameter is not provided, // the secret will have a default lifetime of 730 days (63072000s). - Lifetime string `json:"lifetime,omitempty"` + // Wire name: 'lifetime' + Lifetime string // The service principal ID. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateServicePrincipalSecretRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateServicePrincipalSecretRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createServicePrincipalSecretRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createServicePrincipalSecretRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateServicePrincipalSecretRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateServicePrincipalSecretRequest) MarshalJSON() ([]byte, error) { + pb, err := createServicePrincipalSecretRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateServicePrincipalSecretResponse struct { // UTC time when the secret was created - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // UTC time when the secret will expire. If the field is not present, the // secret does not expire. - ExpireTime string `json:"expire_time,omitempty"` + // Wire name: 'expire_time' + ExpireTime string // ID of the secret - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Secret Value - Secret string `json:"secret,omitempty"` + // Wire name: 'secret' + Secret string // Secret Hash - SecretHash string `json:"secret_hash,omitempty"` + // Wire name: 'secret_hash' + SecretHash string // Status of the secret - Status string `json:"status,omitempty"` + // Wire name: 'status' + Status string // UTC time when the secret was updated - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateServicePrincipalSecretResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateServicePrincipalSecretResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createServicePrincipalSecretResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createServicePrincipalSecretResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { + pb, err := createServicePrincipalSecretResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete account federation policy type DeleteAccountFederationPolicyRequest struct { // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *DeleteAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteCustomAppIntegrationOutput struct { } +func (st *DeleteCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCustomAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCustomAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := deleteCustomAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete Custom OAuth App Integration type DeleteCustomAppIntegrationRequest struct { - IntegrationId string `json:"-" url:"-"` + + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` +} + +func (st *DeleteCustomAppIntegrationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCustomAppIntegrationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCustomAppIntegrationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCustomAppIntegrationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCustomAppIntegrationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeletePublishedAppIntegrationOutput struct { } +func (st *DeletePublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePublishedAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePublishedAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := deletePublishedAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete Published OAuth App Integration type DeletePublishedAppIntegrationRequest struct { - IntegrationId string `json:"-" url:"-"` + + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` +} + +func (st *DeletePublishedAppIntegrationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePublishedAppIntegrationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePublishedAppIntegrationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePublishedAppIntegrationRequest) MarshalJSON() ([]byte, error) { + pb, err := deletePublishedAppIntegrationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete service principal federation policy type DeleteServicePrincipalFederationPolicyRequest struct { // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` // The service principal id for the federation policy. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` +} + +func (st *DeleteServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteServicePrincipalFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteServicePrincipalFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteServicePrincipalFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete service principal secret type DeleteServicePrincipalSecretRequest struct { // The secret ID. - SecretId string `json:"-" url:"-"` + // Wire name: 'secret_id' + SecretId string `tf:"-"` // The service principal ID. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` +} + +func (st *DeleteServicePrincipalSecretRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteServicePrincipalSecretRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteServicePrincipalSecretRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteServicePrincipalSecretRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteServicePrincipalSecretRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FederationPolicy struct { // Creation time of the federation policy. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // Description of the federation policy. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Resource name for the federation policy. Example values include // `accounts//federationPolicies/my-federation-policy` for // Account Federation Policies, and @@ -227,275 +605,633 @@ type FederationPolicy struct { // for Service Principal Federation Policies. Typically an output parameter, // which does not need to be specified in create or update requests. If // specified in a request, must match the value in the request URL. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Specifies the policy to use for validating OIDC claims in your federated // tokens. - OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` + // Wire name: 'oidc_policy' + OidcPolicy *OidcFederationPolicy // The ID of the federation policy. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // The service principal ID that this federation policy applies to. Only set // for service principal federation policies. - ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 // Unique, immutable id of the federation policy. - Uid string `json:"uid,omitempty"` + // Wire name: 'uid' + Uid string // Last update time of the federation policy. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FederationPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FederationPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &federationPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := federationPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FederationPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FederationPolicy) MarshalJSON() ([]byte, error) { + pb, err := federationPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get account federation policy type GetAccountFederationPolicyRequest struct { // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` +} + +func (st *GetAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCustomAppIntegrationOutput struct { // The client id of the custom OAuth app - ClientId string `json:"client_id,omitempty"` + // Wire name: 'client_id' + ClientId string // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential bool `json:"confidential,omitempty"` + // Wire name: 'confidential' + Confidential bool - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string - CreatedBy int64 `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy int64 - CreatorUsername string `json:"creator_username,omitempty"` + // Wire name: 'creator_username' + CreatorUsername string // ID of this custom app - IntegrationId string `json:"integration_id,omitempty"` + // Wire name: 'integration_id' + IntegrationId string // The display name of the custom OAuth app - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // List of OAuth redirect urls - RedirectUrls []string `json:"redirect_urls,omitempty"` + // Wire name: 'redirect_urls' + RedirectUrls []string - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string // Token access policy - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy // Scopes that will need to be consented by end user to mint the access // token. If the user does not authorize the access token will not be // minted. Must be a subset of scopes. - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + // Wire name: 'user_authorized_scopes' + UserAuthorizedScopes []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCustomAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCustomAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := getCustomAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get OAuth Custom App Integration type GetCustomAppIntegrationRequest struct { // The OAuth app integration ID. - IntegrationId string `json:"-" url:"-"` + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` +} + +func (st *GetCustomAppIntegrationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCustomAppIntegrationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCustomAppIntegrationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCustomAppIntegrationRequest) MarshalJSON() ([]byte, error) { + pb, err := getCustomAppIntegrationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCustomAppIntegrationsOutput struct { // List of Custom OAuth App Integrations defined for the account. - Apps []GetCustomAppIntegrationOutput `json:"apps,omitempty"` + // Wire name: 'apps' + Apps []GetCustomAppIntegrationOutput - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetCustomAppIntegrationsOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetCustomAppIntegrationsOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCustomAppIntegrationsOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCustomAppIntegrationsOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetCustomAppIntegrationsOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetCustomAppIntegrationsOutput) MarshalJSON() ([]byte, error) { + pb, err := getCustomAppIntegrationsOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPublishedAppIntegrationOutput struct { // App-id of the published app integration - AppId string `json:"app_id,omitempty"` + // Wire name: 'app_id' + AppId string - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string - CreatedBy int64 `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy int64 // Unique integration id for the published OAuth app - IntegrationId string `json:"integration_id,omitempty"` + // Wire name: 'integration_id' + IntegrationId string // Display name of the published OAuth app - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Token access policy - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := getPublishedAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get OAuth Published App Integration type GetPublishedAppIntegrationRequest struct { - IntegrationId string `json:"-" url:"-"` + + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` +} + +func (st *GetPublishedAppIntegrationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedAppIntegrationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedAppIntegrationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPublishedAppIntegrationRequest) MarshalJSON() ([]byte, error) { + pb, err := getPublishedAppIntegrationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPublishedAppIntegrationsOutput struct { // List of Published OAuth App Integrations defined for the account. - Apps []GetPublishedAppIntegrationOutput `json:"apps,omitempty"` + // Wire name: 'apps' + Apps []GetPublishedAppIntegrationOutput - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPublishedAppIntegrationsOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPublishedAppIntegrationsOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedAppIntegrationsOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedAppIntegrationsOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPublishedAppIntegrationsOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPublishedAppIntegrationsOutput) MarshalJSON() ([]byte, error) { + pb, err := getPublishedAppIntegrationsOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPublishedAppsOutput struct { // List of Published OAuth Apps. - Apps []PublishedAppOutput `json:"apps,omitempty"` + // Wire name: 'apps' + Apps []PublishedAppOutput // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPublishedAppsOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPublishedAppsOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPublishedAppsOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPublishedAppsOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPublishedAppsOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPublishedAppsOutput) MarshalJSON() ([]byte, error) { + pb, err := getPublishedAppsOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get service principal federation policy type GetServicePrincipalFederationPolicyRequest struct { // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` // The service principal id for the federation policy. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` +} + +func (st *GetServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServicePrincipalFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServicePrincipalFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getServicePrincipalFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List account federation policies type ListAccountFederationPoliciesRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAccountFederationPoliciesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAccountFederationPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAccountFederationPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAccountFederationPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAccountFederationPoliciesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAccountFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listAccountFederationPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get custom oauth app integrations type ListCustomAppIntegrationsRequest struct { - IncludeCreatorUsername bool `json:"-" url:"include_creator_username,omitempty"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'include_creator_username' + IncludeCreatorUsername bool `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'page_token' + PageToken string `tf:"-"` + + ForceSendFields []string `tf:"-"` } -func (s *ListCustomAppIntegrationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListCustomAppIntegrationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCustomAppIntegrationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCustomAppIntegrationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListCustomAppIntegrationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListCustomAppIntegrationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listCustomAppIntegrationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListFederationPoliciesResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Policies []FederationPolicy `json:"policies,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'policies' + Policies []FederationPolicy - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFederationPoliciesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFederationPoliciesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFederationPoliciesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFederationPoliciesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { + pb, err := listFederationPoliciesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get all the published OAuth apps type ListOAuthPublishedAppsRequest struct { // The max number of OAuth published apps to return in one page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // A token that can be used to get the next page of results. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListOAuthPublishedAppsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListOAuthPublishedAppsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listOAuthPublishedAppsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listOAuthPublishedAppsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListOAuthPublishedAppsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListOAuthPublishedAppsRequest) MarshalJSON() ([]byte, error) { + pb, err := listOAuthPublishedAppsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get published oauth app integrations type ListPublishedAppIntegrationsRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPublishedAppIntegrationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPublishedAppIntegrationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPublishedAppIntegrationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPublishedAppIntegrationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPublishedAppIntegrationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPublishedAppIntegrationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listPublishedAppIntegrationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List service principal federation policies type ListServicePrincipalFederationPoliciesRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` // The service principal id for the federation policy. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListServicePrincipalFederationPoliciesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListServicePrincipalFederationPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listServicePrincipalFederationPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listServicePrincipalFederationPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListServicePrincipalFederationPoliciesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListServicePrincipalFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listServicePrincipalFederationPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List service principal secrets @@ -509,36 +1245,74 @@ type ListServicePrincipalSecretsRequest struct { // the response contains no `next_page_token`. Note that the number of // entries returned must not be used to determine when the listing is // complete. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The service principal ID. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListServicePrincipalSecretsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListServicePrincipalSecretsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listServicePrincipalSecretsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listServicePrincipalSecretsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListServicePrincipalSecretsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListServicePrincipalSecretsRequest) MarshalJSON() ([]byte, error) { + pb, err := listServicePrincipalSecretsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListServicePrincipalSecretsResponse struct { // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // List of the secrets - Secrets []SecretInfo `json:"secrets,omitempty"` + // Wire name: 'secrets' + Secrets []SecretInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListServicePrincipalSecretsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListServicePrincipalSecretsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listServicePrincipalSecretsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listServicePrincipalSecretsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListServicePrincipalSecretsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListServicePrincipalSecretsResponse) MarshalJSON() ([]byte, error) { + pb, err := listServicePrincipalSecretsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Specifies the policy to use for validating OIDC claims in your federated @@ -550,190 +1324,485 @@ type OidcFederationPolicy struct { // the token matches at least one audience in the policy, the token is // considered a match. If audiences is unspecified, defaults to your // Databricks account id. - Audiences []string `json:"audiences,omitempty"` + // Wire name: 'audiences' + Audiences []string // The required token issuer, as specified in the 'iss' claim of federated // tokens. - Issuer string `json:"issuer,omitempty"` + // Wire name: 'issuer' + Issuer string // The public keys used to validate the signature of federated tokens, in // JWKS format. Most use cases should not need to specify this field. If // jwks_uri and jwks_json are both unspecified (recommended), Databricks // automatically fetches the public keys from your issuer’s well known // endpoint. Databricks strongly recommends relying on your issuer’s well // known endpoint for discovering public keys. - JwksJson string `json:"jwks_json,omitempty"` + // Wire name: 'jwks_json' + JwksJson string // URL of the public keys used to validate the signature of federated // tokens, in JWKS format. Most use cases should not need to specify this // field. If jwks_uri and jwks_json are both unspecified (recommended), // Databricks automatically fetches the public keys from your issuer’s // well known endpoint. Databricks strongly recommends relying on your // issuer’s well known endpoint for discovering public keys. - JwksUri string `json:"jwks_uri,omitempty"` + // Wire name: 'jwks_uri' + JwksUri string // The required token subject, as specified in the subject claim of // federated tokens. Must be specified for service principal federation // policies. Must not be specified for account federation policies. - Subject string `json:"subject,omitempty"` + // Wire name: 'subject' + Subject string // The claim that contains the subject of the token. If unspecified, the // default value is 'sub'. - SubjectClaim string `json:"subject_claim,omitempty"` + // Wire name: 'subject_claim' + SubjectClaim string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OidcFederationPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OidcFederationPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &oidcFederationPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := oidcFederationPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OidcFederationPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OidcFederationPolicy) MarshalJSON() ([]byte, error) { + pb, err := oidcFederationPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PublishedAppOutput struct { // Unique ID of the published OAuth app. - AppId string `json:"app_id,omitempty"` + // Wire name: 'app_id' + AppId string // Client ID of the published OAuth app. It is the client_id in the OAuth // flow - ClientId string `json:"client_id,omitempty"` + // Wire name: 'client_id' + ClientId string // Description of the published OAuth app. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Whether the published OAuth app is a confidential client. It is always // false for published OAuth apps. - IsConfidentialClient bool `json:"is_confidential_client,omitempty"` + // Wire name: 'is_confidential_client' + IsConfidentialClient bool // The display name of the published OAuth app. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Redirect URLs of the published OAuth app. - RedirectUrls []string `json:"redirect_urls,omitempty"` + // Wire name: 'redirect_urls' + RedirectUrls []string // Required scopes for the published OAuth app. - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PublishedAppOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PublishedAppOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &publishedAppOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := publishedAppOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PublishedAppOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PublishedAppOutput) MarshalJSON() ([]byte, error) { + pb, err := publishedAppOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SecretInfo struct { // UTC time when the secret was created - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // UTC time when the secret will expire. If the field is not present, the // secret does not expire. - ExpireTime string `json:"expire_time,omitempty"` + // Wire name: 'expire_time' + ExpireTime string // ID of the secret - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Secret Hash - SecretHash string `json:"secret_hash,omitempty"` + // Wire name: 'secret_hash' + SecretHash string // Status of the secret - Status string `json:"status,omitempty"` + // Wire name: 'status' + Status string // UTC time when the secret was updated - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SecretInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SecretInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &secretInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := secretInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SecretInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SecretInfo) MarshalJSON() ([]byte, error) { + pb, err := secretInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenAccessPolicy struct { // access token time to live in minutes - AccessTokenTtlInMinutes int `json:"access_token_ttl_in_minutes,omitempty"` + // Wire name: 'access_token_ttl_in_minutes' + AccessTokenTtlInMinutes int // refresh token time to live in minutes - RefreshTokenTtlInMinutes int `json:"refresh_token_ttl_in_minutes,omitempty"` + // Wire name: 'refresh_token_ttl_in_minutes' + RefreshTokenTtlInMinutes int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenAccessPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenAccessPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenAccessPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenAccessPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenAccessPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenAccessPolicy) MarshalJSON() ([]byte, error) { + pb, err := tokenAccessPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update account federation policy type UpdateAccountFederationPolicyRequest struct { - Policy FederationPolicy `json:"policy"` + + // Wire name: 'policy' + Policy FederationPolicy // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` // The field mask specifies which fields of the policy to update. To specify // multiple fields in the field mask, use comma as the separator (no space). // The special value '*' indicates that all fields should be updated (full // replacement). If unspecified, all fields that are set in the policy // provided in the update request will overwrite the corresponding fields in // the existing policy. Example value: 'description,oidc_policy.audiences'. - UpdateMask string `json:"-" url:"update_mask,omitempty"` + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAccountFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAccountFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAccountFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCustomAppIntegration struct { - IntegrationId string `json:"-" url:"-"` + + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` // List of OAuth redirect urls to be updated in the custom OAuth app // integration - RedirectUrls []string `json:"redirect_urls,omitempty"` + // Wire name: 'redirect_urls' + RedirectUrls []string // List of OAuth scopes to be updated in the custom OAuth app integration, // similar to redirect URIs this will fully replace the existing values // instead of appending - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string // Token access policy to be updated in the custom OAuth app integration - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy // Scopes that will need to be consented by end user to mint the access // token. If the user does not authorize the access token will not be // minted. Must be a subset of scopes. - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + // Wire name: 'user_authorized_scopes' + UserAuthorizedScopes []string +} + +func (st *UpdateCustomAppIntegration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCustomAppIntegrationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCustomAppIntegrationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCustomAppIntegration) MarshalJSON() ([]byte, error) { + pb, err := updateCustomAppIntegrationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCustomAppIntegrationOutput struct { } +func (st *UpdateCustomAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCustomAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCustomAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := updateCustomAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdatePublishedAppIntegration struct { - IntegrationId string `json:"-" url:"-"` + + // Wire name: 'integration_id' + IntegrationId string `tf:"-"` // Token access policy to be updated in the published OAuth app integration - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + // Wire name: 'token_access_policy' + TokenAccessPolicy *TokenAccessPolicy +} + +func (st *UpdatePublishedAppIntegration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePublishedAppIntegrationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePublishedAppIntegrationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdatePublishedAppIntegration) MarshalJSON() ([]byte, error) { + pb, err := updatePublishedAppIntegrationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdatePublishedAppIntegrationOutput struct { } +func (st *UpdatePublishedAppIntegrationOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePublishedAppIntegrationOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePublishedAppIntegrationOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdatePublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { + pb, err := updatePublishedAppIntegrationOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest struct { - Policy FederationPolicy `json:"policy"` + + // Wire name: 'policy' + Policy FederationPolicy // The identifier for the federation policy. - PolicyId string `json:"-" url:"-"` + // Wire name: 'policy_id' + PolicyId string `tf:"-"` // The service principal id for the federation policy. - ServicePrincipalId int64 `json:"-" url:"-"` + // Wire name: 'service_principal_id' + ServicePrincipalId int64 `tf:"-"` // The field mask specifies which fields of the policy to update. To specify // multiple fields in the field mask, use comma as the separator (no space). // The special value '*' indicates that all fields should be updated (full // replacement). If unspecified, all fields that are set in the policy // provided in the update request will overwrite the corresponding fields in // the existing policy. Example value: 'description,oidc_policy.audiences'. - UpdateMask string `json:"-" url:"update_mask,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} - -func (s *UpdateServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s UpdateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` + + ForceSendFields []string `tf:"-"` +} + +func (st *UpdateServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateServicePrincipalFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateServicePrincipalFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := updateServicePrincipalFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/pipelines/impl.go b/service/pipelines/impl.go index 53232ecd0..7da1d8459 100755 --- a/service/pipelines/impl.go +++ b/service/pipelines/impl.go @@ -18,64 +18,192 @@ type pipelinesImpl struct { } func (a *pipelinesImpl) Create(ctx context.Context, request CreatePipeline) (*CreatePipelineResponse, error) { - var createPipelineResponse CreatePipelineResponse + + requestPb, pbErr := createPipelineToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createPipelineResponsePb createPipelineResponsePb path := "/api/2.0/pipelines" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPipelineResponse) - return &createPipelineResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createPipelineResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createPipelineResponseFromPb(&createPipelineResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) Delete(ctx context.Context, request DeletePipelineRequest) error { - var deletePipelineResponse DeletePipelineResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + + requestPb, pbErr := deletePipelineRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deletePipelineResponsePb deletePipelineResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePipelineResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deletePipelineResponsePb, + ) + if err != nil { + return err + } + return err } func (a *pipelinesImpl) Get(ctx context.Context, request GetPipelineRequest) (*GetPipelineResponse, error) { - var getPipelineResponse GetPipelineResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + + requestPb, pbErr := getPipelineRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPipelineResponsePb getPipelineResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPipelineResponse) - return &getPipelineResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPipelineResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPipelineResponseFromPb(&getPipelineResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) GetPermissionLevels(ctx context.Context, request GetPipelinePermissionLevelsRequest) (*GetPipelinePermissionLevelsResponse, error) { - var getPipelinePermissionLevelsResponse GetPipelinePermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v/permissionLevels", request.PipelineId) + + requestPb, pbErr := getPipelinePermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getPipelinePermissionLevelsResponsePb getPipelinePermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v/permissionLevels", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPipelinePermissionLevelsResponse) - return &getPipelinePermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getPipelinePermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getPipelinePermissionLevelsResponseFromPb(&getPipelinePermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) GetPermissions(ctx context.Context, request GetPipelinePermissionsRequest) (*PipelinePermissions, error) { - var pipelinePermissions PipelinePermissions - path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + + requestPb, pbErr := getPipelinePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var pipelinePermissionsPb pipelinePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &pipelinePermissions) - return &pipelinePermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &pipelinePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := pipelinePermissionsFromPb(&pipelinePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) GetUpdate(ctx context.Context, request GetUpdateRequest) (*GetUpdateResponse, error) { - var getUpdateResponse GetUpdateResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v/updates/%v", request.PipelineId, request.UpdateId) + + requestPb, pbErr := getUpdateRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getUpdateResponsePb getUpdateResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v/updates/%v", requestPb.PipelineId, requestPb.UpdateId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getUpdateResponse) - return &getUpdateResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getUpdateResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getUpdateResponseFromPb(&getUpdateResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List pipeline events. @@ -114,13 +242,35 @@ func (a *pipelinesImpl) ListPipelineEventsAll(ctx context.Context, request ListP } func (a *pipelinesImpl) internalListPipelineEvents(ctx context.Context, request ListPipelineEventsRequest) (*ListPipelineEventsResponse, error) { - var listPipelineEventsResponse ListPipelineEventsResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v/events", request.PipelineId) + + requestPb, pbErr := listPipelineEventsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listPipelineEventsResponsePb listPipelineEventsResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v/events", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPipelineEventsResponse) - return &listPipelineEventsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listPipelineEventsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listPipelineEventsResponseFromPb(&listPipelineEventsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List pipelines. @@ -159,75 +309,221 @@ func (a *pipelinesImpl) ListPipelinesAll(ctx context.Context, request ListPipeli } func (a *pipelinesImpl) internalListPipelines(ctx context.Context, request ListPipelinesRequest) (*ListPipelinesResponse, error) { - var listPipelinesResponse ListPipelinesResponse + + requestPb, pbErr := listPipelinesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listPipelinesResponsePb listPipelinesResponsePb path := "/api/2.0/pipelines" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPipelinesResponse) - return &listPipelinesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listPipelinesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listPipelinesResponseFromPb(&listPipelinesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) ListUpdates(ctx context.Context, request ListUpdatesRequest) (*ListUpdatesResponse, error) { - var listUpdatesResponse ListUpdatesResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", request.PipelineId) + + requestPb, pbErr := listUpdatesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listUpdatesResponsePb listUpdatesResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUpdatesResponse) - return &listUpdatesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listUpdatesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listUpdatesResponseFromPb(&listUpdatesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) SetPermissions(ctx context.Context, request PipelinePermissionsRequest) (*PipelinePermissions, error) { - var pipelinePermissions PipelinePermissions - path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + + requestPb, pbErr := pipelinePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var pipelinePermissionsPb pipelinePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &pipelinePermissions) - return &pipelinePermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &pipelinePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := pipelinePermissionsFromPb(&pipelinePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) StartUpdate(ctx context.Context, request StartUpdate) (*StartUpdateResponse, error) { - var startUpdateResponse StartUpdateResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", request.PipelineId) + + requestPb, pbErr := startUpdateToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var startUpdateResponsePb startUpdateResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &startUpdateResponse) - return &startUpdateResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &startUpdateResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := startUpdateResponseFromPb(&startUpdateResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *pipelinesImpl) Stop(ctx context.Context, request StopRequest) error { - var stopPipelineResponse StopPipelineResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v/stop", request.PipelineId) + + requestPb, pbErr := stopRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var stopPipelineResponsePb stopPipelineResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v/stop", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopPipelineResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &stopPipelineResponsePb, + ) + if err != nil { + return err + } + return err } func (a *pipelinesImpl) Update(ctx context.Context, request EditPipeline) error { - var editPipelineResponse EditPipelineResponse - path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + + requestPb, pbErr := editPipelineToPb(&request) + if pbErr != nil { + return pbErr + } + + var editPipelineResponsePb editPipelineResponsePb + path := fmt.Sprintf("/api/2.0/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &editPipelineResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &editPipelineResponsePb, + ) + if err != nil { + return err + } + return err } func (a *pipelinesImpl) UpdatePermissions(ctx context.Context, request PipelinePermissionsRequest) (*PipelinePermissions, error) { - var pipelinePermissions PipelinePermissions - path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + + requestPb, pbErr := pipelinePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var pipelinePermissionsPb pipelinePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", requestPb.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &pipelinePermissions) - return &pipelinePermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &pipelinePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := pipelinePermissionsFromPb(&pipelinePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/pipelines/internal.go b/service/pipelines/internal.go new file mode 100755 index 000000000..8ad8dba6e --- /dev/null +++ b/service/pipelines/internal.go @@ -0,0 +1,3212 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package pipelines + +import ( + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/compute" +) + +func createPipelineToPb(st *CreatePipeline) (*createPipelinePb, error) { + if st == nil { + return nil, nil + } + pb := &createPipelinePb{} + pb.AllowDuplicateNames = st.AllowDuplicateNames + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Catalog = st.Catalog + + pb.Channel = st.Channel + + pb.Clusters = st.Clusters + + pb.Configuration = st.Configuration + + pb.Continuous = st.Continuous + + pb.Deployment = st.Deployment + + pb.Development = st.Development + + pb.DryRun = st.DryRun + + pb.Edition = st.Edition + + pb.EventLog = st.EventLog + + pb.Filters = st.Filters + + pb.GatewayDefinition = st.GatewayDefinition + + pb.Id = st.Id + + pb.IngestionDefinition = st.IngestionDefinition + + pb.Libraries = st.Libraries + + pb.Name = st.Name + + pb.Notifications = st.Notifications + + pb.Photon = st.Photon + + pb.RestartWindow = st.RestartWindow + + pb.RootPath = st.RootPath + + pb.RunAs = st.RunAs + + pb.Schema = st.Schema + + pb.Serverless = st.Serverless + + pb.Storage = st.Storage + + pb.Target = st.Target + + pb.Trigger = st.Trigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPipelinePb struct { + AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Channel string `json:"channel,omitempty"` + + Clusters []PipelineCluster `json:"clusters,omitempty"` + + Configuration map[string]string `json:"configuration,omitempty"` + + Continuous bool `json:"continuous,omitempty"` + + Deployment *PipelineDeployment `json:"deployment,omitempty"` + + Development bool `json:"development,omitempty"` + + DryRun bool `json:"dry_run,omitempty"` + + Edition string `json:"edition,omitempty"` + + EventLog *EventLogSpec `json:"event_log,omitempty"` + + Filters *Filters `json:"filters,omitempty"` + + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + + Id string `json:"id,omitempty"` + + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + + Libraries []PipelineLibrary `json:"libraries,omitempty"` + + Name string `json:"name,omitempty"` + + Notifications []Notifications `json:"notifications,omitempty"` + + Photon bool `json:"photon,omitempty"` + + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + + RootPath string `json:"root_path,omitempty"` + + RunAs *RunAs `json:"run_as,omitempty"` + + Schema string `json:"schema,omitempty"` + + Serverless bool `json:"serverless,omitempty"` + + Storage string `json:"storage,omitempty"` + + Target string `json:"target,omitempty"` + + Trigger *PipelineTrigger `json:"trigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPipelineFromPb(pb *createPipelinePb) (*CreatePipeline, error) { + if pb == nil { + return nil, nil + } + st := &CreatePipeline{} + st.AllowDuplicateNames = pb.AllowDuplicateNames + st.BudgetPolicyId = pb.BudgetPolicyId + st.Catalog = pb.Catalog + st.Channel = pb.Channel + st.Clusters = pb.Clusters + st.Configuration = pb.Configuration + st.Continuous = pb.Continuous + st.Deployment = pb.Deployment + st.Development = pb.Development + st.DryRun = pb.DryRun + st.Edition = pb.Edition + st.EventLog = pb.EventLog + st.Filters = pb.Filters + st.GatewayDefinition = pb.GatewayDefinition + st.Id = pb.Id + st.IngestionDefinition = pb.IngestionDefinition + st.Libraries = pb.Libraries + st.Name = pb.Name + st.Notifications = pb.Notifications + st.Photon = pb.Photon + st.RestartWindow = pb.RestartWindow + st.RootPath = pb.RootPath + st.RunAs = pb.RunAs + st.Schema = pb.Schema + st.Serverless = pb.Serverless + st.Storage = pb.Storage + st.Target = pb.Target + st.Trigger = pb.Trigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPipelinePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPipelinePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPipelineResponseToPb(st *CreatePipelineResponse) (*createPipelineResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createPipelineResponsePb{} + pb.EffectiveSettings = st.EffectiveSettings + + pb.PipelineId = st.PipelineId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPipelineResponsePb struct { + EffectiveSettings *PipelineSpec `json:"effective_settings,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPipelineResponseFromPb(pb *createPipelineResponsePb) (*CreatePipelineResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreatePipelineResponse{} + st.EffectiveSettings = pb.EffectiveSettings + st.PipelineId = pb.PipelineId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPipelineResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPipelineResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cronTriggerToPb(st *CronTrigger) (*cronTriggerPb, error) { + if st == nil { + return nil, nil + } + pb := &cronTriggerPb{} + pb.QuartzCronSchedule = st.QuartzCronSchedule + + pb.TimezoneId = st.TimezoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cronTriggerPb struct { + QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` + + TimezoneId string `json:"timezone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cronTriggerFromPb(pb *cronTriggerPb) (*CronTrigger, error) { + if pb == nil { + return nil, nil + } + st := &CronTrigger{} + st.QuartzCronSchedule = pb.QuartzCronSchedule + st.TimezoneId = pb.TimezoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cronTriggerPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cronTriggerPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dataPlaneIdToPb(st *DataPlaneId) (*dataPlaneIdPb, error) { + if st == nil { + return nil, nil + } + pb := &dataPlaneIdPb{} + pb.Instance = st.Instance + + pb.SeqNo = st.SeqNo + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dataPlaneIdPb struct { + Instance string `json:"instance,omitempty"` + + SeqNo int64 `json:"seq_no,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dataPlaneIdFromPb(pb *dataPlaneIdPb) (*DataPlaneId, error) { + if pb == nil { + return nil, nil + } + st := &DataPlaneId{} + st.Instance = pb.Instance + st.SeqNo = pb.SeqNo + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dataPlaneIdPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dataPlaneIdPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deletePipelineRequestToPb(st *DeletePipelineRequest) (*deletePipelineRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePipelineRequestPb{} + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type deletePipelineRequestPb struct { + PipelineId string `json:"-" url:"-"` +} + +func deletePipelineRequestFromPb(pb *deletePipelineRequestPb) (*DeletePipelineRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeletePipelineRequest{} + st.PipelineId = pb.PipelineId + + return st, nil +} + +func deletePipelineResponseToPb(st *DeletePipelineResponse) (*deletePipelineResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deletePipelineResponsePb{} + + return pb, nil +} + +type deletePipelineResponsePb struct { +} + +func deletePipelineResponseFromPb(pb *deletePipelineResponsePb) (*DeletePipelineResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeletePipelineResponse{} + + return st, nil +} + +func editPipelineToPb(st *EditPipeline) (*editPipelinePb, error) { + if st == nil { + return nil, nil + } + pb := &editPipelinePb{} + pb.AllowDuplicateNames = st.AllowDuplicateNames + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Catalog = st.Catalog + + pb.Channel = st.Channel + + pb.Clusters = st.Clusters + + pb.Configuration = st.Configuration + + pb.Continuous = st.Continuous + + pb.Deployment = st.Deployment + + pb.Development = st.Development + + pb.Edition = st.Edition + + pb.EventLog = st.EventLog + + pb.ExpectedLastModified = st.ExpectedLastModified + + pb.Filters = st.Filters + + pb.GatewayDefinition = st.GatewayDefinition + + pb.Id = st.Id + + pb.IngestionDefinition = st.IngestionDefinition + + pb.Libraries = st.Libraries + + pb.Name = st.Name + + pb.Notifications = st.Notifications + + pb.Photon = st.Photon + + pb.PipelineId = st.PipelineId + + pb.RestartWindow = st.RestartWindow + + pb.RootPath = st.RootPath + + pb.RunAs = st.RunAs + + pb.Schema = st.Schema + + pb.Serverless = st.Serverless + + pb.Storage = st.Storage + + pb.Target = st.Target + + pb.Trigger = st.Trigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editPipelinePb struct { + AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Channel string `json:"channel,omitempty"` + + Clusters []PipelineCluster `json:"clusters,omitempty"` + + Configuration map[string]string `json:"configuration,omitempty"` + + Continuous bool `json:"continuous,omitempty"` + + Deployment *PipelineDeployment `json:"deployment,omitempty"` + + Development bool `json:"development,omitempty"` + + Edition string `json:"edition,omitempty"` + + EventLog *EventLogSpec `json:"event_log,omitempty"` + + ExpectedLastModified int64 `json:"expected_last_modified,omitempty"` + + Filters *Filters `json:"filters,omitempty"` + + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + + Id string `json:"id,omitempty"` + + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + + Libraries []PipelineLibrary `json:"libraries,omitempty"` + + Name string `json:"name,omitempty"` + + Notifications []Notifications `json:"notifications,omitempty"` + + Photon bool `json:"photon,omitempty"` + + PipelineId string `json:"-" url:"-"` + + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + + RootPath string `json:"root_path,omitempty"` + + RunAs *RunAs `json:"run_as,omitempty"` + + Schema string `json:"schema,omitempty"` + + Serverless bool `json:"serverless,omitempty"` + + Storage string `json:"storage,omitempty"` + + Target string `json:"target,omitempty"` + + Trigger *PipelineTrigger `json:"trigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editPipelineFromPb(pb *editPipelinePb) (*EditPipeline, error) { + if pb == nil { + return nil, nil + } + st := &EditPipeline{} + st.AllowDuplicateNames = pb.AllowDuplicateNames + st.BudgetPolicyId = pb.BudgetPolicyId + st.Catalog = pb.Catalog + st.Channel = pb.Channel + st.Clusters = pb.Clusters + st.Configuration = pb.Configuration + st.Continuous = pb.Continuous + st.Deployment = pb.Deployment + st.Development = pb.Development + st.Edition = pb.Edition + st.EventLog = pb.EventLog + st.ExpectedLastModified = pb.ExpectedLastModified + st.Filters = pb.Filters + st.GatewayDefinition = pb.GatewayDefinition + st.Id = pb.Id + st.IngestionDefinition = pb.IngestionDefinition + st.Libraries = pb.Libraries + st.Name = pb.Name + st.Notifications = pb.Notifications + st.Photon = pb.Photon + st.PipelineId = pb.PipelineId + st.RestartWindow = pb.RestartWindow + st.RootPath = pb.RootPath + st.RunAs = pb.RunAs + st.Schema = pb.Schema + st.Serverless = pb.Serverless + st.Storage = pb.Storage + st.Target = pb.Target + st.Trigger = pb.Trigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editPipelinePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editPipelinePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editPipelineResponseToPb(st *EditPipelineResponse) (*editPipelineResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editPipelineResponsePb{} + + return pb, nil +} + +type editPipelineResponsePb struct { +} + +func editPipelineResponseFromPb(pb *editPipelineResponsePb) (*EditPipelineResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditPipelineResponse{} + + return st, nil +} + +func errorDetailToPb(st *ErrorDetail) (*errorDetailPb, error) { + if st == nil { + return nil, nil + } + pb := &errorDetailPb{} + pb.Exceptions = st.Exceptions + + pb.Fatal = st.Fatal + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type errorDetailPb struct { + Exceptions []SerializedException `json:"exceptions,omitempty"` + + Fatal bool `json:"fatal,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func errorDetailFromPb(pb *errorDetailPb) (*ErrorDetail, error) { + if pb == nil { + return nil, nil + } + st := &ErrorDetail{} + st.Exceptions = pb.Exceptions + st.Fatal = pb.Fatal + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *errorDetailPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st errorDetailPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func eventLogSpecToPb(st *EventLogSpec) (*eventLogSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &eventLogSpecPb{} + pb.Catalog = st.Catalog + + pb.Name = st.Name + + pb.Schema = st.Schema + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type eventLogSpecPb struct { + Catalog string `json:"catalog,omitempty"` + + Name string `json:"name,omitempty"` + + Schema string `json:"schema,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func eventLogSpecFromPb(pb *eventLogSpecPb) (*EventLogSpec, error) { + if pb == nil { + return nil, nil + } + st := &EventLogSpec{} + st.Catalog = pb.Catalog + st.Name = pb.Name + st.Schema = pb.Schema + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *eventLogSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st eventLogSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fileLibraryToPb(st *FileLibrary) (*fileLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := &fileLibraryPb{} + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type fileLibraryPb struct { + Path string `json:"path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func fileLibraryFromPb(pb *fileLibraryPb) (*FileLibrary, error) { + if pb == nil { + return nil, nil + } + st := &FileLibrary{} + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *fileLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st fileLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func filtersToPb(st *Filters) (*filtersPb, error) { + if st == nil { + return nil, nil + } + pb := &filtersPb{} + pb.Exclude = st.Exclude + + pb.Include = st.Include + + return pb, nil +} + +type filtersPb struct { + Exclude []string `json:"exclude,omitempty"` + + Include []string `json:"include,omitempty"` +} + +func filtersFromPb(pb *filtersPb) (*Filters, error) { + if pb == nil { + return nil, nil + } + st := &Filters{} + st.Exclude = pb.Exclude + st.Include = pb.Include + + return st, nil +} + +func getPipelinePermissionLevelsRequestToPb(st *GetPipelinePermissionLevelsRequest) (*getPipelinePermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPipelinePermissionLevelsRequestPb{} + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type getPipelinePermissionLevelsRequestPb struct { + PipelineId string `json:"-" url:"-"` +} + +func getPipelinePermissionLevelsRequestFromPb(pb *getPipelinePermissionLevelsRequestPb) (*GetPipelinePermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPipelinePermissionLevelsRequest{} + st.PipelineId = pb.PipelineId + + return st, nil +} + +func getPipelinePermissionLevelsResponseToPb(st *GetPipelinePermissionLevelsResponse) (*getPipelinePermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPipelinePermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getPipelinePermissionLevelsResponsePb struct { + PermissionLevels []PipelinePermissionsDescription `json:"permission_levels,omitempty"` +} + +func getPipelinePermissionLevelsResponseFromPb(pb *getPipelinePermissionLevelsResponsePb) (*GetPipelinePermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPipelinePermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getPipelinePermissionsRequestToPb(st *GetPipelinePermissionsRequest) (*getPipelinePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPipelinePermissionsRequestPb{} + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type getPipelinePermissionsRequestPb struct { + PipelineId string `json:"-" url:"-"` +} + +func getPipelinePermissionsRequestFromPb(pb *getPipelinePermissionsRequestPb) (*GetPipelinePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPipelinePermissionsRequest{} + st.PipelineId = pb.PipelineId + + return st, nil +} + +func getPipelineRequestToPb(st *GetPipelineRequest) (*getPipelineRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPipelineRequestPb{} + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type getPipelineRequestPb struct { + PipelineId string `json:"-" url:"-"` +} + +func getPipelineRequestFromPb(pb *getPipelineRequestPb) (*GetPipelineRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPipelineRequest{} + st.PipelineId = pb.PipelineId + + return st, nil +} + +func getPipelineResponseToPb(st *GetPipelineResponse) (*getPipelineResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getPipelineResponsePb{} + pb.Cause = st.Cause + + pb.ClusterId = st.ClusterId + + pb.CreatorUserName = st.CreatorUserName + + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.Health = st.Health + + pb.LastModified = st.LastModified + + pb.LatestUpdates = st.LatestUpdates + + pb.Name = st.Name + + pb.PipelineId = st.PipelineId + + pb.RunAsUserName = st.RunAsUserName + + pb.Spec = st.Spec + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPipelineResponsePb struct { + Cause string `json:"cause,omitempty"` + + ClusterId string `json:"cluster_id,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + Health GetPipelineResponseHealth `json:"health,omitempty"` + + LastModified int64 `json:"last_modified,omitempty"` + + LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + + Name string `json:"name,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + RunAsUserName string `json:"run_as_user_name,omitempty"` + + Spec *PipelineSpec `json:"spec,omitempty"` + + State PipelineState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPipelineResponseFromPb(pb *getPipelineResponsePb) (*GetPipelineResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetPipelineResponse{} + st.Cause = pb.Cause + st.ClusterId = pb.ClusterId + st.CreatorUserName = pb.CreatorUserName + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + st.Health = pb.Health + st.LastModified = pb.LastModified + st.LatestUpdates = pb.LatestUpdates + st.Name = pb.Name + st.PipelineId = pb.PipelineId + st.RunAsUserName = pb.RunAsUserName + st.Spec = pb.Spec + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPipelineResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPipelineResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getUpdateRequestToPb(st *GetUpdateRequest) (*getUpdateRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getUpdateRequestPb{} + pb.PipelineId = st.PipelineId + + pb.UpdateId = st.UpdateId + + return pb, nil +} + +type getUpdateRequestPb struct { + PipelineId string `json:"-" url:"-"` + + UpdateId string `json:"-" url:"-"` +} + +func getUpdateRequestFromPb(pb *getUpdateRequestPb) (*GetUpdateRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetUpdateRequest{} + st.PipelineId = pb.PipelineId + st.UpdateId = pb.UpdateId + + return st, nil +} + +func getUpdateResponseToPb(st *GetUpdateResponse) (*getUpdateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getUpdateResponsePb{} + pb.Update = st.Update + + return pb, nil +} + +type getUpdateResponsePb struct { + Update *UpdateInfo `json:"update,omitempty"` +} + +func getUpdateResponseFromPb(pb *getUpdateResponsePb) (*GetUpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetUpdateResponse{} + st.Update = pb.Update + + return st, nil +} + +func ingestionConfigToPb(st *IngestionConfig) (*ingestionConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &ingestionConfigPb{} + pb.Report = st.Report + + pb.Schema = st.Schema + + pb.Table = st.Table + + return pb, nil +} + +type ingestionConfigPb struct { + Report *ReportSpec `json:"report,omitempty"` + + Schema *SchemaSpec `json:"schema,omitempty"` + + Table *TableSpec `json:"table,omitempty"` +} + +func ingestionConfigFromPb(pb *ingestionConfigPb) (*IngestionConfig, error) { + if pb == nil { + return nil, nil + } + st := &IngestionConfig{} + st.Report = pb.Report + st.Schema = pb.Schema + st.Table = pb.Table + + return st, nil +} + +func ingestionGatewayPipelineDefinitionToPb(st *IngestionGatewayPipelineDefinition) (*ingestionGatewayPipelineDefinitionPb, error) { + if st == nil { + return nil, nil + } + pb := &ingestionGatewayPipelineDefinitionPb{} + pb.ConnectionId = st.ConnectionId + + pb.ConnectionName = st.ConnectionName + + pb.GatewayStorageCatalog = st.GatewayStorageCatalog + + pb.GatewayStorageName = st.GatewayStorageName + + pb.GatewayStorageSchema = st.GatewayStorageSchema + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type ingestionGatewayPipelineDefinitionPb struct { + ConnectionId string `json:"connection_id,omitempty"` + + ConnectionName string `json:"connection_name"` + + GatewayStorageCatalog string `json:"gateway_storage_catalog"` + + GatewayStorageName string `json:"gateway_storage_name,omitempty"` + + GatewayStorageSchema string `json:"gateway_storage_schema"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func ingestionGatewayPipelineDefinitionFromPb(pb *ingestionGatewayPipelineDefinitionPb) (*IngestionGatewayPipelineDefinition, error) { + if pb == nil { + return nil, nil + } + st := &IngestionGatewayPipelineDefinition{} + st.ConnectionId = pb.ConnectionId + st.ConnectionName = pb.ConnectionName + st.GatewayStorageCatalog = pb.GatewayStorageCatalog + st.GatewayStorageName = pb.GatewayStorageName + st.GatewayStorageSchema = pb.GatewayStorageSchema + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *ingestionGatewayPipelineDefinitionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st ingestionGatewayPipelineDefinitionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func ingestionPipelineDefinitionToPb(st *IngestionPipelineDefinition) (*ingestionPipelineDefinitionPb, error) { + if st == nil { + return nil, nil + } + pb := &ingestionPipelineDefinitionPb{} + pb.ConnectionName = st.ConnectionName + + pb.IngestionGatewayId = st.IngestionGatewayId + + pb.Objects = st.Objects + + pb.SourceType = st.SourceType + + pb.TableConfiguration = st.TableConfiguration + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type ingestionPipelineDefinitionPb struct { + ConnectionName string `json:"connection_name,omitempty"` + + IngestionGatewayId string `json:"ingestion_gateway_id,omitempty"` + + Objects []IngestionConfig `json:"objects,omitempty"` + + SourceType IngestionSourceType `json:"source_type,omitempty"` + + TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func ingestionPipelineDefinitionFromPb(pb *ingestionPipelineDefinitionPb) (*IngestionPipelineDefinition, error) { + if pb == nil { + return nil, nil + } + st := &IngestionPipelineDefinition{} + st.ConnectionName = pb.ConnectionName + st.IngestionGatewayId = pb.IngestionGatewayId + st.Objects = pb.Objects + st.SourceType = pb.SourceType + st.TableConfiguration = pb.TableConfiguration + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *ingestionPipelineDefinitionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st ingestionPipelineDefinitionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPipelineEventsRequestToPb(st *ListPipelineEventsRequest) (*listPipelineEventsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listPipelineEventsRequestPb{} + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.PipelineId = st.PipelineId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPipelineEventsRequestPb struct { + Filter string `json:"-" url:"filter,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + OrderBy []string `json:"-" url:"order_by,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + PipelineId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPipelineEventsRequestFromPb(pb *listPipelineEventsRequestPb) (*ListPipelineEventsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListPipelineEventsRequest{} + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + st.PipelineId = pb.PipelineId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPipelineEventsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPipelineEventsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPipelineEventsResponseToPb(st *ListPipelineEventsResponse) (*listPipelineEventsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listPipelineEventsResponsePb{} + pb.Events = st.Events + + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPipelineEventsResponsePb struct { + Events []PipelineEvent `json:"events,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPipelineEventsResponseFromPb(pb *listPipelineEventsResponsePb) (*ListPipelineEventsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListPipelineEventsResponse{} + st.Events = pb.Events + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPipelineEventsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPipelineEventsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPipelinesRequestToPb(st *ListPipelinesRequest) (*listPipelinesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listPipelinesRequestPb{} + pb.Filter = st.Filter + + pb.MaxResults = st.MaxResults + + pb.OrderBy = st.OrderBy + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPipelinesRequestPb struct { + Filter string `json:"-" url:"filter,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + OrderBy []string `json:"-" url:"order_by,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPipelinesRequestFromPb(pb *listPipelinesRequestPb) (*ListPipelinesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListPipelinesRequest{} + st.Filter = pb.Filter + st.MaxResults = pb.MaxResults + st.OrderBy = pb.OrderBy + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPipelinesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPipelinesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPipelinesResponseToPb(st *ListPipelinesResponse) (*listPipelinesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listPipelinesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Statuses = st.Statuses + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPipelinesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Statuses []PipelineStateInfo `json:"statuses,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPipelinesResponseFromPb(pb *listPipelinesResponsePb) (*ListPipelinesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListPipelinesResponse{} + st.NextPageToken = pb.NextPageToken + st.Statuses = pb.Statuses + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPipelinesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPipelinesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listUpdatesRequestToPb(st *ListUpdatesRequest) (*listUpdatesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listUpdatesRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.PipelineId = st.PipelineId + + pb.UntilUpdateId = st.UntilUpdateId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listUpdatesRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + PipelineId string `json:"-" url:"-"` + + UntilUpdateId string `json:"-" url:"until_update_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listUpdatesRequestFromPb(pb *listUpdatesRequestPb) (*ListUpdatesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListUpdatesRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.PipelineId = pb.PipelineId + st.UntilUpdateId = pb.UntilUpdateId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listUpdatesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listUpdatesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listUpdatesResponseToPb(st *ListUpdatesResponse) (*listUpdatesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listUpdatesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.PrevPageToken = st.PrevPageToken + + pb.Updates = st.Updates + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listUpdatesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PrevPageToken string `json:"prev_page_token,omitempty"` + + Updates []UpdateInfo `json:"updates,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listUpdatesResponseFromPb(pb *listUpdatesResponsePb) (*ListUpdatesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListUpdatesResponse{} + st.NextPageToken = pb.NextPageToken + st.PrevPageToken = pb.PrevPageToken + st.Updates = pb.Updates + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listUpdatesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listUpdatesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func manualTriggerToPb(st *ManualTrigger) (*manualTriggerPb, error) { + if st == nil { + return nil, nil + } + pb := &manualTriggerPb{} + + return pb, nil +} + +type manualTriggerPb struct { +} + +func manualTriggerFromPb(pb *manualTriggerPb) (*ManualTrigger, error) { + if pb == nil { + return nil, nil + } + st := &ManualTrigger{} + + return st, nil +} + +func notebookLibraryToPb(st *NotebookLibrary) (*notebookLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := ¬ebookLibraryPb{} + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type notebookLibraryPb struct { + Path string `json:"path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func notebookLibraryFromPb(pb *notebookLibraryPb) (*NotebookLibrary, error) { + if pb == nil { + return nil, nil + } + st := &NotebookLibrary{} + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *notebookLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st notebookLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func notificationsToPb(st *Notifications) (*notificationsPb, error) { + if st == nil { + return nil, nil + } + pb := ¬ificationsPb{} + pb.Alerts = st.Alerts + + pb.EmailRecipients = st.EmailRecipients + + return pb, nil +} + +type notificationsPb struct { + Alerts []string `json:"alerts,omitempty"` + + EmailRecipients []string `json:"email_recipients,omitempty"` +} + +func notificationsFromPb(pb *notificationsPb) (*Notifications, error) { + if pb == nil { + return nil, nil + } + st := &Notifications{} + st.Alerts = pb.Alerts + st.EmailRecipients = pb.EmailRecipients + + return st, nil +} + +func originToPb(st *Origin) (*originPb, error) { + if st == nil { + return nil, nil + } + pb := &originPb{} + pb.BatchId = st.BatchId + + pb.Cloud = st.Cloud + + pb.ClusterId = st.ClusterId + + pb.DatasetName = st.DatasetName + + pb.FlowId = st.FlowId + + pb.FlowName = st.FlowName + + pb.Host = st.Host + + pb.MaintenanceId = st.MaintenanceId + + pb.MaterializationName = st.MaterializationName + + pb.OrgId = st.OrgId + + pb.PipelineId = st.PipelineId + + pb.PipelineName = st.PipelineName + + pb.Region = st.Region + + pb.RequestId = st.RequestId + + pb.TableId = st.TableId + + pb.UcResourceId = st.UcResourceId + + pb.UpdateId = st.UpdateId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type originPb struct { + BatchId int64 `json:"batch_id,omitempty"` + + Cloud string `json:"cloud,omitempty"` + + ClusterId string `json:"cluster_id,omitempty"` + + DatasetName string `json:"dataset_name,omitempty"` + + FlowId string `json:"flow_id,omitempty"` + + FlowName string `json:"flow_name,omitempty"` + + Host string `json:"host,omitempty"` + + MaintenanceId string `json:"maintenance_id,omitempty"` + + MaterializationName string `json:"materialization_name,omitempty"` + + OrgId int64 `json:"org_id,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + PipelineName string `json:"pipeline_name,omitempty"` + + Region string `json:"region,omitempty"` + + RequestId string `json:"request_id,omitempty"` + + TableId string `json:"table_id,omitempty"` + + UcResourceId string `json:"uc_resource_id,omitempty"` + + UpdateId string `json:"update_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func originFromPb(pb *originPb) (*Origin, error) { + if pb == nil { + return nil, nil + } + st := &Origin{} + st.BatchId = pb.BatchId + st.Cloud = pb.Cloud + st.ClusterId = pb.ClusterId + st.DatasetName = pb.DatasetName + st.FlowId = pb.FlowId + st.FlowName = pb.FlowName + st.Host = pb.Host + st.MaintenanceId = pb.MaintenanceId + st.MaterializationName = pb.MaterializationName + st.OrgId = pb.OrgId + st.PipelineId = pb.PipelineId + st.PipelineName = pb.PipelineName + st.Region = pb.Region + st.RequestId = pb.RequestId + st.TableId = pb.TableId + st.UcResourceId = pb.UcResourceId + st.UpdateId = pb.UpdateId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *originPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st originPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pathPatternToPb(st *PathPattern) (*pathPatternPb, error) { + if st == nil { + return nil, nil + } + pb := &pathPatternPb{} + pb.Include = st.Include + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pathPatternPb struct { + Include string `json:"include,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pathPatternFromPb(pb *pathPatternPb) (*PathPattern, error) { + if pb == nil { + return nil, nil + } + st := &PathPattern{} + st.Include = pb.Include + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pathPatternPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pathPatternPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineAccessControlRequestToPb(st *PipelineAccessControlRequest) (*pipelineAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineAccessControlRequestFromPb(pb *pipelineAccessControlRequestPb) (*PipelineAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &PipelineAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineAccessControlResponseToPb(st *PipelineAccessControlResponse) (*pipelineAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineAccessControlResponsePb struct { + AllPermissions []PipelinePermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineAccessControlResponseFromPb(pb *pipelineAccessControlResponsePb) (*PipelineAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &PipelineAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineClusterToPb(st *PipelineCluster) (*pipelineClusterPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineClusterPb{} + pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues + + pb.Autoscale = st.Autoscale + + pb.AwsAttributes = st.AwsAttributes + + pb.AzureAttributes = st.AzureAttributes + + pb.ClusterLogConf = st.ClusterLogConf + + pb.CustomTags = st.CustomTags + + pb.DriverInstancePoolId = st.DriverInstancePoolId + + pb.DriverNodeTypeId = st.DriverNodeTypeId + + pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption + + pb.GcpAttributes = st.GcpAttributes + + pb.InitScripts = st.InitScripts + + pb.InstancePoolId = st.InstancePoolId + + pb.Label = st.Label + + pb.NodeTypeId = st.NodeTypeId + + pb.NumWorkers = st.NumWorkers + + pb.PolicyId = st.PolicyId + + pb.SparkConf = st.SparkConf + + pb.SparkEnvVars = st.SparkEnvVars + + pb.SshPublicKeys = st.SshPublicKeys + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineClusterPb struct { + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + + Autoscale *PipelineClusterAutoscale `json:"autoscale,omitempty"` + + AwsAttributes *compute.AwsAttributes `json:"aws_attributes,omitempty"` + + AzureAttributes *compute.AzureAttributes `json:"azure_attributes,omitempty"` + + ClusterLogConf *compute.ClusterLogConf `json:"cluster_log_conf,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + + GcpAttributes *compute.GcpAttributes `json:"gcp_attributes,omitempty"` + + InitScripts []compute.InitScriptInfo `json:"init_scripts,omitempty"` + + InstancePoolId string `json:"instance_pool_id,omitempty"` + + Label string `json:"label,omitempty"` + + NodeTypeId string `json:"node_type_id,omitempty"` + + NumWorkers int `json:"num_workers,omitempty"` + + PolicyId string `json:"policy_id,omitempty"` + + SparkConf map[string]string `json:"spark_conf,omitempty"` + + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineClusterFromPb(pb *pipelineClusterPb) (*PipelineCluster, error) { + if pb == nil { + return nil, nil + } + st := &PipelineCluster{} + st.ApplyPolicyDefaultValues = pb.ApplyPolicyDefaultValues + st.Autoscale = pb.Autoscale + st.AwsAttributes = pb.AwsAttributes + st.AzureAttributes = pb.AzureAttributes + st.ClusterLogConf = pb.ClusterLogConf + st.CustomTags = pb.CustomTags + st.DriverInstancePoolId = pb.DriverInstancePoolId + st.DriverNodeTypeId = pb.DriverNodeTypeId + st.EnableLocalDiskEncryption = pb.EnableLocalDiskEncryption + st.GcpAttributes = pb.GcpAttributes + st.InitScripts = pb.InitScripts + st.InstancePoolId = pb.InstancePoolId + st.Label = pb.Label + st.NodeTypeId = pb.NodeTypeId + st.NumWorkers = pb.NumWorkers + st.PolicyId = pb.PolicyId + st.SparkConf = pb.SparkConf + st.SparkEnvVars = pb.SparkEnvVars + st.SshPublicKeys = pb.SshPublicKeys + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineClusterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineClusterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineClusterAutoscaleToPb(st *PipelineClusterAutoscale) (*pipelineClusterAutoscalePb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineClusterAutoscalePb{} + pb.MaxWorkers = st.MaxWorkers + + pb.MinWorkers = st.MinWorkers + + pb.Mode = st.Mode + + return pb, nil +} + +type pipelineClusterAutoscalePb struct { + MaxWorkers int `json:"max_workers"` + + MinWorkers int `json:"min_workers"` + + Mode PipelineClusterAutoscaleMode `json:"mode,omitempty"` +} + +func pipelineClusterAutoscaleFromPb(pb *pipelineClusterAutoscalePb) (*PipelineClusterAutoscale, error) { + if pb == nil { + return nil, nil + } + st := &PipelineClusterAutoscale{} + st.MaxWorkers = pb.MaxWorkers + st.MinWorkers = pb.MinWorkers + st.Mode = pb.Mode + + return st, nil +} + +func pipelineDeploymentToPb(st *PipelineDeployment) (*pipelineDeploymentPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineDeploymentPb{} + pb.Kind = st.Kind + + pb.MetadataFilePath = st.MetadataFilePath + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineDeploymentPb struct { + Kind DeploymentKind `json:"kind"` + + MetadataFilePath string `json:"metadata_file_path,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineDeploymentFromPb(pb *pipelineDeploymentPb) (*PipelineDeployment, error) { + if pb == nil { + return nil, nil + } + st := &PipelineDeployment{} + st.Kind = pb.Kind + st.MetadataFilePath = pb.MetadataFilePath + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineDeploymentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineDeploymentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineEventToPb(st *PipelineEvent) (*pipelineEventPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineEventPb{} + pb.Error = st.Error + + pb.EventType = st.EventType + + pb.Id = st.Id + + pb.Level = st.Level + + pb.MaturityLevel = st.MaturityLevel + + pb.Message = st.Message + + pb.Origin = st.Origin + + pb.Sequence = st.Sequence + + pb.Timestamp = st.Timestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineEventPb struct { + Error *ErrorDetail `json:"error,omitempty"` + + EventType string `json:"event_type,omitempty"` + + Id string `json:"id,omitempty"` + + Level EventLevel `json:"level,omitempty"` + + MaturityLevel MaturityLevel `json:"maturity_level,omitempty"` + + Message string `json:"message,omitempty"` + + Origin *Origin `json:"origin,omitempty"` + + Sequence *Sequencing `json:"sequence,omitempty"` + + Timestamp string `json:"timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineEventFromPb(pb *pipelineEventPb) (*PipelineEvent, error) { + if pb == nil { + return nil, nil + } + st := &PipelineEvent{} + st.Error = pb.Error + st.EventType = pb.EventType + st.Id = pb.Id + st.Level = pb.Level + st.MaturityLevel = pb.MaturityLevel + st.Message = pb.Message + st.Origin = pb.Origin + st.Sequence = pb.Sequence + st.Timestamp = pb.Timestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineEventPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineEventPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineLibraryToPb(st *PipelineLibrary) (*pipelineLibraryPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineLibraryPb{} + pb.File = st.File + + pb.Glob = st.Glob + + pb.Jar = st.Jar + + pb.Maven = st.Maven + + pb.Notebook = st.Notebook + + pb.Whl = st.Whl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineLibraryPb struct { + File *FileLibrary `json:"file,omitempty"` + + Glob *PathPattern `json:"glob,omitempty"` + + Jar string `json:"jar,omitempty"` + + Maven *compute.MavenLibrary `json:"maven,omitempty"` + + Notebook *NotebookLibrary `json:"notebook,omitempty"` + + Whl string `json:"whl,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineLibraryFromPb(pb *pipelineLibraryPb) (*PipelineLibrary, error) { + if pb == nil { + return nil, nil + } + st := &PipelineLibrary{} + st.File = pb.File + st.Glob = pb.Glob + st.Jar = pb.Jar + st.Maven = pb.Maven + st.Notebook = pb.Notebook + st.Whl = pb.Whl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineLibraryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineLibraryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelinePermissionToPb(st *PipelinePermission) (*pipelinePermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelinePermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelinePermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelinePermissionFromPb(pb *pipelinePermissionPb) (*PipelinePermission, error) { + if pb == nil { + return nil, nil + } + st := &PipelinePermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelinePermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelinePermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelinePermissionsToPb(st *PipelinePermissions) (*pipelinePermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelinePermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelinePermissionsPb struct { + AccessControlList []PipelineAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelinePermissionsFromPb(pb *pipelinePermissionsPb) (*PipelinePermissions, error) { + if pb == nil { + return nil, nil + } + st := &PipelinePermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelinePermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelinePermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelinePermissionsDescriptionToPb(st *PipelinePermissionsDescription) (*pipelinePermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelinePermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelinePermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelinePermissionsDescriptionFromPb(pb *pipelinePermissionsDescriptionPb) (*PipelinePermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &PipelinePermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelinePermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelinePermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelinePermissionsRequestToPb(st *PipelinePermissionsRequest) (*pipelinePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelinePermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type pipelinePermissionsRequestPb struct { + AccessControlList []PipelineAccessControlRequest `json:"access_control_list,omitempty"` + + PipelineId string `json:"-" url:"-"` +} + +func pipelinePermissionsRequestFromPb(pb *pipelinePermissionsRequestPb) (*PipelinePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &PipelinePermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.PipelineId = pb.PipelineId + + return st, nil +} + +func pipelineSpecToPb(st *PipelineSpec) (*pipelineSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineSpecPb{} + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Catalog = st.Catalog + + pb.Channel = st.Channel + + pb.Clusters = st.Clusters + + pb.Configuration = st.Configuration + + pb.Continuous = st.Continuous + + pb.Deployment = st.Deployment + + pb.Development = st.Development + + pb.Edition = st.Edition + + pb.EventLog = st.EventLog + + pb.Filters = st.Filters + + pb.GatewayDefinition = st.GatewayDefinition + + pb.Id = st.Id + + pb.IngestionDefinition = st.IngestionDefinition + + pb.Libraries = st.Libraries + + pb.Name = st.Name + + pb.Notifications = st.Notifications + + pb.Photon = st.Photon + + pb.RestartWindow = st.RestartWindow + + pb.RootPath = st.RootPath + + pb.Schema = st.Schema + + pb.Serverless = st.Serverless + + pb.Storage = st.Storage + + pb.Target = st.Target + + pb.Trigger = st.Trigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineSpecPb struct { + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Channel string `json:"channel,omitempty"` + + Clusters []PipelineCluster `json:"clusters,omitempty"` + + Configuration map[string]string `json:"configuration,omitempty"` + + Continuous bool `json:"continuous,omitempty"` + + Deployment *PipelineDeployment `json:"deployment,omitempty"` + + Development bool `json:"development,omitempty"` + + Edition string `json:"edition,omitempty"` + + EventLog *EventLogSpec `json:"event_log,omitempty"` + + Filters *Filters `json:"filters,omitempty"` + + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + + Id string `json:"id,omitempty"` + + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + + Libraries []PipelineLibrary `json:"libraries,omitempty"` + + Name string `json:"name,omitempty"` + + Notifications []Notifications `json:"notifications,omitempty"` + + Photon bool `json:"photon,omitempty"` + + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + + RootPath string `json:"root_path,omitempty"` + + Schema string `json:"schema,omitempty"` + + Serverless bool `json:"serverless,omitempty"` + + Storage string `json:"storage,omitempty"` + + Target string `json:"target,omitempty"` + + Trigger *PipelineTrigger `json:"trigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineSpecFromPb(pb *pipelineSpecPb) (*PipelineSpec, error) { + if pb == nil { + return nil, nil + } + st := &PipelineSpec{} + st.BudgetPolicyId = pb.BudgetPolicyId + st.Catalog = pb.Catalog + st.Channel = pb.Channel + st.Clusters = pb.Clusters + st.Configuration = pb.Configuration + st.Continuous = pb.Continuous + st.Deployment = pb.Deployment + st.Development = pb.Development + st.Edition = pb.Edition + st.EventLog = pb.EventLog + st.Filters = pb.Filters + st.GatewayDefinition = pb.GatewayDefinition + st.Id = pb.Id + st.IngestionDefinition = pb.IngestionDefinition + st.Libraries = pb.Libraries + st.Name = pb.Name + st.Notifications = pb.Notifications + st.Photon = pb.Photon + st.RestartWindow = pb.RestartWindow + st.RootPath = pb.RootPath + st.Schema = pb.Schema + st.Serverless = pb.Serverless + st.Storage = pb.Storage + st.Target = pb.Target + st.Trigger = pb.Trigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineStateInfoToPb(st *PipelineStateInfo) (*pipelineStateInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineStateInfoPb{} + pb.ClusterId = st.ClusterId + + pb.CreatorUserName = st.CreatorUserName + + pb.Health = st.Health + + pb.LatestUpdates = st.LatestUpdates + + pb.Name = st.Name + + pb.PipelineId = st.PipelineId + + pb.RunAsUserName = st.RunAsUserName + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pipelineStateInfoPb struct { + ClusterId string `json:"cluster_id,omitempty"` + + CreatorUserName string `json:"creator_user_name,omitempty"` + + Health PipelineStateInfoHealth `json:"health,omitempty"` + + LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + + Name string `json:"name,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + RunAsUserName string `json:"run_as_user_name,omitempty"` + + State PipelineState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pipelineStateInfoFromPb(pb *pipelineStateInfoPb) (*PipelineStateInfo, error) { + if pb == nil { + return nil, nil + } + st := &PipelineStateInfo{} + st.ClusterId = pb.ClusterId + st.CreatorUserName = pb.CreatorUserName + st.Health = pb.Health + st.LatestUpdates = pb.LatestUpdates + st.Name = pb.Name + st.PipelineId = pb.PipelineId + st.RunAsUserName = pb.RunAsUserName + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pipelineStateInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pipelineStateInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pipelineTriggerToPb(st *PipelineTrigger) (*pipelineTriggerPb, error) { + if st == nil { + return nil, nil + } + pb := &pipelineTriggerPb{} + pb.Cron = st.Cron + + pb.Manual = st.Manual + + return pb, nil +} + +type pipelineTriggerPb struct { + Cron *CronTrigger `json:"cron,omitempty"` + + Manual *ManualTrigger `json:"manual,omitempty"` +} + +func pipelineTriggerFromPb(pb *pipelineTriggerPb) (*PipelineTrigger, error) { + if pb == nil { + return nil, nil + } + st := &PipelineTrigger{} + st.Cron = pb.Cron + st.Manual = pb.Manual + + return st, nil +} + +func reportSpecToPb(st *ReportSpec) (*reportSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &reportSpecPb{} + pb.DestinationCatalog = st.DestinationCatalog + + pb.DestinationSchema = st.DestinationSchema + + pb.DestinationTable = st.DestinationTable + + pb.SourceUrl = st.SourceUrl + + pb.TableConfiguration = st.TableConfiguration + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type reportSpecPb struct { + DestinationCatalog string `json:"destination_catalog"` + + DestinationSchema string `json:"destination_schema"` + + DestinationTable string `json:"destination_table,omitempty"` + + SourceUrl string `json:"source_url"` + + TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func reportSpecFromPb(pb *reportSpecPb) (*ReportSpec, error) { + if pb == nil { + return nil, nil + } + st := &ReportSpec{} + st.DestinationCatalog = pb.DestinationCatalog + st.DestinationSchema = pb.DestinationSchema + st.DestinationTable = pb.DestinationTable + st.SourceUrl = pb.SourceUrl + st.TableConfiguration = pb.TableConfiguration + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *reportSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st reportSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func restartWindowToPb(st *RestartWindow) (*restartWindowPb, error) { + if st == nil { + return nil, nil + } + pb := &restartWindowPb{} + pb.DaysOfWeek = st.DaysOfWeek + + pb.StartHour = st.StartHour + + pb.TimeZoneId = st.TimeZoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type restartWindowPb struct { + DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` + + StartHour int `json:"start_hour"` + + TimeZoneId string `json:"time_zone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func restartWindowFromPb(pb *restartWindowPb) (*RestartWindow, error) { + if pb == nil { + return nil, nil + } + st := &RestartWindow{} + st.DaysOfWeek = pb.DaysOfWeek + st.StartHour = pb.StartHour + st.TimeZoneId = pb.TimeZoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *restartWindowPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st restartWindowPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func runAsToPb(st *RunAs) (*runAsPb, error) { + if st == nil { + return nil, nil + } + pb := &runAsPb{} + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type runAsPb struct { + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func runAsFromPb(pb *runAsPb) (*RunAs, error) { + if pb == nil { + return nil, nil + } + st := &RunAs{} + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *runAsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st runAsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func schemaSpecToPb(st *SchemaSpec) (*schemaSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &schemaSpecPb{} + pb.DestinationCatalog = st.DestinationCatalog + + pb.DestinationSchema = st.DestinationSchema + + pb.SourceCatalog = st.SourceCatalog + + pb.SourceSchema = st.SourceSchema + + pb.TableConfiguration = st.TableConfiguration + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type schemaSpecPb struct { + DestinationCatalog string `json:"destination_catalog"` + + DestinationSchema string `json:"destination_schema"` + + SourceCatalog string `json:"source_catalog,omitempty"` + + SourceSchema string `json:"source_schema"` + + TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func schemaSpecFromPb(pb *schemaSpecPb) (*SchemaSpec, error) { + if pb == nil { + return nil, nil + } + st := &SchemaSpec{} + st.DestinationCatalog = pb.DestinationCatalog + st.DestinationSchema = pb.DestinationSchema + st.SourceCatalog = pb.SourceCatalog + st.SourceSchema = pb.SourceSchema + st.TableConfiguration = pb.TableConfiguration + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *schemaSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st schemaSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sequencingToPb(st *Sequencing) (*sequencingPb, error) { + if st == nil { + return nil, nil + } + pb := &sequencingPb{} + pb.ControlPlaneSeqNo = st.ControlPlaneSeqNo + + pb.DataPlaneId = st.DataPlaneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sequencingPb struct { + ControlPlaneSeqNo int64 `json:"control_plane_seq_no,omitempty"` + + DataPlaneId *DataPlaneId `json:"data_plane_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sequencingFromPb(pb *sequencingPb) (*Sequencing, error) { + if pb == nil { + return nil, nil + } + st := &Sequencing{} + st.ControlPlaneSeqNo = pb.ControlPlaneSeqNo + st.DataPlaneId = pb.DataPlaneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sequencingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sequencingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func serializedExceptionToPb(st *SerializedException) (*serializedExceptionPb, error) { + if st == nil { + return nil, nil + } + pb := &serializedExceptionPb{} + pb.ClassName = st.ClassName + + pb.Message = st.Message + + pb.Stack = st.Stack + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type serializedExceptionPb struct { + ClassName string `json:"class_name,omitempty"` + + Message string `json:"message,omitempty"` + + Stack []StackFrame `json:"stack,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func serializedExceptionFromPb(pb *serializedExceptionPb) (*SerializedException, error) { + if pb == nil { + return nil, nil + } + st := &SerializedException{} + st.ClassName = pb.ClassName + st.Message = pb.Message + st.Stack = pb.Stack + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *serializedExceptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st serializedExceptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func stackFrameToPb(st *StackFrame) (*stackFramePb, error) { + if st == nil { + return nil, nil + } + pb := &stackFramePb{} + pb.DeclaringClass = st.DeclaringClass + + pb.FileName = st.FileName + + pb.LineNumber = st.LineNumber + + pb.MethodName = st.MethodName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type stackFramePb struct { + DeclaringClass string `json:"declaring_class,omitempty"` + + FileName string `json:"file_name,omitempty"` + + LineNumber int `json:"line_number,omitempty"` + + MethodName string `json:"method_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func stackFrameFromPb(pb *stackFramePb) (*StackFrame, error) { + if pb == nil { + return nil, nil + } + st := &StackFrame{} + st.DeclaringClass = pb.DeclaringClass + st.FileName = pb.FileName + st.LineNumber = pb.LineNumber + st.MethodName = pb.MethodName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *stackFramePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st stackFramePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func startUpdateToPb(st *StartUpdate) (*startUpdatePb, error) { + if st == nil { + return nil, nil + } + pb := &startUpdatePb{} + pb.Cause = st.Cause + + pb.FullRefresh = st.FullRefresh + + pb.FullRefreshSelection = st.FullRefreshSelection + + pb.PipelineId = st.PipelineId + + pb.RefreshSelection = st.RefreshSelection + + pb.ValidateOnly = st.ValidateOnly + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type startUpdatePb struct { + Cause StartUpdateCause `json:"cause,omitempty"` + + FullRefresh bool `json:"full_refresh,omitempty"` + + FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + + PipelineId string `json:"-" url:"-"` + + RefreshSelection []string `json:"refresh_selection,omitempty"` + + ValidateOnly bool `json:"validate_only,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func startUpdateFromPb(pb *startUpdatePb) (*StartUpdate, error) { + if pb == nil { + return nil, nil + } + st := &StartUpdate{} + st.Cause = pb.Cause + st.FullRefresh = pb.FullRefresh + st.FullRefreshSelection = pb.FullRefreshSelection + st.PipelineId = pb.PipelineId + st.RefreshSelection = pb.RefreshSelection + st.ValidateOnly = pb.ValidateOnly + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *startUpdatePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st startUpdatePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func startUpdateResponseToPb(st *StartUpdateResponse) (*startUpdateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &startUpdateResponsePb{} + pb.UpdateId = st.UpdateId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type startUpdateResponsePb struct { + UpdateId string `json:"update_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func startUpdateResponseFromPb(pb *startUpdateResponsePb) (*StartUpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &StartUpdateResponse{} + st.UpdateId = pb.UpdateId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *startUpdateResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st startUpdateResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func stopPipelineResponseToPb(st *StopPipelineResponse) (*stopPipelineResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &stopPipelineResponsePb{} + + return pb, nil +} + +type stopPipelineResponsePb struct { +} + +func stopPipelineResponseFromPb(pb *stopPipelineResponsePb) (*StopPipelineResponse, error) { + if pb == nil { + return nil, nil + } + st := &StopPipelineResponse{} + + return st, nil +} + +func stopRequestToPb(st *StopRequest) (*stopRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &stopRequestPb{} + pb.PipelineId = st.PipelineId + + return pb, nil +} + +type stopRequestPb struct { + PipelineId string `json:"-" url:"-"` +} + +func stopRequestFromPb(pb *stopRequestPb) (*StopRequest, error) { + if pb == nil { + return nil, nil + } + st := &StopRequest{} + st.PipelineId = pb.PipelineId + + return st, nil +} + +func tableSpecToPb(st *TableSpec) (*tableSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &tableSpecPb{} + pb.DestinationCatalog = st.DestinationCatalog + + pb.DestinationSchema = st.DestinationSchema + + pb.DestinationTable = st.DestinationTable + + pb.SourceCatalog = st.SourceCatalog + + pb.SourceSchema = st.SourceSchema + + pb.SourceTable = st.SourceTable + + pb.TableConfiguration = st.TableConfiguration + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableSpecPb struct { + DestinationCatalog string `json:"destination_catalog"` + + DestinationSchema string `json:"destination_schema"` + + DestinationTable string `json:"destination_table,omitempty"` + + SourceCatalog string `json:"source_catalog,omitempty"` + + SourceSchema string `json:"source_schema,omitempty"` + + SourceTable string `json:"source_table"` + + TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableSpecFromPb(pb *tableSpecPb) (*TableSpec, error) { + if pb == nil { + return nil, nil + } + st := &TableSpec{} + st.DestinationCatalog = pb.DestinationCatalog + st.DestinationSchema = pb.DestinationSchema + st.DestinationTable = pb.DestinationTable + st.SourceCatalog = pb.SourceCatalog + st.SourceSchema = pb.SourceSchema + st.SourceTable = pb.SourceTable + st.TableConfiguration = pb.TableConfiguration + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tableSpecificConfigToPb(st *TableSpecificConfig) (*tableSpecificConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &tableSpecificConfigPb{} + pb.ExcludeColumns = st.ExcludeColumns + + pb.IncludeColumns = st.IncludeColumns + + pb.PrimaryKeys = st.PrimaryKeys + + pb.SalesforceIncludeFormulaFields = st.SalesforceIncludeFormulaFields + + pb.ScdType = st.ScdType + + pb.SequenceBy = st.SequenceBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableSpecificConfigPb struct { + ExcludeColumns []string `json:"exclude_columns,omitempty"` + + IncludeColumns []string `json:"include_columns,omitempty"` + + PrimaryKeys []string `json:"primary_keys,omitempty"` + + SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` + + ScdType TableSpecificConfigScdType `json:"scd_type,omitempty"` + + SequenceBy []string `json:"sequence_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableSpecificConfigFromPb(pb *tableSpecificConfigPb) (*TableSpecificConfig, error) { + if pb == nil { + return nil, nil + } + st := &TableSpecificConfig{} + st.ExcludeColumns = pb.ExcludeColumns + st.IncludeColumns = pb.IncludeColumns + st.PrimaryKeys = pb.PrimaryKeys + st.SalesforceIncludeFormulaFields = pb.SalesforceIncludeFormulaFields + st.ScdType = pb.ScdType + st.SequenceBy = pb.SequenceBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableSpecificConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableSpecificConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateInfoToPb(st *UpdateInfo) (*updateInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &updateInfoPb{} + pb.Cause = st.Cause + + pb.ClusterId = st.ClusterId + + pb.Config = st.Config + + pb.CreationTime = st.CreationTime + + pb.FullRefresh = st.FullRefresh + + pb.FullRefreshSelection = st.FullRefreshSelection + + pb.PipelineId = st.PipelineId + + pb.RefreshSelection = st.RefreshSelection + + pb.State = st.State + + pb.UpdateId = st.UpdateId + + pb.ValidateOnly = st.ValidateOnly + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateInfoPb struct { + Cause UpdateInfoCause `json:"cause,omitempty"` + + ClusterId string `json:"cluster_id,omitempty"` + + Config *PipelineSpec `json:"config,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + FullRefresh bool `json:"full_refresh,omitempty"` + + FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + RefreshSelection []string `json:"refresh_selection,omitempty"` + + State UpdateInfoState `json:"state,omitempty"` + + UpdateId string `json:"update_id,omitempty"` + + ValidateOnly bool `json:"validate_only,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateInfoFromPb(pb *updateInfoPb) (*UpdateInfo, error) { + if pb == nil { + return nil, nil + } + st := &UpdateInfo{} + st.Cause = pb.Cause + st.ClusterId = pb.ClusterId + st.Config = pb.Config + st.CreationTime = pb.CreationTime + st.FullRefresh = pb.FullRefresh + st.FullRefreshSelection = pb.FullRefreshSelection + st.PipelineId = pb.PipelineId + st.RefreshSelection = pb.RefreshSelection + st.State = pb.State + st.UpdateId = pb.UpdateId + st.ValidateOnly = pb.ValidateOnly + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateStateInfoToPb(st *UpdateStateInfo) (*updateStateInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &updateStateInfoPb{} + pb.CreationTime = st.CreationTime + + pb.State = st.State + + pb.UpdateId = st.UpdateId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateStateInfoPb struct { + CreationTime string `json:"creation_time,omitempty"` + + State UpdateStateInfoState `json:"state,omitempty"` + + UpdateId string `json:"update_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateStateInfoFromPb(pb *updateStateInfoPb) (*UpdateStateInfo, error) { + if pb == nil { + return nil, nil + } + st := &UpdateStateInfo{} + st.CreationTime = pb.CreationTime + st.State = pb.State + st.UpdateId = pb.UpdateId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateStateInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateStateInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/pipelines/model.go b/service/pipelines/model.go index c8f53b00a..324e64e09 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -3,152 +3,258 @@ package pipelines import ( + "encoding/json" "fmt" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" ) type CreatePipeline struct { // If false, deployment will fail if name conflicts with that of another // pipeline. - AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + // Wire name: 'allow_duplicate_names' + AllowDuplicateNames bool // Budget policy of this pipeline. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // DLT Release Channel that specifies which version to use. - Channel string `json:"channel,omitempty"` + // Wire name: 'channel' + Channel string // Cluster settings for this pipeline deployment. - Clusters []PipelineCluster `json:"clusters,omitempty"` + // Wire name: 'clusters' + Clusters []PipelineCluster // String-String configuration for this pipeline execution. - Configuration map[string]string `json:"configuration,omitempty"` + // Wire name: 'configuration' + Configuration map[string]string // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous bool `json:"continuous,omitempty"` + // Wire name: 'continuous' + Continuous bool // Deployment type of this pipeline. - Deployment *PipelineDeployment `json:"deployment,omitempty"` + // Wire name: 'deployment' + Deployment *PipelineDeployment // Whether the pipeline is in Development mode. Defaults to false. - Development bool `json:"development,omitempty"` + // Wire name: 'development' + Development bool - DryRun bool `json:"dry_run,omitempty"` + // Wire name: 'dry_run' + DryRun bool // Pipeline product edition. - Edition string `json:"edition,omitempty"` + // Wire name: 'edition' + Edition string // Event log configuration for this pipeline - EventLog *EventLogSpec `json:"event_log,omitempty"` + // Wire name: 'event_log' + EventLog *EventLogSpec // Filters on which Pipeline packages to include in the deployed graph. - Filters *Filters `json:"filters,omitempty"` + // Wire name: 'filters' + Filters *Filters // The definition of a gateway pipeline to support change data capture. - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + // Wire name: 'gateway_definition' + GatewayDefinition *IngestionGatewayPipelineDefinition // Unique identifier for this pipeline. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'schema', 'target', or 'catalog' settings. - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + // Wire name: 'ingestion_definition' + IngestionDefinition *IngestionPipelineDefinition // Libraries or code needed by this deployment. - Libraries []PipelineLibrary `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []PipelineLibrary // Friendly identifier for this pipeline. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // List of notification settings for this pipeline. - Notifications []Notifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications []Notifications // Whether Photon is enabled for this pipeline. - Photon bool `json:"photon,omitempty"` + // Wire name: 'photon' + Photon bool // Restart window of this pipeline. - RestartWindow *RestartWindow `json:"restart_window,omitempty"` + // Wire name: 'restart_window' + RestartWindow *RestartWindow // Root path for this pipeline. This is used as the root directory when // editing the pipeline in the Databricks user interface and it is added to // sys.path when executing Python sources during pipeline execution. - RootPath string `json:"root_path,omitempty"` + // Wire name: 'root_path' + RootPath string // Write-only setting, available only in Create/Update calls. Specifies the // user or service principal that the pipeline runs as. If not specified, // the pipeline runs as the user who created the pipeline. // // Only `user_name` or `service_principal_name` can be specified. If both // are specified, an error is thrown. - RunAs *RunAs `json:"run_as,omitempty"` + // Wire name: 'run_as' + RunAs *RunAs // The default schema (database) where tables are read from or published to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // Whether serverless compute is enabled for this pipeline. - Serverless bool `json:"serverless,omitempty"` + // Wire name: 'serverless' + Serverless bool // DBFS root directory for storing checkpoints and tables. - Storage string `json:"storage,omitempty"` + // Wire name: 'storage' + Storage string // Target schema (database) to add tables in this pipeline to. Exactly one // of `schema` or `target` must be specified. To publish to Unity Catalog, // also specify `catalog`. This legacy field is deprecated for pipeline // creation in favor of the `schema` field. - Target string `json:"target,omitempty"` + // Wire name: 'target' + Target string // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger *PipelineTrigger `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger *PipelineTrigger - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePipeline) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePipeline) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPipelinePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPipelineFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePipeline) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePipeline) MarshalJSON() ([]byte, error) { + pb, err := createPipelineToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePipelineResponse struct { // Only returned when dry_run is true. - EffectiveSettings *PipelineSpec `json:"effective_settings,omitempty"` + // Wire name: 'effective_settings' + EffectiveSettings *PipelineSpec // The unique identifier for the newly created pipeline. Only returned when // dry_run is false. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePipelineResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePipelineResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPipelineResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPipelineResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePipelineResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePipelineResponse) MarshalJSON() ([]byte, error) { + pb, err := createPipelineResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CronTrigger struct { - QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` - TimezoneId string `json:"timezone_id,omitempty"` + // Wire name: 'quartz_cron_schedule' + QuartzCronSchedule string + + // Wire name: 'timezone_id' + TimezoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CronTrigger) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CronTrigger) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cronTriggerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cronTriggerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CronTrigger) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CronTrigger) MarshalJSON() ([]byte, error) { + pb, err := cronTriggerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DataPlaneId struct { // The instance name of the data plane emitting an event. - Instance string `json:"instance,omitempty"` + // Wire name: 'instance' + Instance string // A sequence number, unique and increasing within the data plane instance. - SeqNo int64 `json:"seq_no,omitempty"` + // Wire name: 'seq_no' + SeqNo int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DataPlaneId) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DataPlaneId) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataPlaneIdPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataPlaneIdFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DataPlaneId) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DataPlaneId) MarshalJSON() ([]byte, error) { + pb, err := dataPlaneIdToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Days of week in which the restart is allowed to happen (within a five-hour // window starting at start_hour). If not specified all days of the week will be // used. type DayOfWeek string +type dayOfWeekPb string const DayOfWeekFriday DayOfWeek = `FRIDAY` @@ -185,17 +291,86 @@ func (f *DayOfWeek) Type() string { return "DayOfWeek" } +func dayOfWeekToPb(st *DayOfWeek) (*dayOfWeekPb, error) { + if st == nil { + return nil, nil + } + pb := dayOfWeekPb(*st) + return &pb, nil +} + +func dayOfWeekFromPb(pb *dayOfWeekPb) (*DayOfWeek, error) { + if pb == nil { + return nil, nil + } + st := DayOfWeek(*pb) + return &st, nil +} + // Delete a pipeline type DeletePipelineRequest struct { - PipelineId string `json:"-" url:"-"` + + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *DeletePipelineRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePipelineRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePipelineRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePipelineRequest) MarshalJSON() ([]byte, error) { + pb, err := deletePipelineRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeletePipelineResponse struct { } +func (st *DeletePipelineResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePipelineResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePipelineResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePipelineResponse) MarshalJSON() ([]byte, error) { + pb, err := deletePipelineResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The deployment method that manages the pipeline: - BUNDLE: The pipeline is // managed by a Databricks Asset Bundle. type DeploymentKind string +type deploymentKindPb string const DeploymentKindBundle DeploymentKind = `BUNDLE` @@ -220,117 +395,224 @@ func (f *DeploymentKind) Type() string { return "DeploymentKind" } +func deploymentKindToPb(st *DeploymentKind) (*deploymentKindPb, error) { + if st == nil { + return nil, nil + } + pb := deploymentKindPb(*st) + return &pb, nil +} + +func deploymentKindFromPb(pb *deploymentKindPb) (*DeploymentKind, error) { + if pb == nil { + return nil, nil + } + st := DeploymentKind(*pb) + return &st, nil +} + type EditPipeline struct { // If false, deployment will fail if name has changed and conflicts the name // of another pipeline. - AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + // Wire name: 'allow_duplicate_names' + AllowDuplicateNames bool // Budget policy of this pipeline. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // DLT Release Channel that specifies which version to use. - Channel string `json:"channel,omitempty"` + // Wire name: 'channel' + Channel string // Cluster settings for this pipeline deployment. - Clusters []PipelineCluster `json:"clusters,omitempty"` + // Wire name: 'clusters' + Clusters []PipelineCluster // String-String configuration for this pipeline execution. - Configuration map[string]string `json:"configuration,omitempty"` + // Wire name: 'configuration' + Configuration map[string]string // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous bool `json:"continuous,omitempty"` + // Wire name: 'continuous' + Continuous bool // Deployment type of this pipeline. - Deployment *PipelineDeployment `json:"deployment,omitempty"` + // Wire name: 'deployment' + Deployment *PipelineDeployment // Whether the pipeline is in Development mode. Defaults to false. - Development bool `json:"development,omitempty"` + // Wire name: 'development' + Development bool // Pipeline product edition. - Edition string `json:"edition,omitempty"` + // Wire name: 'edition' + Edition string // Event log configuration for this pipeline - EventLog *EventLogSpec `json:"event_log,omitempty"` + // Wire name: 'event_log' + EventLog *EventLogSpec // If present, the last-modified time of the pipeline settings before the // edit. If the settings were modified after that time, then the request // will fail with a conflict. - ExpectedLastModified int64 `json:"expected_last_modified,omitempty"` + // Wire name: 'expected_last_modified' + ExpectedLastModified int64 // Filters on which Pipeline packages to include in the deployed graph. - Filters *Filters `json:"filters,omitempty"` + // Wire name: 'filters' + Filters *Filters // The definition of a gateway pipeline to support change data capture. - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + // Wire name: 'gateway_definition' + GatewayDefinition *IngestionGatewayPipelineDefinition // Unique identifier for this pipeline. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'schema', 'target', or 'catalog' settings. - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + // Wire name: 'ingestion_definition' + IngestionDefinition *IngestionPipelineDefinition // Libraries or code needed by this deployment. - Libraries []PipelineLibrary `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []PipelineLibrary // Friendly identifier for this pipeline. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // List of notification settings for this pipeline. - Notifications []Notifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications []Notifications // Whether Photon is enabled for this pipeline. - Photon bool `json:"photon,omitempty"` + // Wire name: 'photon' + Photon bool // Unique identifier for this pipeline. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` // Restart window of this pipeline. - RestartWindow *RestartWindow `json:"restart_window,omitempty"` + // Wire name: 'restart_window' + RestartWindow *RestartWindow // Root path for this pipeline. This is used as the root directory when // editing the pipeline in the Databricks user interface and it is added to // sys.path when executing Python sources during pipeline execution. - RootPath string `json:"root_path,omitempty"` + // Wire name: 'root_path' + RootPath string // Write-only setting, available only in Create/Update calls. Specifies the // user or service principal that the pipeline runs as. If not specified, // the pipeline runs as the user who created the pipeline. // // Only `user_name` or `service_principal_name` can be specified. If both // are specified, an error is thrown. - RunAs *RunAs `json:"run_as,omitempty"` + // Wire name: 'run_as' + RunAs *RunAs // The default schema (database) where tables are read from or published to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // Whether serverless compute is enabled for this pipeline. - Serverless bool `json:"serverless,omitempty"` + // Wire name: 'serverless' + Serverless bool // DBFS root directory for storing checkpoints and tables. - Storage string `json:"storage,omitempty"` + // Wire name: 'storage' + Storage string // Target schema (database) to add tables in this pipeline to. Exactly one // of `schema` or `target` must be specified. To publish to Unity Catalog, // also specify `catalog`. This legacy field is deprecated for pipeline // creation in favor of the `schema` field. - Target string `json:"target,omitempty"` + // Wire name: 'target' + Target string // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger *PipelineTrigger `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger *PipelineTrigger - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditPipeline) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditPipeline) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editPipelinePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editPipelineFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditPipeline) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditPipeline) MarshalJSON() ([]byte, error) { + pb, err := editPipelineToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EditPipelineResponse struct { } +func (st *EditPipelineResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editPipelineResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editPipelineResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditPipelineResponse) MarshalJSON() ([]byte, error) { + pb, err := editPipelineResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ErrorDetail struct { // The exception thrown for this error, with its chain of cause. - Exceptions []SerializedException `json:"exceptions,omitempty"` + // Wire name: 'exceptions' + Exceptions []SerializedException // Whether this error is considered fatal, that is, unrecoverable. - Fatal bool `json:"fatal,omitempty"` + // Wire name: 'fatal' + Fatal bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ErrorDetail) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ErrorDetail) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &errorDetailPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := errorDetailFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ErrorDetail) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ErrorDetail) MarshalJSON() ([]byte, error) { + pb, err := errorDetailToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The severity level of the event. type EventLevel string +type eventLevelPb string const EventLevelError EventLevel = `ERROR` @@ -361,111 +643,327 @@ func (f *EventLevel) Type() string { return "EventLevel" } +func eventLevelToPb(st *EventLevel) (*eventLevelPb, error) { + if st == nil { + return nil, nil + } + pb := eventLevelPb(*st) + return &pb, nil +} + +func eventLevelFromPb(pb *eventLevelPb) (*EventLevel, error) { + if pb == nil { + return nil, nil + } + st := EventLevel(*pb) + return &st, nil +} + // Configurable event log parameters. type EventLogSpec struct { // The UC catalog the event log is published under. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // The name the event log is published to in UC. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The UC schema the event log is published under. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EventLogSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EventLogSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &eventLogSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := eventLogSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EventLogSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EventLogSpec) MarshalJSON() ([]byte, error) { + pb, err := eventLogSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FileLibrary struct { // The absolute path of the source code. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FileLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FileLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fileLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fileLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FileLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FileLibrary) MarshalJSON() ([]byte, error) { + pb, err := fileLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Filters struct { // Paths to exclude. - Exclude []string `json:"exclude,omitempty"` + // Wire name: 'exclude' + Exclude []string // Paths to include. - Include []string `json:"include,omitempty"` + // Wire name: 'include' + Include []string +} + +func (st *Filters) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &filtersPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := filtersFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Filters) MarshalJSON() ([]byte, error) { + pb, err := filtersToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get pipeline permission levels type GetPipelinePermissionLevelsRequest struct { // The pipeline for which to get or manage permissions. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *GetPipelinePermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPipelinePermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPipelinePermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPipelinePermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getPipelinePermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPipelinePermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []PipelinePermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []PipelinePermissionsDescription +} + +func (st *GetPipelinePermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPipelinePermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPipelinePermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPipelinePermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getPipelinePermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get pipeline permissions type GetPipelinePermissionsRequest struct { // The pipeline for which to get or manage permissions. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *GetPipelinePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPipelinePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPipelinePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPipelinePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getPipelinePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a pipeline type GetPipelineRequest struct { - PipelineId string `json:"-" url:"-"` + + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *GetPipelineRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPipelineRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPipelineRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPipelineRequest) MarshalJSON() ([]byte, error) { + pb, err := getPipelineRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetPipelineResponse struct { // An optional message detailing the cause of the pipeline state. - Cause string `json:"cause,omitempty"` + // Wire name: 'cause' + Cause string // The ID of the cluster that the pipeline is running on. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The username of the pipeline creator. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // Serverless budget policy ID of this pipeline. - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string // The health of a pipeline. - Health GetPipelineResponseHealth `json:"health,omitempty"` + // Wire name: 'health' + Health GetPipelineResponseHealth // The last time the pipeline settings were modified or created. - LastModified int64 `json:"last_modified,omitempty"` + // Wire name: 'last_modified' + LastModified int64 // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + // Wire name: 'latest_updates' + LatestUpdates []UpdateStateInfo // A human friendly identifier for the pipeline, taken from the `spec`. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The ID of the pipeline. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // Username of the user that the pipeline will run on behalf of. - RunAsUserName string `json:"run_as_user_name,omitempty"` + // Wire name: 'run_as_user_name' + RunAsUserName string // The pipeline specification. This field is not returned when called by // `ListPipelines`. - Spec *PipelineSpec `json:"spec,omitempty"` + // Wire name: 'spec' + Spec *PipelineSpec // The pipeline state. - State PipelineState `json:"state,omitempty"` + // Wire name: 'state' + State PipelineState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetPipelineResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetPipelineResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPipelineResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPipelineResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetPipelineResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetPipelineResponse) MarshalJSON() ([]byte, error) { + pb, err := getPipelineResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The health of a pipeline. type GetPipelineResponseHealth string +type getPipelineResponseHealthPb string const GetPipelineResponseHealthHealthy GetPipelineResponseHealth = `HEALTHY` @@ -492,91 +990,233 @@ func (f *GetPipelineResponseHealth) Type() string { return "GetPipelineResponseHealth" } +func getPipelineResponseHealthToPb(st *GetPipelineResponseHealth) (*getPipelineResponseHealthPb, error) { + if st == nil { + return nil, nil + } + pb := getPipelineResponseHealthPb(*st) + return &pb, nil +} + +func getPipelineResponseHealthFromPb(pb *getPipelineResponseHealthPb) (*GetPipelineResponseHealth, error) { + if pb == nil { + return nil, nil + } + st := GetPipelineResponseHealth(*pb) + return &st, nil +} + // Get a pipeline update type GetUpdateRequest struct { // The ID of the pipeline. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` // The ID of the update. - UpdateId string `json:"-" url:"-"` + // Wire name: 'update_id' + UpdateId string `tf:"-"` +} + +func (st *GetUpdateRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getUpdateRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getUpdateRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetUpdateRequest) MarshalJSON() ([]byte, error) { + pb, err := getUpdateRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetUpdateResponse struct { // The current update info. - Update *UpdateInfo `json:"update,omitempty"` + // Wire name: 'update' + Update *UpdateInfo +} + +func (st *GetUpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getUpdateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getUpdateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetUpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := getUpdateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IngestionConfig struct { // Select a specific source report. - Report *ReportSpec `json:"report,omitempty"` + // Wire name: 'report' + Report *ReportSpec // Select all tables from a specific source schema. - Schema *SchemaSpec `json:"schema,omitempty"` + // Wire name: 'schema' + Schema *SchemaSpec // Select a specific source table. - Table *TableSpec `json:"table,omitempty"` + // Wire name: 'table' + Table *TableSpec +} + +func (st *IngestionConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ingestionConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ingestionConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st IngestionConfig) MarshalJSON() ([]byte, error) { + pb, err := ingestionConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IngestionGatewayPipelineDefinition struct { // [Deprecated, use connection_name instead] Immutable. The Unity Catalog // connection that this gateway pipeline uses to communicate with the // source. - ConnectionId string `json:"connection_id,omitempty"` + // Wire name: 'connection_id' + ConnectionId string // Immutable. The Unity Catalog connection that this gateway pipeline uses // to communicate with the source. - ConnectionName string `json:"connection_name"` + // Wire name: 'connection_name' + ConnectionName string // Required, Immutable. The name of the catalog for the gateway pipeline's // storage location. - GatewayStorageCatalog string `json:"gateway_storage_catalog"` + // Wire name: 'gateway_storage_catalog' + GatewayStorageCatalog string // Optional. The Unity Catalog-compatible name for the gateway storage // location. This is the destination to use for the data that is extracted // by the gateway. Delta Live Tables system will automatically create the // storage location under the catalog and schema. - GatewayStorageName string `json:"gateway_storage_name,omitempty"` + // Wire name: 'gateway_storage_name' + GatewayStorageName string // Required, Immutable. The name of the schema for the gateway pipelines's // storage location. - GatewayStorageSchema string `json:"gateway_storage_schema"` + // Wire name: 'gateway_storage_schema' + GatewayStorageSchema string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *IngestionGatewayPipelineDefinition) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *IngestionGatewayPipelineDefinition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ingestionGatewayPipelineDefinitionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ingestionGatewayPipelineDefinitionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s IngestionGatewayPipelineDefinition) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st IngestionGatewayPipelineDefinition) MarshalJSON() ([]byte, error) { + pb, err := ingestionGatewayPipelineDefinitionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IngestionPipelineDefinition struct { // Immutable. The Unity Catalog connection that this ingestion pipeline uses // to communicate with the source. This is used with connectors for // applications like Salesforce, Workday, and so on. - ConnectionName string `json:"connection_name,omitempty"` + // Wire name: 'connection_name' + ConnectionName string // Immutable. Identifier for the gateway that is used by this ingestion // pipeline to communicate with the source database. This is used with // connectors to databases like SQL Server. - IngestionGatewayId string `json:"ingestion_gateway_id,omitempty"` + // Wire name: 'ingestion_gateway_id' + IngestionGatewayId string // Required. Settings specifying tables to replicate and the destination for // the replicated tables. - Objects []IngestionConfig `json:"objects,omitempty"` + // Wire name: 'objects' + Objects []IngestionConfig // The type of the foreign source. The source type will be inferred from the // source connection or ingestion gateway. This field is output only and // will be ignored if provided. - SourceType IngestionSourceType `json:"source_type,omitempty"` + // Wire name: 'source_type' + SourceType IngestionSourceType // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in the pipeline. - TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + // Wire name: 'table_configuration' + TableConfiguration *TableSpecificConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *IngestionPipelineDefinition) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *IngestionPipelineDefinition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ingestionPipelineDefinitionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ingestionPipelineDefinitionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { + pb, err := ingestionPipelineDefinitionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IngestionSourceType string +type ingestionSourceTypePb string const IngestionSourceTypeDynamics365 IngestionSourceType = `DYNAMICS365` @@ -623,6 +1263,22 @@ func (f *IngestionSourceType) Type() string { return "IngestionSourceType" } +func ingestionSourceTypeToPb(st *IngestionSourceType) (*ingestionSourceTypePb, error) { + if st == nil { + return nil, nil + } + pb := ingestionSourceTypePb(*st) + return &pb, nil +} + +func ingestionSourceTypeFromPb(pb *ingestionSourceTypePb) (*IngestionSourceType, error) { + if pb == nil { + return nil, nil + } + st := IngestionSourceType(*pb) + return &st, nil +} + // List pipeline events type ListPipelineEventsRequest struct { // Criteria to select a subset of results, expressed using a SQL-like @@ -632,51 +1288,93 @@ type ListPipelineEventsRequest struct { // // Composite expressions are supported, for example: level in ('ERROR', // 'WARN') AND timestamp> '2021-07-22T06:37:33.083Z' - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // Max number of entries to return in a single page. The system may return // fewer than max_results events in a response, even if there are more // events available. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // A string indicating a sort order by timestamp for the results, for // example, ["timestamp asc"]. The sort order can be ascending or // descending. By default, events are returned in descending order by // timestamp. - OrderBy []string `json:"-" url:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string `tf:"-"` // Page token returned by previous call. This field is mutually exclusive // with all fields in this request except max_results. An error is returned // if any fields other than max_results are set when this field is set. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The pipeline to return events for. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPipelineEventsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPipelineEventsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPipelineEventsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPipelineEventsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPipelineEventsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPipelineEventsRequest) MarshalJSON() ([]byte, error) { + pb, err := listPipelineEventsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListPipelineEventsResponse struct { // The list of events matching the request criteria. - Events []PipelineEvent `json:"events,omitempty"` + // Wire name: 'events' + Events []PipelineEvent // If present, a token to fetch the next page of events. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // If present, a token to fetch the previous page of events. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPipelineEventsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPipelineEventsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPipelineEventsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPipelineEventsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPipelineEventsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPipelineEventsResponse) MarshalJSON() ([]byte, error) { + pb, err := listPipelineEventsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List pipelines @@ -690,95 +1388,202 @@ type ListPipelinesRequest struct { // '%shopping%'` // // Composite filters are not supported. This field is optional. - Filter string `json:"-" url:"filter,omitempty"` + // Wire name: 'filter' + Filter string `tf:"-"` // The maximum number of entries to return in a single page. The system may // return fewer than max_results events in a response, even if there are // more events available. This field is optional. The default value is 25. // The maximum value is 100. An error is returned if the value of // max_results is greater than 100. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // A list of strings specifying the order of results. Supported order_by // fields are id and name. The default is id asc. This field is optional. - OrderBy []string `json:"-" url:"order_by,omitempty"` + // Wire name: 'order_by' + OrderBy []string `tf:"-"` // Page token returned by previous call - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPipelinesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPipelinesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPipelinesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPipelinesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPipelinesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPipelinesRequest) MarshalJSON() ([]byte, error) { + pb, err := listPipelinesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListPipelinesResponse struct { // If present, a token to fetch the next page of events. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // The list of events matching the request criteria. - Statuses []PipelineStateInfo `json:"statuses,omitempty"` + // Wire name: 'statuses' + Statuses []PipelineStateInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPipelinesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPipelinesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPipelinesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPipelinesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPipelinesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPipelinesResponse) MarshalJSON() ([]byte, error) { + pb, err := listPipelinesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List pipeline updates type ListUpdatesRequest struct { // Max number of entries to return in a single page. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Page token returned by previous call - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` // The pipeline to return updates for. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` // If present, returns updates until and including this update_id. - UntilUpdateId string `json:"-" url:"until_update_id,omitempty"` + // Wire name: 'until_update_id' + UntilUpdateId string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListUpdatesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListUpdatesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listUpdatesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listUpdatesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListUpdatesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListUpdatesRequest) MarshalJSON() ([]byte, error) { + pb, err := listUpdatesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListUpdatesResponse struct { // If present, then there are more results, and this a token to be used in a // subsequent request to fetch the next page. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // If present, then this token can be used in a subsequent request to fetch // the previous page. - PrevPageToken string `json:"prev_page_token,omitempty"` + // Wire name: 'prev_page_token' + PrevPageToken string - Updates []UpdateInfo `json:"updates,omitempty"` + // Wire name: 'updates' + Updates []UpdateInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListUpdatesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListUpdatesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listUpdatesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listUpdatesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListUpdatesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListUpdatesResponse) MarshalJSON() ([]byte, error) { + pb, err := listUpdatesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ManualTrigger struct { } +func (st *ManualTrigger) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &manualTriggerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := manualTriggerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ManualTrigger) MarshalJSON() ([]byte, error) { + pb, err := manualTriggerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Maturity level for EventDetails. type MaturityLevel string +type maturityLevelPb string const MaturityLevelDeprecated MaturityLevel = `DEPRECATED` @@ -807,19 +1612,53 @@ func (f *MaturityLevel) Type() string { return "MaturityLevel" } +func maturityLevelToPb(st *MaturityLevel) (*maturityLevelPb, error) { + if st == nil { + return nil, nil + } + pb := maturityLevelPb(*st) + return &pb, nil +} + +func maturityLevelFromPb(pb *maturityLevelPb) (*MaturityLevel, error) { + if pb == nil { + return nil, nil + } + st := MaturityLevel(*pb) + return &st, nil +} + type NotebookLibrary struct { // The absolute path of the source code. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NotebookLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NotebookLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ebookLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notebookLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NotebookLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NotebookLibrary) MarshalJSON() ([]byte, error) { + pb, err := notebookLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Notifications struct { @@ -830,139 +1669,266 @@ type Notifications struct { // `on-update-failure`: Each time a pipeline update fails. * // `on-update-fatal-failure`: A pipeline update fails with a non-retryable // (fatal) error. * `on-flow-failure`: A single data flow fails. - Alerts []string `json:"alerts,omitempty"` + // Wire name: 'alerts' + Alerts []string // A list of email addresses notified when a configured alert is triggered. - EmailRecipients []string `json:"email_recipients,omitempty"` + // Wire name: 'email_recipients' + EmailRecipients []string +} + +func (st *Notifications) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ificationsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notificationsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Notifications) MarshalJSON() ([]byte, error) { + pb, err := notificationsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Origin struct { // The id of a batch. Unique within a flow. - BatchId int64 `json:"batch_id,omitempty"` + // Wire name: 'batch_id' + BatchId int64 // The cloud provider, e.g., AWS or Azure. - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // The id of the cluster where an execution happens. Unique within a region. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The name of a dataset. Unique within a pipeline. - DatasetName string `json:"dataset_name,omitempty"` + // Wire name: 'dataset_name' + DatasetName string // The id of the flow. Globally unique. Incremental queries will generally // reuse the same id while complete queries will have a new id per update. - FlowId string `json:"flow_id,omitempty"` + // Wire name: 'flow_id' + FlowId string // The name of the flow. Not unique. - FlowName string `json:"flow_name,omitempty"` + // Wire name: 'flow_name' + FlowName string // The optional host name where the event was triggered - Host string `json:"host,omitempty"` + // Wire name: 'host' + Host string // The id of a maintenance run. Globally unique. - MaintenanceId string `json:"maintenance_id,omitempty"` + // Wire name: 'maintenance_id' + MaintenanceId string // Materialization name. - MaterializationName string `json:"materialization_name,omitempty"` + // Wire name: 'materialization_name' + MaterializationName string // The org id of the user. Unique within a cloud. - OrgId int64 `json:"org_id,omitempty"` + // Wire name: 'org_id' + OrgId int64 // The id of the pipeline. Globally unique. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // The name of the pipeline. Not unique. - PipelineName string `json:"pipeline_name,omitempty"` + // Wire name: 'pipeline_name' + PipelineName string // The cloud region. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The id of the request that caused an update. - RequestId string `json:"request_id,omitempty"` + // Wire name: 'request_id' + RequestId string // The id of a (delta) table. Globally unique. - TableId string `json:"table_id,omitempty"` + // Wire name: 'table_id' + TableId string // The Unity Catalog id of the MV or ST being updated. - UcResourceId string `json:"uc_resource_id,omitempty"` + // Wire name: 'uc_resource_id' + UcResourceId string // The id of an execution. Globally unique. - UpdateId string `json:"update_id,omitempty"` + // Wire name: 'update_id' + UpdateId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Origin) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Origin) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &originPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := originFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Origin) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Origin) MarshalJSON() ([]byte, error) { + pb, err := originToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PathPattern struct { // The source code to include for pipelines - Include string `json:"include,omitempty"` + // Wire name: 'include' + Include string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PathPattern) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PathPattern) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pathPatternPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pathPatternFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PathPattern) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PathPattern) MarshalJSON() ([]byte, error) { + pb, err := pathPatternToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PipelinePermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := pipelineAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineAccessControlResponse struct { // All permissions. - AllPermissions []PipelinePermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []PipelinePermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := pipelineAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineCluster struct { // Note: This field won't be persisted. Only API users will check this // field. - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + // Wire name: 'apply_policy_default_values' + ApplyPolicyDefaultValues bool // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale *PipelineClusterAutoscale `json:"autoscale,omitempty"` + // Wire name: 'autoscale' + Autoscale *PipelineClusterAutoscale // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes *compute.AwsAttributes `json:"aws_attributes,omitempty"` + // Wire name: 'aws_attributes' + AwsAttributes *compute.AwsAttributes // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes *compute.AzureAttributes `json:"azure_attributes,omitempty"` + // Wire name: 'azure_attributes' + AzureAttributes *compute.AzureAttributes // The configuration for delivering spark logs to a long-term storage // destination. Only dbfs destinations are supported. Only one destination // can be specified for one cluster. If the conf is given, the logs will be // delivered to the destination every `5 mins`. The destination of driver // logs is `$destination/$clusterId/driver`, while the destination of // executor logs is `$destination/$clusterId/executor`. - ClusterLogConf *compute.ClusterLogConf `json:"cluster_log_conf,omitempty"` + // Wire name: 'cluster_log_conf' + ClusterLogConf *compute.ClusterLogConf // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -971,37 +1937,46 @@ type PipelineCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + // Wire name: 'driver_instance_pool_id' + DriverInstancePoolId string // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + // Wire name: 'driver_node_type_id' + DriverNodeTypeId string // Whether to enable local disk encryption for the cluster. - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + // Wire name: 'enable_local_disk_encryption' + EnableLocalDiskEncryption bool // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes *compute.GcpAttributes `json:"gcp_attributes,omitempty"` + // Wire name: 'gcp_attributes' + GcpAttributes *compute.GcpAttributes // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts []compute.InitScriptInfo `json:"init_scripts,omitempty"` + // Wire name: 'init_scripts' + InitScripts []compute.InitScriptInfo // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId string `json:"instance_pool_id,omitempty"` + // Wire name: 'instance_pool_id' + InstancePoolId string // A label for the cluster specification, either `default` to configure the // default cluster, or `maintenance` to configure the maintenance cluster. // This field is optional. The default value is `default`. - Label string `json:"label,omitempty"` + // Wire name: 'label' + Label string // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId string `json:"node_type_id,omitempty"` + // Wire name: 'node_type_id' + NodeTypeId string // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1012,13 +1987,16 @@ type PipelineCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers int `json:"num_workers,omitempty"` + // Wire name: 'num_workers' + NumWorkers int // The ID of the cluster policy used to create the cluster if applicable. - PolicyId string `json:"policy_id,omitempty"` + // Wire name: 'policy_id' + PolicyId string // An object containing a set of optional, user-specified Spark // configuration key-value pairs. See :method:clusters/create for more // details. - SparkConf map[string]string `json:"spark_conf,omitempty"` + // Wire name: 'spark_conf' + SparkConf map[string]string // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1032,37 +2010,84 @@ type PipelineCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + // Wire name: 'spark_env_vars' + SparkEnvVars map[string]string // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + // Wire name: 'ssh_public_keys' + SshPublicKeys []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineCluster) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineCluster) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineClusterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineClusterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineCluster) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineCluster) MarshalJSON() ([]byte, error) { + pb, err := pipelineClusterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineClusterAutoscale struct { // The maximum number of workers to which the cluster can scale up when // overloaded. `max_workers` must be strictly greater than `min_workers`. - MaxWorkers int `json:"max_workers"` + // Wire name: 'max_workers' + MaxWorkers int // The minimum number of workers the cluster can scale down to when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers int `json:"min_workers"` + // Wire name: 'min_workers' + MinWorkers int // Databricks Enhanced Autoscaling optimizes cluster utilization by // automatically allocating cluster resources based on workload volume, with // minimal impact to the data processing latency of your pipelines. Enhanced // Autoscaling is available for `updates` clusters only. The legacy // autoscaling feature is used for `maintenance` clusters. - Mode PipelineClusterAutoscaleMode `json:"mode,omitempty"` + // Wire name: 'mode' + Mode PipelineClusterAutoscaleMode +} + +func (st *PipelineClusterAutoscale) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineClusterAutoscalePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineClusterAutoscaleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PipelineClusterAutoscale) MarshalJSON() ([]byte, error) { + pb, err := pipelineClusterAutoscaleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Databricks Enhanced Autoscaling optimizes cluster utilization by @@ -1071,6 +2096,7 @@ type PipelineClusterAutoscale struct { // Autoscaling is available for `updates` clusters only. The legacy autoscaling // feature is used for `maintenance` clusters. type PipelineClusterAutoscaleMode string +type pipelineClusterAutoscaleModePb string const PipelineClusterAutoscaleModeEnhanced PipelineClusterAutoscaleMode = `ENHANCED` @@ -1097,103 +2123,209 @@ func (f *PipelineClusterAutoscaleMode) Type() string { return "PipelineClusterAutoscaleMode" } +func pipelineClusterAutoscaleModeToPb(st *PipelineClusterAutoscaleMode) (*pipelineClusterAutoscaleModePb, error) { + if st == nil { + return nil, nil + } + pb := pipelineClusterAutoscaleModePb(*st) + return &pb, nil +} + +func pipelineClusterAutoscaleModeFromPb(pb *pipelineClusterAutoscaleModePb) (*PipelineClusterAutoscaleMode, error) { + if pb == nil { + return nil, nil + } + st := PipelineClusterAutoscaleMode(*pb) + return &st, nil +} + type PipelineDeployment struct { // The deployment method that manages the pipeline. - Kind DeploymentKind `json:"kind"` + // Wire name: 'kind' + Kind DeploymentKind // The path to the file containing metadata about the deployment. - MetadataFilePath string `json:"metadata_file_path,omitempty"` + // Wire name: 'metadata_file_path' + MetadataFilePath string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineDeployment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineDeployment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineDeploymentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineDeploymentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineDeployment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineDeployment) MarshalJSON() ([]byte, error) { + pb, err := pipelineDeploymentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineEvent struct { // Information about an error captured by the event. - Error *ErrorDetail `json:"error,omitempty"` + // Wire name: 'error' + Error *ErrorDetail // The event type. Should always correspond to the details - EventType string `json:"event_type,omitempty"` + // Wire name: 'event_type' + EventType string // A time-based, globally unique id. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The severity level of the event. - Level EventLevel `json:"level,omitempty"` + // Wire name: 'level' + Level EventLevel // Maturity level for event_type. - MaturityLevel MaturityLevel `json:"maturity_level,omitempty"` + // Wire name: 'maturity_level' + MaturityLevel MaturityLevel // The display message associated with the event. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Describes where the event originates from. - Origin *Origin `json:"origin,omitempty"` + // Wire name: 'origin' + Origin *Origin // A sequencing object to identify and order events. - Sequence *Sequencing `json:"sequence,omitempty"` + // Wire name: 'sequence' + Sequence *Sequencing // The time of the event. - Timestamp string `json:"timestamp,omitempty"` + // Wire name: 'timestamp' + Timestamp string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineEvent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineEvent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineEventPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineEventFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineEvent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineEvent) MarshalJSON() ([]byte, error) { + pb, err := pipelineEventToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineLibrary struct { // The path to a file that defines a pipeline and is stored in the // Databricks Repos. - File *FileLibrary `json:"file,omitempty"` + // Wire name: 'file' + File *FileLibrary // The unified field to include source codes. Each entry can be a notebook // path, a file path, or a folder path that ends `/**`. This field cannot be // used together with `notebook` or `file`. - Glob *PathPattern `json:"glob,omitempty"` + // Wire name: 'glob' + Glob *PathPattern // URI of the jar to be installed. Currently only DBFS is supported. - Jar string `json:"jar,omitempty"` + // Wire name: 'jar' + Jar string // Specification of a maven library to be installed. - Maven *compute.MavenLibrary `json:"maven,omitempty"` + // Wire name: 'maven' + Maven *compute.MavenLibrary // The path to a notebook that defines a pipeline and is stored in the // Databricks workspace. - Notebook *NotebookLibrary `json:"notebook,omitempty"` + // Wire name: 'notebook' + Notebook *NotebookLibrary // URI of the whl to be installed. - Whl string `json:"whl,omitempty"` + // Wire name: 'whl' + Whl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineLibrary) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineLibrary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineLibraryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineLibraryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineLibrary) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineLibrary) MarshalJSON() ([]byte, error) { + pb, err := pipelineLibraryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelinePermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PipelinePermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelinePermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelinePermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelinePermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelinePermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelinePermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelinePermission) MarshalJSON() ([]byte, error) { + pb, err := pipelinePermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type PipelinePermissionLevel string +type pipelinePermissionLevelPb string const PipelinePermissionLevelCanManage PipelinePermissionLevel = `CAN_MANAGE` @@ -1224,121 +2356,249 @@ func (f *PipelinePermissionLevel) Type() string { return "PipelinePermissionLevel" } +func pipelinePermissionLevelToPb(st *PipelinePermissionLevel) (*pipelinePermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := pipelinePermissionLevelPb(*st) + return &pb, nil +} + +func pipelinePermissionLevelFromPb(pb *pipelinePermissionLevelPb) (*PipelinePermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := PipelinePermissionLevel(*pb) + return &st, nil +} + type PipelinePermissions struct { - AccessControlList []PipelineAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []PipelineAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelinePermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelinePermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelinePermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelinePermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelinePermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelinePermissions) MarshalJSON() ([]byte, error) { + pb, err := pipelinePermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelinePermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PipelinePermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelinePermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelinePermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelinePermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelinePermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelinePermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelinePermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := pipelinePermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelinePermissionsRequest struct { - AccessControlList []PipelineAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []PipelineAccessControlRequest // The pipeline for which to get or manage permissions. - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *PipelinePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelinePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelinePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PipelinePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := pipelinePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PipelineSpec struct { // Budget policy of this pipeline. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // DLT Release Channel that specifies which version to use. - Channel string `json:"channel,omitempty"` + // Wire name: 'channel' + Channel string // Cluster settings for this pipeline deployment. - Clusters []PipelineCluster `json:"clusters,omitempty"` + // Wire name: 'clusters' + Clusters []PipelineCluster // String-String configuration for this pipeline execution. - Configuration map[string]string `json:"configuration,omitempty"` + // Wire name: 'configuration' + Configuration map[string]string // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous bool `json:"continuous,omitempty"` + // Wire name: 'continuous' + Continuous bool // Deployment type of this pipeline. - Deployment *PipelineDeployment `json:"deployment,omitempty"` + // Wire name: 'deployment' + Deployment *PipelineDeployment // Whether the pipeline is in Development mode. Defaults to false. - Development bool `json:"development,omitempty"` + // Wire name: 'development' + Development bool // Pipeline product edition. - Edition string `json:"edition,omitempty"` + // Wire name: 'edition' + Edition string // Event log configuration for this pipeline - EventLog *EventLogSpec `json:"event_log,omitempty"` + // Wire name: 'event_log' + EventLog *EventLogSpec // Filters on which Pipeline packages to include in the deployed graph. - Filters *Filters `json:"filters,omitempty"` + // Wire name: 'filters' + Filters *Filters // The definition of a gateway pipeline to support change data capture. - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + // Wire name: 'gateway_definition' + GatewayDefinition *IngestionGatewayPipelineDefinition // Unique identifier for this pipeline. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'schema', 'target', or 'catalog' settings. - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + // Wire name: 'ingestion_definition' + IngestionDefinition *IngestionPipelineDefinition // Libraries or code needed by this deployment. - Libraries []PipelineLibrary `json:"libraries,omitempty"` + // Wire name: 'libraries' + Libraries []PipelineLibrary // Friendly identifier for this pipeline. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // List of notification settings for this pipeline. - Notifications []Notifications `json:"notifications,omitempty"` + // Wire name: 'notifications' + Notifications []Notifications // Whether Photon is enabled for this pipeline. - Photon bool `json:"photon,omitempty"` + // Wire name: 'photon' + Photon bool // Restart window of this pipeline. - RestartWindow *RestartWindow `json:"restart_window,omitempty"` + // Wire name: 'restart_window' + RestartWindow *RestartWindow // Root path for this pipeline. This is used as the root directory when // editing the pipeline in the Databricks user interface and it is added to // sys.path when executing Python sources during pipeline execution. - RootPath string `json:"root_path,omitempty"` + // Wire name: 'root_path' + RootPath string // The default schema (database) where tables are read from or published to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // Whether serverless compute is enabled for this pipeline. - Serverless bool `json:"serverless,omitempty"` + // Wire name: 'serverless' + Serverless bool // DBFS root directory for storing checkpoints and tables. - Storage string `json:"storage,omitempty"` + // Wire name: 'storage' + Storage string // Target schema (database) to add tables in this pipeline to. Exactly one // of `schema` or `target` must be specified. To publish to Unity Catalog, // also specify `catalog`. This legacy field is deprecated for pipeline // creation in favor of the `schema` field. - Target string `json:"target,omitempty"` + // Wire name: 'target' + Target string // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger *PipelineTrigger `json:"trigger,omitempty"` + // Wire name: 'trigger' + Trigger *PipelineTrigger - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineSpec) MarshalJSON() ([]byte, error) { + pb, err := pipelineSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The pipeline state. type PipelineState string +type pipelineStatePb string const PipelineStateDeleted PipelineState = `DELETED` @@ -1379,39 +2639,81 @@ func (f *PipelineState) Type() string { return "PipelineState" } +func pipelineStateToPb(st *PipelineState) (*pipelineStatePb, error) { + if st == nil { + return nil, nil + } + pb := pipelineStatePb(*st) + return &pb, nil +} + +func pipelineStateFromPb(pb *pipelineStatePb) (*PipelineState, error) { + if pb == nil { + return nil, nil + } + st := PipelineState(*pb) + return &st, nil +} + type PipelineStateInfo struct { // The unique identifier of the cluster running the pipeline. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The username of the pipeline creator. - CreatorUserName string `json:"creator_user_name,omitempty"` + // Wire name: 'creator_user_name' + CreatorUserName string // The health of a pipeline. - Health PipelineStateInfoHealth `json:"health,omitempty"` + // Wire name: 'health' + Health PipelineStateInfoHealth // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + // Wire name: 'latest_updates' + LatestUpdates []UpdateStateInfo // The user-friendly name of the pipeline. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The unique identifier of the pipeline. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // The username that the pipeline runs as. This is a read only value derived // from the pipeline owner. - RunAsUserName string `json:"run_as_user_name,omitempty"` + // Wire name: 'run_as_user_name' + RunAsUserName string // The pipeline state. - State PipelineState `json:"state,omitempty"` + // Wire name: 'state' + State PipelineState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PipelineStateInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PipelineStateInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineStateInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineStateInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PipelineStateInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PipelineStateInfo) MarshalJSON() ([]byte, error) { + pb, err := pipelineStateInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The health of a pipeline. type PipelineStateInfoHealth string +type pipelineStateInfoHealthPb string const PipelineStateInfoHealthHealthy PipelineStateInfoHealth = `HEALTHY` @@ -1438,61 +2740,147 @@ func (f *PipelineStateInfoHealth) Type() string { return "PipelineStateInfoHealth" } +func pipelineStateInfoHealthToPb(st *PipelineStateInfoHealth) (*pipelineStateInfoHealthPb, error) { + if st == nil { + return nil, nil + } + pb := pipelineStateInfoHealthPb(*st) + return &pb, nil +} + +func pipelineStateInfoHealthFromPb(pb *pipelineStateInfoHealthPb) (*PipelineStateInfoHealth, error) { + if pb == nil { + return nil, nil + } + st := PipelineStateInfoHealth(*pb) + return &st, nil +} + type PipelineTrigger struct { - Cron *CronTrigger `json:"cron,omitempty"` - Manual *ManualTrigger `json:"manual,omitempty"` + // Wire name: 'cron' + Cron *CronTrigger + + // Wire name: 'manual' + Manual *ManualTrigger +} + +func (st *PipelineTrigger) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pipelineTriggerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pipelineTriggerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PipelineTrigger) MarshalJSON() ([]byte, error) { + pb, err := pipelineTriggerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ReportSpec struct { // Required. Destination catalog to store table. - DestinationCatalog string `json:"destination_catalog"` + // Wire name: 'destination_catalog' + DestinationCatalog string // Required. Destination schema to store table. - DestinationSchema string `json:"destination_schema"` + // Wire name: 'destination_schema' + DestinationSchema string // Required. Destination table name. The pipeline fails if a table with that // name already exists. - DestinationTable string `json:"destination_table,omitempty"` + // Wire name: 'destination_table' + DestinationTable string // Required. Report URL in the source system. - SourceUrl string `json:"source_url"` + // Wire name: 'source_url' + SourceUrl string // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object. - TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + // Wire name: 'table_configuration' + TableConfiguration *TableSpecificConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ReportSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ReportSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &reportSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := reportSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ReportSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ReportSpec) MarshalJSON() ([]byte, error) { + pb, err := reportSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestartWindow struct { // Days of week in which the restart is allowed to happen (within a // five-hour window starting at start_hour). If not specified all days of // the week will be used. - DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` + // Wire name: 'days_of_week' + DaysOfWeek []DayOfWeek // An integer between 0 and 23 denoting the start hour for the restart // window in the 24-hour day. Continuous pipeline restart is triggered only // within a five-hour window starting at this hour. - StartHour int `json:"start_hour"` + // Wire name: 'start_hour' + StartHour int // Time zone id of restart window. See // https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html // for details. If not specified, UTC will be used. - TimeZoneId string `json:"time_zone_id,omitempty"` + // Wire name: 'time_zone_id' + TimeZoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RestartWindow) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RestartWindow) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restartWindowPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restartWindowFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RestartWindow) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RestartWindow) MarshalJSON() ([]byte, error) { + pb, err := restartWindowToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Write-only setting, available only in Create/Update calls. Specifies the user @@ -1504,141 +2892,266 @@ func (s RestartWindow) MarshalJSON() ([]byte, error) { type RunAs struct { // Application ID of an active service principal. Setting this field // requires the `servicePrincipal/user` role. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // The email of an active workspace user. Users can only set this field to // their own email. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RunAs) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RunAs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &runAsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := runAsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RunAs) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RunAs) MarshalJSON() ([]byte, error) { + pb, err := runAsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SchemaSpec struct { // Required. Destination catalog to store tables. - DestinationCatalog string `json:"destination_catalog"` + // Wire name: 'destination_catalog' + DestinationCatalog string // Required. Destination schema to store tables in. Tables with the same // name as the source tables are created in this destination schema. The // pipeline fails If a table with the same name already exists. - DestinationSchema string `json:"destination_schema"` + // Wire name: 'destination_schema' + DestinationSchema string // The source catalog name. Might be optional depending on the type of // source. - SourceCatalog string `json:"source_catalog,omitempty"` + // Wire name: 'source_catalog' + SourceCatalog string // Required. Schema name in the source database. - SourceSchema string `json:"source_schema"` + // Wire name: 'source_schema' + SourceSchema string // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in this schema and override the // table_configuration defined in the IngestionPipelineDefinition object. - TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + // Wire name: 'table_configuration' + TableConfiguration *TableSpecificConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SchemaSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SchemaSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &schemaSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := schemaSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SchemaSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SchemaSpec) MarshalJSON() ([]byte, error) { + pb, err := schemaSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Sequencing struct { // A sequence number, unique and increasing within the control plane. - ControlPlaneSeqNo int64 `json:"control_plane_seq_no,omitempty"` + // Wire name: 'control_plane_seq_no' + ControlPlaneSeqNo int64 // the ID assigned by the data plane. - DataPlaneId *DataPlaneId `json:"data_plane_id,omitempty"` + // Wire name: 'data_plane_id' + DataPlaneId *DataPlaneId - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Sequencing) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Sequencing) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sequencingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sequencingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Sequencing) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Sequencing) MarshalJSON() ([]byte, error) { + pb, err := sequencingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SerializedException struct { // Runtime class of the exception - ClassName string `json:"class_name,omitempty"` + // Wire name: 'class_name' + ClassName string // Exception message - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Stack trace consisting of a list of stack frames - Stack []StackFrame `json:"stack,omitempty"` + // Wire name: 'stack' + Stack []StackFrame - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SerializedException) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SerializedException) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &serializedExceptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := serializedExceptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SerializedException) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SerializedException) MarshalJSON() ([]byte, error) { + pb, err := serializedExceptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StackFrame struct { // Class from which the method call originated - DeclaringClass string `json:"declaring_class,omitempty"` + // Wire name: 'declaring_class' + DeclaringClass string // File where the method is defined - FileName string `json:"file_name,omitempty"` + // Wire name: 'file_name' + FileName string // Line from which the method was called - LineNumber int `json:"line_number,omitempty"` + // Wire name: 'line_number' + LineNumber int // Name of the method which was called - MethodName string `json:"method_name,omitempty"` + // Wire name: 'method_name' + MethodName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StackFrame) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StackFrame) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stackFramePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stackFrameFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StackFrame) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StackFrame) MarshalJSON() ([]byte, error) { + pb, err := stackFrameToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StartUpdate struct { // What triggered this update. - Cause StartUpdateCause `json:"cause,omitempty"` + // Wire name: 'cause' + Cause StartUpdateCause // If true, this update will reset all tables before running. - FullRefresh bool `json:"full_refresh,omitempty"` + // Wire name: 'full_refresh' + FullRefresh bool // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + // Wire name: 'full_refresh_selection' + FullRefreshSelection []string - PipelineId string `json:"-" url:"-"` + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection []string `json:"refresh_selection,omitempty"` + // Wire name: 'refresh_selection' + RefreshSelection []string // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly bool `json:"validate_only,omitempty"` + // Wire name: 'validate_only' + ValidateOnly bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StartUpdate) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StartUpdate) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startUpdatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startUpdateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StartUpdate) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StartUpdate) MarshalJSON() ([]byte, error) { + pb, err := startUpdateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // What triggered this update. type StartUpdateCause string +type startUpdateCausePb string const StartUpdateCauseApiCall StartUpdateCause = `API_CALL` @@ -1675,57 +3188,168 @@ func (f *StartUpdateCause) Type() string { return "StartUpdateCause" } +func startUpdateCauseToPb(st *StartUpdateCause) (*startUpdateCausePb, error) { + if st == nil { + return nil, nil + } + pb := startUpdateCausePb(*st) + return &pb, nil +} + +func startUpdateCauseFromPb(pb *startUpdateCausePb) (*StartUpdateCause, error) { + if pb == nil { + return nil, nil + } + st := StartUpdateCause(*pb) + return &st, nil +} + type StartUpdateResponse struct { - UpdateId string `json:"update_id,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'update_id' + UpdateId string + + ForceSendFields []string `tf:"-"` } -func (s *StartUpdateResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StartUpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startUpdateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startUpdateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StartUpdateResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StartUpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := startUpdateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StopPipelineResponse struct { } +func (st *StopPipelineResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stopPipelineResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stopPipelineResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StopPipelineResponse) MarshalJSON() ([]byte, error) { + pb, err := stopPipelineResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Stop a pipeline type StopRequest struct { - PipelineId string `json:"-" url:"-"` + + // Wire name: 'pipeline_id' + PipelineId string `tf:"-"` +} + +func (st *StopRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stopRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stopRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StopRequest) MarshalJSON() ([]byte, error) { + pb, err := stopRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableSpec struct { // Required. Destination catalog to store table. - DestinationCatalog string `json:"destination_catalog"` + // Wire name: 'destination_catalog' + DestinationCatalog string // Required. Destination schema to store table. - DestinationSchema string `json:"destination_schema"` + // Wire name: 'destination_schema' + DestinationSchema string // Optional. Destination table name. The pipeline fails if a table with that // name already exists. If not set, the source table name is used. - DestinationTable string `json:"destination_table,omitempty"` + // Wire name: 'destination_table' + DestinationTable string // Source catalog name. Might be optional depending on the type of source. - SourceCatalog string `json:"source_catalog,omitempty"` + // Wire name: 'source_catalog' + SourceCatalog string // Schema name in the source database. Might be optional depending on the // type of source. - SourceSchema string `json:"source_schema,omitempty"` + // Wire name: 'source_schema' + SourceSchema string // Required. Table name in the source database. - SourceTable string `json:"source_table"` + // Wire name: 'source_table' + SourceTable string // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object and the SchemaSpec. - TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` + // Wire name: 'table_configuration' + TableConfiguration *TableSpecificConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableSpec) MarshalJSON() ([]byte, error) { + pb, err := tableSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableSpecificConfig struct { @@ -1734,38 +3358,62 @@ type TableSpecificConfig struct { // When specified, all other columns including future ones will be // automatically included for ingestion. This field in mutually exclusive // with `include_columns`. - ExcludeColumns []string `json:"exclude_columns,omitempty"` + // Wire name: 'exclude_columns' + ExcludeColumns []string // A list of column names to be included for the ingestion. When not // specified, all columns except ones in exclude_columns will be included. // Future columns will be automatically included. When specified, all other // future columns will be automatically excluded from ingestion. This field // in mutually exclusive with `exclude_columns`. - IncludeColumns []string `json:"include_columns,omitempty"` + // Wire name: 'include_columns' + IncludeColumns []string // The primary key of the table used to apply changes. - PrimaryKeys []string `json:"primary_keys,omitempty"` + // Wire name: 'primary_keys' + PrimaryKeys []string // If true, formula fields defined in the table are included in the // ingestion. This setting is only valid for the Salesforce connector - SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` + // Wire name: 'salesforce_include_formula_fields' + SalesforceIncludeFormulaFields bool // The SCD type to use to ingest the table. - ScdType TableSpecificConfigScdType `json:"scd_type,omitempty"` + // Wire name: 'scd_type' + ScdType TableSpecificConfigScdType // The column names specifying the logical order of events in the source // data. Delta Live Tables uses this sequencing to handle change events that // arrive out of order. - SequenceBy []string `json:"sequence_by,omitempty"` + // Wire name: 'sequence_by' + SequenceBy []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableSpecificConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableSpecificConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableSpecificConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableSpecificConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableSpecificConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableSpecificConfig) MarshalJSON() ([]byte, error) { + pb, err := tableSpecificConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The SCD type to use to ingest the table. type TableSpecificConfigScdType string +type tableSpecificConfigScdTypePb string const TableSpecificConfigScdTypeScdType1 TableSpecificConfigScdType = `SCD_TYPE_1` @@ -1792,51 +3440,96 @@ func (f *TableSpecificConfigScdType) Type() string { return "TableSpecificConfigScdType" } +func tableSpecificConfigScdTypeToPb(st *TableSpecificConfigScdType) (*tableSpecificConfigScdTypePb, error) { + if st == nil { + return nil, nil + } + pb := tableSpecificConfigScdTypePb(*st) + return &pb, nil +} + +func tableSpecificConfigScdTypeFromPb(pb *tableSpecificConfigScdTypePb) (*TableSpecificConfigScdType, error) { + if pb == nil { + return nil, nil + } + st := TableSpecificConfigScdType(*pb) + return &st, nil +} + type UpdateInfo struct { // What triggered this update. - Cause UpdateInfoCause `json:"cause,omitempty"` + // Wire name: 'cause' + Cause UpdateInfoCause // The ID of the cluster that the update is running on. - ClusterId string `json:"cluster_id,omitempty"` + // Wire name: 'cluster_id' + ClusterId string // The pipeline configuration with system defaults applied where unspecified // by the user. Not returned by ListUpdates. - Config *PipelineSpec `json:"config,omitempty"` + // Wire name: 'config' + Config *PipelineSpec // The time when this update was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // If true, this update will reset all tables before running. - FullRefresh bool `json:"full_refresh,omitempty"` + // Wire name: 'full_refresh' + FullRefresh bool // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + // Wire name: 'full_refresh_selection' + FullRefreshSelection []string // The ID of the pipeline. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection []string `json:"refresh_selection,omitempty"` + // Wire name: 'refresh_selection' + RefreshSelection []string // The update state. - State UpdateInfoState `json:"state,omitempty"` + // Wire name: 'state' + State UpdateInfoState // The ID of this update. - UpdateId string `json:"update_id,omitempty"` + // Wire name: 'update_id' + UpdateId string // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly bool `json:"validate_only,omitempty"` + // Wire name: 'validate_only' + ValidateOnly bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateInfo) MarshalJSON() ([]byte, error) { + pb, err := updateInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // What triggered this update. type UpdateInfoCause string +type updateInfoCausePb string const UpdateInfoCauseApiCall UpdateInfoCause = `API_CALL` @@ -1873,8 +3566,25 @@ func (f *UpdateInfoCause) Type() string { return "UpdateInfoCause" } +func updateInfoCauseToPb(st *UpdateInfoCause) (*updateInfoCausePb, error) { + if st == nil { + return nil, nil + } + pb := updateInfoCausePb(*st) + return &pb, nil +} + +func updateInfoCauseFromPb(pb *updateInfoCausePb) (*UpdateInfoCause, error) { + if pb == nil { + return nil, nil + } + st := UpdateInfoCause(*pb) + return &st, nil +} + // The update state. type UpdateInfoState string +type updateInfoStatePb string const UpdateInfoStateCanceled UpdateInfoState = `CANCELED` @@ -1919,26 +3629,64 @@ func (f *UpdateInfoState) Type() string { return "UpdateInfoState" } +func updateInfoStateToPb(st *UpdateInfoState) (*updateInfoStatePb, error) { + if st == nil { + return nil, nil + } + pb := updateInfoStatePb(*st) + return &pb, nil +} + +func updateInfoStateFromPb(pb *updateInfoStatePb) (*UpdateInfoState, error) { + if pb == nil { + return nil, nil + } + st := UpdateInfoState(*pb) + return &st, nil +} + type UpdateStateInfo struct { - CreationTime string `json:"creation_time,omitempty"` + + // Wire name: 'creation_time' + CreationTime string // The update state. - State UpdateStateInfoState `json:"state,omitempty"` + // Wire name: 'state' + State UpdateStateInfoState - UpdateId string `json:"update_id,omitempty"` + // Wire name: 'update_id' + UpdateId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateStateInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateStateInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateStateInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateStateInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateStateInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateStateInfo) MarshalJSON() ([]byte, error) { + pb, err := updateStateInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The update state. type UpdateStateInfoState string +type updateStateInfoStatePb string const UpdateStateInfoStateCanceled UpdateStateInfoState = `CANCELED` @@ -1982,3 +3730,73 @@ func (f *UpdateStateInfoState) Set(v string) error { func (f *UpdateStateInfoState) Type() string { return "UpdateStateInfoState" } + +func updateStateInfoStateToPb(st *UpdateStateInfoState) (*updateStateInfoStatePb, error) { + if st == nil { + return nil, nil + } + pb := updateStateInfoStatePb(*st) + return &pb, nil +} + +func updateStateInfoStateFromPb(pb *updateStateInfoStatePb) (*UpdateStateInfoState, error) { + if pb == nil { + return nil, nil + } + st := UpdateStateInfoState(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/pkg.go b/service/pkg.go index 599ac820d..00f58b46e 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -54,10 +54,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. -// // - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. // +// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. @@ -204,6 +204,8 @@ // // - [catalog.QualityMonitorsAPI]: A monitor computes and monitors data or model quality metrics for a table over time. // +// - [qualitymonitor.QualityMonitorsV2API]: Manage data quality of UC objects (currently support `schema`). +// // - [sql.QueriesAPI]: The queries API can be used to perform CRUD operations on queries. // // - [sql.QueriesLegacyAPI]: These endpoints are used for CRUD operations on query definitions. @@ -322,6 +324,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/oauth2" "github.com/databricks/databricks-sdk-go/service/pipelines" "github.com/databricks/databricks-sdk-go/service/provisioning" + "github.com/databricks/databricks-sdk-go/service/qualitymonitor" "github.com/databricks/databricks-sdk-go/service/serving" "github.com/databricks/databricks-sdk-go/service/settings" "github.com/databricks/databricks-sdk-go/service/sharing" @@ -437,6 +440,7 @@ var ( _ *sharing.ProvidersAPI = nil _ *oauth2.PublishedAppIntegrationAPI = nil _ *catalog.QualityMonitorsAPI = nil + _ *qualitymonitor.QualityMonitorsV2API = nil _ *sql.QueriesAPI = nil _ *sql.QueriesLegacyAPI = nil _ *dashboards.QueryExecutionAPI = nil diff --git a/service/provisioning/impl.go b/service/provisioning/impl.go index 00fe68611..42336917d 100755 --- a/service/provisioning/impl.go +++ b/service/provisioning/impl.go @@ -16,44 +16,127 @@ type credentialsImpl struct { } func (a *credentialsImpl) Create(ctx context.Context, request CreateCredentialRequest) (*Credential, error) { - var credential Credential + + requestPb, pbErr := createCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var credentialPb credentialPb path := fmt.Sprintf("/api/2.0/accounts/%v/credentials", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &credential) - return &credential, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &credentialPb, + ) + if err != nil { + return nil, err + } + resp, err := credentialFromPb(&credentialPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) Delete(ctx context.Context, request DeleteCredentialRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), request.CredentialsId) + + requestPb, pbErr := deleteCredentialRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), requestPb.CredentialsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *credentialsImpl) Get(ctx context.Context, request GetCredentialRequest) (*Credential, error) { - var credential Credential - path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), request.CredentialsId) + + requestPb, pbErr := getCredentialRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var credentialPb credentialPb + path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), requestPb.CredentialsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &credential) - return &credential, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &credentialPb, + ) + if err != nil { + return nil, err + } + resp, err := credentialFromPb(&credentialPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *credentialsImpl) List(ctx context.Context) ([]Credential, error) { - var credentialList []Credential + + var credentialListPb []credentialPb path := fmt.Sprintf("/api/2.0/accounts/%v/credentials", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &credentialList) - return credentialList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &credentialListPb, + ) + if err != nil { + return nil, err + } + var resp []Credential + for _, item := range credentialListPb { + itemResp, err := credentialFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just EncryptionKeys API methods @@ -62,44 +145,127 @@ type encryptionKeysImpl struct { } func (a *encryptionKeysImpl) Create(ctx context.Context, request CreateCustomerManagedKeyRequest) (*CustomerManagedKey, error) { - var customerManagedKey CustomerManagedKey + + requestPb, pbErr := createCustomerManagedKeyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var customerManagedKeyPb customerManagedKeyPb path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &customerManagedKey) - return &customerManagedKey, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &customerManagedKeyPb, + ) + if err != nil { + return nil, err + } + resp, err := customerManagedKeyFromPb(&customerManagedKeyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *encryptionKeysImpl) Delete(ctx context.Context, request DeleteEncryptionKeyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), request.CustomerManagedKeyId) + + requestPb, pbErr := deleteEncryptionKeyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), requestPb.CustomerManagedKeyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *encryptionKeysImpl) Get(ctx context.Context, request GetEncryptionKeyRequest) (*CustomerManagedKey, error) { - var customerManagedKey CustomerManagedKey - path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), request.CustomerManagedKeyId) + + requestPb, pbErr := getEncryptionKeyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var customerManagedKeyPb customerManagedKeyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), requestPb.CustomerManagedKeyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &customerManagedKey) - return &customerManagedKey, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &customerManagedKeyPb, + ) + if err != nil { + return nil, err + } + resp, err := customerManagedKeyFromPb(&customerManagedKeyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *encryptionKeysImpl) List(ctx context.Context) ([]CustomerManagedKey, error) { - var customerManagedKeyList []CustomerManagedKey + + var customerManagedKeyListPb []customerManagedKeyPb path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &customerManagedKeyList) - return customerManagedKeyList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &customerManagedKeyListPb, + ) + if err != nil { + return nil, err + } + var resp []CustomerManagedKey + for _, item := range customerManagedKeyListPb { + itemResp, err := customerManagedKeyFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just Networks API methods @@ -108,44 +274,127 @@ type networksImpl struct { } func (a *networksImpl) Create(ctx context.Context, request CreateNetworkRequest) (*Network, error) { - var network Network + + requestPb, pbErr := createNetworkRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var networkPb networkPb path := fmt.Sprintf("/api/2.0/accounts/%v/networks", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &network) - return &network, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &networkPb, + ) + if err != nil { + return nil, err + } + resp, err := networkFromPb(&networkPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networksImpl) Delete(ctx context.Context, request DeleteNetworkRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), request.NetworkId) + + requestPb, pbErr := deleteNetworkRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), requestPb.NetworkId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *networksImpl) Get(ctx context.Context, request GetNetworkRequest) (*Network, error) { - var network Network - path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), request.NetworkId) + + requestPb, pbErr := getNetworkRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var networkPb networkPb + path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), requestPb.NetworkId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &network) - return &network, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &networkPb, + ) + if err != nil { + return nil, err + } + resp, err := networkFromPb(&networkPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networksImpl) List(ctx context.Context) ([]Network, error) { - var networkList []Network + + var networkListPb []networkPb path := fmt.Sprintf("/api/2.0/accounts/%v/networks", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &networkList) - return networkList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &networkListPb, + ) + if err != nil { + return nil, err + } + var resp []Network + for _, item := range networkListPb { + itemResp, err := networkFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just PrivateAccess API methods @@ -154,54 +403,155 @@ type privateAccessImpl struct { } func (a *privateAccessImpl) Create(ctx context.Context, request UpsertPrivateAccessSettingsRequest) (*PrivateAccessSettings, error) { - var privateAccessSettings PrivateAccessSettings + + requestPb, pbErr := upsertPrivateAccessSettingsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var privateAccessSettingsPb privateAccessSettingsPb path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &privateAccessSettings) - return &privateAccessSettings, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &privateAccessSettingsPb, + ) + if err != nil { + return nil, err + } + resp, err := privateAccessSettingsFromPb(&privateAccessSettingsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *privateAccessImpl) Delete(ctx context.Context, request DeletePrivateAccesRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + + requestPb, pbErr := deletePrivateAccesRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), requestPb.PrivateAccessSettingsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *privateAccessImpl) Get(ctx context.Context, request GetPrivateAccesRequest) (*PrivateAccessSettings, error) { - var privateAccessSettings PrivateAccessSettings - path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + + requestPb, pbErr := getPrivateAccesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var privateAccessSettingsPb privateAccessSettingsPb + path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), requestPb.PrivateAccessSettingsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &privateAccessSettings) - return &privateAccessSettings, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &privateAccessSettingsPb, + ) + if err != nil { + return nil, err + } + resp, err := privateAccessSettingsFromPb(&privateAccessSettingsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *privateAccessImpl) List(ctx context.Context) ([]PrivateAccessSettings, error) { - var privateAccessSettingsList []PrivateAccessSettings + + var privateAccessSettingsListPb []privateAccessSettingsPb path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &privateAccessSettingsList) - return privateAccessSettingsList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &privateAccessSettingsListPb, + ) + if err != nil { + return nil, err + } + var resp []PrivateAccessSettings + for _, item := range privateAccessSettingsListPb { + itemResp, err := privateAccessSettingsFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } func (a *privateAccessImpl) Replace(ctx context.Context, request UpsertPrivateAccessSettingsRequest) error { - var replaceResponse ReplaceResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + + requestPb, pbErr := upsertPrivateAccessSettingsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var replaceResponsePb replaceResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), requestPb.PrivateAccessSettingsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &replaceResponsePb, + ) + if err != nil { + return err + } + return err } @@ -211,44 +561,127 @@ type storageImpl struct { } func (a *storageImpl) Create(ctx context.Context, request CreateStorageConfigurationRequest) (*StorageConfiguration, error) { - var storageConfiguration StorageConfiguration + + requestPb, pbErr := createStorageConfigurationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var storageConfigurationPb storageConfigurationPb path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &storageConfiguration) - return &storageConfiguration, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &storageConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := storageConfigurationFromPb(&storageConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *storageImpl) Delete(ctx context.Context, request DeleteStorageRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), request.StorageConfigurationId) + + requestPb, pbErr := deleteStorageRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), requestPb.StorageConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *storageImpl) Get(ctx context.Context, request GetStorageRequest) (*StorageConfiguration, error) { - var storageConfiguration StorageConfiguration - path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), request.StorageConfigurationId) + + requestPb, pbErr := getStorageRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var storageConfigurationPb storageConfigurationPb + path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), requestPb.StorageConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &storageConfiguration) - return &storageConfiguration, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &storageConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := storageConfigurationFromPb(&storageConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *storageImpl) List(ctx context.Context) ([]StorageConfiguration, error) { - var storageConfigurationList []StorageConfiguration + + var storageConfigurationListPb []storageConfigurationPb path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &storageConfigurationList) - return storageConfigurationList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &storageConfigurationListPb, + ) + if err != nil { + return nil, err + } + var resp []StorageConfiguration + for _, item := range storageConfigurationListPb { + itemResp, err := storageConfigurationFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just VpcEndpoints API methods @@ -257,44 +690,127 @@ type vpcEndpointsImpl struct { } func (a *vpcEndpointsImpl) Create(ctx context.Context, request CreateVpcEndpointRequest) (*VpcEndpoint, error) { - var vpcEndpoint VpcEndpoint + + requestPb, pbErr := createVpcEndpointRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var vpcEndpointPb vpcEndpointPb path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &vpcEndpoint) - return &vpcEndpoint, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &vpcEndpointPb, + ) + if err != nil { + return nil, err + } + resp, err := vpcEndpointFromPb(&vpcEndpointPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vpcEndpointsImpl) Delete(ctx context.Context, request DeleteVpcEndpointRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), request.VpcEndpointId) + + requestPb, pbErr := deleteVpcEndpointRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), requestPb.VpcEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *vpcEndpointsImpl) Get(ctx context.Context, request GetVpcEndpointRequest) (*VpcEndpoint, error) { - var vpcEndpoint VpcEndpoint - path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), request.VpcEndpointId) + + requestPb, pbErr := getVpcEndpointRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var vpcEndpointPb vpcEndpointPb + path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), requestPb.VpcEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &vpcEndpoint) - return &vpcEndpoint, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &vpcEndpointPb, + ) + if err != nil { + return nil, err + } + resp, err := vpcEndpointFromPb(&vpcEndpointPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vpcEndpointsImpl) List(ctx context.Context) ([]VpcEndpoint, error) { - var vpcEndpointList []VpcEndpoint + + var vpcEndpointListPb []vpcEndpointPb path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &vpcEndpointList) - return vpcEndpointList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &vpcEndpointListPb, + ) + if err != nil { + return nil, err + } + var resp []VpcEndpoint + for _, item := range vpcEndpointListPb { + itemResp, err := vpcEndpointFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just Workspaces API methods @@ -303,53 +819,154 @@ type workspacesImpl struct { } func (a *workspacesImpl) Create(ctx context.Context, request CreateWorkspaceRequest) (*Workspace, error) { - var workspace Workspace + + requestPb, pbErr := createWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspacePb workspacePb path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &workspace) - return &workspace, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &workspacePb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceFromPb(&workspacePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspacesImpl) Delete(ctx context.Context, request DeleteWorkspaceRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := deleteWorkspaceRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *workspacesImpl) Get(ctx context.Context, request GetWorkspaceRequest) (*Workspace, error) { - var workspace Workspace - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := getWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspacePb workspacePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspace) - return &workspace, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &workspacePb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceFromPb(&workspacePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspacesImpl) List(ctx context.Context) ([]Workspace, error) { - var workspaceList []Workspace + + var workspaceListPb []workspacePb path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &workspaceList) - return workspaceList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &workspaceListPb, + ) + if err != nil { + return nil, err + } + var resp []Workspace + for _, item := range workspaceListPb { + itemResp, err := workspaceFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } func (a *workspacesImpl) Update(ctx context.Context, request UpdateWorkspaceRequest) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := updateWorkspaceRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } diff --git a/service/provisioning/internal.go b/service/provisioning/internal.go new file mode 100755 index 000000000..16e09b49f --- /dev/null +++ b/service/provisioning/internal.go @@ -0,0 +1,2191 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package provisioning + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func awsCredentialsToPb(st *AwsCredentials) (*awsCredentialsPb, error) { + if st == nil { + return nil, nil + } + pb := &awsCredentialsPb{} + pb.StsRole = st.StsRole + + return pb, nil +} + +type awsCredentialsPb struct { + StsRole *StsRole `json:"sts_role,omitempty"` +} + +func awsCredentialsFromPb(pb *awsCredentialsPb) (*AwsCredentials, error) { + if pb == nil { + return nil, nil + } + st := &AwsCredentials{} + st.StsRole = pb.StsRole + + return st, nil +} + +func awsKeyInfoToPb(st *AwsKeyInfo) (*awsKeyInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &awsKeyInfoPb{} + pb.KeyAlias = st.KeyAlias + + pb.KeyArn = st.KeyArn + + pb.KeyRegion = st.KeyRegion + + pb.ReuseKeyForClusterVolumes = st.ReuseKeyForClusterVolumes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type awsKeyInfoPb struct { + KeyAlias string `json:"key_alias,omitempty"` + + KeyArn string `json:"key_arn"` + + KeyRegion string `json:"key_region"` + + ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func awsKeyInfoFromPb(pb *awsKeyInfoPb) (*AwsKeyInfo, error) { + if pb == nil { + return nil, nil + } + st := &AwsKeyInfo{} + st.KeyAlias = pb.KeyAlias + st.KeyArn = pb.KeyArn + st.KeyRegion = pb.KeyRegion + st.ReuseKeyForClusterVolumes = pb.ReuseKeyForClusterVolumes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *awsKeyInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st awsKeyInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func azureWorkspaceInfoToPb(st *AzureWorkspaceInfo) (*azureWorkspaceInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &azureWorkspaceInfoPb{} + pb.ResourceGroup = st.ResourceGroup + + pb.SubscriptionId = st.SubscriptionId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type azureWorkspaceInfoPb struct { + ResourceGroup string `json:"resource_group,omitempty"` + + SubscriptionId string `json:"subscription_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func azureWorkspaceInfoFromPb(pb *azureWorkspaceInfoPb) (*AzureWorkspaceInfo, error) { + if pb == nil { + return nil, nil + } + st := &AzureWorkspaceInfo{} + st.ResourceGroup = pb.ResourceGroup + st.SubscriptionId = pb.SubscriptionId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *azureWorkspaceInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st azureWorkspaceInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cloudResourceContainerToPb(st *CloudResourceContainer) (*cloudResourceContainerPb, error) { + if st == nil { + return nil, nil + } + pb := &cloudResourceContainerPb{} + pb.Gcp = st.Gcp + + return pb, nil +} + +type cloudResourceContainerPb struct { + Gcp *CustomerFacingGcpCloudResourceContainer `json:"gcp,omitempty"` +} + +func cloudResourceContainerFromPb(pb *cloudResourceContainerPb) (*CloudResourceContainer, error) { + if pb == nil { + return nil, nil + } + st := &CloudResourceContainer{} + st.Gcp = pb.Gcp + + return st, nil +} + +func createAwsKeyInfoToPb(st *CreateAwsKeyInfo) (*createAwsKeyInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &createAwsKeyInfoPb{} + pb.KeyAlias = st.KeyAlias + + pb.KeyArn = st.KeyArn + + pb.ReuseKeyForClusterVolumes = st.ReuseKeyForClusterVolumes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAwsKeyInfoPb struct { + KeyAlias string `json:"key_alias,omitempty"` + + KeyArn string `json:"key_arn"` + + ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAwsKeyInfoFromPb(pb *createAwsKeyInfoPb) (*CreateAwsKeyInfo, error) { + if pb == nil { + return nil, nil + } + st := &CreateAwsKeyInfo{} + st.KeyAlias = pb.KeyAlias + st.KeyArn = pb.KeyArn + st.ReuseKeyForClusterVolumes = pb.ReuseKeyForClusterVolumes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAwsKeyInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAwsKeyInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCredentialAwsCredentialsToPb(st *CreateCredentialAwsCredentials) (*createCredentialAwsCredentialsPb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialAwsCredentialsPb{} + pb.StsRole = st.StsRole + + return pb, nil +} + +type createCredentialAwsCredentialsPb struct { + StsRole *CreateCredentialStsRole `json:"sts_role,omitempty"` +} + +func createCredentialAwsCredentialsFromPb(pb *createCredentialAwsCredentialsPb) (*CreateCredentialAwsCredentials, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialAwsCredentials{} + st.StsRole = pb.StsRole + + return st, nil +} + +func createCredentialRequestToPb(st *CreateCredentialRequest) (*createCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialRequestPb{} + pb.AwsCredentials = st.AwsCredentials + + pb.CredentialsName = st.CredentialsName + + return pb, nil +} + +type createCredentialRequestPb struct { + AwsCredentials CreateCredentialAwsCredentials `json:"aws_credentials"` + + CredentialsName string `json:"credentials_name"` +} + +func createCredentialRequestFromPb(pb *createCredentialRequestPb) (*CreateCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialRequest{} + st.AwsCredentials = pb.AwsCredentials + st.CredentialsName = pb.CredentialsName + + return st, nil +} + +func createCredentialStsRoleToPb(st *CreateCredentialStsRole) (*createCredentialStsRolePb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialStsRolePb{} + pb.RoleArn = st.RoleArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCredentialStsRolePb struct { + RoleArn string `json:"role_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCredentialStsRoleFromPb(pb *createCredentialStsRolePb) (*CreateCredentialStsRole, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialStsRole{} + st.RoleArn = pb.RoleArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCredentialStsRolePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCredentialStsRolePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCustomerManagedKeyRequestToPb(st *CreateCustomerManagedKeyRequest) (*createCustomerManagedKeyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCustomerManagedKeyRequestPb{} + pb.AwsKeyInfo = st.AwsKeyInfo + + pb.GcpKeyInfo = st.GcpKeyInfo + + pb.UseCases = st.UseCases + + return pb, nil +} + +type createCustomerManagedKeyRequestPb struct { + AwsKeyInfo *CreateAwsKeyInfo `json:"aws_key_info,omitempty"` + + GcpKeyInfo *CreateGcpKeyInfo `json:"gcp_key_info,omitempty"` + + UseCases []KeyUseCase `json:"use_cases"` +} + +func createCustomerManagedKeyRequestFromPb(pb *createCustomerManagedKeyRequestPb) (*CreateCustomerManagedKeyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCustomerManagedKeyRequest{} + st.AwsKeyInfo = pb.AwsKeyInfo + st.GcpKeyInfo = pb.GcpKeyInfo + st.UseCases = pb.UseCases + + return st, nil +} + +func createGcpKeyInfoToPb(st *CreateGcpKeyInfo) (*createGcpKeyInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &createGcpKeyInfoPb{} + pb.KmsKeyId = st.KmsKeyId + + return pb, nil +} + +type createGcpKeyInfoPb struct { + KmsKeyId string `json:"kms_key_id"` +} + +func createGcpKeyInfoFromPb(pb *createGcpKeyInfoPb) (*CreateGcpKeyInfo, error) { + if pb == nil { + return nil, nil + } + st := &CreateGcpKeyInfo{} + st.KmsKeyId = pb.KmsKeyId + + return st, nil +} + +func createNetworkRequestToPb(st *CreateNetworkRequest) (*createNetworkRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createNetworkRequestPb{} + pb.GcpNetworkInfo = st.GcpNetworkInfo + + pb.NetworkName = st.NetworkName + + pb.SecurityGroupIds = st.SecurityGroupIds + + pb.SubnetIds = st.SubnetIds + + pb.VpcEndpoints = st.VpcEndpoints + + pb.VpcId = st.VpcId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createNetworkRequestPb struct { + GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + + NetworkName string `json:"network_name"` + + SecurityGroupIds []string `json:"security_group_ids,omitempty"` + + SubnetIds []string `json:"subnet_ids,omitempty"` + + VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + + VpcId string `json:"vpc_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createNetworkRequestFromPb(pb *createNetworkRequestPb) (*CreateNetworkRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateNetworkRequest{} + st.GcpNetworkInfo = pb.GcpNetworkInfo + st.NetworkName = pb.NetworkName + st.SecurityGroupIds = pb.SecurityGroupIds + st.SubnetIds = pb.SubnetIds + st.VpcEndpoints = pb.VpcEndpoints + st.VpcId = pb.VpcId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createNetworkRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createNetworkRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createStorageConfigurationRequestToPb(st *CreateStorageConfigurationRequest) (*createStorageConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createStorageConfigurationRequestPb{} + pb.RootBucketInfo = st.RootBucketInfo + + pb.StorageConfigurationName = st.StorageConfigurationName + + return pb, nil +} + +type createStorageConfigurationRequestPb struct { + RootBucketInfo RootBucketInfo `json:"root_bucket_info"` + + StorageConfigurationName string `json:"storage_configuration_name"` +} + +func createStorageConfigurationRequestFromPb(pb *createStorageConfigurationRequestPb) (*CreateStorageConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateStorageConfigurationRequest{} + st.RootBucketInfo = pb.RootBucketInfo + st.StorageConfigurationName = pb.StorageConfigurationName + + return st, nil +} + +func createVpcEndpointRequestToPb(st *CreateVpcEndpointRequest) (*createVpcEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createVpcEndpointRequestPb{} + pb.AwsVpcEndpointId = st.AwsVpcEndpointId + + pb.GcpVpcEndpointInfo = st.GcpVpcEndpointInfo + + pb.Region = st.Region + + pb.VpcEndpointName = st.VpcEndpointName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createVpcEndpointRequestPb struct { + AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` + + GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` + + Region string `json:"region,omitempty"` + + VpcEndpointName string `json:"vpc_endpoint_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createVpcEndpointRequestFromPb(pb *createVpcEndpointRequestPb) (*CreateVpcEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateVpcEndpointRequest{} + st.AwsVpcEndpointId = pb.AwsVpcEndpointId + st.GcpVpcEndpointInfo = pb.GcpVpcEndpointInfo + st.Region = pb.Region + st.VpcEndpointName = pb.VpcEndpointName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createVpcEndpointRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createVpcEndpointRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createWorkspaceRequestToPb(st *CreateWorkspaceRequest) (*createWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createWorkspaceRequestPb{} + pb.AwsRegion = st.AwsRegion + + pb.Cloud = st.Cloud + + pb.CloudResourceContainer = st.CloudResourceContainer + + pb.CredentialsId = st.CredentialsId + + pb.CustomTags = st.CustomTags + + pb.DeploymentName = st.DeploymentName + + pb.GcpManagedNetworkConfig = st.GcpManagedNetworkConfig + + pb.GkeConfig = st.GkeConfig + + pb.IsNoPublicIpEnabled = st.IsNoPublicIpEnabled + + pb.Location = st.Location + + pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId + + pb.NetworkId = st.NetworkId + + pb.PricingTier = st.PricingTier + + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId + + pb.WorkspaceName = st.WorkspaceName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createWorkspaceRequestPb struct { + AwsRegion string `json:"aws_region,omitempty"` + + Cloud string `json:"cloud,omitempty"` + + CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + + CredentialsId string `json:"credentials_id,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DeploymentName string `json:"deployment_name,omitempty"` + + GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + + GkeConfig *GkeConfig `json:"gke_config,omitempty"` + + IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + + Location string `json:"location,omitempty"` + + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + + NetworkId string `json:"network_id,omitempty"` + + PricingTier PricingTier `json:"pricing_tier,omitempty"` + + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + + WorkspaceName string `json:"workspace_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createWorkspaceRequestFromPb(pb *createWorkspaceRequestPb) (*CreateWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateWorkspaceRequest{} + st.AwsRegion = pb.AwsRegion + st.Cloud = pb.Cloud + st.CloudResourceContainer = pb.CloudResourceContainer + st.CredentialsId = pb.CredentialsId + st.CustomTags = pb.CustomTags + st.DeploymentName = pb.DeploymentName + st.GcpManagedNetworkConfig = pb.GcpManagedNetworkConfig + st.GkeConfig = pb.GkeConfig + st.IsNoPublicIpEnabled = pb.IsNoPublicIpEnabled + st.Location = pb.Location + st.ManagedServicesCustomerManagedKeyId = pb.ManagedServicesCustomerManagedKeyId + st.NetworkId = pb.NetworkId + st.PricingTier = pb.PricingTier + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + st.StorageConfigurationId = pb.StorageConfigurationId + st.StorageCustomerManagedKeyId = pb.StorageCustomerManagedKeyId + st.WorkspaceName = pb.WorkspaceName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createWorkspaceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createWorkspaceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func credentialToPb(st *Credential) (*credentialPb, error) { + if st == nil { + return nil, nil + } + pb := &credentialPb{} + pb.AccountId = st.AccountId + + pb.AwsCredentials = st.AwsCredentials + + pb.CreationTime = st.CreationTime + + pb.CredentialsId = st.CredentialsId + + pb.CredentialsName = st.CredentialsName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type credentialPb struct { + AccountId string `json:"account_id,omitempty"` + + AwsCredentials *AwsCredentials `json:"aws_credentials,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + CredentialsId string `json:"credentials_id,omitempty"` + + CredentialsName string `json:"credentials_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func credentialFromPb(pb *credentialPb) (*Credential, error) { + if pb == nil { + return nil, nil + } + st := &Credential{} + st.AccountId = pb.AccountId + st.AwsCredentials = pb.AwsCredentials + st.CreationTime = pb.CreationTime + st.CredentialsId = pb.CredentialsId + st.CredentialsName = pb.CredentialsName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *credentialPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st credentialPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func customerFacingGcpCloudResourceContainerToPb(st *CustomerFacingGcpCloudResourceContainer) (*customerFacingGcpCloudResourceContainerPb, error) { + if st == nil { + return nil, nil + } + pb := &customerFacingGcpCloudResourceContainerPb{} + pb.ProjectId = st.ProjectId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type customerFacingGcpCloudResourceContainerPb struct { + ProjectId string `json:"project_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func customerFacingGcpCloudResourceContainerFromPb(pb *customerFacingGcpCloudResourceContainerPb) (*CustomerFacingGcpCloudResourceContainer, error) { + if pb == nil { + return nil, nil + } + st := &CustomerFacingGcpCloudResourceContainer{} + st.ProjectId = pb.ProjectId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *customerFacingGcpCloudResourceContainerPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st customerFacingGcpCloudResourceContainerPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func customerManagedKeyToPb(st *CustomerManagedKey) (*customerManagedKeyPb, error) { + if st == nil { + return nil, nil + } + pb := &customerManagedKeyPb{} + pb.AccountId = st.AccountId + + pb.AwsKeyInfo = st.AwsKeyInfo + + pb.CreationTime = st.CreationTime + + pb.CustomerManagedKeyId = st.CustomerManagedKeyId + + pb.GcpKeyInfo = st.GcpKeyInfo + + pb.UseCases = st.UseCases + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type customerManagedKeyPb struct { + AccountId string `json:"account_id,omitempty"` + + AwsKeyInfo *AwsKeyInfo `json:"aws_key_info,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + CustomerManagedKeyId string `json:"customer_managed_key_id,omitempty"` + + GcpKeyInfo *GcpKeyInfo `json:"gcp_key_info,omitempty"` + + UseCases []KeyUseCase `json:"use_cases,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func customerManagedKeyFromPb(pb *customerManagedKeyPb) (*CustomerManagedKey, error) { + if pb == nil { + return nil, nil + } + st := &CustomerManagedKey{} + st.AccountId = pb.AccountId + st.AwsKeyInfo = pb.AwsKeyInfo + st.CreationTime = pb.CreationTime + st.CustomerManagedKeyId = pb.CustomerManagedKeyId + st.GcpKeyInfo = pb.GcpKeyInfo + st.UseCases = pb.UseCases + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *customerManagedKeyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st customerManagedKeyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteCredentialRequestToPb(st *DeleteCredentialRequest) (*deleteCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCredentialRequestPb{} + pb.CredentialsId = st.CredentialsId + + return pb, nil +} + +type deleteCredentialRequestPb struct { + CredentialsId string `json:"-" url:"-"` +} + +func deleteCredentialRequestFromPb(pb *deleteCredentialRequestPb) (*DeleteCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCredentialRequest{} + st.CredentialsId = pb.CredentialsId + + return st, nil +} + +func deleteEncryptionKeyRequestToPb(st *DeleteEncryptionKeyRequest) (*deleteEncryptionKeyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteEncryptionKeyRequestPb{} + pb.CustomerManagedKeyId = st.CustomerManagedKeyId + + return pb, nil +} + +type deleteEncryptionKeyRequestPb struct { + CustomerManagedKeyId string `json:"-" url:"-"` +} + +func deleteEncryptionKeyRequestFromPb(pb *deleteEncryptionKeyRequestPb) (*DeleteEncryptionKeyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteEncryptionKeyRequest{} + st.CustomerManagedKeyId = pb.CustomerManagedKeyId + + return st, nil +} + +func deleteNetworkRequestToPb(st *DeleteNetworkRequest) (*deleteNetworkRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNetworkRequestPb{} + pb.NetworkId = st.NetworkId + + return pb, nil +} + +type deleteNetworkRequestPb struct { + NetworkId string `json:"-" url:"-"` +} + +func deleteNetworkRequestFromPb(pb *deleteNetworkRequestPb) (*DeleteNetworkRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNetworkRequest{} + st.NetworkId = pb.NetworkId + + return st, nil +} + +func deletePrivateAccesRequestToPb(st *DeletePrivateAccesRequest) (*deletePrivateAccesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePrivateAccesRequestPb{} + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + return pb, nil +} + +type deletePrivateAccesRequestPb struct { + PrivateAccessSettingsId string `json:"-" url:"-"` +} + +func deletePrivateAccesRequestFromPb(pb *deletePrivateAccesRequestPb) (*DeletePrivateAccesRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeletePrivateAccesRequest{} + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteStorageRequestToPb(st *DeleteStorageRequest) (*deleteStorageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteStorageRequestPb{} + pb.StorageConfigurationId = st.StorageConfigurationId + + return pb, nil +} + +type deleteStorageRequestPb struct { + StorageConfigurationId string `json:"-" url:"-"` +} + +func deleteStorageRequestFromPb(pb *deleteStorageRequestPb) (*DeleteStorageRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteStorageRequest{} + st.StorageConfigurationId = pb.StorageConfigurationId + + return st, nil +} + +func deleteVpcEndpointRequestToPb(st *DeleteVpcEndpointRequest) (*deleteVpcEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteVpcEndpointRequestPb{} + pb.VpcEndpointId = st.VpcEndpointId + + return pb, nil +} + +type deleteVpcEndpointRequestPb struct { + VpcEndpointId string `json:"-" url:"-"` +} + +func deleteVpcEndpointRequestFromPb(pb *deleteVpcEndpointRequestPb) (*DeleteVpcEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteVpcEndpointRequest{} + st.VpcEndpointId = pb.VpcEndpointId + + return st, nil +} + +func deleteWorkspaceRequestToPb(st *DeleteWorkspaceRequest) (*deleteWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWorkspaceRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type deleteWorkspaceRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func deleteWorkspaceRequestFromPb(pb *deleteWorkspaceRequestPb) (*DeleteWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWorkspaceRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func externalCustomerInfoToPb(st *ExternalCustomerInfo) (*externalCustomerInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &externalCustomerInfoPb{} + pb.AuthoritativeUserEmail = st.AuthoritativeUserEmail + + pb.AuthoritativeUserFullName = st.AuthoritativeUserFullName + + pb.CustomerName = st.CustomerName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalCustomerInfoPb struct { + AuthoritativeUserEmail string `json:"authoritative_user_email,omitempty"` + + AuthoritativeUserFullName string `json:"authoritative_user_full_name,omitempty"` + + CustomerName string `json:"customer_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalCustomerInfoFromPb(pb *externalCustomerInfoPb) (*ExternalCustomerInfo, error) { + if pb == nil { + return nil, nil + } + st := &ExternalCustomerInfo{} + st.AuthoritativeUserEmail = pb.AuthoritativeUserEmail + st.AuthoritativeUserFullName = pb.AuthoritativeUserFullName + st.CustomerName = pb.CustomerName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalCustomerInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalCustomerInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gcpKeyInfoToPb(st *GcpKeyInfo) (*gcpKeyInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpKeyInfoPb{} + pb.KmsKeyId = st.KmsKeyId + + return pb, nil +} + +type gcpKeyInfoPb struct { + KmsKeyId string `json:"kms_key_id"` +} + +func gcpKeyInfoFromPb(pb *gcpKeyInfoPb) (*GcpKeyInfo, error) { + if pb == nil { + return nil, nil + } + st := &GcpKeyInfo{} + st.KmsKeyId = pb.KmsKeyId + + return st, nil +} + +func gcpManagedNetworkConfigToPb(st *GcpManagedNetworkConfig) (*gcpManagedNetworkConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpManagedNetworkConfigPb{} + pb.GkeClusterPodIpRange = st.GkeClusterPodIpRange + + pb.GkeClusterServiceIpRange = st.GkeClusterServiceIpRange + + pb.SubnetCidr = st.SubnetCidr + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gcpManagedNetworkConfigPb struct { + GkeClusterPodIpRange string `json:"gke_cluster_pod_ip_range,omitempty"` + + GkeClusterServiceIpRange string `json:"gke_cluster_service_ip_range,omitempty"` + + SubnetCidr string `json:"subnet_cidr,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gcpManagedNetworkConfigFromPb(pb *gcpManagedNetworkConfigPb) (*GcpManagedNetworkConfig, error) { + if pb == nil { + return nil, nil + } + st := &GcpManagedNetworkConfig{} + st.GkeClusterPodIpRange = pb.GkeClusterPodIpRange + st.GkeClusterServiceIpRange = pb.GkeClusterServiceIpRange + st.SubnetCidr = pb.SubnetCidr + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gcpManagedNetworkConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gcpManagedNetworkConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func gcpNetworkInfoToPb(st *GcpNetworkInfo) (*gcpNetworkInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpNetworkInfoPb{} + pb.NetworkProjectId = st.NetworkProjectId + + pb.PodIpRangeName = st.PodIpRangeName + + pb.ServiceIpRangeName = st.ServiceIpRangeName + + pb.SubnetId = st.SubnetId + + pb.SubnetRegion = st.SubnetRegion + + pb.VpcId = st.VpcId + + return pb, nil +} + +type gcpNetworkInfoPb struct { + NetworkProjectId string `json:"network_project_id"` + + PodIpRangeName string `json:"pod_ip_range_name"` + + ServiceIpRangeName string `json:"service_ip_range_name"` + + SubnetId string `json:"subnet_id"` + + SubnetRegion string `json:"subnet_region"` + + VpcId string `json:"vpc_id"` +} + +func gcpNetworkInfoFromPb(pb *gcpNetworkInfoPb) (*GcpNetworkInfo, error) { + if pb == nil { + return nil, nil + } + st := &GcpNetworkInfo{} + st.NetworkProjectId = pb.NetworkProjectId + st.PodIpRangeName = pb.PodIpRangeName + st.ServiceIpRangeName = pb.ServiceIpRangeName + st.SubnetId = pb.SubnetId + st.SubnetRegion = pb.SubnetRegion + st.VpcId = pb.VpcId + + return st, nil +} + +func gcpVpcEndpointInfoToPb(st *GcpVpcEndpointInfo) (*gcpVpcEndpointInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &gcpVpcEndpointInfoPb{} + pb.EndpointRegion = st.EndpointRegion + + pb.ProjectId = st.ProjectId + + pb.PscConnectionId = st.PscConnectionId + + pb.PscEndpointName = st.PscEndpointName + + pb.ServiceAttachmentId = st.ServiceAttachmentId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gcpVpcEndpointInfoPb struct { + EndpointRegion string `json:"endpoint_region"` + + ProjectId string `json:"project_id"` + + PscConnectionId string `json:"psc_connection_id,omitempty"` + + PscEndpointName string `json:"psc_endpoint_name"` + + ServiceAttachmentId string `json:"service_attachment_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gcpVpcEndpointInfoFromPb(pb *gcpVpcEndpointInfoPb) (*GcpVpcEndpointInfo, error) { + if pb == nil { + return nil, nil + } + st := &GcpVpcEndpointInfo{} + st.EndpointRegion = pb.EndpointRegion + st.ProjectId = pb.ProjectId + st.PscConnectionId = pb.PscConnectionId + st.PscEndpointName = pb.PscEndpointName + st.ServiceAttachmentId = pb.ServiceAttachmentId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gcpVpcEndpointInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gcpVpcEndpointInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getCredentialRequestToPb(st *GetCredentialRequest) (*getCredentialRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialRequestPb{} + pb.CredentialsId = st.CredentialsId + + return pb, nil +} + +type getCredentialRequestPb struct { + CredentialsId string `json:"-" url:"-"` +} + +func getCredentialRequestFromPb(pb *getCredentialRequestPb) (*GetCredentialRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialRequest{} + st.CredentialsId = pb.CredentialsId + + return st, nil +} + +func getEncryptionKeyRequestToPb(st *GetEncryptionKeyRequest) (*getEncryptionKeyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getEncryptionKeyRequestPb{} + pb.CustomerManagedKeyId = st.CustomerManagedKeyId + + return pb, nil +} + +type getEncryptionKeyRequestPb struct { + CustomerManagedKeyId string `json:"-" url:"-"` +} + +func getEncryptionKeyRequestFromPb(pb *getEncryptionKeyRequestPb) (*GetEncryptionKeyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetEncryptionKeyRequest{} + st.CustomerManagedKeyId = pb.CustomerManagedKeyId + + return st, nil +} + +func getNetworkRequestToPb(st *GetNetworkRequest) (*getNetworkRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getNetworkRequestPb{} + pb.NetworkId = st.NetworkId + + return pb, nil +} + +type getNetworkRequestPb struct { + NetworkId string `json:"-" url:"-"` +} + +func getNetworkRequestFromPb(pb *getNetworkRequestPb) (*GetNetworkRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetNetworkRequest{} + st.NetworkId = pb.NetworkId + + return st, nil +} + +func getPrivateAccesRequestToPb(st *GetPrivateAccesRequest) (*getPrivateAccesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPrivateAccesRequestPb{} + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + return pb, nil +} + +type getPrivateAccesRequestPb struct { + PrivateAccessSettingsId string `json:"-" url:"-"` +} + +func getPrivateAccesRequestFromPb(pb *getPrivateAccesRequestPb) (*GetPrivateAccesRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPrivateAccesRequest{} + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + + return st, nil +} + +func getStorageRequestToPb(st *GetStorageRequest) (*getStorageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStorageRequestPb{} + pb.StorageConfigurationId = st.StorageConfigurationId + + return pb, nil +} + +type getStorageRequestPb struct { + StorageConfigurationId string `json:"-" url:"-"` +} + +func getStorageRequestFromPb(pb *getStorageRequestPb) (*GetStorageRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStorageRequest{} + st.StorageConfigurationId = pb.StorageConfigurationId + + return st, nil +} + +func getVpcEndpointRequestToPb(st *GetVpcEndpointRequest) (*getVpcEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getVpcEndpointRequestPb{} + pb.VpcEndpointId = st.VpcEndpointId + + return pb, nil +} + +type getVpcEndpointRequestPb struct { + VpcEndpointId string `json:"-" url:"-"` +} + +func getVpcEndpointRequestFromPb(pb *getVpcEndpointRequestPb) (*GetVpcEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetVpcEndpointRequest{} + st.VpcEndpointId = pb.VpcEndpointId + + return st, nil +} + +func getWorkspaceRequestToPb(st *GetWorkspaceRequest) (*getWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type getWorkspaceRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func getWorkspaceRequestFromPb(pb *getWorkspaceRequestPb) (*GetWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func gkeConfigToPb(st *GkeConfig) (*gkeConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &gkeConfigPb{} + pb.ConnectivityType = st.ConnectivityType + + pb.MasterIpRange = st.MasterIpRange + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type gkeConfigPb struct { + ConnectivityType GkeConfigConnectivityType `json:"connectivity_type,omitempty"` + + MasterIpRange string `json:"master_ip_range,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func gkeConfigFromPb(pb *gkeConfigPb) (*GkeConfig, error) { + if pb == nil { + return nil, nil + } + st := &GkeConfig{} + st.ConnectivityType = pb.ConnectivityType + st.MasterIpRange = pb.MasterIpRange + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *gkeConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st gkeConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func networkToPb(st *Network) (*networkPb, error) { + if st == nil { + return nil, nil + } + pb := &networkPb{} + pb.AccountId = st.AccountId + + pb.CreationTime = st.CreationTime + + pb.ErrorMessages = st.ErrorMessages + + pb.GcpNetworkInfo = st.GcpNetworkInfo + + pb.NetworkId = st.NetworkId + + pb.NetworkName = st.NetworkName + + pb.SecurityGroupIds = st.SecurityGroupIds + + pb.SubnetIds = st.SubnetIds + + pb.VpcEndpoints = st.VpcEndpoints + + pb.VpcId = st.VpcId + + pb.VpcStatus = st.VpcStatus + + pb.WarningMessages = st.WarningMessages + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type networkPb struct { + AccountId string `json:"account_id,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + ErrorMessages []NetworkHealth `json:"error_messages,omitempty"` + + GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + + NetworkId string `json:"network_id,omitempty"` + + NetworkName string `json:"network_name,omitempty"` + + SecurityGroupIds []string `json:"security_group_ids,omitempty"` + + SubnetIds []string `json:"subnet_ids,omitempty"` + + VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + + VpcId string `json:"vpc_id,omitempty"` + + VpcStatus VpcStatus `json:"vpc_status,omitempty"` + + WarningMessages []NetworkWarning `json:"warning_messages,omitempty"` + + WorkspaceId int64 `json:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func networkFromPb(pb *networkPb) (*Network, error) { + if pb == nil { + return nil, nil + } + st := &Network{} + st.AccountId = pb.AccountId + st.CreationTime = pb.CreationTime + st.ErrorMessages = pb.ErrorMessages + st.GcpNetworkInfo = pb.GcpNetworkInfo + st.NetworkId = pb.NetworkId + st.NetworkName = pb.NetworkName + st.SecurityGroupIds = pb.SecurityGroupIds + st.SubnetIds = pb.SubnetIds + st.VpcEndpoints = pb.VpcEndpoints + st.VpcId = pb.VpcId + st.VpcStatus = pb.VpcStatus + st.WarningMessages = pb.WarningMessages + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *networkPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st networkPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func networkHealthToPb(st *NetworkHealth) (*networkHealthPb, error) { + if st == nil { + return nil, nil + } + pb := &networkHealthPb{} + pb.ErrorMessage = st.ErrorMessage + + pb.ErrorType = st.ErrorType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type networkHealthPb struct { + ErrorMessage string `json:"error_message,omitempty"` + + ErrorType ErrorType `json:"error_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func networkHealthFromPb(pb *networkHealthPb) (*NetworkHealth, error) { + if pb == nil { + return nil, nil + } + st := &NetworkHealth{} + st.ErrorMessage = pb.ErrorMessage + st.ErrorType = pb.ErrorType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *networkHealthPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st networkHealthPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func networkVpcEndpointsToPb(st *NetworkVpcEndpoints) (*networkVpcEndpointsPb, error) { + if st == nil { + return nil, nil + } + pb := &networkVpcEndpointsPb{} + pb.DataplaneRelay = st.DataplaneRelay + + pb.RestApi = st.RestApi + + return pb, nil +} + +type networkVpcEndpointsPb struct { + DataplaneRelay []string `json:"dataplane_relay"` + + RestApi []string `json:"rest_api"` +} + +func networkVpcEndpointsFromPb(pb *networkVpcEndpointsPb) (*NetworkVpcEndpoints, error) { + if pb == nil { + return nil, nil + } + st := &NetworkVpcEndpoints{} + st.DataplaneRelay = pb.DataplaneRelay + st.RestApi = pb.RestApi + + return st, nil +} + +func networkWarningToPb(st *NetworkWarning) (*networkWarningPb, error) { + if st == nil { + return nil, nil + } + pb := &networkWarningPb{} + pb.WarningMessage = st.WarningMessage + + pb.WarningType = st.WarningType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type networkWarningPb struct { + WarningMessage string `json:"warning_message,omitempty"` + + WarningType WarningType `json:"warning_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func networkWarningFromPb(pb *networkWarningPb) (*NetworkWarning, error) { + if pb == nil { + return nil, nil + } + st := &NetworkWarning{} + st.WarningMessage = pb.WarningMessage + st.WarningType = pb.WarningType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *networkWarningPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st networkWarningPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func privateAccessSettingsToPb(st *PrivateAccessSettings) (*privateAccessSettingsPb, error) { + if st == nil { + return nil, nil + } + pb := &privateAccessSettingsPb{} + pb.AccountId = st.AccountId + + pb.AllowedVpcEndpointIds = st.AllowedVpcEndpointIds + + pb.PrivateAccessLevel = st.PrivateAccessLevel + + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + pb.PrivateAccessSettingsName = st.PrivateAccessSettingsName + + pb.PublicAccessEnabled = st.PublicAccessEnabled + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type privateAccessSettingsPb struct { + AccountId string `json:"account_id,omitempty"` + + AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + + PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + + PrivateAccessSettingsName string `json:"private_access_settings_name,omitempty"` + + PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func privateAccessSettingsFromPb(pb *privateAccessSettingsPb) (*PrivateAccessSettings, error) { + if pb == nil { + return nil, nil + } + st := &PrivateAccessSettings{} + st.AccountId = pb.AccountId + st.AllowedVpcEndpointIds = pb.AllowedVpcEndpointIds + st.PrivateAccessLevel = pb.PrivateAccessLevel + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + st.PrivateAccessSettingsName = pb.PrivateAccessSettingsName + st.PublicAccessEnabled = pb.PublicAccessEnabled + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *privateAccessSettingsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st privateAccessSettingsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func replaceResponseToPb(st *ReplaceResponse) (*replaceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &replaceResponsePb{} + + return pb, nil +} + +type replaceResponsePb struct { +} + +func replaceResponseFromPb(pb *replaceResponsePb) (*ReplaceResponse, error) { + if pb == nil { + return nil, nil + } + st := &ReplaceResponse{} + + return st, nil +} + +func rootBucketInfoToPb(st *RootBucketInfo) (*rootBucketInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &rootBucketInfoPb{} + pb.BucketName = st.BucketName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type rootBucketInfoPb struct { + BucketName string `json:"bucket_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func rootBucketInfoFromPb(pb *rootBucketInfoPb) (*RootBucketInfo, error) { + if pb == nil { + return nil, nil + } + st := &RootBucketInfo{} + st.BucketName = pb.BucketName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *rootBucketInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st rootBucketInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func storageConfigurationToPb(st *StorageConfiguration) (*storageConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &storageConfigurationPb{} + pb.AccountId = st.AccountId + + pb.CreationTime = st.CreationTime + + pb.RootBucketInfo = st.RootBucketInfo + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.StorageConfigurationName = st.StorageConfigurationName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type storageConfigurationPb struct { + AccountId string `json:"account_id,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + RootBucketInfo *RootBucketInfo `json:"root_bucket_info,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + + StorageConfigurationName string `json:"storage_configuration_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func storageConfigurationFromPb(pb *storageConfigurationPb) (*StorageConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &StorageConfiguration{} + st.AccountId = pb.AccountId + st.CreationTime = pb.CreationTime + st.RootBucketInfo = pb.RootBucketInfo + st.StorageConfigurationId = pb.StorageConfigurationId + st.StorageConfigurationName = pb.StorageConfigurationName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *storageConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st storageConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func stsRoleToPb(st *StsRole) (*stsRolePb, error) { + if st == nil { + return nil, nil + } + pb := &stsRolePb{} + pb.ExternalId = st.ExternalId + + pb.RoleArn = st.RoleArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type stsRolePb struct { + ExternalId string `json:"external_id,omitempty"` + + RoleArn string `json:"role_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func stsRoleFromPb(pb *stsRolePb) (*StsRole, error) { + if pb == nil { + return nil, nil + } + st := &StsRole{} + st.ExternalId = pb.ExternalId + st.RoleArn = pb.RoleArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *stsRolePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st stsRolePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func updateWorkspaceRequestToPb(st *UpdateWorkspaceRequest) (*updateWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceRequestPb{} + pb.AwsRegion = st.AwsRegion + + pb.CredentialsId = st.CredentialsId + + pb.CustomTags = st.CustomTags + + pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId + + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.NetworkId = st.NetworkId + + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateWorkspaceRequestPb struct { + AwsRegion string `json:"aws_region,omitempty"` + + CredentialsId string `json:"credentials_id,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + + NetworkId string `json:"network_id,omitempty"` + + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + + WorkspaceId int64 `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateWorkspaceRequestFromPb(pb *updateWorkspaceRequestPb) (*UpdateWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceRequest{} + st.AwsRegion = pb.AwsRegion + st.CredentialsId = pb.CredentialsId + st.CustomTags = pb.CustomTags + st.ManagedServicesCustomerManagedKeyId = pb.ManagedServicesCustomerManagedKeyId + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.NetworkId = pb.NetworkId + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + st.StorageConfigurationId = pb.StorageConfigurationId + st.StorageCustomerManagedKeyId = pb.StorageCustomerManagedKeyId + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateWorkspaceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateWorkspaceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func upsertPrivateAccessSettingsRequestToPb(st *UpsertPrivateAccessSettingsRequest) (*upsertPrivateAccessSettingsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &upsertPrivateAccessSettingsRequestPb{} + pb.AllowedVpcEndpointIds = st.AllowedVpcEndpointIds + + pb.PrivateAccessLevel = st.PrivateAccessLevel + + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + pb.PrivateAccessSettingsName = st.PrivateAccessSettingsName + + pb.PublicAccessEnabled = st.PublicAccessEnabled + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type upsertPrivateAccessSettingsRequestPb struct { + AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + + PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + + PrivateAccessSettingsId string `json:"-" url:"-"` + + PrivateAccessSettingsName string `json:"private_access_settings_name"` + + PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + + Region string `json:"region"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func upsertPrivateAccessSettingsRequestFromPb(pb *upsertPrivateAccessSettingsRequestPb) (*UpsertPrivateAccessSettingsRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpsertPrivateAccessSettingsRequest{} + st.AllowedVpcEndpointIds = pb.AllowedVpcEndpointIds + st.PrivateAccessLevel = pb.PrivateAccessLevel + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + st.PrivateAccessSettingsName = pb.PrivateAccessSettingsName + st.PublicAccessEnabled = pb.PublicAccessEnabled + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *upsertPrivateAccessSettingsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st upsertPrivateAccessSettingsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func vpcEndpointToPb(st *VpcEndpoint) (*vpcEndpointPb, error) { + if st == nil { + return nil, nil + } + pb := &vpcEndpointPb{} + pb.AccountId = st.AccountId + + pb.AwsAccountId = st.AwsAccountId + + pb.AwsEndpointServiceId = st.AwsEndpointServiceId + + pb.AwsVpcEndpointId = st.AwsVpcEndpointId + + pb.GcpVpcEndpointInfo = st.GcpVpcEndpointInfo + + pb.Region = st.Region + + pb.State = st.State + + pb.UseCase = st.UseCase + + pb.VpcEndpointId = st.VpcEndpointId + + pb.VpcEndpointName = st.VpcEndpointName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type vpcEndpointPb struct { + AccountId string `json:"account_id,omitempty"` + + AwsAccountId string `json:"aws_account_id,omitempty"` + + AwsEndpointServiceId string `json:"aws_endpoint_service_id,omitempty"` + + AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` + + GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` + + Region string `json:"region,omitempty"` + + State string `json:"state,omitempty"` + + UseCase EndpointUseCase `json:"use_case,omitempty"` + + VpcEndpointId string `json:"vpc_endpoint_id,omitempty"` + + VpcEndpointName string `json:"vpc_endpoint_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func vpcEndpointFromPb(pb *vpcEndpointPb) (*VpcEndpoint, error) { + if pb == nil { + return nil, nil + } + st := &VpcEndpoint{} + st.AccountId = pb.AccountId + st.AwsAccountId = pb.AwsAccountId + st.AwsEndpointServiceId = pb.AwsEndpointServiceId + st.AwsVpcEndpointId = pb.AwsVpcEndpointId + st.GcpVpcEndpointInfo = pb.GcpVpcEndpointInfo + st.Region = pb.Region + st.State = pb.State + st.UseCase = pb.UseCase + st.VpcEndpointId = pb.VpcEndpointId + st.VpcEndpointName = pb.VpcEndpointName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *vpcEndpointPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st vpcEndpointPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceToPb(st *Workspace) (*workspacePb, error) { + if st == nil { + return nil, nil + } + pb := &workspacePb{} + pb.AccountId = st.AccountId + + pb.AwsRegion = st.AwsRegion + + pb.AzureWorkspaceInfo = st.AzureWorkspaceInfo + + pb.Cloud = st.Cloud + + pb.CloudResourceContainer = st.CloudResourceContainer + + pb.CreationTime = st.CreationTime + + pb.CredentialsId = st.CredentialsId + + pb.CustomTags = st.CustomTags + + pb.DeploymentName = st.DeploymentName + + pb.ExternalCustomerInfo = st.ExternalCustomerInfo + + pb.GcpManagedNetworkConfig = st.GcpManagedNetworkConfig + + pb.GkeConfig = st.GkeConfig + + pb.IsNoPublicIpEnabled = st.IsNoPublicIpEnabled + + pb.Location = st.Location + + pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId + + pb.NetworkId = st.NetworkId + + pb.PricingTier = st.PricingTier + + pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId + + pb.StorageConfigurationId = st.StorageConfigurationId + + pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId + + pb.WorkspaceId = st.WorkspaceId + + pb.WorkspaceName = st.WorkspaceName + + pb.WorkspaceStatus = st.WorkspaceStatus + + pb.WorkspaceStatusMessage = st.WorkspaceStatusMessage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspacePb struct { + AccountId string `json:"account_id,omitempty"` + + AwsRegion string `json:"aws_region,omitempty"` + + AzureWorkspaceInfo *AzureWorkspaceInfo `json:"azure_workspace_info,omitempty"` + + Cloud string `json:"cloud,omitempty"` + + CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + CredentialsId string `json:"credentials_id,omitempty"` + + CustomTags map[string]string `json:"custom_tags,omitempty"` + + DeploymentName string `json:"deployment_name,omitempty"` + + ExternalCustomerInfo *ExternalCustomerInfo `json:"external_customer_info,omitempty"` + + GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + + GkeConfig *GkeConfig `json:"gke_config,omitempty"` + + IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + + Location string `json:"location,omitempty"` + + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + + NetworkId string `json:"network_id,omitempty"` + + PricingTier PricingTier `json:"pricing_tier,omitempty"` + + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + + WorkspaceId int64 `json:"workspace_id,omitempty"` + + WorkspaceName string `json:"workspace_name,omitempty"` + + WorkspaceStatus WorkspaceStatus `json:"workspace_status,omitempty"` + + WorkspaceStatusMessage string `json:"workspace_status_message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceFromPb(pb *workspacePb) (*Workspace, error) { + if pb == nil { + return nil, nil + } + st := &Workspace{} + st.AccountId = pb.AccountId + st.AwsRegion = pb.AwsRegion + st.AzureWorkspaceInfo = pb.AzureWorkspaceInfo + st.Cloud = pb.Cloud + st.CloudResourceContainer = pb.CloudResourceContainer + st.CreationTime = pb.CreationTime + st.CredentialsId = pb.CredentialsId + st.CustomTags = pb.CustomTags + st.DeploymentName = pb.DeploymentName + st.ExternalCustomerInfo = pb.ExternalCustomerInfo + st.GcpManagedNetworkConfig = pb.GcpManagedNetworkConfig + st.GkeConfig = pb.GkeConfig + st.IsNoPublicIpEnabled = pb.IsNoPublicIpEnabled + st.Location = pb.Location + st.ManagedServicesCustomerManagedKeyId = pb.ManagedServicesCustomerManagedKeyId + st.NetworkId = pb.NetworkId + st.PricingTier = pb.PricingTier + st.PrivateAccessSettingsId = pb.PrivateAccessSettingsId + st.StorageConfigurationId = pb.StorageConfigurationId + st.StorageCustomerManagedKeyId = pb.StorageCustomerManagedKeyId + st.WorkspaceId = pb.WorkspaceId + st.WorkspaceName = pb.WorkspaceName + st.WorkspaceStatus = pb.WorkspaceStatus + st.WorkspaceStatusMessage = pb.WorkspaceStatusMessage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspacePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspacePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/provisioning/model.go b/service/provisioning/model.go index af68dac4a..27449ff31 100755 --- a/service/provisioning/model.go +++ b/service/provisioning/model.go @@ -3,200 +3,518 @@ package provisioning import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AwsCredentials struct { - StsRole *StsRole `json:"sts_role,omitempty"` + + // Wire name: 'sts_role' + StsRole *StsRole +} + +func (st *AwsCredentials) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsCredentialsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsCredentialsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AwsCredentials) MarshalJSON() ([]byte, error) { + pb, err := awsCredentialsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AwsKeyInfo struct { // The AWS KMS key alias. - KeyAlias string `json:"key_alias,omitempty"` + // Wire name: 'key_alias' + KeyAlias string // The AWS KMS key's Amazon Resource Name (ARN). - KeyArn string `json:"key_arn"` + // Wire name: 'key_arn' + KeyArn string // The AWS KMS key region. - KeyRegion string `json:"key_region"` + // Wire name: 'key_region' + KeyRegion string // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. If you do not want to use this key for encrypting // EBS volumes, set to `false`. - ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + // Wire name: 'reuse_key_for_cluster_volumes' + ReuseKeyForClusterVolumes bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AwsKeyInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AwsKeyInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &awsKeyInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := awsKeyInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AwsKeyInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AwsKeyInfo) MarshalJSON() ([]byte, error) { + pb, err := awsKeyInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AzureWorkspaceInfo struct { // Azure Resource Group name - ResourceGroup string `json:"resource_group,omitempty"` + // Wire name: 'resource_group' + ResourceGroup string // Azure Subscription ID - SubscriptionId string `json:"subscription_id,omitempty"` + // Wire name: 'subscription_id' + SubscriptionId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AzureWorkspaceInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AzureWorkspaceInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureWorkspaceInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureWorkspaceInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AzureWorkspaceInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AzureWorkspaceInfo) MarshalJSON() ([]byte, error) { + pb, err := azureWorkspaceInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The general workspace configurations that are specific to cloud providers. type CloudResourceContainer struct { // The general workspace configurations that are specific to Google Cloud. - Gcp *CustomerFacingGcpCloudResourceContainer `json:"gcp,omitempty"` + // Wire name: 'gcp' + Gcp *CustomerFacingGcpCloudResourceContainer +} + +func (st *CloudResourceContainer) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cloudResourceContainerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cloudResourceContainerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CloudResourceContainer) MarshalJSON() ([]byte, error) { + pb, err := cloudResourceContainerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateAwsKeyInfo struct { // The AWS KMS key alias. - KeyAlias string `json:"key_alias,omitempty"` + // Wire name: 'key_alias' + KeyAlias string // The AWS KMS key's Amazon Resource Name (ARN). Note that the key's AWS // region is inferred from the ARN. - KeyArn string `json:"key_arn"` + // Wire name: 'key_arn' + KeyArn string // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. To not use this key also for encrypting EBS volumes, // set this to `false`. - ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + // Wire name: 'reuse_key_for_cluster_volumes' + ReuseKeyForClusterVolumes bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAwsKeyInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAwsKeyInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAwsKeyInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAwsKeyInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAwsKeyInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAwsKeyInfo) MarshalJSON() ([]byte, error) { + pb, err := createAwsKeyInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialAwsCredentials struct { - StsRole *CreateCredentialStsRole `json:"sts_role,omitempty"` + + // Wire name: 'sts_role' + StsRole *CreateCredentialStsRole +} + +func (st *CreateCredentialAwsCredentials) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialAwsCredentialsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialAwsCredentialsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCredentialAwsCredentials) MarshalJSON() ([]byte, error) { + pb, err := createCredentialAwsCredentialsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialRequest struct { - AwsCredentials CreateCredentialAwsCredentials `json:"aws_credentials"` + + // Wire name: 'aws_credentials' + AwsCredentials CreateCredentialAwsCredentials // The human-readable name of the credential configuration object. - CredentialsName string `json:"credentials_name"` + // Wire name: 'credentials_name' + CredentialsName string +} + +func (st *CreateCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := createCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialStsRole struct { // The Amazon Resource Name (ARN) of the cross account role. - RoleArn string `json:"role_arn,omitempty"` + // Wire name: 'role_arn' + RoleArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCredentialStsRole) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCredentialStsRole) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialStsRolePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialStsRoleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCredentialStsRole) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCredentialStsRole) MarshalJSON() ([]byte, error) { + pb, err := createCredentialStsRoleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCustomerManagedKeyRequest struct { - AwsKeyInfo *CreateAwsKeyInfo `json:"aws_key_info,omitempty"` - GcpKeyInfo *CreateGcpKeyInfo `json:"gcp_key_info,omitempty"` + // Wire name: 'aws_key_info' + AwsKeyInfo *CreateAwsKeyInfo + + // Wire name: 'gcp_key_info' + GcpKeyInfo *CreateGcpKeyInfo // The cases that the key can be used for. - UseCases []KeyUseCase `json:"use_cases"` + // Wire name: 'use_cases' + UseCases []KeyUseCase +} + +func (st *CreateCustomerManagedKeyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCustomerManagedKeyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCustomerManagedKeyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateCustomerManagedKeyRequest) MarshalJSON() ([]byte, error) { + pb, err := createCustomerManagedKeyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateGcpKeyInfo struct { // The GCP KMS key's resource name - KmsKeyId string `json:"kms_key_id"` + // Wire name: 'kms_key_id' + KmsKeyId string +} + +func (st *CreateGcpKeyInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createGcpKeyInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createGcpKeyInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateGcpKeyInfo) MarshalJSON() ([]byte, error) { + pb, err := createGcpKeyInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateNetworkRequest struct { // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + // Wire name: 'gcp_network_info' + GcpNetworkInfo *GcpNetworkInfo // The human-readable name of the network configuration. - NetworkName string `json:"network_name"` + // Wire name: 'network_name' + NetworkName string // IDs of one to five security groups associated with this network. Security // group IDs **cannot** be used in multiple network configurations. - SecurityGroupIds []string `json:"security_group_ids,omitempty"` + // Wire name: 'security_group_ids' + SecurityGroupIds []string // IDs of at least two subnets associated with this network. Subnet IDs // **cannot** be used in multiple network configurations. - SubnetIds []string `json:"subnet_ids,omitempty"` + // Wire name: 'subnet_ids' + SubnetIds []string // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + // Wire name: 'vpc_endpoints' + VpcEndpoints *NetworkVpcEndpoints // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId string `json:"vpc_id,omitempty"` + // Wire name: 'vpc_id' + VpcId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateNetworkRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateNetworkRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createNetworkRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createNetworkRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateNetworkRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateNetworkRequest) MarshalJSON() ([]byte, error) { + pb, err := createNetworkRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateStorageConfigurationRequest struct { // Root S3 bucket information. - RootBucketInfo RootBucketInfo `json:"root_bucket_info"` + // Wire name: 'root_bucket_info' + RootBucketInfo RootBucketInfo // The human-readable name of the storage configuration. - StorageConfigurationName string `json:"storage_configuration_name"` + // Wire name: 'storage_configuration_name' + StorageConfigurationName string +} + +func (st *CreateStorageConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createStorageConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createStorageConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateStorageConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := createStorageConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateVpcEndpointRequest struct { // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` + // Wire name: 'aws_vpc_endpoint_id' + AwsVpcEndpointId string // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` + // Wire name: 'gcp_vpc_endpoint_info' + GcpVpcEndpointInfo *GcpVpcEndpointInfo // The AWS region in which this VPC endpoint object exists. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The human-readable name of the storage configuration. - VpcEndpointName string `json:"vpc_endpoint_name"` + // Wire name: 'vpc_endpoint_name' + VpcEndpointName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateVpcEndpointRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateVpcEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createVpcEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createVpcEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateVpcEndpointRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateVpcEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := createVpcEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateWorkspaceRequest struct { // The AWS region of the workspace's data plane. - AwsRegion string `json:"aws_region,omitempty"` + // Wire name: 'aws_region' + AwsRegion string // The cloud provider which the workspace uses. For Google Cloud workspaces, // always set this field to `gcp`. - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + // Wire name: 'cloud_resource_container' + CloudResourceContainer *CloudResourceContainer // ID of the workspace's credential configuration object. - CredentialsId string `json:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // The deployment name defines part of the subdomain for the workspace. The // workspace URL for the web application and REST APIs is // `.cloud.databricks.com`. For example, if the @@ -226,7 +544,8 @@ type CreateWorkspaceRequest struct { // // If a new workspace omits this property, the server generates a unique // deployment name for you with the pattern `dbc-xxxxxxxx-xxxx`. - DeploymentName string `json:"deployment_name,omitempty"` + // Wire name: 'deployment_name' + DeploymentName string // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -250,27 +569,34 @@ type CreateWorkspaceRequest struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + // Wire name: 'gcp_managed_network_config' + GcpManagedNetworkConfig *GcpManagedNetworkConfig // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig *GkeConfig `json:"gke_config,omitempty"` + // Wire name: 'gke_config' + GkeConfig *GkeConfig // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + // Wire name: 'is_no_public_ip_enabled' + IsNoPublicIpEnabled bool // The Google Cloud region of the workspace data plane in your Google // account. For example, `us-east4`. - Location string `json:"location,omitempty"` + // Wire name: 'location' + Location string // The ID of the workspace's managed services encryption key configuration // object. This is used to help protect and control access to the // workspace's notebooks, secrets, Databricks SQL queries, and query // history. The provided key configuration object property `use_cases` must // contain `MANAGED_SERVICES`. - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + // Wire name: 'managed_services_customer_managed_key_id' + ManagedServicesCustomerManagedKeyId string - NetworkId string `json:"network_id,omitempty"` + // Wire name: 'network_id' + NetworkId string // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier PricingTier `json:"pricing_tier,omitempty"` + // Wire name: 'pricing_tier' + PricingTier PricingTier // ID of the workspace's private access settings object. Only used for // PrivateLink. This ID must be specified for customers using [AWS // PrivateLink] for either front-end (user-to-workspace connection), @@ -282,142 +608,450 @@ type CreateWorkspaceRequest struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string // The ID of the workspace's storage configuration object. - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // The ID of the workspace's storage encryption key configuration object. // This is used to encrypt the workspace's root S3 bucket (root DBFS and // system data) and, optionally, cluster EBS volumes. The provided key // configuration object property `use_cases` must contain `STORAGE`. - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + // Wire name: 'storage_customer_managed_key_id' + StorageCustomerManagedKeyId string // The workspace's human-readable name. - WorkspaceName string `json:"workspace_name"` + // Wire name: 'workspace_name' + WorkspaceName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateWorkspaceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateWorkspaceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := createWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Credential struct { // The Databricks account ID that hosts the credential. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string - AwsCredentials *AwsCredentials `json:"aws_credentials,omitempty"` + // Wire name: 'aws_credentials' + AwsCredentials *AwsCredentials // Time in epoch milliseconds when the credential was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Databricks credential configuration ID. - CredentialsId string `json:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string // The human-readable name of the credential configuration object. - CredentialsName string `json:"credentials_name,omitempty"` + // Wire name: 'credentials_name' + CredentialsName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Credential) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Credential) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &credentialPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := credentialFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Credential) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Credential) MarshalJSON() ([]byte, error) { + pb, err := credentialToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. + type CustomTags map[string]string +type customTagsPb CustomTags + +func customTagsToPb(st *CustomTags) (*customTagsPb, error) { + if st == nil { + return nil, nil + } + stPb := customTagsPb(*st) + return &stPb, nil +} +func customTagsFromPb(stPb *customTagsPb) (*CustomTags, error) { + if stPb == nil { + return nil, nil + } + st := CustomTags(*stPb) + return &st, nil +} // The general workspace configurations that are specific to Google Cloud. type CustomerFacingGcpCloudResourceContainer struct { // The Google Cloud project ID, which the workspace uses to instantiate // cloud resources for your workspace. - ProjectId string `json:"project_id,omitempty"` + // Wire name: 'project_id' + ProjectId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CustomerFacingGcpCloudResourceContainer) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CustomerFacingGcpCloudResourceContainer) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &customerFacingGcpCloudResourceContainerPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := customerFacingGcpCloudResourceContainerFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CustomerFacingGcpCloudResourceContainer) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CustomerFacingGcpCloudResourceContainer) MarshalJSON() ([]byte, error) { + pb, err := customerFacingGcpCloudResourceContainerToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CustomerManagedKey struct { // The Databricks account ID that holds the customer-managed key. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string - AwsKeyInfo *AwsKeyInfo `json:"aws_key_info,omitempty"` + // Wire name: 'aws_key_info' + AwsKeyInfo *AwsKeyInfo // Time in epoch milliseconds when the customer key was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // ID of the encryption key configuration object. - CustomerManagedKeyId string `json:"customer_managed_key_id,omitempty"` + // Wire name: 'customer_managed_key_id' + CustomerManagedKeyId string - GcpKeyInfo *GcpKeyInfo `json:"gcp_key_info,omitempty"` + // Wire name: 'gcp_key_info' + GcpKeyInfo *GcpKeyInfo // The cases that the key can be used for. - UseCases []KeyUseCase `json:"use_cases,omitempty"` + // Wire name: 'use_cases' + UseCases []KeyUseCase - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CustomerManagedKey) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CustomerManagedKey) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &customerManagedKeyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := customerManagedKeyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CustomerManagedKey) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CustomerManagedKey) MarshalJSON() ([]byte, error) { + pb, err := customerManagedKeyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete credential configuration type DeleteCredentialRequest struct { // Databricks Account API credential configuration ID - CredentialsId string `json:"-" url:"-"` + // Wire name: 'credentials_id' + CredentialsId string `tf:"-"` +} + +func (st *DeleteCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete encryption key configuration type DeleteEncryptionKeyRequest struct { // Databricks encryption key configuration ID. - CustomerManagedKeyId string `json:"-" url:"-"` + // Wire name: 'customer_managed_key_id' + CustomerManagedKeyId string `tf:"-"` +} + +func (st *DeleteEncryptionKeyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteEncryptionKeyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteEncryptionKeyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteEncryptionKeyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteEncryptionKeyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a network configuration type DeleteNetworkRequest struct { // Databricks Account API network configuration ID. - NetworkId string `json:"-" url:"-"` + // Wire name: 'network_id' + NetworkId string `tf:"-"` +} + +func (st *DeleteNetworkRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNetworkRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNetworkRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNetworkRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteNetworkRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a private access settings object type DeletePrivateAccesRequest struct { // Databricks Account API private access settings ID. - PrivateAccessSettingsId string `json:"-" url:"-"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string `tf:"-"` +} + +func (st *DeletePrivateAccesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePrivateAccesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePrivateAccesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePrivateAccesRequest) MarshalJSON() ([]byte, error) { + pb, err := deletePrivateAccesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete storage configuration type DeleteStorageRequest struct { // Databricks Account API storage configuration ID. - StorageConfigurationId string `json:"-" url:"-"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string `tf:"-"` +} + +func (st *DeleteStorageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteStorageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteStorageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteStorageRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteStorageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete VPC endpoint configuration type DeleteVpcEndpointRequest struct { // Databricks VPC endpoint ID. - VpcEndpointId string `json:"-" url:"-"` + // Wire name: 'vpc_endpoint_id' + VpcEndpointId string `tf:"-"` +} + +func (st *DeleteVpcEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteVpcEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteVpcEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteVpcEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteVpcEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a workspace type DeleteWorkspaceRequest struct { // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *DeleteWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // This enumeration represents the type of Databricks VPC [endpoint service] @@ -425,6 +1059,7 @@ type DeleteWorkspaceRequest struct { // // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html type EndpointUseCase string +type endpointUseCasePb string const EndpointUseCaseDataplaneRelayAccess EndpointUseCase = `DATAPLANE_RELAY_ACCESS` @@ -451,9 +1086,26 @@ func (f *EndpointUseCase) Type() string { return "EndpointUseCase" } +func endpointUseCaseToPb(st *EndpointUseCase) (*endpointUseCasePb, error) { + if st == nil { + return nil, nil + } + pb := endpointUseCasePb(*st) + return &pb, nil +} + +func endpointUseCaseFromPb(pb *endpointUseCasePb) (*EndpointUseCase, error) { + if pb == nil { + return nil, nil + } + st := EndpointUseCase(*pb) + return &st, nil +} + // The AWS resource associated with this error: credentials, VPC, subnet, // security group, or network ACL. type ErrorType string +type errorTypePb string const ErrorTypeCredentials ErrorType = `credentials` @@ -486,28 +1138,90 @@ func (f *ErrorType) Type() string { return "ErrorType" } +func errorTypeToPb(st *ErrorType) (*errorTypePb, error) { + if st == nil { + return nil, nil + } + pb := errorTypePb(*st) + return &pb, nil +} + +func errorTypeFromPb(pb *errorTypePb) (*ErrorType, error) { + if pb == nil { + return nil, nil + } + st := ErrorType(*pb) + return &st, nil +} + type ExternalCustomerInfo struct { // Email of the authoritative user. - AuthoritativeUserEmail string `json:"authoritative_user_email,omitempty"` + // Wire name: 'authoritative_user_email' + AuthoritativeUserEmail string // The authoritative user full name. - AuthoritativeUserFullName string `json:"authoritative_user_full_name,omitempty"` + // Wire name: 'authoritative_user_full_name' + AuthoritativeUserFullName string // The legal entity name for the external workspace - CustomerName string `json:"customer_name,omitempty"` + // Wire name: 'customer_name' + CustomerName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalCustomerInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalCustomerInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalCustomerInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalCustomerInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalCustomerInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalCustomerInfo) MarshalJSON() ([]byte, error) { + pb, err := externalCustomerInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GcpKeyInfo struct { // The GCP KMS key's resource name - KmsKeyId string `json:"kms_key_id"` + // Wire name: 'kms_key_id' + KmsKeyId string +} + +func (st *GcpKeyInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpKeyInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpKeyInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GcpKeyInfo) MarshalJSON() ([]byte, error) { + pb, err := gcpKeyInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The network settings for the workspace. The configurations are only for @@ -536,114 +1250,369 @@ type GcpKeyInfo struct { type GcpManagedNetworkConfig struct { // The IP range from which to allocate GKE cluster pods. No bigger than `/9` // and no smaller than `/21`. - GkeClusterPodIpRange string `json:"gke_cluster_pod_ip_range,omitempty"` + // Wire name: 'gke_cluster_pod_ip_range' + GkeClusterPodIpRange string // The IP range from which to allocate GKE cluster services. No bigger than // `/16` and no smaller than `/27`. - GkeClusterServiceIpRange string `json:"gke_cluster_service_ip_range,omitempty"` + // Wire name: 'gke_cluster_service_ip_range' + GkeClusterServiceIpRange string // The IP range from which to allocate GKE cluster nodes. No bigger than // `/9` and no smaller than `/29`. - SubnetCidr string `json:"subnet_cidr,omitempty"` + // Wire name: 'subnet_cidr' + SubnetCidr string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GcpManagedNetworkConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GcpManagedNetworkConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpManagedNetworkConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpManagedNetworkConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GcpManagedNetworkConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GcpManagedNetworkConfig) MarshalJSON() ([]byte, error) { + pb, err := gcpManagedNetworkConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The Google Cloud specific information for this network (for example, the VPC // ID, subnet ID, and secondary IP ranges). type GcpNetworkInfo struct { // The Google Cloud project ID of the VPC network. - NetworkProjectId string `json:"network_project_id"` + // Wire name: 'network_project_id' + NetworkProjectId string // The name of the secondary IP range for pods. A Databricks-managed GKE // cluster uses this IP range for its pods. This secondary IP range can be // used by only one workspace. - PodIpRangeName string `json:"pod_ip_range_name"` + // Wire name: 'pod_ip_range_name' + PodIpRangeName string // The name of the secondary IP range for services. A Databricks-managed GKE // cluster uses this IP range for its services. This secondary IP range can // be used by only one workspace. - ServiceIpRangeName string `json:"service_ip_range_name"` + // Wire name: 'service_ip_range_name' + ServiceIpRangeName string // The ID of the subnet associated with this network. - SubnetId string `json:"subnet_id"` + // Wire name: 'subnet_id' + SubnetId string // The Google Cloud region of the workspace data plane (for example, // `us-east4`). - SubnetRegion string `json:"subnet_region"` + // Wire name: 'subnet_region' + SubnetRegion string // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId string `json:"vpc_id"` + // Wire name: 'vpc_id' + VpcId string +} + +func (st *GcpNetworkInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpNetworkInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpNetworkInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GcpNetworkInfo) MarshalJSON() ([]byte, error) { + pb, err := gcpNetworkInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The Google Cloud specific information for this Private Service Connect // endpoint. type GcpVpcEndpointInfo struct { // Region of the PSC endpoint. - EndpointRegion string `json:"endpoint_region"` + // Wire name: 'endpoint_region' + EndpointRegion string // The Google Cloud project ID of the VPC network where the PSC connection // resides. - ProjectId string `json:"project_id"` + // Wire name: 'project_id' + ProjectId string // The unique ID of this PSC connection. - PscConnectionId string `json:"psc_connection_id,omitempty"` + // Wire name: 'psc_connection_id' + PscConnectionId string // The name of the PSC endpoint in the Google Cloud project. - PscEndpointName string `json:"psc_endpoint_name"` + // Wire name: 'psc_endpoint_name' + PscEndpointName string // The service attachment this PSC connection connects to. - ServiceAttachmentId string `json:"service_attachment_id,omitempty"` + // Wire name: 'service_attachment_id' + ServiceAttachmentId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GcpVpcEndpointInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GcpVpcEndpointInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gcpVpcEndpointInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gcpVpcEndpointInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GcpVpcEndpointInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GcpVpcEndpointInfo) MarshalJSON() ([]byte, error) { + pb, err := gcpVpcEndpointInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get credential configuration type GetCredentialRequest struct { // Databricks Account API credential configuration ID - CredentialsId string `json:"-" url:"-"` + // Wire name: 'credentials_id' + CredentialsId string `tf:"-"` +} + +func (st *GetCredentialRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialRequest) MarshalJSON() ([]byte, error) { + pb, err := getCredentialRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get encryption key configuration type GetEncryptionKeyRequest struct { // Databricks encryption key configuration ID. - CustomerManagedKeyId string `json:"-" url:"-"` + // Wire name: 'customer_managed_key_id' + CustomerManagedKeyId string `tf:"-"` +} + +func (st *GetEncryptionKeyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEncryptionKeyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEncryptionKeyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetEncryptionKeyRequest) MarshalJSON() ([]byte, error) { + pb, err := getEncryptionKeyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a network configuration type GetNetworkRequest struct { // Databricks Account API network configuration ID. - NetworkId string `json:"-" url:"-"` + // Wire name: 'network_id' + NetworkId string `tf:"-"` +} + +func (st *GetNetworkRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getNetworkRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getNetworkRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetNetworkRequest) MarshalJSON() ([]byte, error) { + pb, err := getNetworkRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a private access settings object type GetPrivateAccesRequest struct { // Databricks Account API private access settings ID. - PrivateAccessSettingsId string `json:"-" url:"-"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string `tf:"-"` +} + +func (st *GetPrivateAccesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPrivateAccesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPrivateAccesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPrivateAccesRequest) MarshalJSON() ([]byte, error) { + pb, err := getPrivateAccesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get storage configuration type GetStorageRequest struct { // Databricks Account API storage configuration ID. - StorageConfigurationId string `json:"-" url:"-"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string `tf:"-"` +} + +func (st *GetStorageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStorageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStorageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStorageRequest) MarshalJSON() ([]byte, error) { + pb, err := getStorageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a VPC endpoint configuration type GetVpcEndpointRequest struct { // Databricks VPC endpoint ID. - VpcEndpointId string `json:"-" url:"-"` + // Wire name: 'vpc_endpoint_id' + VpcEndpointId string `tf:"-"` +} + +func (st *GetVpcEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getVpcEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getVpcEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetVpcEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := getVpcEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a workspace type GetWorkspaceRequest struct { // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *GetWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The configurations for the GKE cluster of a Databricks workspace. @@ -656,22 +1625,41 @@ type GkeConfig struct { // // Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of // a public GKE cluster have public IP addresses. - ConnectivityType GkeConfigConnectivityType `json:"connectivity_type,omitempty"` + // Wire name: 'connectivity_type' + ConnectivityType GkeConfigConnectivityType // The IP range from which to allocate GKE cluster master resources. This // field will be ignored if GKE private cluster is not enabled. // // It must be exactly as big as `/28`. - MasterIpRange string `json:"master_ip_range,omitempty"` + // Wire name: 'master_ip_range' + MasterIpRange string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GkeConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GkeConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &gkeConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := gkeConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GkeConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GkeConfig) MarshalJSON() ([]byte, error) { + pb, err := gkeConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Specifies the network connectivity types for the GKE nodes and the GKE master @@ -683,6 +1671,7 @@ func (s GkeConfig) MarshalJSON() ([]byte, error) { // Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of a // public GKE cluster have public IP addresses. type GkeConfigConnectivityType string +type gkeConfigConnectivityTypePb string const GkeConfigConnectivityTypePrivateNodePublicMaster GkeConfigConnectivityType = `PRIVATE_NODE_PUBLIC_MASTER` @@ -709,10 +1698,27 @@ func (f *GkeConfigConnectivityType) Type() string { return "GkeConfigConnectivityType" } +func gkeConfigConnectivityTypeToPb(st *GkeConfigConnectivityType) (*gkeConfigConnectivityTypePb, error) { + if st == nil { + return nil, nil + } + pb := gkeConfigConnectivityTypePb(*st) + return &pb, nil +} + +func gkeConfigConnectivityTypeFromPb(pb *gkeConfigConnectivityTypePb) (*GkeConfigConnectivityType, error) { + if pb == nil { + return nil, nil + } + st := GkeConfigConnectivityType(*pb) + return &st, nil +} + // Possible values are: * `MANAGED_SERVICES`: Encrypts notebook and secret data // in the control plane * `STORAGE`: Encrypts the workspace's root S3 bucket // (root DBFS and system data) and, optionally, cluster EBS volumes. type KeyUseCase string +type keyUseCasePb string // Encrypts notebook and secret data in the control plane const KeyUseCaseManagedServices KeyUseCase = `MANAGED_SERVICES` @@ -742,68 +1748,133 @@ func (f *KeyUseCase) Type() string { return "KeyUseCase" } +func keyUseCaseToPb(st *KeyUseCase) (*keyUseCasePb, error) { + if st == nil { + return nil, nil + } + pb := keyUseCasePb(*st) + return &pb, nil +} + +func keyUseCaseFromPb(pb *keyUseCasePb) (*KeyUseCase, error) { + if pb == nil { + return nil, nil + } + st := KeyUseCase(*pb) + return &st, nil +} + type Network struct { // The Databricks account ID associated with this network configuration. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Time in epoch milliseconds when the network was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Array of error messages about the network configuration. - ErrorMessages []NetworkHealth `json:"error_messages,omitempty"` + // Wire name: 'error_messages' + ErrorMessages []NetworkHealth // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + // Wire name: 'gcp_network_info' + GcpNetworkInfo *GcpNetworkInfo // The Databricks network configuration ID. - NetworkId string `json:"network_id,omitempty"` + // Wire name: 'network_id' + NetworkId string // The human-readable name of the network configuration. - NetworkName string `json:"network_name,omitempty"` + // Wire name: 'network_name' + NetworkName string - SecurityGroupIds []string `json:"security_group_ids,omitempty"` + // Wire name: 'security_group_ids' + SecurityGroupIds []string - SubnetIds []string `json:"subnet_ids,omitempty"` + // Wire name: 'subnet_ids' + SubnetIds []string // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + // Wire name: 'vpc_endpoints' + VpcEndpoints *NetworkVpcEndpoints // The ID of the VPC associated with this network configuration. VPC IDs can // be used in multiple networks. - VpcId string `json:"vpc_id,omitempty"` + // Wire name: 'vpc_id' + VpcId string // The status of this network configuration object in terms of its use in a // workspace: * `UNATTACHED`: Unattached. * `VALID`: Valid. * `BROKEN`: // Broken. * `WARNED`: Warned. - VpcStatus VpcStatus `json:"vpc_status,omitempty"` + // Wire name: 'vpc_status' + VpcStatus VpcStatus // Array of warning messages about the network configuration. - WarningMessages []NetworkWarning `json:"warning_messages,omitempty"` + // Wire name: 'warning_messages' + WarningMessages []NetworkWarning // Workspace ID associated with this network configuration. - WorkspaceId int64 `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Network) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Network) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Network) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Network) MarshalJSON() ([]byte, error) { + pb, err := networkToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NetworkHealth struct { // Details of the error. - ErrorMessage string `json:"error_message,omitempty"` + // Wire name: 'error_message' + ErrorMessage string // The AWS resource associated with this error: credentials, VPC, subnet, // security group, or network ACL. - ErrorType ErrorType `json:"error_type,omitempty"` + // Wire name: 'error_type' + ErrorType ErrorType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NetworkHealth) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NetworkHealth) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkHealthPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkHealthFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NetworkHealth) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NetworkHealth) MarshalJSON() ([]byte, error) { + pb, err := networkHealthToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // If specified, contains the VPC endpoints used to allow cluster communication @@ -813,28 +1884,74 @@ func (s NetworkHealth) MarshalJSON() ([]byte, error) { type NetworkVpcEndpoints struct { // The VPC endpoint ID used by this network to access the Databricks secure // cluster connectivity relay. - DataplaneRelay []string `json:"dataplane_relay"` + // Wire name: 'dataplane_relay' + DataplaneRelay []string // The VPC endpoint ID used by this network to access the Databricks REST // API. - RestApi []string `json:"rest_api"` + // Wire name: 'rest_api' + RestApi []string +} + +func (st *NetworkVpcEndpoints) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkVpcEndpointsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkVpcEndpointsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NetworkVpcEndpoints) MarshalJSON() ([]byte, error) { + pb, err := networkVpcEndpointsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NetworkWarning struct { // Details of the warning. - WarningMessage string `json:"warning_message,omitempty"` + // Wire name: 'warning_message' + WarningMessage string // The AWS resource associated with this warning: a subnet or a security // group. - WarningType WarningType `json:"warning_type,omitempty"` + // Wire name: 'warning_type' + WarningType WarningType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NetworkWarning) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NetworkWarning) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkWarningPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkWarningFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NetworkWarning) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NetworkWarning) MarshalJSON() ([]byte, error) { + pb, err := networkWarningToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The pricing tier of the workspace. For pricing tier information, see [AWS @@ -842,6 +1959,7 @@ func (s NetworkWarning) MarshalJSON() ([]byte, error) { // // [AWS Pricing]: https://databricks.com/product/aws-pricing type PricingTier string +type pricingTierPb string const PricingTierCommunityEdition PricingTier = `COMMUNITY_EDITION` @@ -876,6 +1994,22 @@ func (f *PricingTier) Type() string { return "PricingTier" } +func pricingTierToPb(st *PricingTier) (*pricingTierPb, error) { + if st == nil { + return nil, nil + } + pb := pricingTierPb(*st) + return &pb, nil +} + +func pricingTierFromPb(pb *pricingTierPb) (*PricingTier, error) { + if pb == nil { + return nil, nil + } + st := PricingTier(*pb) + return &st, nil +} + // The private access level controls which VPC endpoints can connect to the UI // or API of any workspace that attaches this private access settings object. * // `ACCOUNT` level access (the default) allows only VPC endpoints that are @@ -883,6 +2017,7 @@ func (f *PricingTier) Type() string { // level access allows only specified VPC endpoints connect to your workspace. // For details, see `allowed_vpc_endpoint_ids`. type PrivateAccessLevel string +type privateAccessLevelPb string const PrivateAccessLevelAccount PrivateAccessLevel = `ACCOUNT` @@ -909,149 +2044,325 @@ func (f *PrivateAccessLevel) Type() string { return "PrivateAccessLevel" } +func privateAccessLevelToPb(st *PrivateAccessLevel) (*privateAccessLevelPb, error) { + if st == nil { + return nil, nil + } + pb := privateAccessLevelPb(*st) + return &pb, nil +} + +func privateAccessLevelFromPb(pb *privateAccessLevelPb) (*PrivateAccessLevel, error) { + if pb == nil { + return nil, nil + } + st := PrivateAccessLevel(*pb) + return &st, nil +} + type PrivateAccessSettings struct { // The Databricks account ID that hosts the credential. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // An array of Databricks VPC endpoint IDs. - AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + // Wire name: 'allowed_vpc_endpoint_ids' + AllowedVpcEndpointIds []string // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + // Wire name: 'private_access_level' + PrivateAccessLevel PrivateAccessLevel // Databricks private access settings ID. - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string // The human-readable name of the private access settings object. - PrivateAccessSettingsName string `json:"private_access_settings_name,omitempty"` + // Wire name: 'private_access_settings_name' + PrivateAccessSettingsName string // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + // Wire name: 'public_access_enabled' + PublicAccessEnabled bool // The cloud region for workspaces attached to this private access settings // object. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PrivateAccessSettings) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PrivateAccessSettings) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &privateAccessSettingsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := privateAccessSettingsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PrivateAccessSettings) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PrivateAccessSettings) MarshalJSON() ([]byte, error) { + pb, err := privateAccessSettingsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ReplaceResponse struct { } +func (st *ReplaceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &replaceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := replaceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ReplaceResponse) MarshalJSON() ([]byte, error) { + pb, err := replaceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Root S3 bucket information. type RootBucketInfo struct { // The name of the S3 bucket. - BucketName string `json:"bucket_name,omitempty"` + // Wire name: 'bucket_name' + BucketName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RootBucketInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RootBucketInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rootBucketInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rootBucketInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RootBucketInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RootBucketInfo) MarshalJSON() ([]byte, error) { + pb, err := rootBucketInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StorageConfiguration struct { // The Databricks account ID that hosts the credential. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Time in epoch milliseconds when the storage configuration was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Root S3 bucket information. - RootBucketInfo *RootBucketInfo `json:"root_bucket_info,omitempty"` + // Wire name: 'root_bucket_info' + RootBucketInfo *RootBucketInfo // Databricks storage configuration ID. - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // The human-readable name of the storage configuration. - StorageConfigurationName string `json:"storage_configuration_name,omitempty"` + // Wire name: 'storage_configuration_name' + StorageConfigurationName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StorageConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StorageConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &storageConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := storageConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StorageConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StorageConfiguration) MarshalJSON() ([]byte, error) { + pb, err := storageConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StsRole struct { // The external ID that needs to be trusted by the cross-account role. This // is always your Databricks account ID. - ExternalId string `json:"external_id,omitempty"` + // Wire name: 'external_id' + ExternalId string // The Amazon Resource Name (ARN) of the cross account role. - RoleArn string `json:"role_arn,omitempty"` + // Wire name: 'role_arn' + RoleArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StsRole) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StsRole) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stsRolePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stsRoleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StsRole) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StsRole) MarshalJSON() ([]byte, error) { + pb, err := stsRoleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateWorkspaceRequest struct { // The AWS region of the workspace's data plane (for example, `us-west-2`). // This parameter is available only for updating failed workspaces. - AwsRegion string `json:"aws_region,omitempty"` + // Wire name: 'aws_region' + AwsRegion string // ID of the workspace's credential configuration object. This parameter is // available for updating both failed and running workspaces. - CredentialsId string `json:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // The ID of the workspace's managed services encryption key configuration // object. This parameter is available only for updating failed workspaces. - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + // Wire name: 'managed_services_customer_managed_key_id' + ManagedServicesCustomerManagedKeyId string - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string // The ID of the workspace's network configuration object. Used only if you // already use a customer-managed VPC. For failed workspaces only, you can // switch from a Databricks-managed VPC to a customer-managed VPC by // updating the workspace to add a network configuration ID. - NetworkId string `json:"network_id,omitempty"` + // Wire name: 'network_id' + NetworkId string // The ID of the workspace's private access settings configuration object. // This parameter is available only for updating failed workspaces. - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string // The ID of the workspace's storage configuration object. This parameter is // available only for updating failed workspaces. - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // The ID of the key configuration object for workspace storage. This // parameter is available for updating both failed and running workspaces. - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + // Wire name: 'storage_customer_managed_key_id' + StorageCustomerManagedKeyId string // Workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateWorkspaceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateWorkspaceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpsertPrivateAccessSettingsRequest struct { @@ -1069,91 +2380,142 @@ type UpsertPrivateAccessSettingsRequest struct { // public internet, see [IP access lists]. // // [IP access lists]: https://docs.databricks.com/security/network/ip-access-list.html - AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + // Wire name: 'allowed_vpc_endpoint_ids' + AllowedVpcEndpointIds []string // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + // Wire name: 'private_access_level' + PrivateAccessLevel PrivateAccessLevel // Databricks Account API private access settings ID. - PrivateAccessSettingsId string `json:"-" url:"-"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string `tf:"-"` // The human-readable name of the private access settings object. - PrivateAccessSettingsName string `json:"private_access_settings_name"` + // Wire name: 'private_access_settings_name' + PrivateAccessSettingsName string // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + // Wire name: 'public_access_enabled' + PublicAccessEnabled bool // The cloud region for workspaces associated with this private access // settings object. - Region string `json:"region"` + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpsertPrivateAccessSettingsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpsertPrivateAccessSettingsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &upsertPrivateAccessSettingsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := upsertPrivateAccessSettingsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpsertPrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpsertPrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + pb, err := upsertPrivateAccessSettingsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type VpcEndpoint struct { // The Databricks account ID that hosts the VPC endpoint configuration. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // The AWS Account in which the VPC endpoint object exists. - AwsAccountId string `json:"aws_account_id,omitempty"` + // Wire name: 'aws_account_id' + AwsAccountId string // The ID of the Databricks [endpoint service] that this VPC endpoint is // connected to. For a list of endpoint service IDs for each supported AWS // region, see the [Databricks PrivateLink documentation]. // // [Databricks PrivateLink documentation]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - AwsEndpointServiceId string `json:"aws_endpoint_service_id,omitempty"` + // Wire name: 'aws_endpoint_service_id' + AwsEndpointServiceId string // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` + // Wire name: 'aws_vpc_endpoint_id' + AwsVpcEndpointId string // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` + // Wire name: 'gcp_vpc_endpoint_info' + GcpVpcEndpointInfo *GcpVpcEndpointInfo // The AWS region in which this VPC endpoint object exists. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The current state (such as `available` or `rejected`) of the VPC // endpoint. Derived from AWS. For the full set of values, see [AWS // DescribeVpcEndpoint documentation]. // // [AWS DescribeVpcEndpoint documentation]: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html - State string `json:"state,omitempty"` + // Wire name: 'state' + State string // This enumeration represents the type of Databricks VPC [endpoint service] // that was used when creating this VPC endpoint. // // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - UseCase EndpointUseCase `json:"use_case,omitempty"` + // Wire name: 'use_case' + UseCase EndpointUseCase // Databricks VPC endpoint ID. This is the Databricks-specific name of the // VPC endpoint. Do not confuse this with the `aws_vpc_endpoint_id`, which // is the ID within AWS of the VPC endpoint. - VpcEndpointId string `json:"vpc_endpoint_id,omitempty"` + // Wire name: 'vpc_endpoint_id' + VpcEndpointId string // The human-readable name of the storage configuration. - VpcEndpointName string `json:"vpc_endpoint_name,omitempty"` + // Wire name: 'vpc_endpoint_name' + VpcEndpointName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *VpcEndpoint) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *VpcEndpoint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &vpcEndpointPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := vpcEndpointFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s VpcEndpoint) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st VpcEndpoint) MarshalJSON() ([]byte, error) { + pb, err := vpcEndpointToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status of this network configuration object in terms of its use in a // workspace: * `UNATTACHED`: Unattached. * `VALID`: Valid. * `BROKEN`: Broken. // * `WARNED`: Warned. type VpcStatus string +type vpcStatusPb string // Broken. const VpcStatusBroken VpcStatus = `BROKEN` @@ -1188,8 +2550,25 @@ func (f *VpcStatus) Type() string { return "VpcStatus" } +func vpcStatusToPb(st *VpcStatus) (*vpcStatusPb, error) { + if st == nil { + return nil, nil + } + pb := vpcStatusPb(*st) + return &pb, nil +} + +func vpcStatusFromPb(pb *vpcStatusPb) (*VpcStatus, error) { + if pb == nil { + return nil, nil + } + st := VpcStatus(*pb) + return &st, nil +} + // The AWS resource associated with this warning: a subnet or a security group. type WarningType string +type warningTypePb string const WarningTypeSecurityGroup WarningType = `securityGroup` @@ -1216,38 +2595,64 @@ func (f *WarningType) Type() string { return "WarningType" } +func warningTypeToPb(st *WarningType) (*warningTypePb, error) { + if st == nil { + return nil, nil + } + pb := warningTypePb(*st) + return &pb, nil +} + +func warningTypeFromPb(pb *warningTypePb) (*WarningType, error) { + if pb == nil { + return nil, nil + } + st := WarningType(*pb) + return &st, nil +} + type Workspace struct { // Databricks account ID. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // The AWS region of the workspace data plane (for example, `us-west-2`). - AwsRegion string `json:"aws_region,omitempty"` + // Wire name: 'aws_region' + AwsRegion string - AzureWorkspaceInfo *AzureWorkspaceInfo `json:"azure_workspace_info,omitempty"` + // Wire name: 'azure_workspace_info' + AzureWorkspaceInfo *AzureWorkspaceInfo // The cloud name. This field always has the value `gcp`. - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + // Wire name: 'cloud_resource_container' + CloudResourceContainer *CloudResourceContainer // Time in epoch milliseconds when the workspace was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // ID of the workspace's credential configuration object. - CredentialsId string `json:"credentials_id,omitempty"` + // Wire name: 'credentials_id' + CredentialsId string // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags map[string]string `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags map[string]string // The deployment name defines part of the subdomain for the workspace. The // workspace URL for web application and REST APIs is // `.cloud.databricks.com`. // // This value must be unique across all non-deleted deployments across all // AWS regions. - DeploymentName string `json:"deployment_name,omitempty"` + // Wire name: 'deployment_name' + DeploymentName string // If this workspace is for a external customer, then external_customer_info // is populated. If this workspace is not for a external customer, then // external_customer_info is empty. - ExternalCustomerInfo *ExternalCustomerInfo `json:"external_customer_info,omitempty"` + // Wire name: 'external_customer_info' + ExternalCustomerInfo *ExternalCustomerInfo // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -1271,24 +2676,31 @@ type Workspace struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + // Wire name: 'gcp_managed_network_config' + GcpManagedNetworkConfig *GcpManagedNetworkConfig // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig *GkeConfig `json:"gke_config,omitempty"` + // Wire name: 'gke_config' + GkeConfig *GkeConfig // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + // Wire name: 'is_no_public_ip_enabled' + IsNoPublicIpEnabled bool // The Google Cloud region of the workspace data plane in your Google // account (for example, `us-east4`). - Location string `json:"location,omitempty"` + // Wire name: 'location' + Location string // ID of the key configuration for encrypting managed services. - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + // Wire name: 'managed_services_customer_managed_key_id' + ManagedServicesCustomerManagedKeyId string // The network configuration ID that is attached to the workspace. This // field is available only if the network is a customer-managed network. - NetworkId string `json:"network_id,omitempty"` + // Wire name: 'network_id' + NetworkId string // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier PricingTier `json:"pricing_tier,omitempty"` + // Wire name: 'pricing_tier' + PricingTier PricingTier // ID of the workspace's private access settings object. Only used for // PrivateLink. You must specify this ID if you are using [AWS PrivateLink] // for either front-end (user-to-workspace connection), back-end (data plane @@ -1299,37 +2711,62 @@ type Workspace struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + // Wire name: 'private_access_settings_id' + PrivateAccessSettingsId string // ID of the workspace's storage configuration object. - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + // Wire name: 'storage_configuration_id' + StorageConfigurationId string // ID of the key configuration for encrypting workspace storage. - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + // Wire name: 'storage_customer_managed_key_id' + StorageCustomerManagedKeyId string // A unique integer ID for the workspace - WorkspaceId int64 `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 // The human-readable name of the workspace. - WorkspaceName string `json:"workspace_name,omitempty"` + // Wire name: 'workspace_name' + WorkspaceName string // The status of the workspace. For workspace creation, usually it is set to // `PROVISIONING` initially. Continue to check the status until the status // is `RUNNING`. - WorkspaceStatus WorkspaceStatus `json:"workspace_status,omitempty"` + // Wire name: 'workspace_status' + WorkspaceStatus WorkspaceStatus // Message describing the current workspace status. - WorkspaceStatusMessage string `json:"workspace_status_message,omitempty"` + // Wire name: 'workspace_status_message' + WorkspaceStatusMessage string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Workspace) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Workspace) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspacePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Workspace) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Workspace) MarshalJSON() ([]byte, error) { + pb, err := workspaceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The status of the workspace. For workspace creation, usually it is set to // `PROVISIONING` initially. Continue to check the status until the status is // `RUNNING`. type WorkspaceStatus string +type workspaceStatusPb string const WorkspaceStatusBanned WorkspaceStatus = `BANNED` @@ -1363,3 +2800,73 @@ func (f *WorkspaceStatus) Set(v string) error { func (f *WorkspaceStatus) Type() string { return "WorkspaceStatus" } + +func workspaceStatusToPb(st *WorkspaceStatus) (*workspaceStatusPb, error) { + if st == nil { + return nil, nil + } + pb := workspaceStatusPb(*st) + return &pb, nil +} + +func workspaceStatusFromPb(pb *workspaceStatusPb) (*WorkspaceStatus, error) { + if pb == nil { + return nil, nil + } + st := WorkspaceStatus(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/qualitymonitor/api.go b/service/qualitymonitor/api.go new file mode 100755 index 000000000..d888046cd --- /dev/null +++ b/service/qualitymonitor/api.go @@ -0,0 +1,91 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// Manage data quality of UC objects (currently support `schema`). +package qualitymonitor + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" +) + +type QualityMonitorsV2Interface interface { + + // Create a quality monitor. + // + // Create a quality monitor on UC object + CreateQualityMonitor(ctx context.Context, request CreateQualityMonitorRequest) (*QualityMonitor, error) + + // Delete a quality monitor. + // + // Delete a quality monitor on UC object + DeleteQualityMonitor(ctx context.Context, request DeleteQualityMonitorRequest) error + + // Delete a quality monitor. + // + // Delete a quality monitor on UC object + DeleteQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) error + + // Read a quality monitor. + // + // Read a quality monitor on UC object + GetQualityMonitor(ctx context.Context, request GetQualityMonitorRequest) (*QualityMonitor, error) + + // Read a quality monitor. + // + // Read a quality monitor on UC object + GetQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) (*QualityMonitor, error) + + // List quality monitors. + // + // (Unimplemented) List quality monitors + // + // This method is generated by Databricks SDK Code Generator. + ListQualityMonitor(ctx context.Context, request ListQualityMonitorRequest) listing.Iterator[QualityMonitor] + + // List quality monitors. + // + // (Unimplemented) List quality monitors + // + // This method is generated by Databricks SDK Code Generator. + ListQualityMonitorAll(ctx context.Context, request ListQualityMonitorRequest) ([]QualityMonitor, error) + + // Update a quality monitor. + // + // Update a quality monitor on UC object + UpdateQualityMonitor(ctx context.Context, request UpdateQualityMonitorRequest) (*QualityMonitor, error) +} + +func NewQualityMonitorsV2(client *client.DatabricksClient) *QualityMonitorsV2API { + return &QualityMonitorsV2API{ + qualityMonitorsV2Impl: qualityMonitorsV2Impl{ + client: client, + }, + } +} + +// Manage data quality of UC objects (currently support `schema`) +type QualityMonitorsV2API struct { + qualityMonitorsV2Impl +} + +// Delete a quality monitor. +// +// Delete a quality monitor on UC object +func (a *QualityMonitorsV2API) DeleteQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) error { + return a.qualityMonitorsV2Impl.DeleteQualityMonitor(ctx, DeleteQualityMonitorRequest{ + ObjectType: objectType, + ObjectId: objectId, + }) +} + +// Read a quality monitor. +// +// Read a quality monitor on UC object +func (a *QualityMonitorsV2API) GetQualityMonitorByObjectTypeAndObjectId(ctx context.Context, objectType string, objectId string) (*QualityMonitor, error) { + return a.qualityMonitorsV2Impl.GetQualityMonitor(ctx, GetQualityMonitorRequest{ + ObjectType: objectType, + ObjectId: objectId, + }) +} diff --git a/service/qualitymonitor/impl.go b/service/qualitymonitor/impl.go new file mode 100755 index 000000000..55162d8e0 --- /dev/null +++ b/service/qualitymonitor/impl.go @@ -0,0 +1,211 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package qualitymonitor + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" +) + +// unexported type that holds implementations of just QualityMonitorsV2 API methods +type qualityMonitorsV2Impl struct { + client *client.DatabricksClient +} + +func (a *qualityMonitorsV2Impl) CreateQualityMonitor(ctx context.Context, request CreateQualityMonitorRequest) (*QualityMonitor, error) { + + requestPb, pbErr := createQualityMonitorRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var qualityMonitorPb qualityMonitorPb + path := "/api/2.0/quality-monitors" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).QualityMonitor, + &qualityMonitorPb, + ) + if err != nil { + return nil, err + } + resp, err := qualityMonitorFromPb(&qualityMonitorPb) + if err != nil { + return nil, err + } + + return resp, err +} + +func (a *qualityMonitorsV2Impl) DeleteQualityMonitor(ctx context.Context, request DeleteQualityMonitorRequest) error { + + requestPb, pbErr := deleteQualityMonitorRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteQualityMonitorResponsePb deleteQualityMonitorResponsePb + path := fmt.Sprintf("/api/2.0/quality-monitors/%v/%v", requestPb.ObjectType, requestPb.ObjectId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteQualityMonitorResponsePb, + ) + if err != nil { + return err + } + + return err +} + +func (a *qualityMonitorsV2Impl) GetQualityMonitor(ctx context.Context, request GetQualityMonitorRequest) (*QualityMonitor, error) { + + requestPb, pbErr := getQualityMonitorRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var qualityMonitorPb qualityMonitorPb + path := fmt.Sprintf("/api/2.0/quality-monitors/%v/%v", requestPb.ObjectType, requestPb.ObjectId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &qualityMonitorPb, + ) + if err != nil { + return nil, err + } + resp, err := qualityMonitorFromPb(&qualityMonitorPb) + if err != nil { + return nil, err + } + + return resp, err +} + +// List quality monitors. +// +// (Unimplemented) List quality monitors +func (a *qualityMonitorsV2Impl) ListQualityMonitor(ctx context.Context, request ListQualityMonitorRequest) listing.Iterator[QualityMonitor] { + + getNextPage := func(ctx context.Context, req ListQualityMonitorRequest) (*ListQualityMonitorResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListQualityMonitor(ctx, req) + } + getItems := func(resp *ListQualityMonitorResponse) []QualityMonitor { + return resp.QualityMonitors + } + getNextReq := func(resp *ListQualityMonitorResponse) *ListQualityMonitorRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List quality monitors. +// +// (Unimplemented) List quality monitors +func (a *qualityMonitorsV2Impl) ListQualityMonitorAll(ctx context.Context, request ListQualityMonitorRequest) ([]QualityMonitor, error) { + iterator := a.ListQualityMonitor(ctx, request) + return listing.ToSlice[QualityMonitor](ctx, iterator) +} + +func (a *qualityMonitorsV2Impl) internalListQualityMonitor(ctx context.Context, request ListQualityMonitorRequest) (*ListQualityMonitorResponse, error) { + + requestPb, pbErr := listQualityMonitorRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listQualityMonitorResponsePb listQualityMonitorResponsePb + path := "/api/2.0/quality-monitors" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &listQualityMonitorResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listQualityMonitorResponseFromPb(&listQualityMonitorResponsePb) + if err != nil { + return nil, err + } + + return resp, err +} + +func (a *qualityMonitorsV2Impl) UpdateQualityMonitor(ctx context.Context, request UpdateQualityMonitorRequest) (*QualityMonitor, error) { + + requestPb, pbErr := updateQualityMonitorRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var qualityMonitorPb qualityMonitorPb + path := fmt.Sprintf("/api/2.0/quality-monitors/%v/%v", requestPb.ObjectType, requestPb.ObjectId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb).QualityMonitor, + &qualityMonitorPb, + ) + if err != nil { + return nil, err + } + resp, err := qualityMonitorFromPb(&qualityMonitorPb) + if err != nil { + return nil, err + } + + return resp, err +} diff --git a/service/qualitymonitor/interface.go b/service/qualitymonitor/interface.go new file mode 100755 index 000000000..794d246ab --- /dev/null +++ b/service/qualitymonitor/interface.go @@ -0,0 +1,38 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package qualitymonitor + +import ( + "context" +) + +// Manage data quality of UC objects (currently support `schema`) +type QualityMonitorsV2Service interface { + + // Create a quality monitor. + // + // Create a quality monitor on UC object + CreateQualityMonitor(ctx context.Context, request CreateQualityMonitorRequest) (*QualityMonitor, error) + + // Delete a quality monitor. + // + // Delete a quality monitor on UC object + DeleteQualityMonitor(ctx context.Context, request DeleteQualityMonitorRequest) error + + // Read a quality monitor. + // + // Read a quality monitor on UC object + GetQualityMonitor(ctx context.Context, request GetQualityMonitorRequest) (*QualityMonitor, error) + + // List quality monitors. + // + // (Unimplemented) List quality monitors + // + // Use ListQualityMonitorAll() to get all QualityMonitor instances, which will iterate over every result page. + ListQualityMonitor(ctx context.Context, request ListQualityMonitorRequest) (*ListQualityMonitorResponse, error) + + // Update a quality monitor. + // + // Update a quality monitor on UC object + UpdateQualityMonitor(ctx context.Context, request UpdateQualityMonitorRequest) (*QualityMonitor, error) +} diff --git a/service/qualitymonitor/internal.go b/service/qualitymonitor/internal.go new file mode 100755 index 000000000..51a8ae6e4 --- /dev/null +++ b/service/qualitymonitor/internal.go @@ -0,0 +1,311 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package qualitymonitor + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func anomalyDetectionConfigToPb(st *AnomalyDetectionConfig) (*anomalyDetectionConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &anomalyDetectionConfigPb{} + pb.AnomalyDetectionWorkflowId = st.AnomalyDetectionWorkflowId + + pb.LastRunId = st.LastRunId + + pb.LatestRunStatus = st.LatestRunStatus + + pb.PublishHealthIndicator = st.PublishHealthIndicator + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type anomalyDetectionConfigPb struct { + AnomalyDetectionWorkflowId int64 `json:"anomaly_detection_workflow_id,omitempty"` + + LastRunId string `json:"last_run_id,omitempty"` + + LatestRunStatus AnomalyDetectionRunStatus `json:"latest_run_status,omitempty"` + + PublishHealthIndicator bool `json:"publish_health_indicator,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func anomalyDetectionConfigFromPb(pb *anomalyDetectionConfigPb) (*AnomalyDetectionConfig, error) { + if pb == nil { + return nil, nil + } + st := &AnomalyDetectionConfig{} + st.AnomalyDetectionWorkflowId = pb.AnomalyDetectionWorkflowId + st.LastRunId = pb.LastRunId + st.LatestRunStatus = pb.LatestRunStatus + st.PublishHealthIndicator = pb.PublishHealthIndicator + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *anomalyDetectionConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st anomalyDetectionConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createQualityMonitorRequestToPb(st *CreateQualityMonitorRequest) (*createQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createQualityMonitorRequestPb{} + pb.QualityMonitor = st.QualityMonitor + + return pb, nil +} + +type createQualityMonitorRequestPb struct { + QualityMonitor QualityMonitor `json:"quality_monitor"` +} + +func createQualityMonitorRequestFromPb(pb *createQualityMonitorRequestPb) (*CreateQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateQualityMonitorRequest{} + st.QualityMonitor = pb.QualityMonitor + + return st, nil +} + +func deleteQualityMonitorRequestToPb(st *DeleteQualityMonitorRequest) (*deleteQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteQualityMonitorRequestPb{} + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + return pb, nil +} + +type deleteQualityMonitorRequestPb struct { + ObjectId string `json:"-" url:"-"` + + ObjectType string `json:"-" url:"-"` +} + +func deleteQualityMonitorRequestFromPb(pb *deleteQualityMonitorRequestPb) (*DeleteQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteQualityMonitorRequest{} + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + return st, nil +} + +func deleteQualityMonitorResponseToPb(st *DeleteQualityMonitorResponse) (*deleteQualityMonitorResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteQualityMonitorResponsePb{} + + return pb, nil +} + +type deleteQualityMonitorResponsePb struct { +} + +func deleteQualityMonitorResponseFromPb(pb *deleteQualityMonitorResponsePb) (*DeleteQualityMonitorResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteQualityMonitorResponse{} + + return st, nil +} + +func getQualityMonitorRequestToPb(st *GetQualityMonitorRequest) (*getQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getQualityMonitorRequestPb{} + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + return pb, nil +} + +type getQualityMonitorRequestPb struct { + ObjectId string `json:"-" url:"-"` + + ObjectType string `json:"-" url:"-"` +} + +func getQualityMonitorRequestFromPb(pb *getQualityMonitorRequestPb) (*GetQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetQualityMonitorRequest{} + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + return st, nil +} + +func listQualityMonitorRequestToPb(st *ListQualityMonitorRequest) (*listQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listQualityMonitorRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQualityMonitorRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQualityMonitorRequestFromPb(pb *listQualityMonitorRequestPb) (*ListQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListQualityMonitorRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQualityMonitorRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQualityMonitorRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQualityMonitorResponseToPb(st *ListQualityMonitorResponse) (*listQualityMonitorResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listQualityMonitorResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.QualityMonitors = st.QualityMonitors + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQualityMonitorResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + QualityMonitors []QualityMonitor `json:"quality_monitors,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQualityMonitorResponseFromPb(pb *listQualityMonitorResponsePb) (*ListQualityMonitorResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListQualityMonitorResponse{} + st.NextPageToken = pb.NextPageToken + st.QualityMonitors = pb.QualityMonitors + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQualityMonitorResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQualityMonitorResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func qualityMonitorToPb(st *QualityMonitor) (*qualityMonitorPb, error) { + if st == nil { + return nil, nil + } + pb := &qualityMonitorPb{} + pb.AnomalyDetectionConfig = st.AnomalyDetectionConfig + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + return pb, nil +} + +type qualityMonitorPb struct { + AnomalyDetectionConfig *AnomalyDetectionConfig `json:"anomaly_detection_config,omitempty"` + + ObjectId string `json:"object_id"` + + ObjectType string `json:"object_type"` +} + +func qualityMonitorFromPb(pb *qualityMonitorPb) (*QualityMonitor, error) { + if pb == nil { + return nil, nil + } + st := &QualityMonitor{} + st.AnomalyDetectionConfig = pb.AnomalyDetectionConfig + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + return st, nil +} + +func updateQualityMonitorRequestToPb(st *UpdateQualityMonitorRequest) (*updateQualityMonitorRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateQualityMonitorRequestPb{} + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.QualityMonitor = st.QualityMonitor + + return pb, nil +} + +type updateQualityMonitorRequestPb struct { + ObjectId string `json:"-" url:"-"` + + ObjectType string `json:"-" url:"-"` + + QualityMonitor QualityMonitor `json:"quality_monitor"` +} + +func updateQualityMonitorRequestFromPb(pb *updateQualityMonitorRequestPb) (*UpdateQualityMonitorRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateQualityMonitorRequest{} + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + st.QualityMonitor = pb.QualityMonitor + + return st, nil +} diff --git a/service/qualitymonitor/model.go b/service/qualitymonitor/model.go new file mode 100755 index 000000000..4f7e2f74b --- /dev/null +++ b/service/qualitymonitor/model.go @@ -0,0 +1,443 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package qualitymonitor + +import ( + "encoding/json" + "fmt" + "strings" + "time" +) + +type AnomalyDetectionConfig struct { + // The id of the workflow that detects the anomaly. This field will only + // returned in the Get/Update response, if the request comes from the + // workspace where this anomaly detection job is created. + // Wire name: 'anomaly_detection_workflow_id' + AnomalyDetectionWorkflowId int64 + // Run id of the last run of the workflow + // Wire name: 'last_run_id' + LastRunId string + // The status of the last run of the workflow. + // Wire name: 'latest_run_status' + LatestRunStatus AnomalyDetectionRunStatus + // If health indicator should be shown. + // Wire name: 'publish_health_indicator' + PublishHealthIndicator bool + + ForceSendFields []string `tf:"-"` +} + +func (st *AnomalyDetectionConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &anomalyDetectionConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := anomalyDetectionConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AnomalyDetectionConfig) MarshalJSON() ([]byte, error) { + pb, err := anomalyDetectionConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Status of Anomaly Detection Job Run +type AnomalyDetectionRunStatus string +type anomalyDetectionRunStatusPb string + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusCanceled AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_CANCELED` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusFailed AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_FAILED` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusJobDeleted AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_JOB_DELETED` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusPending AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_PENDING` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusRunning AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_RUNNING` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusSuccess AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_SUCCESS` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusUnknown AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_UNKNOWN` + +const AnomalyDetectionRunStatusAnomalyDetectionRunStatusWorkspaceMismatchError AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_WORKSPACE_MISMATCH_ERROR` + +// String representation for [fmt.Print] +func (f *AnomalyDetectionRunStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *AnomalyDetectionRunStatus) Set(v string) error { + switch v { + case `ANOMALY_DETECTION_RUN_STATUS_CANCELED`, `ANOMALY_DETECTION_RUN_STATUS_FAILED`, `ANOMALY_DETECTION_RUN_STATUS_JOB_DELETED`, `ANOMALY_DETECTION_RUN_STATUS_PENDING`, `ANOMALY_DETECTION_RUN_STATUS_RUNNING`, `ANOMALY_DETECTION_RUN_STATUS_SUCCESS`, `ANOMALY_DETECTION_RUN_STATUS_UNKNOWN`, `ANOMALY_DETECTION_RUN_STATUS_WORKSPACE_MISMATCH_ERROR`: + *f = AnomalyDetectionRunStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ANOMALY_DETECTION_RUN_STATUS_CANCELED", "ANOMALY_DETECTION_RUN_STATUS_FAILED", "ANOMALY_DETECTION_RUN_STATUS_JOB_DELETED", "ANOMALY_DETECTION_RUN_STATUS_PENDING", "ANOMALY_DETECTION_RUN_STATUS_RUNNING", "ANOMALY_DETECTION_RUN_STATUS_SUCCESS", "ANOMALY_DETECTION_RUN_STATUS_UNKNOWN", "ANOMALY_DETECTION_RUN_STATUS_WORKSPACE_MISMATCH_ERROR"`, v) + } +} + +// Type always returns AnomalyDetectionRunStatus to satisfy [pflag.Value] interface +func (f *AnomalyDetectionRunStatus) Type() string { + return "AnomalyDetectionRunStatus" +} + +func anomalyDetectionRunStatusToPb(st *AnomalyDetectionRunStatus) (*anomalyDetectionRunStatusPb, error) { + if st == nil { + return nil, nil + } + pb := anomalyDetectionRunStatusPb(*st) + return &pb, nil +} + +func anomalyDetectionRunStatusFromPb(pb *anomalyDetectionRunStatusPb) (*AnomalyDetectionRunStatus, error) { + if pb == nil { + return nil, nil + } + st := AnomalyDetectionRunStatus(*pb) + return &st, nil +} + +// Create a quality monitor +type CreateQualityMonitorRequest struct { + + // Wire name: 'quality_monitor' + QualityMonitor QualityMonitor +} + +func (st *CreateQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := createQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Delete a quality monitor +type DeleteQualityMonitorRequest struct { + // The id of the request object + // Wire name: 'object_id' + ObjectId string `tf:"-"` + // The type of the monitored object. Can be one of the following: schema + // Wire name: 'object_type' + ObjectType string `tf:"-"` +} + +func (st *DeleteQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type DeleteQualityMonitorResponse struct { +} + +func (st *DeleteQualityMonitorResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteQualityMonitorResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteQualityMonitorResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteQualityMonitorResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteQualityMonitorResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Read a quality monitor +type GetQualityMonitorRequest struct { + // The id of the request object + // Wire name: 'object_id' + ObjectId string `tf:"-"` + // The type of the monitored object. Can be one of the following: schema + // Wire name: 'object_type' + ObjectType string `tf:"-"` +} + +func (st *GetQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := getQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// List quality monitors +type ListQualityMonitorRequest struct { + + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` + + ForceSendFields []string `tf:"-"` +} + +func (st *ListQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := listQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type ListQualityMonitorResponse struct { + + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'quality_monitors' + QualityMonitors []QualityMonitor + + ForceSendFields []string `tf:"-"` +} + +func (st *ListQualityMonitorResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQualityMonitorResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQualityMonitorResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListQualityMonitorResponse) MarshalJSON() ([]byte, error) { + pb, err := listQualityMonitorResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type QualityMonitor struct { + + // Wire name: 'anomaly_detection_config' + AnomalyDetectionConfig *AnomalyDetectionConfig + + // Wire name: 'object_id' + ObjectId string + // The type of the monitored object. Can be one of the following: schema + // Wire name: 'object_type' + ObjectType string +} + +func (st *QualityMonitor) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &qualityMonitorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := qualityMonitorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st QualityMonitor) MarshalJSON() ([]byte, error) { + pb, err := qualityMonitorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +// Update a quality monitor +type UpdateQualityMonitorRequest struct { + // The id of the request object + // Wire name: 'object_id' + ObjectId string `tf:"-"` + // The type of the monitored object. Can be one of the following: schema + // Wire name: 'object_type' + ObjectType string `tf:"-"` + + // Wire name: 'quality_monitor' + QualityMonitor QualityMonitor +} + +func (st *UpdateQualityMonitorRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateQualityMonitorRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateQualityMonitorRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateQualityMonitorRequest) MarshalJSON() ([]byte, error) { + pb, err := updateQualityMonitorRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/serving/impl.go b/service/serving/impl.go index b4fa2f11f..ea958d6bd 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -22,105 +22,321 @@ type servingEndpointsImpl struct { } func (a *servingEndpointsImpl) BuildLogs(ctx context.Context, request BuildLogsRequest) (*BuildLogsResponse, error) { - var buildLogsResponse BuildLogsResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/build-logs", request.Name, request.ServedModelName) + + requestPb, pbErr := buildLogsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var buildLogsResponsePb buildLogsResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/build-logs", requestPb.Name, requestPb.ServedModelName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &buildLogsResponse) - return &buildLogsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &buildLogsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := buildLogsResponseFromPb(&buildLogsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Create(ctx context.Context, request CreateServingEndpoint) (*ServingEndpointDetailed, error) { - var servingEndpointDetailed ServingEndpointDetailed + + requestPb, pbErr := createServingEndpointToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointDetailedPb servingEndpointDetailedPb path := "/api/2.0/serving-endpoints" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servingEndpointDetailed) - return &servingEndpointDetailed, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointDetailedPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointDetailedFromPb(&servingEndpointDetailedPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) CreateProvisionedThroughputEndpoint(ctx context.Context, request CreatePtEndpointRequest) (*ServingEndpointDetailed, error) { - var servingEndpointDetailed ServingEndpointDetailed + + requestPb, pbErr := createPtEndpointRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointDetailedPb servingEndpointDetailedPb path := "/api/2.0/serving-endpoints/pt" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servingEndpointDetailed) - return &servingEndpointDetailed, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointDetailedPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointDetailedFromPb(&servingEndpointDetailedPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Delete(ctx context.Context, request DeleteServingEndpointRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) + + requestPb, pbErr := deleteServingEndpointRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *servingEndpointsImpl) ExportMetrics(ctx context.Context, request ExportMetricsRequest) (*ExportMetricsResponse, error) { - var exportMetricsResponse ExportMetricsResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/metrics", request.Name) + + requestPb, pbErr := exportMetricsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var exportMetricsResponsePb exportMetricsResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/metrics", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportMetricsResponse) - return &exportMetricsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &exportMetricsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := exportMetricsResponseFromPb(&exportMetricsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Get(ctx context.Context, request GetServingEndpointRequest) (*ServingEndpointDetailed, error) { - var servingEndpointDetailed ServingEndpointDetailed - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) + + requestPb, pbErr := getServingEndpointRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointDetailedPb servingEndpointDetailedPb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servingEndpointDetailed) - return &servingEndpointDetailed, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointDetailedPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointDetailedFromPb(&servingEndpointDetailedPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) GetOpenApi(ctx context.Context, request GetOpenApiRequest) (*GetOpenApiResponse, error) { - var getOpenApiResponse GetOpenApiResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/openapi", request.Name) + + requestPb, pbErr := getOpenApiRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getOpenApiResponsePb getOpenApiResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/openapi", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getOpenApiResponse) - return &getOpenApiResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getOpenApiResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getOpenApiResponseFromPb(&getOpenApiResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) GetPermissionLevels(ctx context.Context, request GetServingEndpointPermissionLevelsRequest) (*GetServingEndpointPermissionLevelsResponse, error) { - var getServingEndpointPermissionLevelsResponse GetServingEndpointPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v/permissionLevels", request.ServingEndpointId) + + requestPb, pbErr := getServingEndpointPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getServingEndpointPermissionLevelsResponsePb getServingEndpointPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v/permissionLevels", requestPb.ServingEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getServingEndpointPermissionLevelsResponse) - return &getServingEndpointPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getServingEndpointPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getServingEndpointPermissionLevelsResponseFromPb(&getServingEndpointPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) GetPermissions(ctx context.Context, request GetServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { - var servingEndpointPermissions ServingEndpointPermissions - path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + + requestPb, pbErr := getServingEndpointPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointPermissionsPb servingEndpointPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", requestPb.ServingEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servingEndpointPermissions) - return &servingEndpointPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointPermissionsFromPb(&servingEndpointPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) HttpRequest(ctx context.Context, request ExternalFunctionRequest) (*HttpRequestResponse, error) { - var httpRequestResponse HttpRequestResponse + + requestPb, pbErr := externalFunctionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var httpRequestResponsePb httpRequestResponsePb path := "/api/2.0/external-function" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &httpRequestResponse) - return &httpRequestResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &httpRequestResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := httpRequestResponseFromPb(&httpRequestResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get all serving endpoints. @@ -150,111 +366,326 @@ func (a *servingEndpointsImpl) ListAll(ctx context.Context) ([]ServingEndpoint, } func (a *servingEndpointsImpl) internalList(ctx context.Context) (*ListEndpointsResponse, error) { - var listEndpointsResponse ListEndpointsResponse + + var listEndpointsResponsePb listEndpointsResponsePb path := "/api/2.0/serving-endpoints" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listEndpointsResponse) - return &listEndpointsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listEndpointsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listEndpointsResponseFromPb(&listEndpointsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Logs(ctx context.Context, request LogsRequest) (*ServerLogsResponse, error) { - var serverLogsResponse ServerLogsResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/logs", request.Name, request.ServedModelName) + + requestPb, pbErr := logsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var serverLogsResponsePb serverLogsResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/logs", requestPb.Name, requestPb.ServedModelName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &serverLogsResponse) - return &serverLogsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &serverLogsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := serverLogsResponseFromPb(&serverLogsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Patch(ctx context.Context, request PatchServingEndpointTags) (*EndpointTags, error) { - var endpointTags EndpointTags - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/tags", request.Name) + + requestPb, pbErr := patchServingEndpointTagsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var endpointTagsPb endpointTagsPb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/tags", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &endpointTags) - return &endpointTags, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &endpointTagsPb, + ) + if err != nil { + return nil, err + } + resp, err := endpointTagsFromPb(&endpointTagsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Put(ctx context.Context, request PutRequest) (*PutResponse, error) { - var putResponse PutResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/rate-limits", request.Name) + + requestPb, pbErr := putRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var putResponsePb putResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/rate-limits", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &putResponse) - return &putResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &putResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := putResponseFromPb(&putResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) PutAiGateway(ctx context.Context, request PutAiGatewayRequest) (*PutAiGatewayResponse, error) { - var putAiGatewayResponse PutAiGatewayResponse - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/ai-gateway", request.Name) + + requestPb, pbErr := putAiGatewayRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var putAiGatewayResponsePb putAiGatewayResponsePb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/ai-gateway", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &putAiGatewayResponse) - return &putAiGatewayResponse, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &putAiGatewayResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := putAiGatewayResponseFromPb(&putAiGatewayResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) { - var queryEndpointResponse QueryEndpointResponse - path := fmt.Sprintf("/serving-endpoints/%v/invocations", request.Name) + + requestPb, pbErr := queryEndpointInputToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryEndpointResponsePb queryEndpointResponsePb + path := fmt.Sprintf("/serving-endpoints/%v/invocations", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryEndpointResponse) - return &queryEndpointResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &queryEndpointResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := queryEndpointResponseFromPb(&queryEndpointResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) SetPermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { - var servingEndpointPermissions ServingEndpointPermissions - path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + + requestPb, pbErr := servingEndpointPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointPermissionsPb servingEndpointPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", requestPb.ServingEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &servingEndpointPermissions) - return &servingEndpointPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointPermissionsFromPb(&servingEndpointPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) UpdateConfig(ctx context.Context, request EndpointCoreConfigInput) (*ServingEndpointDetailed, error) { - var servingEndpointDetailed ServingEndpointDetailed - path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/config", request.Name) + + requestPb, pbErr := endpointCoreConfigInputToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointDetailedPb servingEndpointDetailedPb + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/config", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &servingEndpointDetailed) - return &servingEndpointDetailed, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointDetailedPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointDetailedFromPb(&servingEndpointDetailedPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { - var servingEndpointPermissions ServingEndpointPermissions - path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + + requestPb, pbErr := servingEndpointPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointPermissionsPb servingEndpointPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", requestPb.ServingEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &servingEndpointPermissions) - return &servingEndpointPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointPermissionsFromPb(&servingEndpointPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *servingEndpointsImpl) UpdateProvisionedThroughputEndpointConfig(ctx context.Context, request UpdateProvisionedThroughputEndpointConfigRequest) (*ServingEndpointDetailed, error) { - var servingEndpointDetailed ServingEndpointDetailed - path := fmt.Sprintf("/api/2.0/serving-endpoints/pt/%v/config", request.Name) + + requestPb, pbErr := updateProvisionedThroughputEndpointConfigRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var servingEndpointDetailedPb servingEndpointDetailedPb + path := fmt.Sprintf("/api/2.0/serving-endpoints/pt/%v/config", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &servingEndpointDetailed) - return &servingEndpointDetailed, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &servingEndpointDetailedPb, + ) + if err != nil { + return nil, err + } + resp, err := servingEndpointDetailedFromPb(&servingEndpointDetailedPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ServingEndpointsDataPlane API methods @@ -285,6 +716,12 @@ func (a *servingEndpointsDataPlaneImpl) dataPlaneInfoQuery(ctx context.Context, } func (a *servingEndpointsDataPlaneImpl) Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) { + + requestPb, pbErr := queryEndpointInputToPb(&request) + if pbErr != nil { + return nil, pbErr + } + dpi, err := a.dataPlaneInfoQuery(ctx, request) if err != nil { return nil, err @@ -302,10 +739,18 @@ func (a *servingEndpointsDataPlaneImpl) Query(ctx context.Context, request Query queryParams := make(map[string]any) opts = append(opts, httpclient.WithQueryParameters(queryParams)) - var queryEndpointResponse QueryEndpointResponse - opts = append(opts, httpclient.WithRequestData(request)) - opts = append(opts, httpclient.WithResponseUnmarshal(&queryEndpointResponse)) + var queryEndpointResponsePb queryEndpointResponsePb + opts = append(opts, httpclient.WithRequestData(*requestPb)) + opts = append(opts, httpclient.WithResponseUnmarshal(&queryEndpointResponsePb)) opts = append(opts, httpclient.WithToken(dpt)) err = a.client.ApiClient().Do(ctx, http.MethodPost, dpi.EndpointUrl, opts...) - return &queryEndpointResponse, err + if err != nil { + return nil, err + } + resp, err := queryEndpointResponseFromPb(&queryEndpointResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/serving/internal.go b/service/serving/internal.go new file mode 100755 index 000000000..cf9384470 --- /dev/null +++ b/service/serving/internal.go @@ -0,0 +1,3835 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package serving + +import ( + "io" + + "github.com/databricks/databricks-sdk-go/marshal" +) + +func ai21LabsConfigToPb(st *Ai21LabsConfig) (*ai21LabsConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &ai21LabsConfigPb{} + pb.Ai21labsApiKey = st.Ai21labsApiKey + + pb.Ai21labsApiKeyPlaintext = st.Ai21labsApiKeyPlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type ai21LabsConfigPb struct { + Ai21labsApiKey string `json:"ai21labs_api_key,omitempty"` + + Ai21labsApiKeyPlaintext string `json:"ai21labs_api_key_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func ai21LabsConfigFromPb(pb *ai21LabsConfigPb) (*Ai21LabsConfig, error) { + if pb == nil { + return nil, nil + } + st := &Ai21LabsConfig{} + st.Ai21labsApiKey = pb.Ai21labsApiKey + st.Ai21labsApiKeyPlaintext = pb.Ai21labsApiKeyPlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *ai21LabsConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st ai21LabsConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func aiGatewayConfigToPb(st *AiGatewayConfig) (*aiGatewayConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayConfigPb{} + pb.FallbackConfig = st.FallbackConfig + + pb.Guardrails = st.Guardrails + + pb.InferenceTableConfig = st.InferenceTableConfig + + pb.RateLimits = st.RateLimits + + pb.UsageTrackingConfig = st.UsageTrackingConfig + + return pb, nil +} + +type aiGatewayConfigPb struct { + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + + InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` +} + +func aiGatewayConfigFromPb(pb *aiGatewayConfigPb) (*AiGatewayConfig, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayConfig{} + st.FallbackConfig = pb.FallbackConfig + st.Guardrails = pb.Guardrails + st.InferenceTableConfig = pb.InferenceTableConfig + st.RateLimits = pb.RateLimits + st.UsageTrackingConfig = pb.UsageTrackingConfig + + return st, nil +} + +func aiGatewayGuardrailParametersToPb(st *AiGatewayGuardrailParameters) (*aiGatewayGuardrailParametersPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayGuardrailParametersPb{} + pb.InvalidKeywords = st.InvalidKeywords + + pb.Pii = st.Pii + + pb.Safety = st.Safety + + pb.ValidTopics = st.ValidTopics + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type aiGatewayGuardrailParametersPb struct { + InvalidKeywords []string `json:"invalid_keywords,omitempty"` + + Pii *AiGatewayGuardrailPiiBehavior `json:"pii,omitempty"` + + Safety bool `json:"safety,omitempty"` + + ValidTopics []string `json:"valid_topics,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func aiGatewayGuardrailParametersFromPb(pb *aiGatewayGuardrailParametersPb) (*AiGatewayGuardrailParameters, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayGuardrailParameters{} + st.InvalidKeywords = pb.InvalidKeywords + st.Pii = pb.Pii + st.Safety = pb.Safety + st.ValidTopics = pb.ValidTopics + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *aiGatewayGuardrailParametersPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st aiGatewayGuardrailParametersPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func aiGatewayGuardrailPiiBehaviorToPb(st *AiGatewayGuardrailPiiBehavior) (*aiGatewayGuardrailPiiBehaviorPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayGuardrailPiiBehaviorPb{} + pb.Behavior = st.Behavior + + return pb, nil +} + +type aiGatewayGuardrailPiiBehaviorPb struct { + Behavior AiGatewayGuardrailPiiBehaviorBehavior `json:"behavior,omitempty"` +} + +func aiGatewayGuardrailPiiBehaviorFromPb(pb *aiGatewayGuardrailPiiBehaviorPb) (*AiGatewayGuardrailPiiBehavior, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayGuardrailPiiBehavior{} + st.Behavior = pb.Behavior + + return st, nil +} + +func aiGatewayGuardrailsToPb(st *AiGatewayGuardrails) (*aiGatewayGuardrailsPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayGuardrailsPb{} + pb.Input = st.Input + + pb.Output = st.Output + + return pb, nil +} + +type aiGatewayGuardrailsPb struct { + Input *AiGatewayGuardrailParameters `json:"input,omitempty"` + + Output *AiGatewayGuardrailParameters `json:"output,omitempty"` +} + +func aiGatewayGuardrailsFromPb(pb *aiGatewayGuardrailsPb) (*AiGatewayGuardrails, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayGuardrails{} + st.Input = pb.Input + st.Output = pb.Output + + return st, nil +} + +func aiGatewayInferenceTableConfigToPb(st *AiGatewayInferenceTableConfig) (*aiGatewayInferenceTableConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayInferenceTableConfigPb{} + pb.CatalogName = st.CatalogName + + pb.Enabled = st.Enabled + + pb.SchemaName = st.SchemaName + + pb.TableNamePrefix = st.TableNamePrefix + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type aiGatewayInferenceTableConfigPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + TableNamePrefix string `json:"table_name_prefix,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func aiGatewayInferenceTableConfigFromPb(pb *aiGatewayInferenceTableConfigPb) (*AiGatewayInferenceTableConfig, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayInferenceTableConfig{} + st.CatalogName = pb.CatalogName + st.Enabled = pb.Enabled + st.SchemaName = pb.SchemaName + st.TableNamePrefix = pb.TableNamePrefix + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *aiGatewayInferenceTableConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st aiGatewayInferenceTableConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func aiGatewayRateLimitToPb(st *AiGatewayRateLimit) (*aiGatewayRateLimitPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayRateLimitPb{} + pb.Calls = st.Calls + + pb.Key = st.Key + + pb.RenewalPeriod = st.RenewalPeriod + + return pb, nil +} + +type aiGatewayRateLimitPb struct { + Calls int64 `json:"calls"` + + Key AiGatewayRateLimitKey `json:"key,omitempty"` + + RenewalPeriod AiGatewayRateLimitRenewalPeriod `json:"renewal_period"` +} + +func aiGatewayRateLimitFromPb(pb *aiGatewayRateLimitPb) (*AiGatewayRateLimit, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayRateLimit{} + st.Calls = pb.Calls + st.Key = pb.Key + st.RenewalPeriod = pb.RenewalPeriod + + return st, nil +} + +func aiGatewayUsageTrackingConfigToPb(st *AiGatewayUsageTrackingConfig) (*aiGatewayUsageTrackingConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &aiGatewayUsageTrackingConfigPb{} + pb.Enabled = st.Enabled + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type aiGatewayUsageTrackingConfigPb struct { + Enabled bool `json:"enabled,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func aiGatewayUsageTrackingConfigFromPb(pb *aiGatewayUsageTrackingConfigPb) (*AiGatewayUsageTrackingConfig, error) { + if pb == nil { + return nil, nil + } + st := &AiGatewayUsageTrackingConfig{} + st.Enabled = pb.Enabled + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *aiGatewayUsageTrackingConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st aiGatewayUsageTrackingConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func amazonBedrockConfigToPb(st *AmazonBedrockConfig) (*amazonBedrockConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &amazonBedrockConfigPb{} + pb.AwsAccessKeyId = st.AwsAccessKeyId + + pb.AwsAccessKeyIdPlaintext = st.AwsAccessKeyIdPlaintext + + pb.AwsRegion = st.AwsRegion + + pb.AwsSecretAccessKey = st.AwsSecretAccessKey + + pb.AwsSecretAccessKeyPlaintext = st.AwsSecretAccessKeyPlaintext + + pb.BedrockProvider = st.BedrockProvider + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type amazonBedrockConfigPb struct { + AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` + + AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` + + AwsRegion string `json:"aws_region"` + + AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` + + AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` + + BedrockProvider AmazonBedrockConfigBedrockProvider `json:"bedrock_provider"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func amazonBedrockConfigFromPb(pb *amazonBedrockConfigPb) (*AmazonBedrockConfig, error) { + if pb == nil { + return nil, nil + } + st := &AmazonBedrockConfig{} + st.AwsAccessKeyId = pb.AwsAccessKeyId + st.AwsAccessKeyIdPlaintext = pb.AwsAccessKeyIdPlaintext + st.AwsRegion = pb.AwsRegion + st.AwsSecretAccessKey = pb.AwsSecretAccessKey + st.AwsSecretAccessKeyPlaintext = pb.AwsSecretAccessKeyPlaintext + st.BedrockProvider = pb.BedrockProvider + st.InstanceProfileArn = pb.InstanceProfileArn + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *amazonBedrockConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st amazonBedrockConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func anthropicConfigToPb(st *AnthropicConfig) (*anthropicConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &anthropicConfigPb{} + pb.AnthropicApiKey = st.AnthropicApiKey + + pb.AnthropicApiKeyPlaintext = st.AnthropicApiKeyPlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type anthropicConfigPb struct { + AnthropicApiKey string `json:"anthropic_api_key,omitempty"` + + AnthropicApiKeyPlaintext string `json:"anthropic_api_key_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func anthropicConfigFromPb(pb *anthropicConfigPb) (*AnthropicConfig, error) { + if pb == nil { + return nil, nil + } + st := &AnthropicConfig{} + st.AnthropicApiKey = pb.AnthropicApiKey + st.AnthropicApiKeyPlaintext = pb.AnthropicApiKeyPlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *anthropicConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st anthropicConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func apiKeyAuthToPb(st *ApiKeyAuth) (*apiKeyAuthPb, error) { + if st == nil { + return nil, nil + } + pb := &apiKeyAuthPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ValuePlaintext = st.ValuePlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type apiKeyAuthPb struct { + Key string `json:"key"` + + Value string `json:"value,omitempty"` + + ValuePlaintext string `json:"value_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func apiKeyAuthFromPb(pb *apiKeyAuthPb) (*ApiKeyAuth, error) { + if pb == nil { + return nil, nil + } + st := &ApiKeyAuth{} + st.Key = pb.Key + st.Value = pb.Value + st.ValuePlaintext = pb.ValuePlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *apiKeyAuthPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st apiKeyAuthPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func autoCaptureConfigInputToPb(st *AutoCaptureConfigInput) (*autoCaptureConfigInputPb, error) { + if st == nil { + return nil, nil + } + pb := &autoCaptureConfigInputPb{} + pb.CatalogName = st.CatalogName + + pb.Enabled = st.Enabled + + pb.SchemaName = st.SchemaName + + pb.TableNamePrefix = st.TableNamePrefix + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type autoCaptureConfigInputPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + TableNamePrefix string `json:"table_name_prefix,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func autoCaptureConfigInputFromPb(pb *autoCaptureConfigInputPb) (*AutoCaptureConfigInput, error) { + if pb == nil { + return nil, nil + } + st := &AutoCaptureConfigInput{} + st.CatalogName = pb.CatalogName + st.Enabled = pb.Enabled + st.SchemaName = pb.SchemaName + st.TableNamePrefix = pb.TableNamePrefix + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *autoCaptureConfigInputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st autoCaptureConfigInputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func autoCaptureConfigOutputToPb(st *AutoCaptureConfigOutput) (*autoCaptureConfigOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &autoCaptureConfigOutputPb{} + pb.CatalogName = st.CatalogName + + pb.Enabled = st.Enabled + + pb.SchemaName = st.SchemaName + + pb.State = st.State + + pb.TableNamePrefix = st.TableNamePrefix + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type autoCaptureConfigOutputPb struct { + CatalogName string `json:"catalog_name,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + State *AutoCaptureState `json:"state,omitempty"` + + TableNamePrefix string `json:"table_name_prefix,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func autoCaptureConfigOutputFromPb(pb *autoCaptureConfigOutputPb) (*AutoCaptureConfigOutput, error) { + if pb == nil { + return nil, nil + } + st := &AutoCaptureConfigOutput{} + st.CatalogName = pb.CatalogName + st.Enabled = pb.Enabled + st.SchemaName = pb.SchemaName + st.State = pb.State + st.TableNamePrefix = pb.TableNamePrefix + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *autoCaptureConfigOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st autoCaptureConfigOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func autoCaptureStateToPb(st *AutoCaptureState) (*autoCaptureStatePb, error) { + if st == nil { + return nil, nil + } + pb := &autoCaptureStatePb{} + pb.PayloadTable = st.PayloadTable + + return pb, nil +} + +type autoCaptureStatePb struct { + PayloadTable *PayloadTable `json:"payload_table,omitempty"` +} + +func autoCaptureStateFromPb(pb *autoCaptureStatePb) (*AutoCaptureState, error) { + if pb == nil { + return nil, nil + } + st := &AutoCaptureState{} + st.PayloadTable = pb.PayloadTable + + return st, nil +} + +func bearerTokenAuthToPb(st *BearerTokenAuth) (*bearerTokenAuthPb, error) { + if st == nil { + return nil, nil + } + pb := &bearerTokenAuthPb{} + pb.Token = st.Token + + pb.TokenPlaintext = st.TokenPlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type bearerTokenAuthPb struct { + Token string `json:"token,omitempty"` + + TokenPlaintext string `json:"token_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func bearerTokenAuthFromPb(pb *bearerTokenAuthPb) (*BearerTokenAuth, error) { + if pb == nil { + return nil, nil + } + st := &BearerTokenAuth{} + st.Token = pb.Token + st.TokenPlaintext = pb.TokenPlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *bearerTokenAuthPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st bearerTokenAuthPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func buildLogsRequestToPb(st *BuildLogsRequest) (*buildLogsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &buildLogsRequestPb{} + pb.Name = st.Name + + pb.ServedModelName = st.ServedModelName + + return pb, nil +} + +type buildLogsRequestPb struct { + Name string `json:"-" url:"-"` + + ServedModelName string `json:"-" url:"-"` +} + +func buildLogsRequestFromPb(pb *buildLogsRequestPb) (*BuildLogsRequest, error) { + if pb == nil { + return nil, nil + } + st := &BuildLogsRequest{} + st.Name = pb.Name + st.ServedModelName = pb.ServedModelName + + return st, nil +} + +func buildLogsResponseToPb(st *BuildLogsResponse) (*buildLogsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &buildLogsResponsePb{} + pb.Logs = st.Logs + + return pb, nil +} + +type buildLogsResponsePb struct { + Logs string `json:"logs"` +} + +func buildLogsResponseFromPb(pb *buildLogsResponsePb) (*BuildLogsResponse, error) { + if pb == nil { + return nil, nil + } + st := &BuildLogsResponse{} + st.Logs = pb.Logs + + return st, nil +} + +func chatMessageToPb(st *ChatMessage) (*chatMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &chatMessagePb{} + pb.Content = st.Content + + pb.Role = st.Role + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type chatMessagePb struct { + Content string `json:"content,omitempty"` + + Role ChatMessageRole `json:"role,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func chatMessageFromPb(pb *chatMessagePb) (*ChatMessage, error) { + if pb == nil { + return nil, nil + } + st := &ChatMessage{} + st.Content = pb.Content + st.Role = pb.Role + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *chatMessagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st chatMessagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cohereConfigToPb(st *CohereConfig) (*cohereConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &cohereConfigPb{} + pb.CohereApiBase = st.CohereApiBase + + pb.CohereApiKey = st.CohereApiKey + + pb.CohereApiKeyPlaintext = st.CohereApiKeyPlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cohereConfigPb struct { + CohereApiBase string `json:"cohere_api_base,omitempty"` + + CohereApiKey string `json:"cohere_api_key,omitempty"` + + CohereApiKeyPlaintext string `json:"cohere_api_key_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cohereConfigFromPb(pb *cohereConfigPb) (*CohereConfig, error) { + if pb == nil { + return nil, nil + } + st := &CohereConfig{} + st.CohereApiBase = pb.CohereApiBase + st.CohereApiKey = pb.CohereApiKey + st.CohereApiKeyPlaintext = pb.CohereApiKeyPlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cohereConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cohereConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPtEndpointRequestToPb(st *CreatePtEndpointRequest) (*createPtEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createPtEndpointRequestPb{} + pb.AiGateway = st.AiGateway + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Config = st.Config + + pb.Name = st.Name + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPtEndpointRequestPb struct { + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Config PtEndpointCoreConfig `json:"config"` + + Name string `json:"name"` + + Tags []EndpointTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPtEndpointRequestFromPb(pb *createPtEndpointRequestPb) (*CreatePtEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreatePtEndpointRequest{} + st.AiGateway = pb.AiGateway + st.BudgetPolicyId = pb.BudgetPolicyId + st.Config = pb.Config + st.Name = pb.Name + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPtEndpointRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPtEndpointRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createServingEndpointToPb(st *CreateServingEndpoint) (*createServingEndpointPb, error) { + if st == nil { + return nil, nil + } + pb := &createServingEndpointPb{} + pb.AiGateway = st.AiGateway + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Config = st.Config + + pb.Name = st.Name + + pb.RateLimits = st.RateLimits + + pb.RouteOptimized = st.RouteOptimized + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createServingEndpointPb struct { + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Config *EndpointCoreConfigInput `json:"config,omitempty"` + + Name string `json:"name"` + + RateLimits []RateLimit `json:"rate_limits,omitempty"` + + RouteOptimized bool `json:"route_optimized,omitempty"` + + Tags []EndpointTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createServingEndpointFromPb(pb *createServingEndpointPb) (*CreateServingEndpoint, error) { + if pb == nil { + return nil, nil + } + st := &CreateServingEndpoint{} + st.AiGateway = pb.AiGateway + st.BudgetPolicyId = pb.BudgetPolicyId + st.Config = pb.Config + st.Name = pb.Name + st.RateLimits = pb.RateLimits + st.RouteOptimized = pb.RouteOptimized + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createServingEndpointPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createServingEndpointPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func customProviderConfigToPb(st *CustomProviderConfig) (*customProviderConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &customProviderConfigPb{} + pb.ApiKeyAuth = st.ApiKeyAuth + + pb.BearerTokenAuth = st.BearerTokenAuth + + pb.CustomProviderUrl = st.CustomProviderUrl + + return pb, nil +} + +type customProviderConfigPb struct { + ApiKeyAuth *ApiKeyAuth `json:"api_key_auth,omitempty"` + + BearerTokenAuth *BearerTokenAuth `json:"bearer_token_auth,omitempty"` + + CustomProviderUrl string `json:"custom_provider_url"` +} + +func customProviderConfigFromPb(pb *customProviderConfigPb) (*CustomProviderConfig, error) { + if pb == nil { + return nil, nil + } + st := &CustomProviderConfig{} + st.ApiKeyAuth = pb.ApiKeyAuth + st.BearerTokenAuth = pb.BearerTokenAuth + st.CustomProviderUrl = pb.CustomProviderUrl + + return st, nil +} + +func dataPlaneInfoToPb(st *DataPlaneInfo) (*dataPlaneInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &dataPlaneInfoPb{} + pb.AuthorizationDetails = st.AuthorizationDetails + + pb.EndpointUrl = st.EndpointUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dataPlaneInfoPb struct { + AuthorizationDetails string `json:"authorization_details,omitempty"` + + EndpointUrl string `json:"endpoint_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dataPlaneInfoFromPb(pb *dataPlaneInfoPb) (*DataPlaneInfo, error) { + if pb == nil { + return nil, nil + } + st := &DataPlaneInfo{} + st.AuthorizationDetails = pb.AuthorizationDetails + st.EndpointUrl = pb.EndpointUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dataPlaneInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dataPlaneInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func databricksModelServingConfigToPb(st *DatabricksModelServingConfig) (*databricksModelServingConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &databricksModelServingConfigPb{} + pb.DatabricksApiToken = st.DatabricksApiToken + + pb.DatabricksApiTokenPlaintext = st.DatabricksApiTokenPlaintext + + pb.DatabricksWorkspaceUrl = st.DatabricksWorkspaceUrl + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type databricksModelServingConfigPb struct { + DatabricksApiToken string `json:"databricks_api_token,omitempty"` + + DatabricksApiTokenPlaintext string `json:"databricks_api_token_plaintext,omitempty"` + + DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func databricksModelServingConfigFromPb(pb *databricksModelServingConfigPb) (*DatabricksModelServingConfig, error) { + if pb == nil { + return nil, nil + } + st := &DatabricksModelServingConfig{} + st.DatabricksApiToken = pb.DatabricksApiToken + st.DatabricksApiTokenPlaintext = pb.DatabricksApiTokenPlaintext + st.DatabricksWorkspaceUrl = pb.DatabricksWorkspaceUrl + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *databricksModelServingConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st databricksModelServingConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dataframeSplitInputToPb(st *DataframeSplitInput) (*dataframeSplitInputPb, error) { + if st == nil { + return nil, nil + } + pb := &dataframeSplitInputPb{} + pb.Columns = st.Columns + + pb.Data = st.Data + + pb.Index = st.Index + + return pb, nil +} + +type dataframeSplitInputPb struct { + Columns []any `json:"columns,omitempty"` + + Data []any `json:"data,omitempty"` + + Index []int `json:"index,omitempty"` +} + +func dataframeSplitInputFromPb(pb *dataframeSplitInputPb) (*DataframeSplitInput, error) { + if pb == nil { + return nil, nil + } + st := &DataframeSplitInput{} + st.Columns = pb.Columns + st.Data = pb.Data + st.Index = pb.Index + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteServingEndpointRequestToPb(st *DeleteServingEndpointRequest) (*deleteServingEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteServingEndpointRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteServingEndpointRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteServingEndpointRequestFromPb(pb *deleteServingEndpointRequestPb) (*DeleteServingEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteServingEndpointRequest{} + st.Name = pb.Name + + return st, nil +} + +func embeddingsV1ResponseEmbeddingElementToPb(st *EmbeddingsV1ResponseEmbeddingElement) (*embeddingsV1ResponseEmbeddingElementPb, error) { + if st == nil { + return nil, nil + } + pb := &embeddingsV1ResponseEmbeddingElementPb{} + pb.Embedding = st.Embedding + + pb.Index = st.Index + + pb.Object = st.Object + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type embeddingsV1ResponseEmbeddingElementPb struct { + Embedding []float64 `json:"embedding,omitempty"` + + Index int `json:"index,omitempty"` + + Object EmbeddingsV1ResponseEmbeddingElementObject `json:"object,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func embeddingsV1ResponseEmbeddingElementFromPb(pb *embeddingsV1ResponseEmbeddingElementPb) (*EmbeddingsV1ResponseEmbeddingElement, error) { + if pb == nil { + return nil, nil + } + st := &EmbeddingsV1ResponseEmbeddingElement{} + st.Embedding = pb.Embedding + st.Index = pb.Index + st.Object = pb.Object + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *embeddingsV1ResponseEmbeddingElementPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st embeddingsV1ResponseEmbeddingElementPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointCoreConfigInputToPb(st *EndpointCoreConfigInput) (*endpointCoreConfigInputPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointCoreConfigInputPb{} + pb.AutoCaptureConfig = st.AutoCaptureConfig + + pb.Name = st.Name + + pb.ServedEntities = st.ServedEntities + + pb.ServedModels = st.ServedModels + + pb.TrafficConfig = st.TrafficConfig + + return pb, nil +} + +type endpointCoreConfigInputPb struct { + AutoCaptureConfig *AutoCaptureConfigInput `json:"auto_capture_config,omitempty"` + + Name string `json:"-" url:"-"` + + ServedEntities []ServedEntityInput `json:"served_entities,omitempty"` + + ServedModels []ServedModelInput `json:"served_models,omitempty"` + + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` +} + +func endpointCoreConfigInputFromPb(pb *endpointCoreConfigInputPb) (*EndpointCoreConfigInput, error) { + if pb == nil { + return nil, nil + } + st := &EndpointCoreConfigInput{} + st.AutoCaptureConfig = pb.AutoCaptureConfig + st.Name = pb.Name + st.ServedEntities = pb.ServedEntities + st.ServedModels = pb.ServedModels + st.TrafficConfig = pb.TrafficConfig + + return st, nil +} + +func endpointCoreConfigOutputToPb(st *EndpointCoreConfigOutput) (*endpointCoreConfigOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointCoreConfigOutputPb{} + pb.AutoCaptureConfig = st.AutoCaptureConfig + + pb.ConfigVersion = st.ConfigVersion + + pb.ServedEntities = st.ServedEntities + + pb.ServedModels = st.ServedModels + + pb.TrafficConfig = st.TrafficConfig + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointCoreConfigOutputPb struct { + AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` + + ConfigVersion int64 `json:"config_version,omitempty"` + + ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + + ServedModels []ServedModelOutput `json:"served_models,omitempty"` + + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointCoreConfigOutputFromPb(pb *endpointCoreConfigOutputPb) (*EndpointCoreConfigOutput, error) { + if pb == nil { + return nil, nil + } + st := &EndpointCoreConfigOutput{} + st.AutoCaptureConfig = pb.AutoCaptureConfig + st.ConfigVersion = pb.ConfigVersion + st.ServedEntities = pb.ServedEntities + st.ServedModels = pb.ServedModels + st.TrafficConfig = pb.TrafficConfig + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointCoreConfigOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointCoreConfigOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointCoreConfigSummaryToPb(st *EndpointCoreConfigSummary) (*endpointCoreConfigSummaryPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointCoreConfigSummaryPb{} + pb.ServedEntities = st.ServedEntities + + pb.ServedModels = st.ServedModels + + return pb, nil +} + +type endpointCoreConfigSummaryPb struct { + ServedEntities []ServedEntitySpec `json:"served_entities,omitempty"` + + ServedModels []ServedModelSpec `json:"served_models,omitempty"` +} + +func endpointCoreConfigSummaryFromPb(pb *endpointCoreConfigSummaryPb) (*EndpointCoreConfigSummary, error) { + if pb == nil { + return nil, nil + } + st := &EndpointCoreConfigSummary{} + st.ServedEntities = pb.ServedEntities + st.ServedModels = pb.ServedModels + + return st, nil +} + +func endpointPendingConfigToPb(st *EndpointPendingConfig) (*endpointPendingConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointPendingConfigPb{} + pb.AutoCaptureConfig = st.AutoCaptureConfig + + pb.ConfigVersion = st.ConfigVersion + + pb.ServedEntities = st.ServedEntities + + pb.ServedModels = st.ServedModels + + pb.StartTime = st.StartTime + + pb.TrafficConfig = st.TrafficConfig + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointPendingConfigPb struct { + AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` + + ConfigVersion int `json:"config_version,omitempty"` + + ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + + ServedModels []ServedModelOutput `json:"served_models,omitempty"` + + StartTime int64 `json:"start_time,omitempty"` + + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointPendingConfigFromPb(pb *endpointPendingConfigPb) (*EndpointPendingConfig, error) { + if pb == nil { + return nil, nil + } + st := &EndpointPendingConfig{} + st.AutoCaptureConfig = pb.AutoCaptureConfig + st.ConfigVersion = pb.ConfigVersion + st.ServedEntities = pb.ServedEntities + st.ServedModels = pb.ServedModels + st.StartTime = pb.StartTime + st.TrafficConfig = pb.TrafficConfig + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointPendingConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointPendingConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointStateToPb(st *EndpointState) (*endpointStatePb, error) { + if st == nil { + return nil, nil + } + pb := &endpointStatePb{} + pb.ConfigUpdate = st.ConfigUpdate + + pb.Ready = st.Ready + + return pb, nil +} + +type endpointStatePb struct { + ConfigUpdate EndpointStateConfigUpdate `json:"config_update,omitempty"` + + Ready EndpointStateReady `json:"ready,omitempty"` +} + +func endpointStateFromPb(pb *endpointStatePb) (*EndpointState, error) { + if pb == nil { + return nil, nil + } + st := &EndpointState{} + st.ConfigUpdate = pb.ConfigUpdate + st.Ready = pb.Ready + + return st, nil +} + +func endpointTagToPb(st *EndpointTag) (*endpointTagPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointTagPb struct { + Key string `json:"key"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointTagFromPb(pb *endpointTagPb) (*EndpointTag, error) { + if pb == nil { + return nil, nil + } + st := &EndpointTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointTagsToPb(st *EndpointTags) (*endpointTagsPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointTagsPb{} + pb.Tags = st.Tags + + return pb, nil +} + +type endpointTagsPb struct { + Tags []EndpointTag `json:"tags,omitempty"` +} + +func endpointTagsFromPb(pb *endpointTagsPb) (*EndpointTags, error) { + if pb == nil { + return nil, nil + } + st := &EndpointTags{} + st.Tags = pb.Tags + + return st, nil +} + +func exportMetricsRequestToPb(st *ExportMetricsRequest) (*exportMetricsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &exportMetricsRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type exportMetricsRequestPb struct { + Name string `json:"-" url:"-"` +} + +func exportMetricsRequestFromPb(pb *exportMetricsRequestPb) (*ExportMetricsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExportMetricsRequest{} + st.Name = pb.Name + + return st, nil +} + +func exportMetricsResponseToPb(st *ExportMetricsResponse) (*exportMetricsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &exportMetricsResponsePb{} + pb.Contents = st.Contents + + return pb, nil +} + +type exportMetricsResponsePb struct { + Contents io.ReadCloser `json:"-"` +} + +func exportMetricsResponseFromPb(pb *exportMetricsResponsePb) (*ExportMetricsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ExportMetricsResponse{} + st.Contents = pb.Contents + + return st, nil +} + +func externalFunctionRequestToPb(st *ExternalFunctionRequest) (*externalFunctionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &externalFunctionRequestPb{} + pb.ConnectionName = st.ConnectionName + + pb.Headers = st.Headers + + pb.Json = st.Json + + pb.Method = st.Method + + pb.Params = st.Params + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalFunctionRequestPb struct { + ConnectionName string `json:"connection_name"` + + Headers string `json:"headers,omitempty"` + + Json string `json:"json,omitempty"` + + Method ExternalFunctionRequestHttpMethod `json:"method"` + + Params string `json:"params,omitempty"` + + Path string `json:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalFunctionRequestFromPb(pb *externalFunctionRequestPb) (*ExternalFunctionRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExternalFunctionRequest{} + st.ConnectionName = pb.ConnectionName + st.Headers = pb.Headers + st.Json = pb.Json + st.Method = pb.Method + st.Params = pb.Params + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalFunctionRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalFunctionRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func externalModelToPb(st *ExternalModel) (*externalModelPb, error) { + if st == nil { + return nil, nil + } + pb := &externalModelPb{} + pb.Ai21labsConfig = st.Ai21labsConfig + + pb.AmazonBedrockConfig = st.AmazonBedrockConfig + + pb.AnthropicConfig = st.AnthropicConfig + + pb.CohereConfig = st.CohereConfig + + pb.CustomProviderConfig = st.CustomProviderConfig + + pb.DatabricksModelServingConfig = st.DatabricksModelServingConfig + + pb.GoogleCloudVertexAiConfig = st.GoogleCloudVertexAiConfig + + pb.Name = st.Name + + pb.OpenaiConfig = st.OpenaiConfig + + pb.PalmConfig = st.PalmConfig + + pb.Provider = st.Provider + + pb.Task = st.Task + + return pb, nil +} + +type externalModelPb struct { + Ai21labsConfig *Ai21LabsConfig `json:"ai21labs_config,omitempty"` + + AmazonBedrockConfig *AmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` + + AnthropicConfig *AnthropicConfig `json:"anthropic_config,omitempty"` + + CohereConfig *CohereConfig `json:"cohere_config,omitempty"` + + CustomProviderConfig *CustomProviderConfig `json:"custom_provider_config,omitempty"` + + DatabricksModelServingConfig *DatabricksModelServingConfig `json:"databricks_model_serving_config,omitempty"` + + GoogleCloudVertexAiConfig *GoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` + + Name string `json:"name"` + + OpenaiConfig *OpenAiConfig `json:"openai_config,omitempty"` + + PalmConfig *PaLmConfig `json:"palm_config,omitempty"` + + Provider ExternalModelProvider `json:"provider"` + + Task string `json:"task"` +} + +func externalModelFromPb(pb *externalModelPb) (*ExternalModel, error) { + if pb == nil { + return nil, nil + } + st := &ExternalModel{} + st.Ai21labsConfig = pb.Ai21labsConfig + st.AmazonBedrockConfig = pb.AmazonBedrockConfig + st.AnthropicConfig = pb.AnthropicConfig + st.CohereConfig = pb.CohereConfig + st.CustomProviderConfig = pb.CustomProviderConfig + st.DatabricksModelServingConfig = pb.DatabricksModelServingConfig + st.GoogleCloudVertexAiConfig = pb.GoogleCloudVertexAiConfig + st.Name = pb.Name + st.OpenaiConfig = pb.OpenaiConfig + st.PalmConfig = pb.PalmConfig + st.Provider = pb.Provider + st.Task = pb.Task + + return st, nil +} + +func externalModelUsageElementToPb(st *ExternalModelUsageElement) (*externalModelUsageElementPb, error) { + if st == nil { + return nil, nil + } + pb := &externalModelUsageElementPb{} + pb.CompletionTokens = st.CompletionTokens + + pb.PromptTokens = st.PromptTokens + + pb.TotalTokens = st.TotalTokens + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalModelUsageElementPb struct { + CompletionTokens int `json:"completion_tokens,omitempty"` + + PromptTokens int `json:"prompt_tokens,omitempty"` + + TotalTokens int `json:"total_tokens,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalModelUsageElementFromPb(pb *externalModelUsageElementPb) (*ExternalModelUsageElement, error) { + if pb == nil { + return nil, nil + } + st := &ExternalModelUsageElement{} + st.CompletionTokens = pb.CompletionTokens + st.PromptTokens = pb.PromptTokens + st.TotalTokens = pb.TotalTokens + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalModelUsageElementPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalModelUsageElementPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func fallbackConfigToPb(st *FallbackConfig) (*fallbackConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &fallbackConfigPb{} + pb.Enabled = st.Enabled + + return pb, nil +} + +type fallbackConfigPb struct { + Enabled bool `json:"enabled"` +} + +func fallbackConfigFromPb(pb *fallbackConfigPb) (*FallbackConfig, error) { + if pb == nil { + return nil, nil + } + st := &FallbackConfig{} + st.Enabled = pb.Enabled + + return st, nil +} + +func foundationModelToPb(st *FoundationModel) (*foundationModelPb, error) { + if st == nil { + return nil, nil + } + pb := &foundationModelPb{} + pb.Description = st.Description + + pb.DisplayName = st.DisplayName + + pb.Docs = st.Docs + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type foundationModelPb struct { + Description string `json:"description,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Docs string `json:"docs,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func foundationModelFromPb(pb *foundationModelPb) (*FoundationModel, error) { + if pb == nil { + return nil, nil + } + st := &FoundationModel{} + st.Description = pb.Description + st.DisplayName = pb.DisplayName + st.Docs = pb.Docs + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *foundationModelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st foundationModelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getOpenApiRequestToPb(st *GetOpenApiRequest) (*getOpenApiRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getOpenApiRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getOpenApiRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getOpenApiRequestFromPb(pb *getOpenApiRequestPb) (*GetOpenApiRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetOpenApiRequest{} + st.Name = pb.Name + + return st, nil +} + +func getOpenApiResponseToPb(st *GetOpenApiResponse) (*getOpenApiResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getOpenApiResponsePb{} + pb.Contents = st.Contents + + return pb, nil +} + +type getOpenApiResponsePb struct { + Contents io.ReadCloser `json:"-"` +} + +func getOpenApiResponseFromPb(pb *getOpenApiResponsePb) (*GetOpenApiResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetOpenApiResponse{} + st.Contents = pb.Contents + + return st, nil +} + +func getServingEndpointPermissionLevelsRequestToPb(st *GetServingEndpointPermissionLevelsRequest) (*getServingEndpointPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getServingEndpointPermissionLevelsRequestPb{} + pb.ServingEndpointId = st.ServingEndpointId + + return pb, nil +} + +type getServingEndpointPermissionLevelsRequestPb struct { + ServingEndpointId string `json:"-" url:"-"` +} + +func getServingEndpointPermissionLevelsRequestFromPb(pb *getServingEndpointPermissionLevelsRequestPb) (*GetServingEndpointPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetServingEndpointPermissionLevelsRequest{} + st.ServingEndpointId = pb.ServingEndpointId + + return st, nil +} + +func getServingEndpointPermissionLevelsResponseToPb(st *GetServingEndpointPermissionLevelsResponse) (*getServingEndpointPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getServingEndpointPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getServingEndpointPermissionLevelsResponsePb struct { + PermissionLevels []ServingEndpointPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getServingEndpointPermissionLevelsResponseFromPb(pb *getServingEndpointPermissionLevelsResponsePb) (*GetServingEndpointPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetServingEndpointPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getServingEndpointPermissionsRequestToPb(st *GetServingEndpointPermissionsRequest) (*getServingEndpointPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getServingEndpointPermissionsRequestPb{} + pb.ServingEndpointId = st.ServingEndpointId + + return pb, nil +} + +type getServingEndpointPermissionsRequestPb struct { + ServingEndpointId string `json:"-" url:"-"` +} + +func getServingEndpointPermissionsRequestFromPb(pb *getServingEndpointPermissionsRequestPb) (*GetServingEndpointPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetServingEndpointPermissionsRequest{} + st.ServingEndpointId = pb.ServingEndpointId + + return st, nil +} + +func getServingEndpointRequestToPb(st *GetServingEndpointRequest) (*getServingEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getServingEndpointRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getServingEndpointRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getServingEndpointRequestFromPb(pb *getServingEndpointRequestPb) (*GetServingEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetServingEndpointRequest{} + st.Name = pb.Name + + return st, nil +} + +func googleCloudVertexAiConfigToPb(st *GoogleCloudVertexAiConfig) (*googleCloudVertexAiConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &googleCloudVertexAiConfigPb{} + pb.PrivateKey = st.PrivateKey + + pb.PrivateKeyPlaintext = st.PrivateKeyPlaintext + + pb.ProjectId = st.ProjectId + + pb.Region = st.Region + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type googleCloudVertexAiConfigPb struct { + PrivateKey string `json:"private_key,omitempty"` + + PrivateKeyPlaintext string `json:"private_key_plaintext,omitempty"` + + ProjectId string `json:"project_id"` + + Region string `json:"region"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func googleCloudVertexAiConfigFromPb(pb *googleCloudVertexAiConfigPb) (*GoogleCloudVertexAiConfig, error) { + if pb == nil { + return nil, nil + } + st := &GoogleCloudVertexAiConfig{} + st.PrivateKey = pb.PrivateKey + st.PrivateKeyPlaintext = pb.PrivateKeyPlaintext + st.ProjectId = pb.ProjectId + st.Region = pb.Region + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *googleCloudVertexAiConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st googleCloudVertexAiConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func httpRequestResponseToPb(st *HttpRequestResponse) (*httpRequestResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &httpRequestResponsePb{} + pb.Contents = st.Contents + + return pb, nil +} + +type httpRequestResponsePb struct { + Contents io.ReadCloser `json:"-"` +} + +func httpRequestResponseFromPb(pb *httpRequestResponsePb) (*HttpRequestResponse, error) { + if pb == nil { + return nil, nil + } + st := &HttpRequestResponse{} + st.Contents = pb.Contents + + return st, nil +} + +func listEndpointsResponseToPb(st *ListEndpointsResponse) (*listEndpointsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listEndpointsResponsePb{} + pb.Endpoints = st.Endpoints + + return pb, nil +} + +type listEndpointsResponsePb struct { + Endpoints []ServingEndpoint `json:"endpoints,omitempty"` +} + +func listEndpointsResponseFromPb(pb *listEndpointsResponsePb) (*ListEndpointsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListEndpointsResponse{} + st.Endpoints = pb.Endpoints + + return st, nil +} + +func logsRequestToPb(st *LogsRequest) (*logsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &logsRequestPb{} + pb.Name = st.Name + + pb.ServedModelName = st.ServedModelName + + return pb, nil +} + +type logsRequestPb struct { + Name string `json:"-" url:"-"` + + ServedModelName string `json:"-" url:"-"` +} + +func logsRequestFromPb(pb *logsRequestPb) (*LogsRequest, error) { + if pb == nil { + return nil, nil + } + st := &LogsRequest{} + st.Name = pb.Name + st.ServedModelName = pb.ServedModelName + + return st, nil +} + +func modelDataPlaneInfoToPb(st *ModelDataPlaneInfo) (*modelDataPlaneInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &modelDataPlaneInfoPb{} + pb.QueryInfo = st.QueryInfo + + return pb, nil +} + +type modelDataPlaneInfoPb struct { + QueryInfo *DataPlaneInfo `json:"query_info,omitempty"` +} + +func modelDataPlaneInfoFromPb(pb *modelDataPlaneInfoPb) (*ModelDataPlaneInfo, error) { + if pb == nil { + return nil, nil + } + st := &ModelDataPlaneInfo{} + st.QueryInfo = pb.QueryInfo + + return st, nil +} + +func openAiConfigToPb(st *OpenAiConfig) (*openAiConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &openAiConfigPb{} + pb.MicrosoftEntraClientId = st.MicrosoftEntraClientId + + pb.MicrosoftEntraClientSecret = st.MicrosoftEntraClientSecret + + pb.MicrosoftEntraClientSecretPlaintext = st.MicrosoftEntraClientSecretPlaintext + + pb.MicrosoftEntraTenantId = st.MicrosoftEntraTenantId + + pb.OpenaiApiBase = st.OpenaiApiBase + + pb.OpenaiApiKey = st.OpenaiApiKey + + pb.OpenaiApiKeyPlaintext = st.OpenaiApiKeyPlaintext + + pb.OpenaiApiType = st.OpenaiApiType + + pb.OpenaiApiVersion = st.OpenaiApiVersion + + pb.OpenaiDeploymentName = st.OpenaiDeploymentName + + pb.OpenaiOrganization = st.OpenaiOrganization + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type openAiConfigPb struct { + MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` + + MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` + + MicrosoftEntraClientSecretPlaintext string `json:"microsoft_entra_client_secret_plaintext,omitempty"` + + MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` + + OpenaiApiBase string `json:"openai_api_base,omitempty"` + + OpenaiApiKey string `json:"openai_api_key,omitempty"` + + OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` + + OpenaiApiType string `json:"openai_api_type,omitempty"` + + OpenaiApiVersion string `json:"openai_api_version,omitempty"` + + OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` + + OpenaiOrganization string `json:"openai_organization,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func openAiConfigFromPb(pb *openAiConfigPb) (*OpenAiConfig, error) { + if pb == nil { + return nil, nil + } + st := &OpenAiConfig{} + st.MicrosoftEntraClientId = pb.MicrosoftEntraClientId + st.MicrosoftEntraClientSecret = pb.MicrosoftEntraClientSecret + st.MicrosoftEntraClientSecretPlaintext = pb.MicrosoftEntraClientSecretPlaintext + st.MicrosoftEntraTenantId = pb.MicrosoftEntraTenantId + st.OpenaiApiBase = pb.OpenaiApiBase + st.OpenaiApiKey = pb.OpenaiApiKey + st.OpenaiApiKeyPlaintext = pb.OpenaiApiKeyPlaintext + st.OpenaiApiType = pb.OpenaiApiType + st.OpenaiApiVersion = pb.OpenaiApiVersion + st.OpenaiDeploymentName = pb.OpenaiDeploymentName + st.OpenaiOrganization = pb.OpenaiOrganization + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *openAiConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st openAiConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func paLmConfigToPb(st *PaLmConfig) (*paLmConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &paLmConfigPb{} + pb.PalmApiKey = st.PalmApiKey + + pb.PalmApiKeyPlaintext = st.PalmApiKeyPlaintext + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type paLmConfigPb struct { + PalmApiKey string `json:"palm_api_key,omitempty"` + + PalmApiKeyPlaintext string `json:"palm_api_key_plaintext,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func paLmConfigFromPb(pb *paLmConfigPb) (*PaLmConfig, error) { + if pb == nil { + return nil, nil + } + st := &PaLmConfig{} + st.PalmApiKey = pb.PalmApiKey + st.PalmApiKeyPlaintext = pb.PalmApiKeyPlaintext + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *paLmConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st paLmConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func patchServingEndpointTagsToPb(st *PatchServingEndpointTags) (*patchServingEndpointTagsPb, error) { + if st == nil { + return nil, nil + } + pb := &patchServingEndpointTagsPb{} + pb.AddTags = st.AddTags + + pb.DeleteTags = st.DeleteTags + + pb.Name = st.Name + + return pb, nil +} + +type patchServingEndpointTagsPb struct { + AddTags []EndpointTag `json:"add_tags,omitempty"` + + DeleteTags []string `json:"delete_tags,omitempty"` + + Name string `json:"-" url:"-"` +} + +func patchServingEndpointTagsFromPb(pb *patchServingEndpointTagsPb) (*PatchServingEndpointTags, error) { + if pb == nil { + return nil, nil + } + st := &PatchServingEndpointTags{} + st.AddTags = pb.AddTags + st.DeleteTags = pb.DeleteTags + st.Name = pb.Name + + return st, nil +} + +func payloadTableToPb(st *PayloadTable) (*payloadTablePb, error) { + if st == nil { + return nil, nil + } + pb := &payloadTablePb{} + pb.Name = st.Name + + pb.Status = st.Status + + pb.StatusMessage = st.StatusMessage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type payloadTablePb struct { + Name string `json:"name,omitempty"` + + Status string `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func payloadTableFromPb(pb *payloadTablePb) (*PayloadTable, error) { + if pb == nil { + return nil, nil + } + st := &PayloadTable{} + st.Name = pb.Name + st.Status = pb.Status + st.StatusMessage = pb.StatusMessage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *payloadTablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st payloadTablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func ptEndpointCoreConfigToPb(st *PtEndpointCoreConfig) (*ptEndpointCoreConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &ptEndpointCoreConfigPb{} + pb.ServedEntities = st.ServedEntities + + pb.TrafficConfig = st.TrafficConfig + + return pb, nil +} + +type ptEndpointCoreConfigPb struct { + ServedEntities []PtServedModel `json:"served_entities,omitempty"` + + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` +} + +func ptEndpointCoreConfigFromPb(pb *ptEndpointCoreConfigPb) (*PtEndpointCoreConfig, error) { + if pb == nil { + return nil, nil + } + st := &PtEndpointCoreConfig{} + st.ServedEntities = pb.ServedEntities + st.TrafficConfig = pb.TrafficConfig + + return st, nil +} + +func ptServedModelToPb(st *PtServedModel) (*ptServedModelPb, error) { + if st == nil { + return nil, nil + } + pb := &ptServedModelPb{} + pb.EntityName = st.EntityName + + pb.EntityVersion = st.EntityVersion + + pb.Name = st.Name + + pb.ProvisionedModelUnits = st.ProvisionedModelUnits + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type ptServedModelPb struct { + EntityName string `json:"entity_name"` + + EntityVersion string `json:"entity_version,omitempty"` + + Name string `json:"name,omitempty"` + + ProvisionedModelUnits int64 `json:"provisioned_model_units"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func ptServedModelFromPb(pb *ptServedModelPb) (*PtServedModel, error) { + if pb == nil { + return nil, nil + } + st := &PtServedModel{} + st.EntityName = pb.EntityName + st.EntityVersion = pb.EntityVersion + st.Name = pb.Name + st.ProvisionedModelUnits = pb.ProvisionedModelUnits + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *ptServedModelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st ptServedModelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func putAiGatewayRequestToPb(st *PutAiGatewayRequest) (*putAiGatewayRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &putAiGatewayRequestPb{} + pb.FallbackConfig = st.FallbackConfig + + pb.Guardrails = st.Guardrails + + pb.InferenceTableConfig = st.InferenceTableConfig + + pb.Name = st.Name + + pb.RateLimits = st.RateLimits + + pb.UsageTrackingConfig = st.UsageTrackingConfig + + return pb, nil +} + +type putAiGatewayRequestPb struct { + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + + InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + + Name string `json:"-" url:"-"` + + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` +} + +func putAiGatewayRequestFromPb(pb *putAiGatewayRequestPb) (*PutAiGatewayRequest, error) { + if pb == nil { + return nil, nil + } + st := &PutAiGatewayRequest{} + st.FallbackConfig = pb.FallbackConfig + st.Guardrails = pb.Guardrails + st.InferenceTableConfig = pb.InferenceTableConfig + st.Name = pb.Name + st.RateLimits = pb.RateLimits + st.UsageTrackingConfig = pb.UsageTrackingConfig + + return st, nil +} + +func putAiGatewayResponseToPb(st *PutAiGatewayResponse) (*putAiGatewayResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &putAiGatewayResponsePb{} + pb.FallbackConfig = st.FallbackConfig + + pb.Guardrails = st.Guardrails + + pb.InferenceTableConfig = st.InferenceTableConfig + + pb.RateLimits = st.RateLimits + + pb.UsageTrackingConfig = st.UsageTrackingConfig + + return pb, nil +} + +type putAiGatewayResponsePb struct { + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + + InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` +} + +func putAiGatewayResponseFromPb(pb *putAiGatewayResponsePb) (*PutAiGatewayResponse, error) { + if pb == nil { + return nil, nil + } + st := &PutAiGatewayResponse{} + st.FallbackConfig = pb.FallbackConfig + st.Guardrails = pb.Guardrails + st.InferenceTableConfig = pb.InferenceTableConfig + st.RateLimits = pb.RateLimits + st.UsageTrackingConfig = pb.UsageTrackingConfig + + return st, nil +} + +func putRequestToPb(st *PutRequest) (*putRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &putRequestPb{} + pb.Name = st.Name + + pb.RateLimits = st.RateLimits + + return pb, nil +} + +type putRequestPb struct { + Name string `json:"-" url:"-"` + + RateLimits []RateLimit `json:"rate_limits,omitempty"` +} + +func putRequestFromPb(pb *putRequestPb) (*PutRequest, error) { + if pb == nil { + return nil, nil + } + st := &PutRequest{} + st.Name = pb.Name + st.RateLimits = pb.RateLimits + + return st, nil +} + +func putResponseToPb(st *PutResponse) (*putResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &putResponsePb{} + pb.RateLimits = st.RateLimits + + return pb, nil +} + +type putResponsePb struct { + RateLimits []RateLimit `json:"rate_limits,omitempty"` +} + +func putResponseFromPb(pb *putResponsePb) (*PutResponse, error) { + if pb == nil { + return nil, nil + } + st := &PutResponse{} + st.RateLimits = pb.RateLimits + + return st, nil +} + +func queryEndpointInputToPb(st *QueryEndpointInput) (*queryEndpointInputPb, error) { + if st == nil { + return nil, nil + } + pb := &queryEndpointInputPb{} + pb.DataframeRecords = st.DataframeRecords + + pb.DataframeSplit = st.DataframeSplit + + pb.ExtraParams = st.ExtraParams + + pb.Input = st.Input + + pb.Inputs = st.Inputs + + pb.Instances = st.Instances + + pb.MaxTokens = st.MaxTokens + + pb.Messages = st.Messages + + pb.N = st.N + + pb.Name = st.Name + + pb.Prompt = st.Prompt + + pb.Stop = st.Stop + + pb.Stream = st.Stream + + pb.Temperature = st.Temperature + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryEndpointInputPb struct { + DataframeRecords []any `json:"dataframe_records,omitempty"` + + DataframeSplit *DataframeSplitInput `json:"dataframe_split,omitempty"` + + ExtraParams map[string]string `json:"extra_params,omitempty"` + + Input any `json:"input,omitempty"` + + Inputs any `json:"inputs,omitempty"` + + Instances []any `json:"instances,omitempty"` + + MaxTokens int `json:"max_tokens,omitempty"` + + Messages []ChatMessage `json:"messages,omitempty"` + + N int `json:"n,omitempty"` + + Name string `json:"-" url:"-"` + + Prompt any `json:"prompt,omitempty"` + + Stop []string `json:"stop,omitempty"` + + Stream bool `json:"stream,omitempty"` + + Temperature float64 `json:"temperature,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryEndpointInputFromPb(pb *queryEndpointInputPb) (*QueryEndpointInput, error) { + if pb == nil { + return nil, nil + } + st := &QueryEndpointInput{} + st.DataframeRecords = pb.DataframeRecords + st.DataframeSplit = pb.DataframeSplit + st.ExtraParams = pb.ExtraParams + st.Input = pb.Input + st.Inputs = pb.Inputs + st.Instances = pb.Instances + st.MaxTokens = pb.MaxTokens + st.Messages = pb.Messages + st.N = pb.N + st.Name = pb.Name + st.Prompt = pb.Prompt + st.Stop = pb.Stop + st.Stream = pb.Stream + st.Temperature = pb.Temperature + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryEndpointInputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryEndpointInputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryEndpointResponseToPb(st *QueryEndpointResponse) (*queryEndpointResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &queryEndpointResponsePb{} + pb.Choices = st.Choices + + pb.Created = st.Created + + pb.Data = st.Data + + pb.Id = st.Id + + pb.Model = st.Model + + pb.Object = st.Object + + pb.Predictions = st.Predictions + + pb.ServedModelName = st.ServedModelName + + pb.Usage = st.Usage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryEndpointResponsePb struct { + Choices []V1ResponseChoiceElement `json:"choices,omitempty"` + + Created int64 `json:"created,omitempty"` + + Data []EmbeddingsV1ResponseEmbeddingElement `json:"data,omitempty"` + + Id string `json:"id,omitempty"` + + Model string `json:"model,omitempty"` + + Object QueryEndpointResponseObject `json:"object,omitempty"` + + Predictions []any `json:"predictions,omitempty"` + + ServedModelName string `json:"-" url:"-" header:"served-model-name,omitempty"` + + Usage *ExternalModelUsageElement `json:"usage,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryEndpointResponseFromPb(pb *queryEndpointResponsePb) (*QueryEndpointResponse, error) { + if pb == nil { + return nil, nil + } + st := &QueryEndpointResponse{} + st.Choices = pb.Choices + st.Created = pb.Created + st.Data = pb.Data + st.Id = pb.Id + st.Model = pb.Model + st.Object = pb.Object + st.Predictions = pb.Predictions + st.ServedModelName = pb.ServedModelName + st.Usage = pb.Usage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryEndpointResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryEndpointResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func rateLimitToPb(st *RateLimit) (*rateLimitPb, error) { + if st == nil { + return nil, nil + } + pb := &rateLimitPb{} + pb.Calls = st.Calls + + pb.Key = st.Key + + pb.RenewalPeriod = st.RenewalPeriod + + return pb, nil +} + +type rateLimitPb struct { + Calls int64 `json:"calls"` + + Key RateLimitKey `json:"key,omitempty"` + + RenewalPeriod RateLimitRenewalPeriod `json:"renewal_period"` +} + +func rateLimitFromPb(pb *rateLimitPb) (*RateLimit, error) { + if pb == nil { + return nil, nil + } + st := &RateLimit{} + st.Calls = pb.Calls + st.Key = pb.Key + st.RenewalPeriod = pb.RenewalPeriod + + return st, nil +} + +func routeToPb(st *Route) (*routePb, error) { + if st == nil { + return nil, nil + } + pb := &routePb{} + pb.ServedModelName = st.ServedModelName + + pb.TrafficPercentage = st.TrafficPercentage + + return pb, nil +} + +type routePb struct { + ServedModelName string `json:"served_model_name"` + + TrafficPercentage int `json:"traffic_percentage"` +} + +func routeFromPb(pb *routePb) (*Route, error) { + if pb == nil { + return nil, nil + } + st := &Route{} + st.ServedModelName = pb.ServedModelName + st.TrafficPercentage = pb.TrafficPercentage + + return st, nil +} + +func servedEntityInputToPb(st *ServedEntityInput) (*servedEntityInputPb, error) { + if st == nil { + return nil, nil + } + pb := &servedEntityInputPb{} + pb.EntityName = st.EntityName + + pb.EntityVersion = st.EntityVersion + + pb.EnvironmentVars = st.EnvironmentVars + + pb.ExternalModel = st.ExternalModel + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput + + pb.MinProvisionedThroughput = st.MinProvisionedThroughput + + pb.Name = st.Name + + pb.ProvisionedModelUnits = st.ProvisionedModelUnits + + pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled + + pb.WorkloadSize = st.WorkloadSize + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedEntityInputPb struct { + EntityName string `json:"entity_name,omitempty"` + + EntityVersion string `json:"entity_version,omitempty"` + + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + + ExternalModel *ExternalModel `json:"external_model,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + + Name string `json:"name,omitempty"` + + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + + WorkloadSize string `json:"workload_size,omitempty"` + + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedEntityInputFromPb(pb *servedEntityInputPb) (*ServedEntityInput, error) { + if pb == nil { + return nil, nil + } + st := &ServedEntityInput{} + st.EntityName = pb.EntityName + st.EntityVersion = pb.EntityVersion + st.EnvironmentVars = pb.EnvironmentVars + st.ExternalModel = pb.ExternalModel + st.InstanceProfileArn = pb.InstanceProfileArn + st.MaxProvisionedThroughput = pb.MaxProvisionedThroughput + st.MinProvisionedThroughput = pb.MinProvisionedThroughput + st.Name = pb.Name + st.ProvisionedModelUnits = pb.ProvisionedModelUnits + st.ScaleToZeroEnabled = pb.ScaleToZeroEnabled + st.WorkloadSize = pb.WorkloadSize + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedEntityInputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedEntityInputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedEntityOutputToPb(st *ServedEntityOutput) (*servedEntityOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &servedEntityOutputPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Creator = st.Creator + + pb.EntityName = st.EntityName + + pb.EntityVersion = st.EntityVersion + + pb.EnvironmentVars = st.EnvironmentVars + + pb.ExternalModel = st.ExternalModel + + pb.FoundationModel = st.FoundationModel + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput + + pb.MinProvisionedThroughput = st.MinProvisionedThroughput + + pb.Name = st.Name + + pb.ProvisionedModelUnits = st.ProvisionedModelUnits + + pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled + + pb.State = st.State + + pb.WorkloadSize = st.WorkloadSize + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedEntityOutputPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Creator string `json:"creator,omitempty"` + + EntityName string `json:"entity_name,omitempty"` + + EntityVersion string `json:"entity_version,omitempty"` + + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + + ExternalModel *ExternalModel `json:"external_model,omitempty"` + + FoundationModel *FoundationModel `json:"foundation_model,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + + Name string `json:"name,omitempty"` + + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + + State *ServedModelState `json:"state,omitempty"` + + WorkloadSize string `json:"workload_size,omitempty"` + + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedEntityOutputFromPb(pb *servedEntityOutputPb) (*ServedEntityOutput, error) { + if pb == nil { + return nil, nil + } + st := &ServedEntityOutput{} + st.CreationTimestamp = pb.CreationTimestamp + st.Creator = pb.Creator + st.EntityName = pb.EntityName + st.EntityVersion = pb.EntityVersion + st.EnvironmentVars = pb.EnvironmentVars + st.ExternalModel = pb.ExternalModel + st.FoundationModel = pb.FoundationModel + st.InstanceProfileArn = pb.InstanceProfileArn + st.MaxProvisionedThroughput = pb.MaxProvisionedThroughput + st.MinProvisionedThroughput = pb.MinProvisionedThroughput + st.Name = pb.Name + st.ProvisionedModelUnits = pb.ProvisionedModelUnits + st.ScaleToZeroEnabled = pb.ScaleToZeroEnabled + st.State = pb.State + st.WorkloadSize = pb.WorkloadSize + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedEntityOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedEntityOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedEntitySpecToPb(st *ServedEntitySpec) (*servedEntitySpecPb, error) { + if st == nil { + return nil, nil + } + pb := &servedEntitySpecPb{} + pb.EntityName = st.EntityName + + pb.EntityVersion = st.EntityVersion + + pb.ExternalModel = st.ExternalModel + + pb.FoundationModel = st.FoundationModel + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedEntitySpecPb struct { + EntityName string `json:"entity_name,omitempty"` + + EntityVersion string `json:"entity_version,omitempty"` + + ExternalModel *ExternalModel `json:"external_model,omitempty"` + + FoundationModel *FoundationModel `json:"foundation_model,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedEntitySpecFromPb(pb *servedEntitySpecPb) (*ServedEntitySpec, error) { + if pb == nil { + return nil, nil + } + st := &ServedEntitySpec{} + st.EntityName = pb.EntityName + st.EntityVersion = pb.EntityVersion + st.ExternalModel = pb.ExternalModel + st.FoundationModel = pb.FoundationModel + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedEntitySpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedEntitySpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedModelInputToPb(st *ServedModelInput) (*servedModelInputPb, error) { + if st == nil { + return nil, nil + } + pb := &servedModelInputPb{} + pb.EnvironmentVars = st.EnvironmentVars + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput + + pb.MinProvisionedThroughput = st.MinProvisionedThroughput + + pb.ModelName = st.ModelName + + pb.ModelVersion = st.ModelVersion + + pb.Name = st.Name + + pb.ProvisionedModelUnits = st.ProvisionedModelUnits + + pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled + + pb.WorkloadSize = st.WorkloadSize + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedModelInputPb struct { + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + + ModelName string `json:"model_name"` + + ModelVersion string `json:"model_version"` + + Name string `json:"name,omitempty"` + + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled"` + + WorkloadSize string `json:"workload_size,omitempty"` + + WorkloadType ServedModelInputWorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedModelInputFromPb(pb *servedModelInputPb) (*ServedModelInput, error) { + if pb == nil { + return nil, nil + } + st := &ServedModelInput{} + st.EnvironmentVars = pb.EnvironmentVars + st.InstanceProfileArn = pb.InstanceProfileArn + st.MaxProvisionedThroughput = pb.MaxProvisionedThroughput + st.MinProvisionedThroughput = pb.MinProvisionedThroughput + st.ModelName = pb.ModelName + st.ModelVersion = pb.ModelVersion + st.Name = pb.Name + st.ProvisionedModelUnits = pb.ProvisionedModelUnits + st.ScaleToZeroEnabled = pb.ScaleToZeroEnabled + st.WorkloadSize = pb.WorkloadSize + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedModelInputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedModelInputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedModelOutputToPb(st *ServedModelOutput) (*servedModelOutputPb, error) { + if st == nil { + return nil, nil + } + pb := &servedModelOutputPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Creator = st.Creator + + pb.EnvironmentVars = st.EnvironmentVars + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.ModelName = st.ModelName + + pb.ModelVersion = st.ModelVersion + + pb.Name = st.Name + + pb.ProvisionedModelUnits = st.ProvisionedModelUnits + + pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled + + pb.State = st.State + + pb.WorkloadSize = st.WorkloadSize + + pb.WorkloadType = st.WorkloadType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedModelOutputPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Creator string `json:"creator,omitempty"` + + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + ModelName string `json:"model_name,omitempty"` + + ModelVersion string `json:"model_version,omitempty"` + + Name string `json:"name,omitempty"` + + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + + State *ServedModelState `json:"state,omitempty"` + + WorkloadSize string `json:"workload_size,omitempty"` + + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedModelOutputFromPb(pb *servedModelOutputPb) (*ServedModelOutput, error) { + if pb == nil { + return nil, nil + } + st := &ServedModelOutput{} + st.CreationTimestamp = pb.CreationTimestamp + st.Creator = pb.Creator + st.EnvironmentVars = pb.EnvironmentVars + st.InstanceProfileArn = pb.InstanceProfileArn + st.ModelName = pb.ModelName + st.ModelVersion = pb.ModelVersion + st.Name = pb.Name + st.ProvisionedModelUnits = pb.ProvisionedModelUnits + st.ScaleToZeroEnabled = pb.ScaleToZeroEnabled + st.State = pb.State + st.WorkloadSize = pb.WorkloadSize + st.WorkloadType = pb.WorkloadType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedModelOutputPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedModelOutputPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedModelSpecToPb(st *ServedModelSpec) (*servedModelSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &servedModelSpecPb{} + pb.ModelName = st.ModelName + + pb.ModelVersion = st.ModelVersion + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedModelSpecPb struct { + ModelName string `json:"model_name,omitempty"` + + ModelVersion string `json:"model_version,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedModelSpecFromPb(pb *servedModelSpecPb) (*ServedModelSpec, error) { + if pb == nil { + return nil, nil + } + st := &ServedModelSpec{} + st.ModelName = pb.ModelName + st.ModelVersion = pb.ModelVersion + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedModelSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedModelSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servedModelStateToPb(st *ServedModelState) (*servedModelStatePb, error) { + if st == nil { + return nil, nil + } + pb := &servedModelStatePb{} + pb.Deployment = st.Deployment + + pb.DeploymentStateMessage = st.DeploymentStateMessage + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servedModelStatePb struct { + Deployment ServedModelStateDeployment `json:"deployment,omitempty"` + + DeploymentStateMessage string `json:"deployment_state_message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servedModelStateFromPb(pb *servedModelStatePb) (*ServedModelState, error) { + if pb == nil { + return nil, nil + } + st := &ServedModelState{} + st.Deployment = pb.Deployment + st.DeploymentStateMessage = pb.DeploymentStateMessage + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servedModelStatePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servedModelStatePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func serverLogsResponseToPb(st *ServerLogsResponse) (*serverLogsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &serverLogsResponsePb{} + pb.Logs = st.Logs + + return pb, nil +} + +type serverLogsResponsePb struct { + Logs string `json:"logs"` +} + +func serverLogsResponseFromPb(pb *serverLogsResponsePb) (*ServerLogsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ServerLogsResponse{} + st.Logs = pb.Logs + + return st, nil +} + +func servingEndpointToPb(st *ServingEndpoint) (*servingEndpointPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointPb{} + pb.AiGateway = st.AiGateway + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Config = st.Config + + pb.CreationTimestamp = st.CreationTimestamp + + pb.Creator = st.Creator + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.Name = st.Name + + pb.State = st.State + + pb.Tags = st.Tags + + pb.Task = st.Task + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointPb struct { + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Config *EndpointCoreConfigSummary `json:"config,omitempty"` + + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Creator string `json:"creator,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + Name string `json:"name,omitempty"` + + State *EndpointState `json:"state,omitempty"` + + Tags []EndpointTag `json:"tags,omitempty"` + + Task string `json:"task,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointFromPb(pb *servingEndpointPb) (*ServingEndpoint, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpoint{} + st.AiGateway = pb.AiGateway + st.BudgetPolicyId = pb.BudgetPolicyId + st.Config = pb.Config + st.CreationTimestamp = pb.CreationTimestamp + st.Creator = pb.Creator + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.Name = pb.Name + st.State = pb.State + st.Tags = pb.Tags + st.Task = pb.Task + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointAccessControlRequestToPb(st *ServingEndpointAccessControlRequest) (*servingEndpointAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointAccessControlRequestFromPb(pb *servingEndpointAccessControlRequestPb) (*ServingEndpointAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointAccessControlResponseToPb(st *ServingEndpointAccessControlResponse) (*servingEndpointAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointAccessControlResponsePb struct { + AllPermissions []ServingEndpointPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointAccessControlResponseFromPb(pb *servingEndpointAccessControlResponsePb) (*ServingEndpointAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointDetailedToPb(st *ServingEndpointDetailed) (*servingEndpointDetailedPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointDetailedPb{} + pb.AiGateway = st.AiGateway + + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.Config = st.Config + + pb.CreationTimestamp = st.CreationTimestamp + + pb.Creator = st.Creator + + pb.DataPlaneInfo = st.DataPlaneInfo + + pb.EndpointUrl = st.EndpointUrl + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.Name = st.Name + + pb.PendingConfig = st.PendingConfig + + pb.PermissionLevel = st.PermissionLevel + + pb.RouteOptimized = st.RouteOptimized + + pb.State = st.State + + pb.Tags = st.Tags + + pb.Task = st.Task + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointDetailedPb struct { + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + Config *EndpointCoreConfigOutput `json:"config,omitempty"` + + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Creator string `json:"creator,omitempty"` + + DataPlaneInfo *ModelDataPlaneInfo `json:"data_plane_info,omitempty"` + + EndpointUrl string `json:"endpoint_url,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + Name string `json:"name,omitempty"` + + PendingConfig *EndpointPendingConfig `json:"pending_config,omitempty"` + + PermissionLevel ServingEndpointDetailedPermissionLevel `json:"permission_level,omitempty"` + + RouteOptimized bool `json:"route_optimized,omitempty"` + + State *EndpointState `json:"state,omitempty"` + + Tags []EndpointTag `json:"tags,omitempty"` + + Task string `json:"task,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointDetailedFromPb(pb *servingEndpointDetailedPb) (*ServingEndpointDetailed, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointDetailed{} + st.AiGateway = pb.AiGateway + st.BudgetPolicyId = pb.BudgetPolicyId + st.Config = pb.Config + st.CreationTimestamp = pb.CreationTimestamp + st.Creator = pb.Creator + st.DataPlaneInfo = pb.DataPlaneInfo + st.EndpointUrl = pb.EndpointUrl + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.Name = pb.Name + st.PendingConfig = pb.PendingConfig + st.PermissionLevel = pb.PermissionLevel + st.RouteOptimized = pb.RouteOptimized + st.State = pb.State + st.Tags = pb.Tags + st.Task = pb.Task + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointDetailedPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointDetailedPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointPermissionToPb(st *ServingEndpointPermission) (*servingEndpointPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointPermissionFromPb(pb *servingEndpointPermissionPb) (*ServingEndpointPermission, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointPermissionsToPb(st *ServingEndpointPermissions) (*servingEndpointPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointPermissionsPb struct { + AccessControlList []ServingEndpointAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointPermissionsFromPb(pb *servingEndpointPermissionsPb) (*ServingEndpointPermissions, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointPermissionsDescriptionToPb(st *ServingEndpointPermissionsDescription) (*servingEndpointPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type servingEndpointPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func servingEndpointPermissionsDescriptionFromPb(pb *servingEndpointPermissionsDescriptionPb) (*ServingEndpointPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *servingEndpointPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st servingEndpointPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func servingEndpointPermissionsRequestToPb(st *ServingEndpointPermissionsRequest) (*servingEndpointPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &servingEndpointPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.ServingEndpointId = st.ServingEndpointId + + return pb, nil +} + +type servingEndpointPermissionsRequestPb struct { + AccessControlList []ServingEndpointAccessControlRequest `json:"access_control_list,omitempty"` + + ServingEndpointId string `json:"-" url:"-"` +} + +func servingEndpointPermissionsRequestFromPb(pb *servingEndpointPermissionsRequestPb) (*ServingEndpointPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ServingEndpointPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.ServingEndpointId = pb.ServingEndpointId + + return st, nil +} + +func trafficConfigToPb(st *TrafficConfig) (*trafficConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &trafficConfigPb{} + pb.Routes = st.Routes + + return pb, nil +} + +type trafficConfigPb struct { + Routes []Route `json:"routes,omitempty"` +} + +func trafficConfigFromPb(pb *trafficConfigPb) (*TrafficConfig, error) { + if pb == nil { + return nil, nil + } + st := &TrafficConfig{} + st.Routes = pb.Routes + + return st, nil +} + +func updateProvisionedThroughputEndpointConfigRequestToPb(st *UpdateProvisionedThroughputEndpointConfigRequest) (*updateProvisionedThroughputEndpointConfigRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateProvisionedThroughputEndpointConfigRequestPb{} + pb.Config = st.Config + + pb.Name = st.Name + + return pb, nil +} + +type updateProvisionedThroughputEndpointConfigRequestPb struct { + Config PtEndpointCoreConfig `json:"config"` + + Name string `json:"-" url:"-"` +} + +func updateProvisionedThroughputEndpointConfigRequestFromPb(pb *updateProvisionedThroughputEndpointConfigRequestPb) (*UpdateProvisionedThroughputEndpointConfigRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProvisionedThroughputEndpointConfigRequest{} + st.Config = pb.Config + st.Name = pb.Name + + return st, nil +} + +func v1ResponseChoiceElementToPb(st *V1ResponseChoiceElement) (*v1ResponseChoiceElementPb, error) { + if st == nil { + return nil, nil + } + pb := &v1ResponseChoiceElementPb{} + pb.FinishReason = st.FinishReason + + pb.Index = st.Index + + pb.Logprobs = st.Logprobs + + pb.Message = st.Message + + pb.Text = st.Text + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type v1ResponseChoiceElementPb struct { + FinishReason string `json:"finishReason,omitempty"` + + Index int `json:"index,omitempty"` + + Logprobs int `json:"logprobs,omitempty"` + + Message *ChatMessage `json:"message,omitempty"` + + Text string `json:"text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func v1ResponseChoiceElementFromPb(pb *v1ResponseChoiceElementPb) (*V1ResponseChoiceElement, error) { + if pb == nil { + return nil, nil + } + st := &V1ResponseChoiceElement{} + st.FinishReason = pb.FinishReason + st.Index = pb.Index + st.Logprobs = pb.Logprobs + st.Message = pb.Message + st.Text = pb.Text + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *v1ResponseChoiceElementPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st v1ResponseChoiceElementPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/serving/model.go b/service/serving/model.go index 96e125df6..9fe9e6ea5 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -3,10 +3,11 @@ package serving import ( + "encoding/json" "fmt" "io" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type Ai21LabsConfig struct { @@ -14,73 +15,170 @@ type Ai21LabsConfig struct { // prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. // You must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKey string `json:"ai21labs_api_key,omitempty"` + // Wire name: 'ai21labs_api_key' + Ai21labsApiKey string // An AI21 Labs API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `ai21labs_api_key`. You // must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKeyPlaintext string `json:"ai21labs_api_key_plaintext,omitempty"` + // Wire name: 'ai21labs_api_key_plaintext' + Ai21labsApiKeyPlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Ai21LabsConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Ai21LabsConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ai21LabsConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ai21LabsConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Ai21LabsConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Ai21LabsConfig) MarshalJSON() ([]byte, error) { + pb, err := ai21LabsConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayConfig struct { // Configuration for traffic fallback which auto fallbacks to other served // entities if the request to a served entity fails with certain error // codes, to increase availability. - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + // Wire name: 'fallback_config' + FallbackConfig *FallbackConfig // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + // Wire name: 'guardrails' + Guardrails *AiGatewayGuardrails // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + // Wire name: 'inference_table_config' + InferenceTableConfig *AiGatewayInferenceTableConfig // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []AiGatewayRateLimit // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + // Wire name: 'usage_tracking_config' + UsageTrackingConfig *AiGatewayUsageTrackingConfig +} + +func (st *AiGatewayConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AiGatewayConfig) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayGuardrailParameters struct { // List of invalid keywords. AI guardrail uses keyword or string matching to // decide if the keyword exists in the request or response content. - InvalidKeywords []string `json:"invalid_keywords,omitempty"` + // Wire name: 'invalid_keywords' + InvalidKeywords []string // Configuration for guardrail PII filter. - Pii *AiGatewayGuardrailPiiBehavior `json:"pii,omitempty"` + // Wire name: 'pii' + Pii *AiGatewayGuardrailPiiBehavior // Indicates whether the safety filter is enabled. - Safety bool `json:"safety,omitempty"` + // Wire name: 'safety' + Safety bool // The list of allowed topics. Given a chat request, this guardrail flags // the request if its topic is not in the allowed topics. - ValidTopics []string `json:"valid_topics,omitempty"` + // Wire name: 'valid_topics' + ValidTopics []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AiGatewayGuardrailParameters) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AiGatewayGuardrailParameters) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayGuardrailParametersPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayGuardrailParametersFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AiGatewayGuardrailParameters) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AiGatewayGuardrailParameters) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayGuardrailParametersToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayGuardrailPiiBehavior struct { // Configuration for input guardrail filters. - Behavior AiGatewayGuardrailPiiBehaviorBehavior `json:"behavior,omitempty"` + // Wire name: 'behavior' + Behavior AiGatewayGuardrailPiiBehaviorBehavior +} + +func (st *AiGatewayGuardrailPiiBehavior) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayGuardrailPiiBehaviorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayGuardrailPiiBehaviorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AiGatewayGuardrailPiiBehavior) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayGuardrailPiiBehaviorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayGuardrailPiiBehaviorBehavior string +type aiGatewayGuardrailPiiBehaviorBehaviorPb string const AiGatewayGuardrailPiiBehaviorBehaviorBlock AiGatewayGuardrailPiiBehaviorBehavior = `BLOCK` @@ -107,52 +205,145 @@ func (f *AiGatewayGuardrailPiiBehaviorBehavior) Type() string { return "AiGatewayGuardrailPiiBehaviorBehavior" } +func aiGatewayGuardrailPiiBehaviorBehaviorToPb(st *AiGatewayGuardrailPiiBehaviorBehavior) (*aiGatewayGuardrailPiiBehaviorBehaviorPb, error) { + if st == nil { + return nil, nil + } + pb := aiGatewayGuardrailPiiBehaviorBehaviorPb(*st) + return &pb, nil +} + +func aiGatewayGuardrailPiiBehaviorBehaviorFromPb(pb *aiGatewayGuardrailPiiBehaviorBehaviorPb) (*AiGatewayGuardrailPiiBehaviorBehavior, error) { + if pb == nil { + return nil, nil + } + st := AiGatewayGuardrailPiiBehaviorBehavior(*pb) + return &st, nil +} + type AiGatewayGuardrails struct { // Configuration for input guardrail filters. - Input *AiGatewayGuardrailParameters `json:"input,omitempty"` + // Wire name: 'input' + Input *AiGatewayGuardrailParameters // Configuration for output guardrail filters. - Output *AiGatewayGuardrailParameters `json:"output,omitempty"` + // Wire name: 'output' + Output *AiGatewayGuardrailParameters +} + +func (st *AiGatewayGuardrails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayGuardrailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayGuardrailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AiGatewayGuardrails) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayGuardrailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayInferenceTableConfig struct { // The name of the catalog in Unity Catalog. Required when enabling // inference tables. NOTE: On update, you have to disable inference table // first in order to change the catalog name. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // Indicates whether the inference table is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the schema in Unity Catalog. Required when enabling inference // tables. NOTE: On update, you have to disable inference table first in // order to change the schema name. - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // The prefix of the table in Unity Catalog. NOTE: On update, you have to // disable inference table first in order to change the prefix name. - TableNamePrefix string `json:"table_name_prefix,omitempty"` + // Wire name: 'table_name_prefix' + TableNamePrefix string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AiGatewayInferenceTableConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AiGatewayInferenceTableConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayInferenceTableConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayInferenceTableConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AiGatewayInferenceTableConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AiGatewayInferenceTableConfig) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayInferenceTableConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayRateLimit struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls int64 `json:"calls"` + // Wire name: 'calls' + Calls int64 // Key field for a rate limit. Currently, only 'user' and 'endpoint' are // supported, with 'endpoint' being the default if not specified. - Key AiGatewayRateLimitKey `json:"key,omitempty"` + // Wire name: 'key' + Key AiGatewayRateLimitKey // Renewal period field for a rate limit. Currently, only 'minute' is // supported. - RenewalPeriod AiGatewayRateLimitRenewalPeriod `json:"renewal_period"` + // Wire name: 'renewal_period' + RenewalPeriod AiGatewayRateLimitRenewalPeriod +} + +func (st *AiGatewayRateLimit) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayRateLimitPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayRateLimitFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AiGatewayRateLimit) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayRateLimitToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AiGatewayRateLimitKey string +type aiGatewayRateLimitKeyPb string const AiGatewayRateLimitKeyEndpoint AiGatewayRateLimitKey = `endpoint` @@ -179,7 +370,24 @@ func (f *AiGatewayRateLimitKey) Type() string { return "AiGatewayRateLimitKey" } +func aiGatewayRateLimitKeyToPb(st *AiGatewayRateLimitKey) (*aiGatewayRateLimitKeyPb, error) { + if st == nil { + return nil, nil + } + pb := aiGatewayRateLimitKeyPb(*st) + return &pb, nil +} + +func aiGatewayRateLimitKeyFromPb(pb *aiGatewayRateLimitKeyPb) (*AiGatewayRateLimitKey, error) { + if pb == nil { + return nil, nil + } + st := AiGatewayRateLimitKey(*pb) + return &st, nil +} + type AiGatewayRateLimitRenewalPeriod string +type aiGatewayRateLimitRenewalPeriodPb string const AiGatewayRateLimitRenewalPeriodMinute AiGatewayRateLimitRenewalPeriod = `minute` @@ -204,19 +412,53 @@ func (f *AiGatewayRateLimitRenewalPeriod) Type() string { return "AiGatewayRateLimitRenewalPeriod" } +func aiGatewayRateLimitRenewalPeriodToPb(st *AiGatewayRateLimitRenewalPeriod) (*aiGatewayRateLimitRenewalPeriodPb, error) { + if st == nil { + return nil, nil + } + pb := aiGatewayRateLimitRenewalPeriodPb(*st) + return &pb, nil +} + +func aiGatewayRateLimitRenewalPeriodFromPb(pb *aiGatewayRateLimitRenewalPeriodPb) (*AiGatewayRateLimitRenewalPeriod, error) { + if pb == nil { + return nil, nil + } + st := AiGatewayRateLimitRenewalPeriod(*pb) + return &st, nil +} + type AiGatewayUsageTrackingConfig struct { // Whether to enable usage tracking. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AiGatewayUsageTrackingConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AiGatewayUsageTrackingConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aiGatewayUsageTrackingConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aiGatewayUsageTrackingConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AiGatewayUsageTrackingConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AiGatewayUsageTrackingConfig) MarshalJSON() ([]byte, error) { + pb, err := aiGatewayUsageTrackingConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AmazonBedrockConfig struct { @@ -225,51 +467,76 @@ type AmazonBedrockConfig struct { // your API key directly, see `aws_access_key_id_plaintext`. You must // provide an API key using one of the following fields: `aws_access_key_id` // or `aws_access_key_id_plaintext`. - AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` + // Wire name: 'aws_access_key_id' + AwsAccessKeyId string // An AWS access key ID with permissions to interact with Bedrock services // provided as a plaintext string. If you prefer to reference your key using // Databricks Secrets, see `aws_access_key_id`. You must provide an API key // using one of the following fields: `aws_access_key_id` or // `aws_access_key_id_plaintext`. - AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` + // Wire name: 'aws_access_key_id_plaintext' + AwsAccessKeyIdPlaintext string // The AWS region to use. Bedrock has to be enabled there. - AwsRegion string `json:"aws_region"` + // Wire name: 'aws_region' + AwsRegion string // The Databricks secret key reference for an AWS secret access key paired // with the access key ID, with permissions to interact with Bedrock // services. If you prefer to paste your API key directly, see // `aws_secret_access_key_plaintext`. You must provide an API key using one // of the following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` + // Wire name: 'aws_secret_access_key' + AwsSecretAccessKey string // An AWS secret access key paired with the access key ID, with permissions // to interact with Bedrock services provided as a plaintext string. If you // prefer to reference your key using Databricks Secrets, see // `aws_secret_access_key`. You must provide an API key using one of the // following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` + // Wire name: 'aws_secret_access_key_plaintext' + AwsSecretAccessKeyPlaintext string // The underlying provider in Amazon Bedrock. Supported values (case // insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. - BedrockProvider AmazonBedrockConfigBedrockProvider `json:"bedrock_provider"` + // Wire name: 'bedrock_provider' + BedrockProvider AmazonBedrockConfigBedrockProvider // ARN of the instance profile that the external model will use to access // AWS resources. You must authenticate using an instance profile or access // keys. If you prefer to authenticate using access keys, see // `aws_access_key_id`, `aws_access_key_id_plaintext`, // `aws_secret_access_key` and `aws_secret_access_key_plaintext`. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AmazonBedrockConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AmazonBedrockConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &amazonBedrockConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := amazonBedrockConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AmazonBedrockConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AmazonBedrockConfig) MarshalJSON() ([]byte, error) { + pb, err := amazonBedrockConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AmazonBedrockConfigBedrockProvider string +type amazonBedrockConfigBedrockProviderPb string const AmazonBedrockConfigBedrockProviderAi21labs AmazonBedrockConfigBedrockProvider = `ai21labs` @@ -300,157 +567,374 @@ func (f *AmazonBedrockConfigBedrockProvider) Type() string { return "AmazonBedrockConfigBedrockProvider" } +func amazonBedrockConfigBedrockProviderToPb(st *AmazonBedrockConfigBedrockProvider) (*amazonBedrockConfigBedrockProviderPb, error) { + if st == nil { + return nil, nil + } + pb := amazonBedrockConfigBedrockProviderPb(*st) + return &pb, nil +} + +func amazonBedrockConfigBedrockProviderFromPb(pb *amazonBedrockConfigBedrockProviderPb) (*AmazonBedrockConfigBedrockProvider, error) { + if pb == nil { + return nil, nil + } + st := AmazonBedrockConfigBedrockProvider(*pb) + return &st, nil +} + type AnthropicConfig struct { // The Databricks secret key reference for an Anthropic API key. If you // prefer to paste your API key directly, see `anthropic_api_key_plaintext`. // You must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKey string `json:"anthropic_api_key,omitempty"` + // Wire name: 'anthropic_api_key' + AnthropicApiKey string // The Anthropic API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `anthropic_api_key`. You // must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKeyPlaintext string `json:"anthropic_api_key_plaintext,omitempty"` + // Wire name: 'anthropic_api_key_plaintext' + AnthropicApiKeyPlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AnthropicConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AnthropicConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &anthropicConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := anthropicConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AnthropicConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AnthropicConfig) MarshalJSON() ([]byte, error) { + pb, err := anthropicConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ApiKeyAuth struct { // The name of the API key parameter used for authentication. - Key string `json:"key"` + // Wire name: 'key' + Key string // The Databricks secret key reference for an API Key. If you prefer to // paste your token directly, see `value_plaintext`. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string // The API Key provided as a plaintext string. If you prefer to reference // your token using Databricks Secrets, see `value`. - ValuePlaintext string `json:"value_plaintext,omitempty"` + // Wire name: 'value_plaintext' + ValuePlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ApiKeyAuth) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ApiKeyAuth) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &apiKeyAuthPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := apiKeyAuthFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ApiKeyAuth) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ApiKeyAuth) MarshalJSON() ([]byte, error) { + pb, err := apiKeyAuthToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AutoCaptureConfigInput struct { // The name of the catalog in Unity Catalog. NOTE: On update, you cannot // change the catalog name if the inference table is already enabled. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // Indicates whether the inference table is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the schema in Unity Catalog. NOTE: On update, you cannot // change the schema name if the inference table is already enabled. - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string // The prefix of the table in Unity Catalog. NOTE: On update, you cannot // change the prefix name if the inference table is already enabled. - TableNamePrefix string `json:"table_name_prefix,omitempty"` + // Wire name: 'table_name_prefix' + TableNamePrefix string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AutoCaptureConfigInput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AutoCaptureConfigInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &autoCaptureConfigInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := autoCaptureConfigInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AutoCaptureConfigInput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AutoCaptureConfigInput) MarshalJSON() ([]byte, error) { + pb, err := autoCaptureConfigInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AutoCaptureConfigOutput struct { // The name of the catalog in Unity Catalog. NOTE: On update, you cannot // change the catalog name if the inference table is already enabled. - CatalogName string `json:"catalog_name,omitempty"` + // Wire name: 'catalog_name' + CatalogName string // Indicates whether the inference table is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The name of the schema in Unity Catalog. NOTE: On update, you cannot // change the schema name if the inference table is already enabled. - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string - State *AutoCaptureState `json:"state,omitempty"` + // Wire name: 'state' + State *AutoCaptureState // The prefix of the table in Unity Catalog. NOTE: On update, you cannot // change the prefix name if the inference table is already enabled. - TableNamePrefix string `json:"table_name_prefix,omitempty"` + // Wire name: 'table_name_prefix' + TableNamePrefix string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AutoCaptureConfigOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AutoCaptureConfigOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &autoCaptureConfigOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := autoCaptureConfigOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AutoCaptureConfigOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AutoCaptureConfigOutput) MarshalJSON() ([]byte, error) { + pb, err := autoCaptureConfigOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AutoCaptureState struct { - PayloadTable *PayloadTable `json:"payload_table,omitempty"` + + // Wire name: 'payload_table' + PayloadTable *PayloadTable +} + +func (st *AutoCaptureState) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &autoCaptureStatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := autoCaptureStateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AutoCaptureState) MarshalJSON() ([]byte, error) { + pb, err := autoCaptureStateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BearerTokenAuth struct { // The Databricks secret key reference for a token. If you prefer to paste // your token directly, see `token_plaintext`. - Token string `json:"token,omitempty"` + // Wire name: 'token' + Token string // The token provided as a plaintext string. If you prefer to reference your // token using Databricks Secrets, see `token`. - TokenPlaintext string `json:"token_plaintext,omitempty"` + // Wire name: 'token_plaintext' + TokenPlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BearerTokenAuth) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BearerTokenAuth) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &bearerTokenAuthPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := bearerTokenAuthFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BearerTokenAuth) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BearerTokenAuth) MarshalJSON() ([]byte, error) { + pb, err := bearerTokenAuthToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get build logs for a served model type BuildLogsRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The name of the served model that build logs will be retrieved for. This // field is required. - ServedModelName string `json:"-" url:"-"` + // Wire name: 'served_model_name' + ServedModelName string `tf:"-"` +} + +func (st *BuildLogsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &buildLogsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := buildLogsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BuildLogsRequest) MarshalJSON() ([]byte, error) { + pb, err := buildLogsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BuildLogsResponse struct { // The logs associated with building the served entity's environment. - Logs string `json:"logs"` + // Wire name: 'logs' + Logs string +} + +func (st *BuildLogsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &buildLogsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := buildLogsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st BuildLogsResponse) MarshalJSON() ([]byte, error) { + pb, err := buildLogsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ChatMessage struct { // The content of the message. - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string // The role of the message. One of [system, user, assistant]. - Role ChatMessageRole `json:"role,omitempty"` + // Wire name: 'role' + Role ChatMessageRole - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ChatMessage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ChatMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &chatMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := chatMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ChatMessage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ChatMessage) MarshalJSON() ([]byte, error) { + pb, err := chatMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The role of the message. One of [system, user, assistant]. type ChatMessageRole string +type chatMessageRolePb string const ChatMessageRoleAssistant ChatMessageRole = `assistant` @@ -479,119 +963,248 @@ func (f *ChatMessageRole) Type() string { return "ChatMessageRole" } +func chatMessageRoleToPb(st *ChatMessageRole) (*chatMessageRolePb, error) { + if st == nil { + return nil, nil + } + pb := chatMessageRolePb(*st) + return &pb, nil +} + +func chatMessageRoleFromPb(pb *chatMessageRolePb) (*ChatMessageRole, error) { + if pb == nil { + return nil, nil + } + st := ChatMessageRole(*pb) + return &st, nil +} + type CohereConfig struct { // This is an optional field to provide a customized base URL for the Cohere // API. If left unspecified, the standard Cohere base URL is used. - CohereApiBase string `json:"cohere_api_base,omitempty"` + // Wire name: 'cohere_api_base' + CohereApiBase string // The Databricks secret key reference for a Cohere API key. If you prefer // to paste your API key directly, see `cohere_api_key_plaintext`. You must // provide an API key using one of the following fields: `cohere_api_key` or // `cohere_api_key_plaintext`. - CohereApiKey string `json:"cohere_api_key,omitempty"` + // Wire name: 'cohere_api_key' + CohereApiKey string // The Cohere API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `cohere_api_key`. You // must provide an API key using one of the following fields: // `cohere_api_key` or `cohere_api_key_plaintext`. - CohereApiKeyPlaintext string `json:"cohere_api_key_plaintext,omitempty"` + // Wire name: 'cohere_api_key_plaintext' + CohereApiKeyPlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CohereConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CohereConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cohereConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cohereConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CohereConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CohereConfig) MarshalJSON() ([]byte, error) { + pb, err := cohereConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreatePtEndpointRequest struct { // The AI Gateway configuration for the serving endpoint. - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + // Wire name: 'ai_gateway' + AiGateway *AiGatewayConfig // The budget policy associated with the endpoint. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // The core config of the serving endpoint. - Config PtEndpointCoreConfig `json:"config"` + // Wire name: 'config' + Config PtEndpointCoreConfig // The name of the serving endpoint. This field is required and must be // unique across a Databricks workspace. An endpoint name can consist of // alphanumeric characters, dashes, and underscores. - Name string `json:"name"` + // Wire name: 'name' + Name string // Tags to be attached to the serving endpoint and automatically propagated // to billing logs. - Tags []EndpointTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []EndpointTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePtEndpointRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePtEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPtEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPtEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePtEndpointRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePtEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := createPtEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateServingEndpoint struct { // The AI Gateway configuration for the serving endpoint. NOTE: External // model, provisioned throughput, and pay-per-token endpoints are fully // supported; agent endpoints currently only support inference tables. - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + // Wire name: 'ai_gateway' + AiGateway *AiGatewayConfig // The budget policy to be applied to the serving endpoint. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // The core config of the serving endpoint. - Config *EndpointCoreConfigInput `json:"config,omitempty"` + // Wire name: 'config' + Config *EndpointCoreConfigInput // The name of the serving endpoint. This field is required and must be // unique across a Databricks workspace. An endpoint name can consist of // alphanumeric characters, dashes, and underscores. - Name string `json:"name"` + // Wire name: 'name' + Name string // Rate limits to be applied to the serving endpoint. NOTE: this field is // deprecated, please use AI Gateway to manage rate limits. - RateLimits []RateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []RateLimit // Enable route optimization for the serving endpoint. - RouteOptimized bool `json:"route_optimized,omitempty"` + // Wire name: 'route_optimized' + RouteOptimized bool // Tags to be attached to the serving endpoint and automatically propagated // to billing logs. - Tags []EndpointTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []EndpointTag - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateServingEndpoint) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateServingEndpoint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createServingEndpointPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createServingEndpointFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateServingEndpoint) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateServingEndpoint) MarshalJSON() ([]byte, error) { + pb, err := createServingEndpointToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Configs needed to create a custom provider model route. type CustomProviderConfig struct { // This is a field to provide API key authentication for the custom provider // API. You can only specify one authentication method. - ApiKeyAuth *ApiKeyAuth `json:"api_key_auth,omitempty"` + // Wire name: 'api_key_auth' + ApiKeyAuth *ApiKeyAuth // This is a field to provide bearer token authentication for the custom // provider API. You can only specify one authentication method. - BearerTokenAuth *BearerTokenAuth `json:"bearer_token_auth,omitempty"` + // Wire name: 'bearer_token_auth' + BearerTokenAuth *BearerTokenAuth // This is a field to provide the URL of the custom provider API. - CustomProviderUrl string `json:"custom_provider_url"` + // Wire name: 'custom_provider_url' + CustomProviderUrl string +} + +func (st *CustomProviderConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &customProviderConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := customProviderConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CustomProviderConfig) MarshalJSON() ([]byte, error) { + pb, err := customProviderConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details necessary to query this object's API through the DataPlane APIs. type DataPlaneInfo struct { // Authorization details as a string. - AuthorizationDetails string `json:"authorization_details,omitempty"` + // Wire name: 'authorization_details' + AuthorizationDetails string // The URL of the endpoint for this operation in the dataplane. - EndpointUrl string `json:"endpoint_url,omitempty"` + // Wire name: 'endpoint_url' + EndpointUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DataPlaneInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DataPlaneInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataPlaneInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataPlaneInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DataPlaneInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DataPlaneInfo) MarshalJSON() ([]byte, error) { + pb, err := dataPlaneInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DatabricksModelServingConfig struct { @@ -601,65 +1214,188 @@ type DatabricksModelServingConfig struct { // to paste your API key directly, see `databricks_api_token_plaintext`. You // must provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiToken string `json:"databricks_api_token,omitempty"` + // Wire name: 'databricks_api_token' + DatabricksApiToken string // The Databricks API token that corresponds to a user or service principal // with Can Query access to the model serving endpoint pointed to by this // external model provided as a plaintext string. If you prefer to reference // your key using Databricks Secrets, see `databricks_api_token`. You must // provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiTokenPlaintext string `json:"databricks_api_token_plaintext,omitempty"` + // Wire name: 'databricks_api_token_plaintext' + DatabricksApiTokenPlaintext string // The URL of the Databricks workspace containing the model serving endpoint // pointed to by this external model. - DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` + // Wire name: 'databricks_workspace_url' + DatabricksWorkspaceUrl string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DatabricksModelServingConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DatabricksModelServingConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &databricksModelServingConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := databricksModelServingConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DatabricksModelServingConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DatabricksModelServingConfig) MarshalJSON() ([]byte, error) { + pb, err := databricksModelServingConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DataframeSplitInput struct { - Columns []any `json:"columns,omitempty"` - Data []any `json:"data,omitempty"` + // Wire name: 'columns' + Columns []any - Index []int `json:"index,omitempty"` + // Wire name: 'data' + Data []any + + // Wire name: 'index' + Index []int +} + +func (st *DataframeSplitInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataframeSplitInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataframeSplitInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DataframeSplitInput) MarshalJSON() ([]byte, error) { + pb, err := dataframeSplitInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a serving endpoint type DeleteServingEndpointRequest struct { - Name string `json:"-" url:"-"` + + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteServingEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteServingEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteServingEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteServingEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteServingEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EmbeddingsV1ResponseEmbeddingElement struct { - Embedding []float64 `json:"embedding,omitempty"` + + // Wire name: 'embedding' + Embedding []float64 // The index of the embedding in the response. - Index int `json:"index,omitempty"` + // Wire name: 'index' + Index int // This will always be 'embedding'. - Object EmbeddingsV1ResponseEmbeddingElementObject `json:"object,omitempty"` + // Wire name: 'object' + Object EmbeddingsV1ResponseEmbeddingElementObject - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EmbeddingsV1ResponseEmbeddingElement) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EmbeddingsV1ResponseEmbeddingElement) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &embeddingsV1ResponseEmbeddingElementPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := embeddingsV1ResponseEmbeddingElementFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EmbeddingsV1ResponseEmbeddingElement) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EmbeddingsV1ResponseEmbeddingElement) MarshalJSON() ([]byte, error) { + pb, err := embeddingsV1ResponseEmbeddingElementToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // This will always be 'embedding'. type EmbeddingsV1ResponseEmbeddingElementObject string +type embeddingsV1ResponseEmbeddingElementObjectPb string const EmbeddingsV1ResponseEmbeddingElementObjectEmbedding EmbeddingsV1ResponseEmbeddingElementObject = `embedding` @@ -684,22 +1420,68 @@ func (f *EmbeddingsV1ResponseEmbeddingElementObject) Type() string { return "EmbeddingsV1ResponseEmbeddingElementObject" } +func embeddingsV1ResponseEmbeddingElementObjectToPb(st *EmbeddingsV1ResponseEmbeddingElementObject) (*embeddingsV1ResponseEmbeddingElementObjectPb, error) { + if st == nil { + return nil, nil + } + pb := embeddingsV1ResponseEmbeddingElementObjectPb(*st) + return &pb, nil +} + +func embeddingsV1ResponseEmbeddingElementObjectFromPb(pb *embeddingsV1ResponseEmbeddingElementObjectPb) (*EmbeddingsV1ResponseEmbeddingElementObject, error) { + if pb == nil { + return nil, nil + } + st := EmbeddingsV1ResponseEmbeddingElementObject(*pb) + return &st, nil +} + type EndpointCoreConfigInput struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. Note: this field is deprecated for creating // new provisioned throughput endpoints, or updating existing provisioned // throughput endpoints that never have inference table configured; in these // cases please use AI Gateway to manage inference tables. - AutoCaptureConfig *AutoCaptureConfigInput `json:"auto_capture_config,omitempty"` + // Wire name: 'auto_capture_config' + AutoCaptureConfig *AutoCaptureConfigInput // The name of the serving endpoint to update. This field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The list of served entities under the serving endpoint config. - ServedEntities []ServedEntityInput `json:"served_entities,omitempty"` + // Wire name: 'served_entities' + ServedEntities []ServedEntityInput // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels []ServedModelInput `json:"served_models,omitempty"` + // Wire name: 'served_models' + ServedModels []ServedModelInput // The traffic configuration associated with the serving endpoint config. - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + // Wire name: 'traffic_config' + TrafficConfig *TrafficConfig +} + +func (st *EndpointCoreConfigInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointCoreConfigInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointCoreConfigInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EndpointCoreConfigInput) MarshalJSON() ([]byte, error) { + pb, err := endpointCoreConfigInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointCoreConfigOutput struct { @@ -708,34 +1490,83 @@ type EndpointCoreConfigOutput struct { // new provisioned throughput endpoints, or updating existing provisioned // throughput endpoints that never have inference table configured; in these // cases please use AI Gateway to manage inference tables. - AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` + // Wire name: 'auto_capture_config' + AutoCaptureConfig *AutoCaptureConfigOutput // The config version that the serving endpoint is currently serving. - ConfigVersion int64 `json:"config_version,omitempty"` + // Wire name: 'config_version' + ConfigVersion int64 // The list of served entities under the serving endpoint config. - ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + // Wire name: 'served_entities' + ServedEntities []ServedEntityOutput // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels []ServedModelOutput `json:"served_models,omitempty"` + // Wire name: 'served_models' + ServedModels []ServedModelOutput // The traffic configuration associated with the serving endpoint config. - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + // Wire name: 'traffic_config' + TrafficConfig *TrafficConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointCoreConfigOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointCoreConfigOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointCoreConfigOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointCoreConfigOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointCoreConfigOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointCoreConfigOutput) MarshalJSON() ([]byte, error) { + pb, err := endpointCoreConfigOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointCoreConfigSummary struct { // The list of served entities under the serving endpoint config. - ServedEntities []ServedEntitySpec `json:"served_entities,omitempty"` + // Wire name: 'served_entities' + ServedEntities []ServedEntitySpec // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels []ServedModelSpec `json:"served_models,omitempty"` + // Wire name: 'served_models' + ServedModels []ServedModelSpec +} + +func (st *EndpointCoreConfigSummary) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointCoreConfigSummaryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointCoreConfigSummaryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EndpointCoreConfigSummary) MarshalJSON() ([]byte, error) { + pb, err := endpointCoreConfigSummaryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointPendingConfig struct { @@ -744,30 +1575,53 @@ type EndpointPendingConfig struct { // new provisioned throughput endpoints, or updating existing provisioned // throughput endpoints that never have inference table configured; in these // cases please use AI Gateway to manage inference tables. - AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` + // Wire name: 'auto_capture_config' + AutoCaptureConfig *AutoCaptureConfigOutput // The config version that the serving endpoint is currently serving. - ConfigVersion int `json:"config_version,omitempty"` + // Wire name: 'config_version' + ConfigVersion int // The list of served entities belonging to the last issued update to the // serving endpoint. - ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + // Wire name: 'served_entities' + ServedEntities []ServedEntityOutput // (Deprecated, use served_entities instead) The list of served models // belonging to the last issued update to the serving endpoint. - ServedModels []ServedModelOutput `json:"served_models,omitempty"` + // Wire name: 'served_models' + ServedModels []ServedModelOutput // The timestamp when the update to the pending config started. - StartTime int64 `json:"start_time,omitempty"` + // Wire name: 'start_time' + StartTime int64 // The traffic config defining how invocations to the serving endpoint // should be routed. - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + // Wire name: 'traffic_config' + TrafficConfig *TrafficConfig - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointPendingConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointPendingConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointPendingConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointPendingConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointPendingConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointPendingConfig) MarshalJSON() ([]byte, error) { + pb, err := endpointPendingConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointState struct { @@ -776,15 +1630,43 @@ type EndpointState struct { // update in progress. Note that if the endpoint's config_update state value // is IN_PROGRESS, another update can not be made until the update completes // or fails. - ConfigUpdate EndpointStateConfigUpdate `json:"config_update,omitempty"` + // Wire name: 'config_update' + ConfigUpdate EndpointStateConfigUpdate // The state of an endpoint, indicating whether or not the endpoint is // queryable. An endpoint is READY if all of the served entities in its // active configuration are ready. If any of the actively served entities // are in a non-ready state, the endpoint state will be NOT_READY. - Ready EndpointStateReady `json:"ready,omitempty"` + // Wire name: 'ready' + Ready EndpointStateReady +} + +func (st *EndpointState) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointStatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointStateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EndpointState) MarshalJSON() ([]byte, error) { + pb, err := endpointStateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointStateConfigUpdate string +type endpointStateConfigUpdatePb string const EndpointStateConfigUpdateInProgress EndpointStateConfigUpdate = `IN_PROGRESS` @@ -815,7 +1697,24 @@ func (f *EndpointStateConfigUpdate) Type() string { return "EndpointStateConfigUpdate" } +func endpointStateConfigUpdateToPb(st *EndpointStateConfigUpdate) (*endpointStateConfigUpdatePb, error) { + if st == nil { + return nil, nil + } + pb := endpointStateConfigUpdatePb(*st) + return &pb, nil +} + +func endpointStateConfigUpdateFromPb(pb *endpointStateConfigUpdatePb) (*EndpointStateConfigUpdate, error) { + if pb == nil { + return nil, nil + } + st := EndpointStateConfigUpdate(*pb) + return &st, nil +} + type EndpointStateReady string +type endpointStateReadyPb string const EndpointStateReadyNotReady EndpointStateReady = `NOT_READY` @@ -842,67 +1741,206 @@ func (f *EndpointStateReady) Type() string { return "EndpointStateReady" } +func endpointStateReadyToPb(st *EndpointStateReady) (*endpointStateReadyPb, error) { + if st == nil { + return nil, nil + } + pb := endpointStateReadyPb(*st) + return &pb, nil +} + +func endpointStateReadyFromPb(pb *endpointStateReadyPb) (*EndpointStateReady, error) { + if pb == nil { + return nil, nil + } + st := EndpointStateReady(*pb) + return &st, nil +} + type EndpointTag struct { // Key field for a serving endpoint tag. - Key string `json:"key"` + // Wire name: 'key' + Key string // Optional value field for a serving endpoint tag. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointTag) MarshalJSON() ([]byte, error) { + pb, err := endpointTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointTags struct { - Tags []EndpointTag `json:"tags,omitempty"` + + // Wire name: 'tags' + Tags []EndpointTag +} + +func (st *EndpointTags) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointTagsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointTagsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EndpointTags) MarshalJSON() ([]byte, error) { + pb, err := endpointTagsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get metrics of a serving endpoint type ExportMetricsRequest struct { // The name of the serving endpoint to retrieve metrics for. This field is // required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *ExportMetricsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportMetricsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportMetricsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExportMetricsRequest) MarshalJSON() ([]byte, error) { + pb, err := exportMetricsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExportMetricsResponse struct { - Contents io.ReadCloser `json:"-"` + + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` +} + +func (st *ExportMetricsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportMetricsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportMetricsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExportMetricsResponse) MarshalJSON() ([]byte, error) { + pb, err := exportMetricsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Simple Proto message for testing type ExternalFunctionRequest struct { // The connection name to use. This is required to identify the external // connection. - ConnectionName string `json:"connection_name"` + // Wire name: 'connection_name' + ConnectionName string // Additional headers for the request. If not provided, only auth headers // from connections would be passed. - Headers string `json:"headers,omitempty"` + // Wire name: 'headers' + Headers string // The JSON payload to send in the request body. - Json string `json:"json,omitempty"` + // Wire name: 'json' + Json string // The HTTP method to use (e.g., 'GET', 'POST'). - Method ExternalFunctionRequestHttpMethod `json:"method"` + // Wire name: 'method' + Method ExternalFunctionRequestHttpMethod // Query parameters for the request. - Params string `json:"params,omitempty"` + // Wire name: 'params' + Params string // The relative path for the API endpoint. This is required. - Path string `json:"path"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalFunctionRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalFunctionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalFunctionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalFunctionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalFunctionRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalFunctionRequest) MarshalJSON() ([]byte, error) { + pb, err := externalFunctionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExternalFunctionRequestHttpMethod string +type externalFunctionRequestHttpMethodPb string const ExternalFunctionRequestHttpMethodDelete ExternalFunctionRequestHttpMethod = `DELETE` @@ -935,39 +1973,93 @@ func (f *ExternalFunctionRequestHttpMethod) Type() string { return "ExternalFunctionRequestHttpMethod" } +func externalFunctionRequestHttpMethodToPb(st *ExternalFunctionRequestHttpMethod) (*externalFunctionRequestHttpMethodPb, error) { + if st == nil { + return nil, nil + } + pb := externalFunctionRequestHttpMethodPb(*st) + return &pb, nil +} + +func externalFunctionRequestHttpMethodFromPb(pb *externalFunctionRequestHttpMethodPb) (*ExternalFunctionRequestHttpMethod, error) { + if pb == nil { + return nil, nil + } + st := ExternalFunctionRequestHttpMethod(*pb) + return &st, nil +} + type ExternalModel struct { // AI21Labs Config. Only required if the provider is 'ai21labs'. - Ai21labsConfig *Ai21LabsConfig `json:"ai21labs_config,omitempty"` + // Wire name: 'ai21labs_config' + Ai21labsConfig *Ai21LabsConfig // Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. - AmazonBedrockConfig *AmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` + // Wire name: 'amazon_bedrock_config' + AmazonBedrockConfig *AmazonBedrockConfig // Anthropic Config. Only required if the provider is 'anthropic'. - AnthropicConfig *AnthropicConfig `json:"anthropic_config,omitempty"` + // Wire name: 'anthropic_config' + AnthropicConfig *AnthropicConfig // Cohere Config. Only required if the provider is 'cohere'. - CohereConfig *CohereConfig `json:"cohere_config,omitempty"` + // Wire name: 'cohere_config' + CohereConfig *CohereConfig // Custom Provider Config. Only required if the provider is 'custom'. - CustomProviderConfig *CustomProviderConfig `json:"custom_provider_config,omitempty"` + // Wire name: 'custom_provider_config' + CustomProviderConfig *CustomProviderConfig // Databricks Model Serving Config. Only required if the provider is // 'databricks-model-serving'. - DatabricksModelServingConfig *DatabricksModelServingConfig `json:"databricks_model_serving_config,omitempty"` + // Wire name: 'databricks_model_serving_config' + DatabricksModelServingConfig *DatabricksModelServingConfig // Google Cloud Vertex AI Config. Only required if the provider is // 'google-cloud-vertex-ai'. - GoogleCloudVertexAiConfig *GoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` + // Wire name: 'google_cloud_vertex_ai_config' + GoogleCloudVertexAiConfig *GoogleCloudVertexAiConfig // The name of the external model. - Name string `json:"name"` + // Wire name: 'name' + Name string // OpenAI Config. Only required if the provider is 'openai'. - OpenaiConfig *OpenAiConfig `json:"openai_config,omitempty"` + // Wire name: 'openai_config' + OpenaiConfig *OpenAiConfig // PaLM Config. Only required if the provider is 'palm'. - PalmConfig *PaLmConfig `json:"palm_config,omitempty"` + // Wire name: 'palm_config' + PalmConfig *PaLmConfig // The name of the provider for the external model. Currently, the supported // providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', // 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', // and 'custom'. - Provider ExternalModelProvider `json:"provider"` + // Wire name: 'provider' + Provider ExternalModelProvider // The task type of the external model. - Task string `json:"task"` + // Wire name: 'task' + Task string +} + +func (st *ExternalModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExternalModel) MarshalJSON() ([]byte, error) { + pb, err := externalModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExternalModelProvider string +type externalModelProviderPb string const ExternalModelProviderAi21labs ExternalModelProvider = `ai21labs` @@ -1008,23 +2100,59 @@ func (f *ExternalModelProvider) Type() string { return "ExternalModelProvider" } +func externalModelProviderToPb(st *ExternalModelProvider) (*externalModelProviderPb, error) { + if st == nil { + return nil, nil + } + pb := externalModelProviderPb(*st) + return &pb, nil +} + +func externalModelProviderFromPb(pb *externalModelProviderPb) (*ExternalModelProvider, error) { + if pb == nil { + return nil, nil + } + st := ExternalModelProvider(*pb) + return &st, nil +} + type ExternalModelUsageElement struct { // The number of tokens in the chat/completions response. - CompletionTokens int `json:"completion_tokens,omitempty"` + // Wire name: 'completion_tokens' + CompletionTokens int // The number of tokens in the prompt. - PromptTokens int `json:"prompt_tokens,omitempty"` + // Wire name: 'prompt_tokens' + PromptTokens int // The total number of tokens in the prompt and response. - TotalTokens int `json:"total_tokens,omitempty"` + // Wire name: 'total_tokens' + TotalTokens int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalModelUsageElement) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalModelUsageElement) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalModelUsageElementPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalModelUsageElementFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalModelUsageElement) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalModelUsageElement) MarshalJSON() ([]byte, error) { + pb, err := externalModelUsageElementToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FallbackConfig struct { @@ -1034,63 +2162,268 @@ type FallbackConfig struct { // same endpoint, following the order of served entity list, until a // successful response is returned. If all attempts fail, return the last // response with the error code. - Enabled bool `json:"enabled"` + // Wire name: 'enabled' + Enabled bool +} + +func (st *FallbackConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fallbackConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fallbackConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FallbackConfig) MarshalJSON() ([]byte, error) { + pb, err := fallbackConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // All fields are not sensitive as they are hard-coded in the system and made // available to customers. type FoundationModel struct { - Description string `json:"description,omitempty"` - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'description' + Description string - Docs string `json:"docs,omitempty"` + // Wire name: 'display_name' + DisplayName string - Name string `json:"name,omitempty"` + // Wire name: 'docs' + Docs string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'name' + Name string + + ForceSendFields []string `tf:"-"` } -func (s *FoundationModel) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FoundationModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &foundationModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := foundationModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FoundationModel) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FoundationModel) MarshalJSON() ([]byte, error) { + pb, err := foundationModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the schema for a serving endpoint type GetOpenApiRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetOpenApiRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getOpenApiRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getOpenApiRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetOpenApiRequest) MarshalJSON() ([]byte, error) { + pb, err := getOpenApiRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetOpenApiResponse struct { - Contents io.ReadCloser `json:"-"` + + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` +} + +func (st *GetOpenApiResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getOpenApiResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getOpenApiResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetOpenApiResponse) MarshalJSON() ([]byte, error) { + pb, err := getOpenApiResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get serving endpoint permission levels type GetServingEndpointPermissionLevelsRequest struct { // The serving endpoint for which to get or manage permissions. - ServingEndpointId string `json:"-" url:"-"` + // Wire name: 'serving_endpoint_id' + ServingEndpointId string `tf:"-"` +} + +func (st *GetServingEndpointPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServingEndpointPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServingEndpointPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServingEndpointPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getServingEndpointPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetServingEndpointPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []ServingEndpointPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []ServingEndpointPermissionsDescription +} + +func (st *GetServingEndpointPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServingEndpointPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServingEndpointPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServingEndpointPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getServingEndpointPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get serving endpoint permissions type GetServingEndpointPermissionsRequest struct { // The serving endpoint for which to get or manage permissions. - ServingEndpointId string `json:"-" url:"-"` + // Wire name: 'serving_endpoint_id' + ServingEndpointId string `tf:"-"` +} + +func (st *GetServingEndpointPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServingEndpointPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServingEndpointPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServingEndpointPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getServingEndpointPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a single serving endpoint type GetServingEndpointRequest struct { // The name of the serving endpoint. This field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetServingEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getServingEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getServingEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetServingEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := getServingEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GoogleCloudVertexAiConfig struct { @@ -1103,7 +2436,8 @@ type GoogleCloudVertexAiConfig struct { // // [Best practices for managing service account keys]: // https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKey string `json:"private_key,omitempty"` + // Wire name: 'private_key' + PrivateKey string // The private key for the service account which has access to the Google // Cloud Vertex AI Service provided as a plaintext secret. See [Best // practices for managing service account keys]. If you prefer to reference @@ -1113,118 +2447,272 @@ type GoogleCloudVertexAiConfig struct { // // [Best practices for managing service account keys]: // https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKeyPlaintext string `json:"private_key_plaintext,omitempty"` + // Wire name: 'private_key_plaintext' + PrivateKeyPlaintext string // This is the Google Cloud project id that the service account is // associated with. - ProjectId string `json:"project_id"` + // Wire name: 'project_id' + ProjectId string // This is the region for the Google Cloud Vertex AI Service. See [supported // regions] for more details. Some models are only available in specific // regions. // // [supported regions]: // https://cloud.google.com/vertex-ai/docs/general/locations - Region string `json:"region"` + // Wire name: 'region' + Region string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GoogleCloudVertexAiConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GoogleCloudVertexAiConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &googleCloudVertexAiConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := googleCloudVertexAiConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GoogleCloudVertexAiConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GoogleCloudVertexAiConfig) MarshalJSON() ([]byte, error) { + pb, err := googleCloudVertexAiConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type HttpRequestResponse struct { - Contents io.ReadCloser `json:"-"` + + // Wire name: 'contents' + Contents io.ReadCloser `tf:"-"` +} + +func (st *HttpRequestResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &httpRequestResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := httpRequestResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st HttpRequestResponse) MarshalJSON() ([]byte, error) { + pb, err := httpRequestResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListEndpointsResponse struct { // The list of endpoints. - Endpoints []ServingEndpoint `json:"endpoints,omitempty"` + // Wire name: 'endpoints' + Endpoints []ServingEndpoint +} + +func (st *ListEndpointsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listEndpointsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listEndpointsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListEndpointsResponse) MarshalJSON() ([]byte, error) { + pb, err := listEndpointsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the latest logs for a served model type LogsRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The name of the served model that logs will be retrieved for. This field // is required. - ServedModelName string `json:"-" url:"-"` + // Wire name: 'served_model_name' + ServedModelName string `tf:"-"` +} + +func (st *LogsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &logsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := logsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st LogsRequest) MarshalJSON() ([]byte, error) { + pb, err := logsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A representation of all DataPlaneInfo for operations that can be done on a // model through Data Plane APIs. type ModelDataPlaneInfo struct { // Information required to query DataPlane API 'query' endpoint. - QueryInfo *DataPlaneInfo `json:"query_info,omitempty"` + // Wire name: 'query_info' + QueryInfo *DataPlaneInfo +} + +func (st *ModelDataPlaneInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &modelDataPlaneInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := modelDataPlaneInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ModelDataPlaneInfo) MarshalJSON() ([]byte, error) { + pb, err := modelDataPlaneInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Configs needed to create an OpenAI model route. type OpenAiConfig struct { // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Client ID. - MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` + // Wire name: 'microsoft_entra_client_id' + MicrosoftEntraClientId string // The Databricks secret key reference for a client secret used for // Microsoft Entra ID authentication. If you prefer to paste your client // secret directly, see `microsoft_entra_client_secret_plaintext`. You must // provide an API key using one of the following fields: // `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` + // Wire name: 'microsoft_entra_client_secret' + MicrosoftEntraClientSecret string // The client secret used for Microsoft Entra ID authentication provided as // a plaintext string. If you prefer to reference your key using Databricks // Secrets, see `microsoft_entra_client_secret`. You must provide an API key // using one of the following fields: `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecretPlaintext string `json:"microsoft_entra_client_secret_plaintext,omitempty"` + // Wire name: 'microsoft_entra_client_secret_plaintext' + MicrosoftEntraClientSecretPlaintext string // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Tenant ID. - MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` + // Wire name: 'microsoft_entra_tenant_id' + MicrosoftEntraTenantId string // This is a field to provide a customized base URl for the OpenAI API. For // Azure OpenAI, this field is required, and is the base URL for the Azure // OpenAI API service provided by Azure. For other OpenAI API types, this // field is optional, and if left unspecified, the standard OpenAI base URL // is used. - OpenaiApiBase string `json:"openai_api_base,omitempty"` + // Wire name: 'openai_api_base' + OpenaiApiBase string // The Databricks secret key reference for an OpenAI API key using the // OpenAI or Azure service. If you prefer to paste your API key directly, // see `openai_api_key_plaintext`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKey string `json:"openai_api_key,omitempty"` + // Wire name: 'openai_api_key' + OpenaiApiKey string // The OpenAI API key using the OpenAI or Azure service provided as a // plaintext string. If you prefer to reference your key using Databricks // Secrets, see `openai_api_key`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` + // Wire name: 'openai_api_key_plaintext' + OpenaiApiKeyPlaintext string // This is an optional field to specify the type of OpenAI API to use. For // Azure OpenAI, this field is required, and adjust this parameter to // represent the preferred security access validation protocol. For access // token validation, use azure. For authentication using Azure Active // Directory (Azure AD) use, azuread. - OpenaiApiType string `json:"openai_api_type,omitempty"` + // Wire name: 'openai_api_type' + OpenaiApiType string // This is an optional field to specify the OpenAI API version. For Azure // OpenAI, this field is required, and is the version of the Azure OpenAI // service to utilize, specified by a date. - OpenaiApiVersion string `json:"openai_api_version,omitempty"` + // Wire name: 'openai_api_version' + OpenaiApiVersion string // This field is only required for Azure OpenAI and is the name of the // deployment resource for the Azure OpenAI service. - OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` + // Wire name: 'openai_deployment_name' + OpenaiDeploymentName string // This is an optional field to specify the organization in OpenAI or Azure // OpenAI. - OpenaiOrganization string `json:"openai_organization,omitempty"` + // Wire name: 'openai_organization' + OpenaiOrganization string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OpenAiConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OpenAiConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &openAiConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := openAiConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OpenAiConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OpenAiConfig) MarshalJSON() ([]byte, error) { + pb, err := openAiConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PaLmConfig struct { @@ -1232,57 +2720,152 @@ type PaLmConfig struct { // paste your API key directly, see `palm_api_key_plaintext`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKey string `json:"palm_api_key,omitempty"` + // Wire name: 'palm_api_key' + PalmApiKey string // The PaLM API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `palm_api_key`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKeyPlaintext string `json:"palm_api_key_plaintext,omitempty"` + // Wire name: 'palm_api_key_plaintext' + PalmApiKeyPlaintext string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PaLmConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PaLmConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &paLmConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := paLmConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PaLmConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PaLmConfig) MarshalJSON() ([]byte, error) { + pb, err := paLmConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PatchServingEndpointTags struct { // List of endpoint tags to add - AddTags []EndpointTag `json:"add_tags,omitempty"` + // Wire name: 'add_tags' + AddTags []EndpointTag // List of tag keys to delete - DeleteTags []string `json:"delete_tags,omitempty"` + // Wire name: 'delete_tags' + DeleteTags []string // The name of the serving endpoint who's tags to patch. This field is // required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *PatchServingEndpointTags) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchServingEndpointTagsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchServingEndpointTagsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PatchServingEndpointTags) MarshalJSON() ([]byte, error) { + pb, err := patchServingEndpointTagsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PayloadTable struct { - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` + // Wire name: 'name' + Name string - StatusMessage string `json:"status_message,omitempty"` + // Wire name: 'status' + Status string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'status_message' + StatusMessage string + + ForceSendFields []string `tf:"-"` } -func (s *PayloadTable) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PayloadTable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &payloadTablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := payloadTableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PayloadTable) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PayloadTable) MarshalJSON() ([]byte, error) { + pb, err := payloadTableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PtEndpointCoreConfig struct { // The list of served entities under the serving endpoint config. - ServedEntities []PtServedModel `json:"served_entities,omitempty"` + // Wire name: 'served_entities' + ServedEntities []PtServedModel + + // Wire name: 'traffic_config' + TrafficConfig *TrafficConfig +} + +func (st *PtEndpointCoreConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ptEndpointCoreConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ptEndpointCoreConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` +func (st PtEndpointCoreConfig) MarshalJSON() ([]byte, error) { + pb, err := ptEndpointCoreConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PtServedModel struct { @@ -1291,191 +2874,384 @@ type PtServedModel struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object should be given in the form of // **catalog_name.schema_name.model_name**. - EntityName string `json:"entity_name"` + // Wire name: 'entity_name' + EntityName string - EntityVersion string `json:"entity_version,omitempty"` + // Wire name: 'entity_version' + EntityVersion string // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to entity_name-entity_version. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The number of model units to be provisioned. - ProvisionedModelUnits int64 `json:"provisioned_model_units"` + // Wire name: 'provisioned_model_units' + ProvisionedModelUnits int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PtServedModel) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PtServedModel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ptServedModelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ptServedModelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PtServedModel) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PtServedModel) MarshalJSON() ([]byte, error) { + pb, err := ptServedModelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutAiGatewayRequest struct { // Configuration for traffic fallback which auto fallbacks to other served // entities if the request to a served entity fails with certain error // codes, to increase availability. - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + // Wire name: 'fallback_config' + FallbackConfig *FallbackConfig // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + // Wire name: 'guardrails' + Guardrails *AiGatewayGuardrails // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + // Wire name: 'inference_table_config' + InferenceTableConfig *AiGatewayInferenceTableConfig // The name of the serving endpoint whose AI Gateway is being updated. This // field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []AiGatewayRateLimit // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + // Wire name: 'usage_tracking_config' + UsageTrackingConfig *AiGatewayUsageTrackingConfig +} + +func (st *PutAiGatewayRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putAiGatewayRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putAiGatewayRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutAiGatewayRequest) MarshalJSON() ([]byte, error) { + pb, err := putAiGatewayRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutAiGatewayResponse struct { // Configuration for traffic fallback which auto fallbacks to other served // entities if the request to a served entity fails with certain error // codes, to increase availability. - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + // Wire name: 'fallback_config' + FallbackConfig *FallbackConfig // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` + // Wire name: 'guardrails' + Guardrails *AiGatewayGuardrails // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + // Wire name: 'inference_table_config' + InferenceTableConfig *AiGatewayInferenceTableConfig // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []AiGatewayRateLimit // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + // Wire name: 'usage_tracking_config' + UsageTrackingConfig *AiGatewayUsageTrackingConfig +} + +func (st *PutAiGatewayResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putAiGatewayResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putAiGatewayResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutAiGatewayResponse) MarshalJSON() ([]byte, error) { + pb, err := putAiGatewayResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutRequest struct { // The name of the serving endpoint whose rate limits are being updated. // This field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The list of endpoint rate limits. - RateLimits []RateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []RateLimit +} + +func (st *PutRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutRequest) MarshalJSON() ([]byte, error) { + pb, err := putRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutResponse struct { // The list of endpoint rate limits. - RateLimits []RateLimit `json:"rate_limits,omitempty"` + // Wire name: 'rate_limits' + RateLimits []RateLimit +} + +func (st *PutResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutResponse) MarshalJSON() ([]byte, error) { + pb, err := putResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryEndpointInput struct { // Pandas Dataframe input in the records orientation. - DataframeRecords []any `json:"dataframe_records,omitempty"` + // Wire name: 'dataframe_records' + DataframeRecords []any // Pandas Dataframe input in the split orientation. - DataframeSplit *DataframeSplitInput `json:"dataframe_split,omitempty"` + // Wire name: 'dataframe_split' + DataframeSplit *DataframeSplitInput // The extra parameters field used ONLY for __completions, chat,__ and // __embeddings external & foundation model__ serving endpoints. This is a // map of strings and should only be used with other external/foundation // model query fields. - ExtraParams map[string]string `json:"extra_params,omitempty"` + // Wire name: 'extra_params' + ExtraParams map[string]string // The input string (or array of strings) field used ONLY for __embeddings // external & foundation model__ serving endpoints and is the only field // (along with extra_params if needed) used by embeddings queries. - Input any `json:"input,omitempty"` + // Wire name: 'input' + Input any // Tensor-based input in columnar format. - Inputs any `json:"inputs,omitempty"` + // Wire name: 'inputs' + Inputs any // Tensor-based input in row format. - Instances []any `json:"instances,omitempty"` + // Wire name: 'instances' + Instances []any // The max tokens field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is an integer and should only // be used with other chat/completions query fields. - MaxTokens int `json:"max_tokens,omitempty"` + // Wire name: 'max_tokens' + MaxTokens int // The messages field used ONLY for __chat external & foundation model__ // serving endpoints. This is a map of strings and should only be used with // other chat query fields. - Messages []ChatMessage `json:"messages,omitempty"` + // Wire name: 'messages' + Messages []ChatMessage // The n (number of candidates) field used ONLY for __completions__ and // __chat external & foundation model__ serving endpoints. This is an // integer between 1 and 5 with a default of 1 and should only be used with // other chat/completions query fields. - N int `json:"n,omitempty"` + // Wire name: 'n' + N int // The name of the serving endpoint. This field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // The prompt string (or array of strings) field used ONLY for __completions // external & foundation model__ serving endpoints and should only be used // with other completions query fields. - Prompt any `json:"prompt,omitempty"` + // Wire name: 'prompt' + Prompt any // The stop sequences field used ONLY for __completions__ and __chat // external & foundation model__ serving endpoints. This is a list of // strings and should only be used with other chat/completions query fields. - Stop []string `json:"stop,omitempty"` + // Wire name: 'stop' + Stop []string // The stream field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a boolean defaulting to // false and should only be used with other chat/completions query fields. - Stream bool `json:"stream,omitempty"` + // Wire name: 'stream' + Stream bool // The temperature field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a float between 0.0 and 2.0 // with a default of 1.0 and should only be used with other chat/completions // query fields. - Temperature float64 `json:"temperature,omitempty"` + // Wire name: 'temperature' + Temperature float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryEndpointInput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryEndpointInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryEndpointInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryEndpointInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryEndpointInput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryEndpointInput) MarshalJSON() ([]byte, error) { + pb, err := queryEndpointInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryEndpointResponse struct { // The list of choices returned by the __chat or completions // external/foundation model__ serving endpoint. - Choices []V1ResponseChoiceElement `json:"choices,omitempty"` + // Wire name: 'choices' + Choices []V1ResponseChoiceElement // The timestamp in seconds when the query was created in Unix time returned // by a __completions or chat external/foundation model__ serving endpoint. - Created int64 `json:"created,omitempty"` + // Wire name: 'created' + Created int64 // The list of the embeddings returned by the __embeddings // external/foundation model__ serving endpoint. - Data []EmbeddingsV1ResponseEmbeddingElement `json:"data,omitempty"` + // Wire name: 'data' + Data []EmbeddingsV1ResponseEmbeddingElement // The ID of the query that may be returned by a __completions or chat // external/foundation model__ serving endpoint. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The name of the __external/foundation model__ used for querying. This is // the name of the model that was specified in the endpoint config. - Model string `json:"model,omitempty"` + // Wire name: 'model' + Model string // The type of object returned by the __external/foundation model__ serving // endpoint, one of [text_completion, chat.completion, list (of // embeddings)]. - Object QueryEndpointResponseObject `json:"object,omitempty"` + // Wire name: 'object' + Object QueryEndpointResponseObject // The predictions returned by the serving endpoint. - Predictions []any `json:"predictions,omitempty"` + // Wire name: 'predictions' + Predictions []any // The name of the served model that served the request. This is useful when // there are multiple models behind the same endpoint with traffic split. - ServedModelName string `json:"-" url:"-" header:"served-model-name,omitempty"` + // Wire name: 'served-model-name' + ServedModelName string `tf:"-"` // The usage object that may be returned by the __external/foundation // model__ serving endpoint. This contains information about the number of // tokens used in the prompt and response. - Usage *ExternalModelUsageElement `json:"usage,omitempty"` + // Wire name: 'usage' + Usage *ExternalModelUsageElement - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryEndpointResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryEndpointResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryEndpointResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryEndpointResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryEndpointResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryEndpointResponse) MarshalJSON() ([]byte, error) { + pb, err := queryEndpointResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of object returned by the __external/foundation model__ serving // endpoint, one of [text_completion, chat.completion, list (of embeddings)]. type QueryEndpointResponseObject string +type queryEndpointResponseObjectPb string const QueryEndpointResponseObjectChatCompletion QueryEndpointResponseObject = `chat.completion` @@ -1504,20 +3280,65 @@ func (f *QueryEndpointResponseObject) Type() string { return "QueryEndpointResponseObject" } +func queryEndpointResponseObjectToPb(st *QueryEndpointResponseObject) (*queryEndpointResponseObjectPb, error) { + if st == nil { + return nil, nil + } + pb := queryEndpointResponseObjectPb(*st) + return &pb, nil +} + +func queryEndpointResponseObjectFromPb(pb *queryEndpointResponseObjectPb) (*QueryEndpointResponseObject, error) { + if pb == nil { + return nil, nil + } + st := QueryEndpointResponseObject(*pb) + return &st, nil +} + type RateLimit struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls int64 `json:"calls"` + // Wire name: 'calls' + Calls int64 // Key field for a serving endpoint rate limit. Currently, only 'user' and // 'endpoint' are supported, with 'endpoint' being the default if not // specified. - Key RateLimitKey `json:"key,omitempty"` + // Wire name: 'key' + Key RateLimitKey // Renewal period field for a serving endpoint rate limit. Currently, only // 'minute' is supported. - RenewalPeriod RateLimitRenewalPeriod `json:"renewal_period"` + // Wire name: 'renewal_period' + RenewalPeriod RateLimitRenewalPeriod +} + +func (st *RateLimit) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rateLimitPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rateLimitFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RateLimit) MarshalJSON() ([]byte, error) { + pb, err := rateLimitToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RateLimitKey string +type rateLimitKeyPb string const RateLimitKeyEndpoint RateLimitKey = `endpoint` @@ -1544,7 +3365,24 @@ func (f *RateLimitKey) Type() string { return "RateLimitKey" } +func rateLimitKeyToPb(st *RateLimitKey) (*rateLimitKeyPb, error) { + if st == nil { + return nil, nil + } + pb := rateLimitKeyPb(*st) + return &pb, nil +} + +func rateLimitKeyFromPb(pb *rateLimitKeyPb) (*RateLimitKey, error) { + if pb == nil { + return nil, nil + } + st := RateLimitKey(*pb) + return &st, nil +} + type RateLimitRenewalPeriod string +type rateLimitRenewalPeriodPb string const RateLimitRenewalPeriodMinute RateLimitRenewalPeriod = `minute` @@ -1569,12 +3407,55 @@ func (f *RateLimitRenewalPeriod) Type() string { return "RateLimitRenewalPeriod" } +func rateLimitRenewalPeriodToPb(st *RateLimitRenewalPeriod) (*rateLimitRenewalPeriodPb, error) { + if st == nil { + return nil, nil + } + pb := rateLimitRenewalPeriodPb(*st) + return &pb, nil +} + +func rateLimitRenewalPeriodFromPb(pb *rateLimitRenewalPeriodPb) (*RateLimitRenewalPeriod, error) { + if pb == nil { + return nil, nil + } + st := RateLimitRenewalPeriod(*pb) + return &st, nil +} + type Route struct { // The name of the served model this route configures traffic for. - ServedModelName string `json:"served_model_name"` + // Wire name: 'served_model_name' + ServedModelName string // The percentage of endpoint traffic to send to this route. It must be an // integer between 0 and 100 inclusive. - TrafficPercentage int `json:"traffic_percentage"` + // Wire name: 'traffic_percentage' + TrafficPercentage int +} + +func (st *Route) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &routePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := routeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Route) MarshalJSON() ([]byte, error) { + pb, err := routeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedEntityInput struct { @@ -1583,16 +3464,19 @@ type ServedEntityInput struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object should be given in the form of // **catalog_name.schema_name.model_name**. - EntityName string `json:"entity_name,omitempty"` + // Wire name: 'entity_name' + EntityName string - EntityVersion string `json:"entity_version,omitempty"` + // Wire name: 'entity_version' + EntityVersion string // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + // Wire name: 'environment_vars' + EnvironmentVars map[string]string // The external model to be served. NOTE: Only one of external_model and // (entity_name, entity_version, workload_size, workload_type, and // scale_to_zero_enabled) can be specified with the latter set being used @@ -1601,25 +3485,32 @@ type ServedEntityInput struct { // endpoint without external_model. If the endpoint is created without // external_model, users cannot update it to add external_model later. The // task type of all external models within an endpoint must be the same. - ExternalModel *ExternalModel `json:"external_model,omitempty"` + // Wire name: 'external_model' + ExternalModel *ExternalModel // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + // Wire name: 'max_provisioned_throughput' + MaxProvisionedThroughput int // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + // Wire name: 'min_provisioned_throughput' + MinProvisionedThroughput int // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to entity_name-entity_version. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The number of model units provisioned. - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + // Wire name: 'provisioned_model_units' + ProvisionedModelUnits int64 // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + // Wire name: 'scale_to_zero_enabled' + ScaleToZeroEnabled bool // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -1628,7 +3519,8 @@ type ServedEntityInput struct { // provisioned concurrency). Additional custom workload sizes can also be // used when available in the workspace. If scale-to-zero is enabled, the // lower bound of the provisioned concurrency for each workload size is 0. - WorkloadSize string `json:"workload_size,omitempty"` + // Wire name: 'workload_size' + WorkloadSize string // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -1636,38 +3528,62 @@ type ServedEntityInput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType ServingModelWorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedEntityInput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedEntityInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedEntityInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedEntityInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedEntityInput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedEntityInput) MarshalJSON() ([]byte, error) { + pb, err := servedEntityInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedEntityOutput struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - Creator string `json:"creator,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 + + // Wire name: 'creator' + Creator string // The name of the entity to be served. The entity may be a model in the // Databricks Model Registry, a model in the Unity Catalog (UC), or a // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object should be given in the form of // **catalog_name.schema_name.model_name**. - EntityName string `json:"entity_name,omitempty"` + // Wire name: 'entity_name' + EntityName string - EntityVersion string `json:"entity_version,omitempty"` + // Wire name: 'entity_version' + EntityVersion string // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + // Wire name: 'environment_vars' + EnvironmentVars map[string]string // The external model to be served. NOTE: Only one of external_model and // (entity_name, entity_version, workload_size, workload_type, and // scale_to_zero_enabled) can be specified with the latter set being used @@ -1676,30 +3592,39 @@ type ServedEntityOutput struct { // endpoint without external_model. If the endpoint is created without // external_model, users cannot update it to add external_model later. The // task type of all external models within an endpoint must be the same. - ExternalModel *ExternalModel `json:"external_model,omitempty"` + // Wire name: 'external_model' + ExternalModel *ExternalModel // All fields are not sensitive as they are hard-coded in the system and // made available to customers. - FoundationModel *FoundationModel `json:"foundation_model,omitempty"` + // Wire name: 'foundation_model' + FoundationModel *FoundationModel // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + // Wire name: 'max_provisioned_throughput' + MaxProvisionedThroughput int // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + // Wire name: 'min_provisioned_throughput' + MinProvisionedThroughput int // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to entity_name-entity_version. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The number of model units provisioned. - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + // Wire name: 'provisioned_model_units' + ProvisionedModelUnits int64 // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + // Wire name: 'scale_to_zero_enabled' + ScaleToZeroEnabled bool - State *ServedModelState `json:"state,omitempty"` + // Wire name: 'state' + State *ServedModelState // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -1708,7 +3633,8 @@ type ServedEntityOutput struct { // provisioned concurrency). Additional custom workload sizes can also be // used when available in the workspace. If scale-to-zero is enabled, the // lower bound of the provisioned concurrency for each workload size is 0. - WorkloadSize string `json:"workload_size,omitempty"` + // Wire name: 'workload_size' + WorkloadSize string // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -1716,40 +3642,81 @@ type ServedEntityOutput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType ServingModelWorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedEntityOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedEntityOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedEntityOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedEntityOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedEntityOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedEntityOutput) MarshalJSON() ([]byte, error) { + pb, err := servedEntityOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedEntitySpec struct { - EntityName string `json:"entity_name,omitempty"` - EntityVersion string `json:"entity_version,omitempty"` + // Wire name: 'entity_name' + EntityName string - ExternalModel *ExternalModel `json:"external_model,omitempty"` + // Wire name: 'entity_version' + EntityVersion string + + // Wire name: 'external_model' + ExternalModel *ExternalModel // All fields are not sensitive as they are hard-coded in the system and // made available to customers. - FoundationModel *FoundationModel `json:"foundation_model,omitempty"` + // Wire name: 'foundation_model' + FoundationModel *FoundationModel - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedEntitySpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedEntitySpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedEntitySpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedEntitySpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedEntitySpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedEntitySpec) MarshalJSON() ([]byte, error) { + pb, err := servedEntitySpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedModelInput struct { @@ -1759,29 +3726,38 @@ type ServedModelInput struct { // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + // Wire name: 'environment_vars' + EnvironmentVars map[string]string // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + // Wire name: 'max_provisioned_throughput' + MaxProvisionedThroughput int // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + // Wire name: 'min_provisioned_throughput' + MinProvisionedThroughput int - ModelName string `json:"model_name"` + // Wire name: 'model_name' + ModelName string - ModelVersion string `json:"model_version"` + // Wire name: 'model_version' + ModelVersion string // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to entity_name-entity_version. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The number of model units provisioned. - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + // Wire name: 'provisioned_model_units' + ProvisionedModelUnits int64 // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled"` + // Wire name: 'scale_to_zero_enabled' + ScaleToZeroEnabled bool // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -1790,7 +3766,8 @@ type ServedModelInput struct { // provisioned concurrency). Additional custom workload sizes can also be // used when available in the workspace. If scale-to-zero is enabled, the // lower bound of the provisioned concurrency for each workload size is 0. - WorkloadSize string `json:"workload_size,omitempty"` + // Wire name: 'workload_size' + WorkloadSize string // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -1798,22 +3775,41 @@ type ServedModelInput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType ServedModelInputWorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType ServedModelInputWorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedModelInput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedModelInput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedModelInputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedModelInputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedModelInput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedModelInput) MarshalJSON() ([]byte, error) { + pb, err := servedModelInputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Please keep this in sync with with workload types in // InferenceEndpointEntities.scala type ServedModelInputWorkloadType string +type servedModelInputWorkloadTypePb string const ServedModelInputWorkloadTypeCpu ServedModelInputWorkloadType = `CPU` @@ -1846,37 +3842,64 @@ func (f *ServedModelInputWorkloadType) Type() string { return "ServedModelInputWorkloadType" } +func servedModelInputWorkloadTypeToPb(st *ServedModelInputWorkloadType) (*servedModelInputWorkloadTypePb, error) { + if st == nil { + return nil, nil + } + pb := servedModelInputWorkloadTypePb(*st) + return &pb, nil +} + +func servedModelInputWorkloadTypeFromPb(pb *servedModelInputWorkloadTypePb) (*ServedModelInputWorkloadType, error) { + if pb == nil { + return nil, nil + } + st := ServedModelInputWorkloadType(*pb) + return &st, nil +} + type ServedModelOutput struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - Creator string `json:"creator,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 + + // Wire name: 'creator' + Creator string // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + // Wire name: 'environment_vars' + EnvironmentVars map[string]string // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string - ModelVersion string `json:"model_version,omitempty"` + // Wire name: 'model_version' + ModelVersion string // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to entity_name-entity_version. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The number of model units provisioned. - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + // Wire name: 'provisioned_model_units' + ProvisionedModelUnits int64 // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + // Wire name: 'scale_to_zero_enabled' + ScaleToZeroEnabled bool - State *ServedModelState `json:"state,omitempty"` + // Wire name: 'state' + State *ServedModelState // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -1885,7 +3908,8 @@ type ServedModelOutput struct { // provisioned concurrency). Additional custom workload sizes can also be // used when available in the workspace. If scale-to-zero is enabled, the // lower bound of the provisioned concurrency for each workload size is 0. - WorkloadSize string `json:"workload_size,omitempty"` + // Wire name: 'workload_size' + WorkloadSize string // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -1893,55 +3917,114 @@ type ServedModelOutput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + // Wire name: 'workload_type' + WorkloadType ServingModelWorkloadType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedModelOutput) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedModelOutput) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedModelOutputPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedModelOutputFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedModelOutput) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedModelOutput) MarshalJSON() ([]byte, error) { + pb, err := servedModelOutputToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedModelSpec struct { // Only one of model_name and entity_name should be populated - ModelName string `json:"model_name,omitempty"` + // Wire name: 'model_name' + ModelName string // Only one of model_version and entity_version should be populated - ModelVersion string `json:"model_version,omitempty"` + // Wire name: 'model_version' + ModelVersion string - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServedModelSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedModelSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedModelSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedModelSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedModelSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedModelSpec) MarshalJSON() ([]byte, error) { + pb, err := servedModelSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedModelState struct { - Deployment ServedModelStateDeployment `json:"deployment,omitempty"` - DeploymentStateMessage string `json:"deployment_state_message,omitempty"` + // Wire name: 'deployment' + Deployment ServedModelStateDeployment - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'deployment_state_message' + DeploymentStateMessage string + + ForceSendFields []string `tf:"-"` } -func (s *ServedModelState) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServedModelState) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servedModelStatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servedModelStateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServedModelState) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServedModelState) MarshalJSON() ([]byte, error) { + pb, err := servedModelStateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServedModelStateDeployment string +type servedModelStateDeploymentPb string const ServedModelStateDeploymentAborted ServedModelStateDeployment = `DEPLOYMENT_ABORTED` @@ -1974,144 +4057,291 @@ func (f *ServedModelStateDeployment) Type() string { return "ServedModelStateDeployment" } +func servedModelStateDeploymentToPb(st *ServedModelStateDeployment) (*servedModelStateDeploymentPb, error) { + if st == nil { + return nil, nil + } + pb := servedModelStateDeploymentPb(*st) + return &pb, nil +} + +func servedModelStateDeploymentFromPb(pb *servedModelStateDeploymentPb) (*ServedModelStateDeployment, error) { + if pb == nil { + return nil, nil + } + st := ServedModelStateDeployment(*pb) + return &st, nil +} + type ServerLogsResponse struct { // The most recent log lines of the model server processing invocation // requests. - Logs string `json:"logs"` + // Wire name: 'logs' + Logs string +} + +func (st *ServerLogsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &serverLogsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := serverLogsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ServerLogsResponse) MarshalJSON() ([]byte, error) { + pb, err := serverLogsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpoint struct { // The AI Gateway configuration for the serving endpoint. NOTE: External // model, provisioned throughput, and pay-per-token endpoints are fully // supported; agent endpoints currently only support inference tables. - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + // Wire name: 'ai_gateway' + AiGateway *AiGatewayConfig // The budget policy associated with the endpoint. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // The config that is currently being served by the endpoint. - Config *EndpointCoreConfigSummary `json:"config,omitempty"` + // Wire name: 'config' + Config *EndpointCoreConfigSummary // The timestamp when the endpoint was created in Unix time. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // The email of the user who created the serving endpoint. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // System-generated ID of the endpoint, included to be used by the // Permissions API. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // The name of the serving endpoint. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Information corresponding to the state of the serving endpoint. - State *EndpointState `json:"state,omitempty"` + // Wire name: 'state' + State *EndpointState // Tags attached to the serving endpoint. - Tags []EndpointTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []EndpointTag // The task type of the serving endpoint. - Task string `json:"task,omitempty"` + // Wire name: 'task' + Task string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpoint) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpoint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpoint) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpoint) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ServingEndpointPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointAccessControlResponse struct { // All permissions. - AllPermissions []ServingEndpointPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []ServingEndpointPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointDetailed struct { // The AI Gateway configuration for the serving endpoint. NOTE: External // model, provisioned throughput, and pay-per-token endpoints are fully // supported; agent endpoints currently only support inference tables. - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + // Wire name: 'ai_gateway' + AiGateway *AiGatewayConfig // The budget policy associated with the endpoint. - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // The config that is currently being served by the endpoint. - Config *EndpointCoreConfigOutput `json:"config,omitempty"` + // Wire name: 'config' + Config *EndpointCoreConfigOutput // The timestamp when the endpoint was created in Unix time. - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // The email of the user who created the serving endpoint. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // Information required to query DataPlane APIs. - DataPlaneInfo *ModelDataPlaneInfo `json:"data_plane_info,omitempty"` + // Wire name: 'data_plane_info' + DataPlaneInfo *ModelDataPlaneInfo // Endpoint invocation url if route optimization is enabled for endpoint - EndpointUrl string `json:"endpoint_url,omitempty"` + // Wire name: 'endpoint_url' + EndpointUrl string // System-generated ID of the endpoint. This is used to refer to the // endpoint in the Permissions API - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // The name of the serving endpoint. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The config that the endpoint is attempting to update to. - PendingConfig *EndpointPendingConfig `json:"pending_config,omitempty"` + // Wire name: 'pending_config' + PendingConfig *EndpointPendingConfig // The permission level of the principal making the request. - PermissionLevel ServingEndpointDetailedPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ServingEndpointDetailedPermissionLevel // Boolean representing if route optimization has been enabled for the // endpoint - RouteOptimized bool `json:"route_optimized,omitempty"` + // Wire name: 'route_optimized' + RouteOptimized bool // Information corresponding to the state of the serving endpoint. - State *EndpointState `json:"state,omitempty"` + // Wire name: 'state' + State *EndpointState // Tags attached to the serving endpoint. - Tags []EndpointTag `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []EndpointTag // The task type of the serving endpoint. - Task string `json:"task,omitempty"` + // Wire name: 'task' + Task string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointDetailed) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointDetailed) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointDetailedPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointDetailedFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointDetailed) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointDetailed) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointDetailedToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointDetailedPermissionLevel string +type servingEndpointDetailedPermissionLevelPb string const ServingEndpointDetailedPermissionLevelCanManage ServingEndpointDetailedPermissionLevel = `CAN_MANAGE` @@ -2140,26 +4370,64 @@ func (f *ServingEndpointDetailedPermissionLevel) Type() string { return "ServingEndpointDetailedPermissionLevel" } +func servingEndpointDetailedPermissionLevelToPb(st *ServingEndpointDetailedPermissionLevel) (*servingEndpointDetailedPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := servingEndpointDetailedPermissionLevelPb(*st) + return &pb, nil +} + +func servingEndpointDetailedPermissionLevelFromPb(pb *servingEndpointDetailedPermissionLevelPb) (*ServingEndpointDetailedPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := ServingEndpointDetailedPermissionLevel(*pb) + return &st, nil +} + type ServingEndpointPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ServingEndpointPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointPermission) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type ServingEndpointPermissionLevel string +type servingEndpointPermissionLevelPb string const ServingEndpointPermissionLevelCanManage ServingEndpointPermissionLevel = `CAN_MANAGE` @@ -2188,49 +4456,135 @@ func (f *ServingEndpointPermissionLevel) Type() string { return "ServingEndpointPermissionLevel" } +func servingEndpointPermissionLevelToPb(st *ServingEndpointPermissionLevel) (*servingEndpointPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := servingEndpointPermissionLevelPb(*st) + return &pb, nil +} + +func servingEndpointPermissionLevelFromPb(pb *servingEndpointPermissionLevelPb) (*ServingEndpointPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := ServingEndpointPermissionLevel(*pb) + return &st, nil +} + type ServingEndpointPermissions struct { - AccessControlList []ServingEndpointAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []ServingEndpointAccessControlResponse - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_id' + ObjectId string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'object_type' + ObjectType string + + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointPermissions) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel ServingEndpointPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServingEndpointPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServingEndpointPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServingEndpointPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServingEndpointPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServingEndpointPermissionsRequest struct { - AccessControlList []ServingEndpointAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []ServingEndpointAccessControlRequest // The serving endpoint for which to get or manage permissions. - ServingEndpointId string `json:"-" url:"-"` + // Wire name: 'serving_endpoint_id' + ServingEndpointId string `tf:"-"` +} + +func (st *ServingEndpointPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &servingEndpointPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := servingEndpointPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ServingEndpointPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := servingEndpointPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Please keep this in sync with with workload types in // InferenceEndpointEntities.scala type ServingModelWorkloadType string +type servingModelWorkloadTypePb string const ServingModelWorkloadTypeCpu ServingModelWorkloadType = `CPU` @@ -2263,36 +4617,182 @@ func (f *ServingModelWorkloadType) Type() string { return "ServingModelWorkloadType" } +func servingModelWorkloadTypeToPb(st *ServingModelWorkloadType) (*servingModelWorkloadTypePb, error) { + if st == nil { + return nil, nil + } + pb := servingModelWorkloadTypePb(*st) + return &pb, nil +} + +func servingModelWorkloadTypeFromPb(pb *servingModelWorkloadTypePb) (*ServingModelWorkloadType, error) { + if pb == nil { + return nil, nil + } + st := ServingModelWorkloadType(*pb) + return &st, nil +} + type TrafficConfig struct { // The list of routes that define traffic to each served entity. - Routes []Route `json:"routes,omitempty"` + // Wire name: 'routes' + Routes []Route +} + +func (st *TrafficConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trafficConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trafficConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrafficConfig) MarshalJSON() ([]byte, error) { + pb, err := trafficConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProvisionedThroughputEndpointConfigRequest struct { - Config PtEndpointCoreConfig `json:"config"` + + // Wire name: 'config' + Config PtEndpointCoreConfig // The name of the pt endpoint to update. This field is required. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *UpdateProvisionedThroughputEndpointConfigRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProvisionedThroughputEndpointConfigRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProvisionedThroughputEndpointConfigRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateProvisionedThroughputEndpointConfigRequest) MarshalJSON() ([]byte, error) { + pb, err := updateProvisionedThroughputEndpointConfigRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type V1ResponseChoiceElement struct { // The finish reason returned by the endpoint. - FinishReason string `json:"finishReason,omitempty"` + // Wire name: 'finishReason' + FinishReason string // The index of the choice in the __chat or completions__ response. - Index int `json:"index,omitempty"` + // Wire name: 'index' + Index int // The logprobs returned only by the __completions__ endpoint. - Logprobs int `json:"logprobs,omitempty"` + // Wire name: 'logprobs' + Logprobs int // The message response from the __chat__ endpoint. - Message *ChatMessage `json:"message,omitempty"` + // Wire name: 'message' + Message *ChatMessage // The text response from the __completions__ endpoint. - Text string `json:"text,omitempty"` + // Wire name: 'text' + Text string + + ForceSendFields []string `tf:"-"` +} + +func (st *V1ResponseChoiceElement) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &v1ResponseChoiceElementPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := v1ResponseChoiceElementFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st V1ResponseChoiceElement) MarshalJSON() ([]byte, error) { + pb, err := v1ResponseChoiceElementToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} - ForceSendFields []string `json:"-" url:"-"` +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil } -func (s *V1ResponseChoiceElement) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil } -func (s V1ResponseChoiceElement) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/settings/impl.go b/service/settings/impl.go index 7a7db6444..7510feadb 100755 --- a/service/settings/impl.go +++ b/service/settings/impl.go @@ -18,33 +18,95 @@ type accountIpAccessListsImpl struct { } func (a *accountIpAccessListsImpl) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) { - var createIpAccessListResponse CreateIpAccessListResponse + + requestPb, pbErr := createIpAccessListToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createIpAccessListResponsePb createIpAccessListResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createIpAccessListResponse) - return &createIpAccessListResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createIpAccessListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createIpAccessListResponseFromPb(&createIpAccessListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountIpAccessListsImpl) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) - queryParams := make(map[string]any) - headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + + requestPb, pbErr := deleteAccountIpAccessListRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), requestPb.IpAccessListId) + queryParams := make(map[string]any) + headers := make(map[string]string) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountIpAccessListsImpl) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error) { - var getIpAccessListResponse GetIpAccessListResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + + requestPb, pbErr := getAccountIpAccessListRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getIpAccessListResponsePb getIpAccessListResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getIpAccessListResponse) - return &getIpAccessListResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getIpAccessListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getIpAccessListResponseFromPb(&getIpAccessListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get access lists. @@ -78,32 +140,85 @@ func (a *accountIpAccessListsImpl) ListAll(ctx context.Context) ([]IpAccessListI } func (a *accountIpAccessListsImpl) internalList(ctx context.Context) (*GetIpAccessListsResponse, error) { - var getIpAccessListsResponse GetIpAccessListsResponse + + var getIpAccessListsResponsePb getIpAccessListsResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists", a.client.ConfiguredAccountID()) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getIpAccessListsResponse) - return &getIpAccessListsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getIpAccessListsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getIpAccessListsResponseFromPb(&getIpAccessListsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *accountIpAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { - var replaceResponse ReplaceResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + + requestPb, pbErr := replaceIpAccessListToPb(&request) + if pbErr != nil { + return pbErr + } + + var replaceResponsePb replaceResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &replaceResponsePb, + ) + if err != nil { + return err + } + return err } func (a *accountIpAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + + requestPb, pbErr := updateIpAccessListToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -118,34 +233,100 @@ type aibiDashboardEmbeddingAccessPolicyImpl struct { } func (a *aibiDashboardEmbeddingAccessPolicyImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) { - var deleteAibiDashboardEmbeddingAccessPolicySettingResponse DeleteAibiDashboardEmbeddingAccessPolicySettingResponse + + requestPb, pbErr := deleteAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAibiDashboardEmbeddingAccessPolicySettingResponse) - return &deleteAibiDashboardEmbeddingAccessPolicySettingResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteAibiDashboardEmbeddingAccessPolicySettingResponseFromPb(&deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *aibiDashboardEmbeddingAccessPolicyImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingAccessPolicySettingRequest) (*AibiDashboardEmbeddingAccessPolicySetting, error) { - var aibiDashboardEmbeddingAccessPolicySetting AibiDashboardEmbeddingAccessPolicySetting + + requestPb, pbErr := getAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var aibiDashboardEmbeddingAccessPolicySettingPb aibiDashboardEmbeddingAccessPolicySettingPb path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aibiDashboardEmbeddingAccessPolicySetting) - return &aibiDashboardEmbeddingAccessPolicySetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &aibiDashboardEmbeddingAccessPolicySettingPb, + ) + if err != nil { + return nil, err + } + resp, err := aibiDashboardEmbeddingAccessPolicySettingFromPb(&aibiDashboardEmbeddingAccessPolicySettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *aibiDashboardEmbeddingAccessPolicyImpl) Update(ctx context.Context, request UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) (*AibiDashboardEmbeddingAccessPolicySetting, error) { - var aibiDashboardEmbeddingAccessPolicySetting AibiDashboardEmbeddingAccessPolicySetting + + requestPb, pbErr := updateAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var aibiDashboardEmbeddingAccessPolicySettingPb aibiDashboardEmbeddingAccessPolicySettingPb path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &aibiDashboardEmbeddingAccessPolicySetting) - return &aibiDashboardEmbeddingAccessPolicySetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &aibiDashboardEmbeddingAccessPolicySettingPb, + ) + if err != nil { + return nil, err + } + resp, err := aibiDashboardEmbeddingAccessPolicySettingFromPb(&aibiDashboardEmbeddingAccessPolicySettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AibiDashboardEmbeddingApprovedDomains API methods @@ -154,34 +335,100 @@ type aibiDashboardEmbeddingApprovedDomainsImpl struct { } func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) { - var deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse + + requestPb, pbErr := deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) - return &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteAibiDashboardEmbeddingApprovedDomainsSettingResponseFromPb(&deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { - var aibiDashboardEmbeddingApprovedDomainsSetting AibiDashboardEmbeddingApprovedDomainsSetting + + requestPb, pbErr := getAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var aibiDashboardEmbeddingApprovedDomainsSettingPb aibiDashboardEmbeddingApprovedDomainsSettingPb path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aibiDashboardEmbeddingApprovedDomainsSetting) - return &aibiDashboardEmbeddingApprovedDomainsSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &aibiDashboardEmbeddingApprovedDomainsSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := aibiDashboardEmbeddingApprovedDomainsSettingFromPb(&aibiDashboardEmbeddingApprovedDomainsSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Update(ctx context.Context, request UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { - var aibiDashboardEmbeddingApprovedDomainsSetting AibiDashboardEmbeddingApprovedDomainsSetting + + requestPb, pbErr := updateAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var aibiDashboardEmbeddingApprovedDomainsSettingPb aibiDashboardEmbeddingApprovedDomainsSettingPb path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &aibiDashboardEmbeddingApprovedDomainsSetting) - return &aibiDashboardEmbeddingApprovedDomainsSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &aibiDashboardEmbeddingApprovedDomainsSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := aibiDashboardEmbeddingApprovedDomainsSettingFromPb(&aibiDashboardEmbeddingApprovedDomainsSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AutomaticClusterUpdate API methods @@ -190,24 +437,68 @@ type automaticClusterUpdateImpl struct { } func (a *automaticClusterUpdateImpl) Get(ctx context.Context, request GetAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error) { - var automaticClusterUpdateSetting AutomaticClusterUpdateSetting + + requestPb, pbErr := getAutomaticClusterUpdateSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var automaticClusterUpdateSettingPb automaticClusterUpdateSettingPb path := "/api/2.0/settings/types/automatic_cluster_update/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &automaticClusterUpdateSetting) - return &automaticClusterUpdateSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &automaticClusterUpdateSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := automaticClusterUpdateSettingFromPb(&automaticClusterUpdateSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *automaticClusterUpdateImpl) Update(ctx context.Context, request UpdateAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error) { - var automaticClusterUpdateSetting AutomaticClusterUpdateSetting + + requestPb, pbErr := updateAutomaticClusterUpdateSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var automaticClusterUpdateSettingPb automaticClusterUpdateSettingPb path := "/api/2.0/settings/types/automatic_cluster_update/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &automaticClusterUpdateSetting) - return &automaticClusterUpdateSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &automaticClusterUpdateSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := automaticClusterUpdateSettingFromPb(&automaticClusterUpdateSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just ComplianceSecurityProfile API methods @@ -216,24 +507,68 @@ type complianceSecurityProfileImpl struct { } func (a *complianceSecurityProfileImpl) Get(ctx context.Context, request GetComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error) { - var complianceSecurityProfileSetting ComplianceSecurityProfileSetting + + requestPb, pbErr := getComplianceSecurityProfileSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var complianceSecurityProfileSettingPb complianceSecurityProfileSettingPb path := "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &complianceSecurityProfileSetting) - return &complianceSecurityProfileSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &complianceSecurityProfileSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := complianceSecurityProfileSettingFromPb(&complianceSecurityProfileSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *complianceSecurityProfileImpl) Update(ctx context.Context, request UpdateComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error) { - var complianceSecurityProfileSetting ComplianceSecurityProfileSetting + + requestPb, pbErr := updateComplianceSecurityProfileSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var complianceSecurityProfileSettingPb complianceSecurityProfileSettingPb path := "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &complianceSecurityProfileSetting) - return &complianceSecurityProfileSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &complianceSecurityProfileSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := complianceSecurityProfileSettingFromPb(&complianceSecurityProfileSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CredentialsManager API methods @@ -242,14 +577,36 @@ type credentialsManagerImpl struct { } func (a *credentialsManagerImpl) ExchangeToken(ctx context.Context, request ExchangeTokenRequest) (*ExchangeTokenResponse, error) { - var exchangeTokenResponse ExchangeTokenResponse + + requestPb, pbErr := exchangeTokenRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var exchangeTokenResponsePb exchangeTokenResponsePb path := "/api/2.0/credentials-manager/exchange-tokens/token" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &exchangeTokenResponse) - return &exchangeTokenResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &exchangeTokenResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := exchangeTokenResponseFromPb(&exchangeTokenResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just CspEnablementAccount API methods @@ -258,24 +615,68 @@ type cspEnablementAccountImpl struct { } func (a *cspEnablementAccountImpl) Get(ctx context.Context, request GetCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error) { - var cspEnablementAccountSetting CspEnablementAccountSetting + + requestPb, pbErr := getCspEnablementAccountSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cspEnablementAccountSettingPb cspEnablementAccountSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_csp_enablement_ac/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cspEnablementAccountSetting) - return &cspEnablementAccountSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &cspEnablementAccountSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := cspEnablementAccountSettingFromPb(&cspEnablementAccountSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *cspEnablementAccountImpl) Update(ctx context.Context, request UpdateCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error) { - var cspEnablementAccountSetting CspEnablementAccountSetting + + requestPb, pbErr := updateCspEnablementAccountSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var cspEnablementAccountSettingPb cspEnablementAccountSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_csp_enablement_ac/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &cspEnablementAccountSetting) - return &cspEnablementAccountSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &cspEnablementAccountSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := cspEnablementAccountSettingFromPb(&cspEnablementAccountSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DefaultNamespace API methods @@ -284,34 +685,100 @@ type defaultNamespaceImpl struct { } func (a *defaultNamespaceImpl) Delete(ctx context.Context, request DeleteDefaultNamespaceSettingRequest) (*DeleteDefaultNamespaceSettingResponse, error) { - var deleteDefaultNamespaceSettingResponse DeleteDefaultNamespaceSettingResponse + + requestPb, pbErr := deleteDefaultNamespaceSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteDefaultNamespaceSettingResponsePb deleteDefaultNamespaceSettingResponsePb path := "/api/2.0/settings/types/default_namespace_ws/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDefaultNamespaceSettingResponse) - return &deleteDefaultNamespaceSettingResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDefaultNamespaceSettingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteDefaultNamespaceSettingResponseFromPb(&deleteDefaultNamespaceSettingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *defaultNamespaceImpl) Get(ctx context.Context, request GetDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error) { - var defaultNamespaceSetting DefaultNamespaceSetting + + requestPb, pbErr := getDefaultNamespaceSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var defaultNamespaceSettingPb defaultNamespaceSettingPb path := "/api/2.0/settings/types/default_namespace_ws/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &defaultNamespaceSetting) - return &defaultNamespaceSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &defaultNamespaceSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := defaultNamespaceSettingFromPb(&defaultNamespaceSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *defaultNamespaceImpl) Update(ctx context.Context, request UpdateDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error) { - var defaultNamespaceSetting DefaultNamespaceSetting + + requestPb, pbErr := updateDefaultNamespaceSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var defaultNamespaceSettingPb defaultNamespaceSettingPb path := "/api/2.0/settings/types/default_namespace_ws/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &defaultNamespaceSetting) - return &defaultNamespaceSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &defaultNamespaceSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := defaultNamespaceSettingFromPb(&defaultNamespaceSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DisableLegacyAccess API methods @@ -320,34 +787,100 @@ type disableLegacyAccessImpl struct { } func (a *disableLegacyAccessImpl) Delete(ctx context.Context, request DeleteDisableLegacyAccessRequest) (*DeleteDisableLegacyAccessResponse, error) { - var deleteDisableLegacyAccessResponse DeleteDisableLegacyAccessResponse + + requestPb, pbErr := deleteDisableLegacyAccessRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteDisableLegacyAccessResponsePb deleteDisableLegacyAccessResponsePb path := "/api/2.0/settings/types/disable_legacy_access/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyAccessResponse) - return &deleteDisableLegacyAccessResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDisableLegacyAccessResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteDisableLegacyAccessResponseFromPb(&deleteDisableLegacyAccessResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyAccessImpl) Get(ctx context.Context, request GetDisableLegacyAccessRequest) (*DisableLegacyAccess, error) { - var disableLegacyAccess DisableLegacyAccess + + requestPb, pbErr := getDisableLegacyAccessRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyAccessPb disableLegacyAccessPb path := "/api/2.0/settings/types/disable_legacy_access/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyAccess) - return &disableLegacyAccess, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyAccessPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyAccessFromPb(&disableLegacyAccessPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyAccessImpl) Update(ctx context.Context, request UpdateDisableLegacyAccessRequest) (*DisableLegacyAccess, error) { - var disableLegacyAccess DisableLegacyAccess + + requestPb, pbErr := updateDisableLegacyAccessRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyAccessPb disableLegacyAccessPb path := "/api/2.0/settings/types/disable_legacy_access/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyAccess) - return &disableLegacyAccess, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyAccessPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyAccessFromPb(&disableLegacyAccessPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DisableLegacyDbfs API methods @@ -356,34 +889,100 @@ type disableLegacyDbfsImpl struct { } func (a *disableLegacyDbfsImpl) Delete(ctx context.Context, request DeleteDisableLegacyDbfsRequest) (*DeleteDisableLegacyDbfsResponse, error) { - var deleteDisableLegacyDbfsResponse DeleteDisableLegacyDbfsResponse + + requestPb, pbErr := deleteDisableLegacyDbfsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteDisableLegacyDbfsResponsePb deleteDisableLegacyDbfsResponsePb path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyDbfsResponse) - return &deleteDisableLegacyDbfsResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDisableLegacyDbfsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteDisableLegacyDbfsResponseFromPb(&deleteDisableLegacyDbfsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyDbfsImpl) Get(ctx context.Context, request GetDisableLegacyDbfsRequest) (*DisableLegacyDbfs, error) { - var disableLegacyDbfs DisableLegacyDbfs + + requestPb, pbErr := getDisableLegacyDbfsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyDbfsPb disableLegacyDbfsPb path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyDbfs) - return &disableLegacyDbfs, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyDbfsPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyDbfsFromPb(&disableLegacyDbfsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyDbfsImpl) Update(ctx context.Context, request UpdateDisableLegacyDbfsRequest) (*DisableLegacyDbfs, error) { - var disableLegacyDbfs DisableLegacyDbfs + + requestPb, pbErr := updateDisableLegacyDbfsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyDbfsPb disableLegacyDbfsPb path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyDbfs) - return &disableLegacyDbfs, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyDbfsPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyDbfsFromPb(&disableLegacyDbfsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DisableLegacyFeatures API methods @@ -392,34 +991,100 @@ type disableLegacyFeaturesImpl struct { } func (a *disableLegacyFeaturesImpl) Delete(ctx context.Context, request DeleteDisableLegacyFeaturesRequest) (*DeleteDisableLegacyFeaturesResponse, error) { - var deleteDisableLegacyFeaturesResponse DeleteDisableLegacyFeaturesResponse + + requestPb, pbErr := deleteDisableLegacyFeaturesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteDisableLegacyFeaturesResponsePb deleteDisableLegacyFeaturesResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyFeaturesResponse) - return &deleteDisableLegacyFeaturesResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDisableLegacyFeaturesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteDisableLegacyFeaturesResponseFromPb(&deleteDisableLegacyFeaturesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyFeaturesImpl) Get(ctx context.Context, request GetDisableLegacyFeaturesRequest) (*DisableLegacyFeatures, error) { - var disableLegacyFeatures DisableLegacyFeatures + + requestPb, pbErr := getDisableLegacyFeaturesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyFeaturesPb disableLegacyFeaturesPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyFeatures) - return &disableLegacyFeatures, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyFeaturesPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyFeaturesFromPb(&disableLegacyFeaturesPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *disableLegacyFeaturesImpl) Update(ctx context.Context, request UpdateDisableLegacyFeaturesRequest) (*DisableLegacyFeatures, error) { - var disableLegacyFeatures DisableLegacyFeatures + + requestPb, pbErr := updateDisableLegacyFeaturesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var disableLegacyFeaturesPb disableLegacyFeaturesPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyFeatures) - return &disableLegacyFeatures, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &disableLegacyFeaturesPb, + ) + if err != nil { + return nil, err + } + resp, err := disableLegacyFeaturesFromPb(&disableLegacyFeaturesPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EnableExportNotebook API methods @@ -428,24 +1093,63 @@ type enableExportNotebookImpl struct { } func (a *enableExportNotebookImpl) GetEnableExportNotebook(ctx context.Context) (*EnableExportNotebook, error) { - var enableExportNotebook EnableExportNotebook + + var enableExportNotebookPb enableExportNotebookPb path := "/api/2.0/settings/types/enable-export-notebook/names/default" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &enableExportNotebook) - return &enableExportNotebook, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &enableExportNotebookPb, + ) + if err != nil { + return nil, err + } + resp, err := enableExportNotebookFromPb(&enableExportNotebookPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enableExportNotebookImpl) PatchEnableExportNotebook(ctx context.Context, request UpdateEnableExportNotebookRequest) (*EnableExportNotebook, error) { - var enableExportNotebook EnableExportNotebook + + requestPb, pbErr := updateEnableExportNotebookRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enableExportNotebookPb enableExportNotebookPb path := "/api/2.0/settings/types/enable-export-notebook/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &enableExportNotebook) - return &enableExportNotebook, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &enableExportNotebookPb, + ) + if err != nil { + return nil, err + } + resp, err := enableExportNotebookFromPb(&enableExportNotebookPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EnableIpAccessLists API methods @@ -454,34 +1158,100 @@ type enableIpAccessListsImpl struct { } func (a *enableIpAccessListsImpl) Delete(ctx context.Context, request DeleteAccountIpAccessEnableRequest) (*DeleteAccountIpAccessEnableResponse, error) { - var deleteAccountIpAccessEnableResponse DeleteAccountIpAccessEnableResponse + + requestPb, pbErr := deleteAccountIpAccessEnableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteAccountIpAccessEnableResponsePb deleteAccountIpAccessEnableResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/acct_ip_acl_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAccountIpAccessEnableResponse) - return &deleteAccountIpAccessEnableResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteAccountIpAccessEnableResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteAccountIpAccessEnableResponseFromPb(&deleteAccountIpAccessEnableResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enableIpAccessListsImpl) Get(ctx context.Context, request GetAccountIpAccessEnableRequest) (*AccountIpAccessEnable, error) { - var accountIpAccessEnable AccountIpAccessEnable + + requestPb, pbErr := getAccountIpAccessEnableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountIpAccessEnablePb accountIpAccessEnablePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/acct_ip_acl_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountIpAccessEnable) - return &accountIpAccessEnable, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &accountIpAccessEnablePb, + ) + if err != nil { + return nil, err + } + resp, err := accountIpAccessEnableFromPb(&accountIpAccessEnablePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enableIpAccessListsImpl) Update(ctx context.Context, request UpdateAccountIpAccessEnableRequest) (*AccountIpAccessEnable, error) { - var accountIpAccessEnable AccountIpAccessEnable + + requestPb, pbErr := updateAccountIpAccessEnableRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountIpAccessEnablePb accountIpAccessEnablePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/acct_ip_acl_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &accountIpAccessEnable) - return &accountIpAccessEnable, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &accountIpAccessEnablePb, + ) + if err != nil { + return nil, err + } + resp, err := accountIpAccessEnableFromPb(&accountIpAccessEnablePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EnableNotebookTableClipboard API methods @@ -490,24 +1260,63 @@ type enableNotebookTableClipboardImpl struct { } func (a *enableNotebookTableClipboardImpl) GetEnableNotebookTableClipboard(ctx context.Context) (*EnableNotebookTableClipboard, error) { - var enableNotebookTableClipboard EnableNotebookTableClipboard + + var enableNotebookTableClipboardPb enableNotebookTableClipboardPb path := "/api/2.0/settings/types/enable-notebook-table-clipboard/names/default" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &enableNotebookTableClipboard) - return &enableNotebookTableClipboard, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &enableNotebookTableClipboardPb, + ) + if err != nil { + return nil, err + } + resp, err := enableNotebookTableClipboardFromPb(&enableNotebookTableClipboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enableNotebookTableClipboardImpl) PatchEnableNotebookTableClipboard(ctx context.Context, request UpdateEnableNotebookTableClipboardRequest) (*EnableNotebookTableClipboard, error) { - var enableNotebookTableClipboard EnableNotebookTableClipboard + + requestPb, pbErr := updateEnableNotebookTableClipboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enableNotebookTableClipboardPb enableNotebookTableClipboardPb path := "/api/2.0/settings/types/enable-notebook-table-clipboard/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &enableNotebookTableClipboard) - return &enableNotebookTableClipboard, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &enableNotebookTableClipboardPb, + ) + if err != nil { + return nil, err + } + resp, err := enableNotebookTableClipboardFromPb(&enableNotebookTableClipboardPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EnableResultsDownloading API methods @@ -516,24 +1325,63 @@ type enableResultsDownloadingImpl struct { } func (a *enableResultsDownloadingImpl) GetEnableResultsDownloading(ctx context.Context) (*EnableResultsDownloading, error) { - var enableResultsDownloading EnableResultsDownloading + + var enableResultsDownloadingPb enableResultsDownloadingPb path := "/api/2.0/settings/types/enable-results-downloading/names/default" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &enableResultsDownloading) - return &enableResultsDownloading, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &enableResultsDownloadingPb, + ) + if err != nil { + return nil, err + } + resp, err := enableResultsDownloadingFromPb(&enableResultsDownloadingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enableResultsDownloadingImpl) PatchEnableResultsDownloading(ctx context.Context, request UpdateEnableResultsDownloadingRequest) (*EnableResultsDownloading, error) { - var enableResultsDownloading EnableResultsDownloading + + requestPb, pbErr := updateEnableResultsDownloadingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enableResultsDownloadingPb enableResultsDownloadingPb path := "/api/2.0/settings/types/enable-results-downloading/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &enableResultsDownloading) - return &enableResultsDownloading, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &enableResultsDownloadingPb, + ) + if err != nil { + return nil, err + } + resp, err := enableResultsDownloadingFromPb(&enableResultsDownloadingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EnhancedSecurityMonitoring API methods @@ -542,24 +1390,68 @@ type enhancedSecurityMonitoringImpl struct { } func (a *enhancedSecurityMonitoringImpl) Get(ctx context.Context, request GetEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error) { - var enhancedSecurityMonitoringSetting EnhancedSecurityMonitoringSetting + + requestPb, pbErr := getEnhancedSecurityMonitoringSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enhancedSecurityMonitoringSettingPb enhancedSecurityMonitoringSettingPb path := "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &enhancedSecurityMonitoringSetting) - return &enhancedSecurityMonitoringSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &enhancedSecurityMonitoringSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := enhancedSecurityMonitoringSettingFromPb(&enhancedSecurityMonitoringSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *enhancedSecurityMonitoringImpl) Update(ctx context.Context, request UpdateEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error) { - var enhancedSecurityMonitoringSetting EnhancedSecurityMonitoringSetting + + requestPb, pbErr := updateEnhancedSecurityMonitoringSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var enhancedSecurityMonitoringSettingPb enhancedSecurityMonitoringSettingPb path := "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &enhancedSecurityMonitoringSetting) - return &enhancedSecurityMonitoringSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &enhancedSecurityMonitoringSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := enhancedSecurityMonitoringSettingFromPb(&enhancedSecurityMonitoringSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just EsmEnablementAccount API methods @@ -568,24 +1460,68 @@ type esmEnablementAccountImpl struct { } func (a *esmEnablementAccountImpl) Get(ctx context.Context, request GetEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error) { - var esmEnablementAccountSetting EsmEnablementAccountSetting + + requestPb, pbErr := getEsmEnablementAccountSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var esmEnablementAccountSettingPb esmEnablementAccountSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_esm_enablement_ac/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &esmEnablementAccountSetting) - return &esmEnablementAccountSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &esmEnablementAccountSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := esmEnablementAccountSettingFromPb(&esmEnablementAccountSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *esmEnablementAccountImpl) Update(ctx context.Context, request UpdateEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error) { - var esmEnablementAccountSetting EsmEnablementAccountSetting + + requestPb, pbErr := updateEsmEnablementAccountSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var esmEnablementAccountSettingPb esmEnablementAccountSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_esm_enablement_ac/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &esmEnablementAccountSetting) - return &esmEnablementAccountSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &esmEnablementAccountSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := esmEnablementAccountSettingFromPb(&esmEnablementAccountSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just IpAccessLists API methods @@ -594,33 +1530,95 @@ type ipAccessListsImpl struct { } func (a *ipAccessListsImpl) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) { - var createIpAccessListResponse CreateIpAccessListResponse + + requestPb, pbErr := createIpAccessListToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createIpAccessListResponsePb createIpAccessListResponsePb path := "/api/2.0/ip-access-lists" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createIpAccessListResponse) - return &createIpAccessListResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createIpAccessListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createIpAccessListResponseFromPb(&createIpAccessListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *ipAccessListsImpl) Delete(ctx context.Context, request DeleteIpAccessListRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) - queryParams := make(map[string]any) - headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + + requestPb, pbErr := deleteIpAccessListRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", requestPb.IpAccessListId) + queryParams := make(map[string]any) + headers := make(map[string]string) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *ipAccessListsImpl) Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error) { - var fetchIpAccessListResponse FetchIpAccessListResponse - path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + + requestPb, pbErr := getIpAccessListRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var fetchIpAccessListResponsePb fetchIpAccessListResponsePb + path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &fetchIpAccessListResponse) - return &fetchIpAccessListResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &fetchIpAccessListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := fetchIpAccessListResponseFromPb(&fetchIpAccessListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get access lists. @@ -654,32 +1652,85 @@ func (a *ipAccessListsImpl) ListAll(ctx context.Context) ([]IpAccessListInfo, er } func (a *ipAccessListsImpl) internalList(ctx context.Context) (*ListIpAccessListResponse, error) { - var listIpAccessListResponse ListIpAccessListResponse + + var listIpAccessListResponsePb listIpAccessListResponsePb path := "/api/2.0/ip-access-lists" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listIpAccessListResponse) - return &listIpAccessListResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listIpAccessListResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listIpAccessListResponseFromPb(&listIpAccessListResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *ipAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { - var replaceResponse ReplaceResponse - path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + + requestPb, pbErr := replaceIpAccessListToPb(&request) + if pbErr != nil { + return pbErr + } + + var replaceResponsePb replaceResponsePb + path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &replaceResponsePb, + ) + if err != nil { + return err + } + return err } func (a *ipAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + + requestPb, pbErr := updateIpAccessListToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", requestPb.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -689,24 +1740,68 @@ type llmProxyPartnerPoweredAccountImpl struct { } func (a *llmProxyPartnerPoweredAccountImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) { - var llmProxyPartnerPoweredAccount LlmProxyPartnerPoweredAccount + + requestPb, pbErr := getLlmProxyPartnerPoweredAccountRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredAccountPb llmProxyPartnerPoweredAccountPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &llmProxyPartnerPoweredAccount) - return &llmProxyPartnerPoweredAccount, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredAccountPb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredAccountFromPb(&llmProxyPartnerPoweredAccountPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *llmProxyPartnerPoweredAccountImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) { - var llmProxyPartnerPoweredAccount LlmProxyPartnerPoweredAccount + + requestPb, pbErr := updateLlmProxyPartnerPoweredAccountRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredAccountPb llmProxyPartnerPoweredAccountPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &llmProxyPartnerPoweredAccount) - return &llmProxyPartnerPoweredAccount, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredAccountPb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredAccountFromPb(&llmProxyPartnerPoweredAccountPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just LlmProxyPartnerPoweredEnforce API methods @@ -715,24 +1810,68 @@ type llmProxyPartnerPoweredEnforceImpl struct { } func (a *llmProxyPartnerPoweredEnforceImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) { - var llmProxyPartnerPoweredEnforce LlmProxyPartnerPoweredEnforce + + requestPb, pbErr := getLlmProxyPartnerPoweredEnforceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredEnforcePb llmProxyPartnerPoweredEnforcePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered_enforce/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &llmProxyPartnerPoweredEnforce) - return &llmProxyPartnerPoweredEnforce, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredEnforcePb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredEnforceFromPb(&llmProxyPartnerPoweredEnforcePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *llmProxyPartnerPoweredEnforceImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) { - var llmProxyPartnerPoweredEnforce LlmProxyPartnerPoweredEnforce + + requestPb, pbErr := updateLlmProxyPartnerPoweredEnforceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredEnforcePb llmProxyPartnerPoweredEnforcePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered_enforce/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &llmProxyPartnerPoweredEnforce) - return &llmProxyPartnerPoweredEnforce, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredEnforcePb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredEnforceFromPb(&llmProxyPartnerPoweredEnforcePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just LlmProxyPartnerPoweredWorkspace API methods @@ -741,34 +1880,100 @@ type llmProxyPartnerPoweredWorkspaceImpl struct { } func (a *llmProxyPartnerPoweredWorkspaceImpl) Delete(ctx context.Context, request DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) { - var deleteLlmProxyPartnerPoweredWorkspaceResponse DeleteLlmProxyPartnerPoweredWorkspaceResponse + + requestPb, pbErr := deleteLlmProxyPartnerPoweredWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteLlmProxyPartnerPoweredWorkspaceResponsePb deleteLlmProxyPartnerPoweredWorkspaceResponsePb path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteLlmProxyPartnerPoweredWorkspaceResponse) - return &deleteLlmProxyPartnerPoweredWorkspaceResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteLlmProxyPartnerPoweredWorkspaceResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteLlmProxyPartnerPoweredWorkspaceResponseFromPb(&deleteLlmProxyPartnerPoweredWorkspaceResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *llmProxyPartnerPoweredWorkspaceImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) { - var llmProxyPartnerPoweredWorkspace LlmProxyPartnerPoweredWorkspace + + requestPb, pbErr := getLlmProxyPartnerPoweredWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredWorkspacePb llmProxyPartnerPoweredWorkspacePb path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &llmProxyPartnerPoweredWorkspace) - return &llmProxyPartnerPoweredWorkspace, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredWorkspacePb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredWorkspaceFromPb(&llmProxyPartnerPoweredWorkspacePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *llmProxyPartnerPoweredWorkspaceImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) { - var llmProxyPartnerPoweredWorkspace LlmProxyPartnerPoweredWorkspace + + requestPb, pbErr := updateLlmProxyPartnerPoweredWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var llmProxyPartnerPoweredWorkspacePb llmProxyPartnerPoweredWorkspacePb path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &llmProxyPartnerPoweredWorkspace) - return &llmProxyPartnerPoweredWorkspace, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &llmProxyPartnerPoweredWorkspacePb, + ) + if err != nil { + return nil, err + } + resp, err := llmProxyPartnerPoweredWorkspaceFromPb(&llmProxyPartnerPoweredWorkspacePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just NetworkConnectivity API methods @@ -777,65 +1982,193 @@ type networkConnectivityImpl struct { } func (a *networkConnectivityImpl) CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error) { - var networkConnectivityConfiguration NetworkConnectivityConfiguration + + requestPb, pbErr := createNetworkConnectivityConfigRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var networkConnectivityConfigurationPb networkConnectivityConfigurationPb path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.NetworkConnectivityConfig, &networkConnectivityConfiguration) - return &networkConnectivityConfiguration, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).NetworkConnectivityConfig, + &networkConnectivityConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := networkConnectivityConfigurationFromPb(&networkConnectivityConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkConnectivityImpl) CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { - var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + + requestPb, pbErr := createPrivateEndpointRuleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var nccAzurePrivateEndpointRulePb nccAzurePrivateEndpointRulePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.PrivateEndpointRule, &nccAzurePrivateEndpointRule) - return &nccAzurePrivateEndpointRule, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).PrivateEndpointRule, + &nccAzurePrivateEndpointRulePb, + ) + if err != nil { + return nil, err + } + resp, err := nccAzurePrivateEndpointRuleFromPb(&nccAzurePrivateEndpointRulePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkConnectivityImpl) DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error { - var deleteNetworkConnectivityConfigurationResponse DeleteNetworkConnectivityConfigurationResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + + requestPb, pbErr := deleteNetworkConnectivityConfigurationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteNetworkConnectivityConfigurationResponsePb deleteNetworkConnectivityConfigurationResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteNetworkConnectivityConfigurationResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteNetworkConnectivityConfigurationResponsePb, + ) + if err != nil { + return err + } + return err } func (a *networkConnectivityImpl) DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { - var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId, request.PrivateEndpointRuleId) + + requestPb, pbErr := deletePrivateEndpointRuleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var nccAzurePrivateEndpointRulePb nccAzurePrivateEndpointRulePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId, requestPb.PrivateEndpointRuleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &nccAzurePrivateEndpointRule) - return &nccAzurePrivateEndpointRule, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &nccAzurePrivateEndpointRulePb, + ) + if err != nil { + return nil, err + } + resp, err := nccAzurePrivateEndpointRuleFromPb(&nccAzurePrivateEndpointRulePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkConnectivityImpl) GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error) { - var networkConnectivityConfiguration NetworkConnectivityConfiguration - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + + requestPb, pbErr := getNetworkConnectivityConfigurationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var networkConnectivityConfigurationPb networkConnectivityConfigurationPb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &networkConnectivityConfiguration) - return &networkConnectivityConfiguration, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &networkConnectivityConfigurationPb, + ) + if err != nil { + return nil, err + } + resp, err := networkConnectivityConfigurationFromPb(&networkConnectivityConfigurationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkConnectivityImpl) GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { - var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId, request.PrivateEndpointRuleId) + + requestPb, pbErr := getPrivateEndpointRuleRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var nccAzurePrivateEndpointRulePb nccAzurePrivateEndpointRulePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId, requestPb.PrivateEndpointRuleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &nccAzurePrivateEndpointRule) - return &nccAzurePrivateEndpointRule, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &nccAzurePrivateEndpointRulePb, + ) + if err != nil { + return nil, err + } + resp, err := nccAzurePrivateEndpointRuleFromPb(&nccAzurePrivateEndpointRulePb) + if err != nil { + return nil, err + } + + return resp, err } // List network connectivity configurations. @@ -874,13 +2207,35 @@ func (a *networkConnectivityImpl) ListNetworkConnectivityConfigurationsAll(ctx c } func (a *networkConnectivityImpl) internalListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) (*ListNetworkConnectivityConfigurationsResponse, error) { - var listNetworkConnectivityConfigurationsResponse ListNetworkConnectivityConfigurationsResponse + + requestPb, pbErr := listNetworkConnectivityConfigurationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listNetworkConnectivityConfigurationsResponsePb listNetworkConnectivityConfigurationsResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNetworkConnectivityConfigurationsResponse) - return &listNetworkConnectivityConfigurationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listNetworkConnectivityConfigurationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listNetworkConnectivityConfigurationsResponseFromPb(&listNetworkConnectivityConfigurationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List private endpoint rules. @@ -919,27 +2274,71 @@ func (a *networkConnectivityImpl) ListPrivateEndpointRulesAll(ctx context.Contex } func (a *networkConnectivityImpl) internalListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) (*ListNccAzurePrivateEndpointRulesResponse, error) { - var listNccAzurePrivateEndpointRulesResponse ListNccAzurePrivateEndpointRulesResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + + requestPb, pbErr := listPrivateEndpointRulesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listNccAzurePrivateEndpointRulesResponsePb listNccAzurePrivateEndpointRulesResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNccAzurePrivateEndpointRulesResponse) - return &listNccAzurePrivateEndpointRulesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listNccAzurePrivateEndpointRulesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listNccAzurePrivateEndpointRulesResponseFromPb(&listNccAzurePrivateEndpointRulesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkConnectivityImpl) UpdateNccAzurePrivateEndpointRulePublic(ctx context.Context, request UpdateNccAzurePrivateEndpointRulePublicRequest) (*NccAzurePrivateEndpointRule, error) { - var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule - path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId, request.PrivateEndpointRuleId) + + requestPb, pbErr := updateNccAzurePrivateEndpointRulePublicRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var nccAzurePrivateEndpointRulePb nccAzurePrivateEndpointRulePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), requestPb.NetworkConnectivityConfigId, requestPb.PrivateEndpointRuleId) queryParams := make(map[string]any) - if request.UpdateMask != "" { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.PrivateEndpointRule, &nccAzurePrivateEndpointRule) - return &nccAzurePrivateEndpointRule, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).PrivateEndpointRule, + &nccAzurePrivateEndpointRulePb, + ) + if err != nil { + return nil, err + } + resp, err := nccAzurePrivateEndpointRuleFromPb(&nccAzurePrivateEndpointRulePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just NetworkPolicies API methods @@ -948,34 +2347,96 @@ type networkPoliciesImpl struct { } func (a *networkPoliciesImpl) CreateNetworkPolicyRpc(ctx context.Context, request CreateNetworkPolicyRequest) (*AccountNetworkPolicy, error) { - var accountNetworkPolicy AccountNetworkPolicy + + requestPb, pbErr := createNetworkPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountNetworkPolicyPb accountNetworkPolicyPb path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.NetworkPolicy, &accountNetworkPolicy) - return &accountNetworkPolicy, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).NetworkPolicy, + &accountNetworkPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := accountNetworkPolicyFromPb(&accountNetworkPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkPoliciesImpl) DeleteNetworkPolicyRpc(ctx context.Context, request DeleteNetworkPolicyRequest) error { - var deleteNetworkPolicyRpcResponse DeleteNetworkPolicyRpcResponse - path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), request.NetworkPolicyId) + + requestPb, pbErr := deleteNetworkPolicyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteNetworkPolicyRpcResponsePb deleteNetworkPolicyRpcResponsePb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), requestPb.NetworkPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteNetworkPolicyRpcResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteNetworkPolicyRpcResponsePb, + ) + if err != nil { + return err + } + return err } func (a *networkPoliciesImpl) GetNetworkPolicyRpc(ctx context.Context, request GetNetworkPolicyRequest) (*AccountNetworkPolicy, error) { - var accountNetworkPolicy AccountNetworkPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), request.NetworkPolicyId) + + requestPb, pbErr := getNetworkPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountNetworkPolicyPb accountNetworkPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), requestPb.NetworkPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountNetworkPolicy) - return &accountNetworkPolicy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &accountNetworkPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := accountNetworkPolicyFromPb(&accountNetworkPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // List network policies. @@ -1014,24 +2475,68 @@ func (a *networkPoliciesImpl) ListNetworkPoliciesRpcAll(ctx context.Context, req } func (a *networkPoliciesImpl) internalListNetworkPoliciesRpc(ctx context.Context, request ListNetworkPoliciesRequest) (*ListNetworkPoliciesResponse, error) { - var listNetworkPoliciesResponse ListNetworkPoliciesResponse + + requestPb, pbErr := listNetworkPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listNetworkPoliciesResponsePb listNetworkPoliciesResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNetworkPoliciesResponse) - return &listNetworkPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listNetworkPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listNetworkPoliciesResponseFromPb(&listNetworkPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *networkPoliciesImpl) UpdateNetworkPolicyRpc(ctx context.Context, request UpdateNetworkPolicyRequest) (*AccountNetworkPolicy, error) { - var accountNetworkPolicy AccountNetworkPolicy - path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), request.NetworkPolicyId) + + requestPb, pbErr := updateNetworkPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var accountNetworkPolicyPb accountNetworkPolicyPb + path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), requestPb.NetworkPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.NetworkPolicy, &accountNetworkPolicy) - return &accountNetworkPolicy, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb).NetworkPolicy, + &accountNetworkPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := accountNetworkPolicyFromPb(&accountNetworkPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just NotificationDestinations API methods @@ -1040,34 +2545,96 @@ type notificationDestinationsImpl struct { } func (a *notificationDestinationsImpl) Create(ctx context.Context, request CreateNotificationDestinationRequest) (*NotificationDestination, error) { - var notificationDestination NotificationDestination + + requestPb, pbErr := createNotificationDestinationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var notificationDestinationPb notificationDestinationPb path := "/api/2.0/notification-destinations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ¬ificationDestination) - return ¬ificationDestination, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + ¬ificationDestinationPb, + ) + if err != nil { + return nil, err + } + resp, err := notificationDestinationFromPb(¬ificationDestinationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *notificationDestinationsImpl) Delete(ctx context.Context, request DeleteNotificationDestinationRequest) error { - var empty Empty - path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + + requestPb, pbErr := deleteNotificationDestinationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var emptyPb emptyPb + path := fmt.Sprintf("/api/2.0/notification-destinations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &emptyPb, + ) + if err != nil { + return err + } + return err } func (a *notificationDestinationsImpl) Get(ctx context.Context, request GetNotificationDestinationRequest) (*NotificationDestination, error) { - var notificationDestination NotificationDestination - path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + + requestPb, pbErr := getNotificationDestinationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var notificationDestinationPb notificationDestinationPb + path := fmt.Sprintf("/api/2.0/notification-destinations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ¬ificationDestination) - return ¬ificationDestination, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + ¬ificationDestinationPb, + ) + if err != nil { + return nil, err + } + resp, err := notificationDestinationFromPb(¬ificationDestinationPb) + if err != nil { + return nil, err + } + + return resp, err } // List notification destinations. @@ -1106,24 +2673,68 @@ func (a *notificationDestinationsImpl) ListAll(ctx context.Context, request List } func (a *notificationDestinationsImpl) internalList(ctx context.Context, request ListNotificationDestinationsRequest) (*ListNotificationDestinationsResponse, error) { - var listNotificationDestinationsResponse ListNotificationDestinationsResponse + + requestPb, pbErr := listNotificationDestinationsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listNotificationDestinationsResponsePb listNotificationDestinationsResponsePb path := "/api/2.0/notification-destinations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNotificationDestinationsResponse) - return &listNotificationDestinationsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listNotificationDestinationsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listNotificationDestinationsResponseFromPb(&listNotificationDestinationsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *notificationDestinationsImpl) Update(ctx context.Context, request UpdateNotificationDestinationRequest) (*NotificationDestination, error) { - var notificationDestination NotificationDestination - path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + + requestPb, pbErr := updateNotificationDestinationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var notificationDestinationPb notificationDestinationPb + path := fmt.Sprintf("/api/2.0/notification-destinations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ¬ificationDestination) - return ¬ificationDestination, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + ¬ificationDestinationPb, + ) + if err != nil { + return nil, err + } + resp, err := notificationDestinationFromPb(¬ificationDestinationPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just PersonalCompute API methods @@ -1132,34 +2743,100 @@ type personalComputeImpl struct { } func (a *personalComputeImpl) Delete(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error) { - var deletePersonalComputeSettingResponse DeletePersonalComputeSettingResponse + + requestPb, pbErr := deletePersonalComputeSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deletePersonalComputeSettingResponsePb deletePersonalComputeSettingResponsePb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePersonalComputeSettingResponse) - return &deletePersonalComputeSettingResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deletePersonalComputeSettingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deletePersonalComputeSettingResponseFromPb(&deletePersonalComputeSettingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *personalComputeImpl) Get(ctx context.Context, request GetPersonalComputeSettingRequest) (*PersonalComputeSetting, error) { - var personalComputeSetting PersonalComputeSetting + + requestPb, pbErr := getPersonalComputeSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var personalComputeSettingPb personalComputeSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &personalComputeSetting) - return &personalComputeSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &personalComputeSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := personalComputeSettingFromPb(&personalComputeSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *personalComputeImpl) Update(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error) { - var personalComputeSetting PersonalComputeSetting + + requestPb, pbErr := updatePersonalComputeSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var personalComputeSettingPb personalComputeSettingPb path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &personalComputeSetting) - return &personalComputeSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &personalComputeSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := personalComputeSettingFromPb(&personalComputeSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just RestrictWorkspaceAdmins API methods @@ -1168,34 +2845,100 @@ type restrictWorkspaceAdminsImpl struct { } func (a *restrictWorkspaceAdminsImpl) Delete(ctx context.Context, request DeleteRestrictWorkspaceAdminsSettingRequest) (*DeleteRestrictWorkspaceAdminsSettingResponse, error) { - var deleteRestrictWorkspaceAdminsSettingResponse DeleteRestrictWorkspaceAdminsSettingResponse + + requestPb, pbErr := deleteRestrictWorkspaceAdminsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteRestrictWorkspaceAdminsSettingResponsePb deleteRestrictWorkspaceAdminsSettingResponsePb path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteRestrictWorkspaceAdminsSettingResponse) - return &deleteRestrictWorkspaceAdminsSettingResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteRestrictWorkspaceAdminsSettingResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteRestrictWorkspaceAdminsSettingResponseFromPb(&deleteRestrictWorkspaceAdminsSettingResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *restrictWorkspaceAdminsImpl) Get(ctx context.Context, request GetRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error) { - var restrictWorkspaceAdminsSetting RestrictWorkspaceAdminsSetting + + requestPb, pbErr := getRestrictWorkspaceAdminsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var restrictWorkspaceAdminsSettingPb restrictWorkspaceAdminsSettingPb path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &restrictWorkspaceAdminsSetting) - return &restrictWorkspaceAdminsSetting, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &restrictWorkspaceAdminsSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := restrictWorkspaceAdminsSettingFromPb(&restrictWorkspaceAdminsSettingPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *restrictWorkspaceAdminsImpl) Update(ctx context.Context, request UpdateRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error) { - var restrictWorkspaceAdminsSetting RestrictWorkspaceAdminsSetting + + requestPb, pbErr := updateRestrictWorkspaceAdminsSettingRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var restrictWorkspaceAdminsSettingPb restrictWorkspaceAdminsSettingPb path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &restrictWorkspaceAdminsSetting) - return &restrictWorkspaceAdminsSetting, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &restrictWorkspaceAdminsSettingPb, + ) + if err != nil { + return nil, err + } + resp, err := restrictWorkspaceAdminsSettingFromPb(&restrictWorkspaceAdminsSettingPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Settings API methods @@ -1209,53 +2952,149 @@ type tokenManagementImpl struct { } func (a *tokenManagementImpl) CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error) { - var createOboTokenResponse CreateOboTokenResponse + + requestPb, pbErr := createOboTokenRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createOboTokenResponsePb createOboTokenResponsePb path := "/api/2.0/token-management/on-behalf-of/tokens" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createOboTokenResponse) - return &createOboTokenResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createOboTokenResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createOboTokenResponseFromPb(&createOboTokenResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokenManagementImpl) Delete(ctx context.Context, request DeleteTokenManagementRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", request.TokenId) - queryParams := make(map[string]any) - headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + + requestPb, pbErr := deleteTokenManagementRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", requestPb.TokenId) + queryParams := make(map[string]any) + headers := make(map[string]string) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *tokenManagementImpl) Get(ctx context.Context, request GetTokenManagementRequest) (*GetTokenResponse, error) { - var getTokenResponse GetTokenResponse - path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", request.TokenId) + + requestPb, pbErr := getTokenManagementRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getTokenResponsePb getTokenResponsePb + path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", requestPb.TokenId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getTokenResponse) - return &getTokenResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getTokenResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getTokenResponseFromPb(&getTokenResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokenManagementImpl) GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error) { - var getTokenPermissionLevelsResponse GetTokenPermissionLevelsResponse + + var getTokenPermissionLevelsResponsePb getTokenPermissionLevelsResponsePb path := "/api/2.0/permissions/authorization/tokens/permissionLevels" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getTokenPermissionLevelsResponse) - return &getTokenPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getTokenPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getTokenPermissionLevelsResponseFromPb(&getTokenPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokenManagementImpl) GetPermissions(ctx context.Context) (*TokenPermissions, error) { - var tokenPermissions TokenPermissions + + var tokenPermissionsPb tokenPermissionsPb path := "/api/2.0/permissions/authorization/tokens" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &tokenPermissions) - return &tokenPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &tokenPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := tokenPermissionsFromPb(&tokenPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // List all tokens. @@ -1288,35 +3127,101 @@ func (a *tokenManagementImpl) ListAll(ctx context.Context, request ListTokenMana } func (a *tokenManagementImpl) internalList(ctx context.Context, request ListTokenManagementRequest) (*ListTokensResponse, error) { - var listTokensResponse ListTokensResponse + + requestPb, pbErr := listTokenManagementRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listTokensResponsePb listTokensResponsePb path := "/api/2.0/token-management/tokens" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTokensResponse) - return &listTokensResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listTokensResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listTokensResponseFromPb(&listTokensResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokenManagementImpl) SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error) { - var tokenPermissions TokenPermissions + + requestPb, pbErr := tokenPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var tokenPermissionsPb tokenPermissionsPb path := "/api/2.0/permissions/authorization/tokens" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &tokenPermissions) - return &tokenPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &tokenPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := tokenPermissionsFromPb(&tokenPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokenManagementImpl) UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error) { - var tokenPermissions TokenPermissions + + requestPb, pbErr := tokenPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var tokenPermissionsPb tokenPermissionsPb path := "/api/2.0/permissions/authorization/tokens" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &tokenPermissions) - return &tokenPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &tokenPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := tokenPermissionsFromPb(&tokenPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Tokens API methods @@ -1325,24 +3230,64 @@ type tokensImpl struct { } func (a *tokensImpl) Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error) { - var createTokenResponse CreateTokenResponse + + requestPb, pbErr := createTokenRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createTokenResponsePb createTokenResponsePb path := "/api/2.0/token/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createTokenResponse) - return &createTokenResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createTokenResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createTokenResponseFromPb(&createTokenResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *tokensImpl) Delete(ctx context.Context, request RevokeTokenRequest) error { - var revokeTokenResponse RevokeTokenResponse + + requestPb, pbErr := revokeTokenRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var revokeTokenResponsePb revokeTokenResponsePb path := "/api/2.0/token/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &revokeTokenResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &revokeTokenResponsePb, + ) + if err != nil { + return err + } + return err } @@ -1377,13 +3322,30 @@ func (a *tokensImpl) ListAll(ctx context.Context) ([]PublicTokenInfo, error) { } func (a *tokensImpl) internalList(ctx context.Context) (*ListPublicTokensResponse, error) { - var listPublicTokensResponse ListPublicTokensResponse + + var listPublicTokensResponsePb listPublicTokensResponsePb path := "/api/2.0/token/list" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listPublicTokensResponse) - return &listPublicTokensResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listPublicTokensResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listPublicTokensResponseFromPb(&listPublicTokensResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just WorkspaceConf API methods @@ -1392,22 +3354,59 @@ type workspaceConfImpl struct { } func (a *workspaceConfImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error) { - var workspaceConf map[string]string + + requestPb, pbErr := getStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceConfPb map[string]string path := "/api/2.0/workspace-conf" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceConf) - return &workspaceConf, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &workspaceConfPb, + ) + if err != nil { + return nil, err + } + resp := &workspaceConfPb + + return resp, err } func (a *workspaceConfImpl) SetStatus(ctx context.Context, request WorkspaceConf) error { - var setStatusResponse SetStatusResponse + + requestPb, pbErr := workspaceConfToPb(&request) + if pbErr != nil { + return pbErr + } + + var setStatusResponsePb setStatusResponsePb path := "/api/2.0/workspace-conf" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &setStatusResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &setStatusResponsePb, + ) + if err != nil { + return err + } + return err } @@ -1417,22 +3416,66 @@ type workspaceNetworkConfigurationImpl struct { } func (a *workspaceNetworkConfigurationImpl) GetWorkspaceNetworkOptionRpc(ctx context.Context, request GetWorkspaceNetworkOptionRequest) (*WorkspaceNetworkOption, error) { - var workspaceNetworkOption WorkspaceNetworkOption - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/network", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := getWorkspaceNetworkOptionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceNetworkOptionPb workspaceNetworkOptionPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/network", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceNetworkOption) - return &workspaceNetworkOption, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &workspaceNetworkOptionPb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceNetworkOptionFromPb(&workspaceNetworkOptionPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceNetworkConfigurationImpl) UpdateWorkspaceNetworkOptionRpc(ctx context.Context, request UpdateWorkspaceNetworkOptionRequest) (*WorkspaceNetworkOption, error) { - var workspaceNetworkOption WorkspaceNetworkOption - path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/network", a.client.ConfiguredAccountID(), request.WorkspaceId) + + requestPb, pbErr := updateWorkspaceNetworkOptionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceNetworkOptionPb workspaceNetworkOptionPb + path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/network", a.client.ConfiguredAccountID(), requestPb.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.WorkspaceNetworkOption, &workspaceNetworkOption) - return &workspaceNetworkOption, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb).WorkspaceNetworkOption, + &workspaceNetworkOptionPb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceNetworkOptionFromPb(&workspaceNetworkOptionPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/settings/internal.go b/service/settings/internal.go new file mode 100755 index 000000000..2865f211d --- /dev/null +++ b/service/settings/internal.go @@ -0,0 +1,6911 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package settings + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func accountIpAccessEnableToPb(st *AccountIpAccessEnable) (*accountIpAccessEnablePb, error) { + if st == nil { + return nil, nil + } + pb := &accountIpAccessEnablePb{} + pb.AcctIpAclEnable = st.AcctIpAclEnable + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type accountIpAccessEnablePb struct { + AcctIpAclEnable BooleanMessage `json:"acct_ip_acl_enable"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func accountIpAccessEnableFromPb(pb *accountIpAccessEnablePb) (*AccountIpAccessEnable, error) { + if pb == nil { + return nil, nil + } + st := &AccountIpAccessEnable{} + st.AcctIpAclEnable = pb.AcctIpAclEnable + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *accountIpAccessEnablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st accountIpAccessEnablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func accountNetworkPolicyToPb(st *AccountNetworkPolicy) (*accountNetworkPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &accountNetworkPolicyPb{} + pb.AccountId = st.AccountId + + pb.Egress = st.Egress + + pb.NetworkPolicyId = st.NetworkPolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type accountNetworkPolicyPb struct { + AccountId string `json:"account_id,omitempty"` + + Egress *NetworkPolicyEgress `json:"egress,omitempty"` + + NetworkPolicyId string `json:"network_policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func accountNetworkPolicyFromPb(pb *accountNetworkPolicyPb) (*AccountNetworkPolicy, error) { + if pb == nil { + return nil, nil + } + st := &AccountNetworkPolicy{} + st.AccountId = pb.AccountId + st.Egress = pb.Egress + st.NetworkPolicyId = pb.NetworkPolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *accountNetworkPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st accountNetworkPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func aibiDashboardEmbeddingAccessPolicyToPb(st *AibiDashboardEmbeddingAccessPolicy) (*aibiDashboardEmbeddingAccessPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &aibiDashboardEmbeddingAccessPolicyPb{} + pb.AccessPolicyType = st.AccessPolicyType + + return pb, nil +} + +type aibiDashboardEmbeddingAccessPolicyPb struct { + AccessPolicyType AibiDashboardEmbeddingAccessPolicyAccessPolicyType `json:"access_policy_type"` +} + +func aibiDashboardEmbeddingAccessPolicyFromPb(pb *aibiDashboardEmbeddingAccessPolicyPb) (*AibiDashboardEmbeddingAccessPolicy, error) { + if pb == nil { + return nil, nil + } + st := &AibiDashboardEmbeddingAccessPolicy{} + st.AccessPolicyType = pb.AccessPolicyType + + return st, nil +} + +func aibiDashboardEmbeddingAccessPolicySettingToPb(st *AibiDashboardEmbeddingAccessPolicySetting) (*aibiDashboardEmbeddingAccessPolicySettingPb, error) { + if st == nil { + return nil, nil + } + pb := &aibiDashboardEmbeddingAccessPolicySettingPb{} + pb.AibiDashboardEmbeddingAccessPolicy = st.AibiDashboardEmbeddingAccessPolicy + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type aibiDashboardEmbeddingAccessPolicySettingPb struct { + AibiDashboardEmbeddingAccessPolicy AibiDashboardEmbeddingAccessPolicy `json:"aibi_dashboard_embedding_access_policy"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func aibiDashboardEmbeddingAccessPolicySettingFromPb(pb *aibiDashboardEmbeddingAccessPolicySettingPb) (*AibiDashboardEmbeddingAccessPolicySetting, error) { + if pb == nil { + return nil, nil + } + st := &AibiDashboardEmbeddingAccessPolicySetting{} + st.AibiDashboardEmbeddingAccessPolicy = pb.AibiDashboardEmbeddingAccessPolicy + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *aibiDashboardEmbeddingAccessPolicySettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st aibiDashboardEmbeddingAccessPolicySettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func aibiDashboardEmbeddingApprovedDomainsToPb(st *AibiDashboardEmbeddingApprovedDomains) (*aibiDashboardEmbeddingApprovedDomainsPb, error) { + if st == nil { + return nil, nil + } + pb := &aibiDashboardEmbeddingApprovedDomainsPb{} + pb.ApprovedDomains = st.ApprovedDomains + + return pb, nil +} + +type aibiDashboardEmbeddingApprovedDomainsPb struct { + ApprovedDomains []string `json:"approved_domains,omitempty"` +} + +func aibiDashboardEmbeddingApprovedDomainsFromPb(pb *aibiDashboardEmbeddingApprovedDomainsPb) (*AibiDashboardEmbeddingApprovedDomains, error) { + if pb == nil { + return nil, nil + } + st := &AibiDashboardEmbeddingApprovedDomains{} + st.ApprovedDomains = pb.ApprovedDomains + + return st, nil +} + +func aibiDashboardEmbeddingApprovedDomainsSettingToPb(st *AibiDashboardEmbeddingApprovedDomainsSetting) (*aibiDashboardEmbeddingApprovedDomainsSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &aibiDashboardEmbeddingApprovedDomainsSettingPb{} + pb.AibiDashboardEmbeddingApprovedDomains = st.AibiDashboardEmbeddingApprovedDomains + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type aibiDashboardEmbeddingApprovedDomainsSettingPb struct { + AibiDashboardEmbeddingApprovedDomains AibiDashboardEmbeddingApprovedDomains `json:"aibi_dashboard_embedding_approved_domains"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func aibiDashboardEmbeddingApprovedDomainsSettingFromPb(pb *aibiDashboardEmbeddingApprovedDomainsSettingPb) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { + if pb == nil { + return nil, nil + } + st := &AibiDashboardEmbeddingApprovedDomainsSetting{} + st.AibiDashboardEmbeddingApprovedDomains = pb.AibiDashboardEmbeddingApprovedDomains + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *aibiDashboardEmbeddingApprovedDomainsSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st aibiDashboardEmbeddingApprovedDomainsSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func automaticClusterUpdateSettingToPb(st *AutomaticClusterUpdateSetting) (*automaticClusterUpdateSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &automaticClusterUpdateSettingPb{} + pb.AutomaticClusterUpdateWorkspace = st.AutomaticClusterUpdateWorkspace + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type automaticClusterUpdateSettingPb struct { + AutomaticClusterUpdateWorkspace ClusterAutoRestartMessage `json:"automatic_cluster_update_workspace"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func automaticClusterUpdateSettingFromPb(pb *automaticClusterUpdateSettingPb) (*AutomaticClusterUpdateSetting, error) { + if pb == nil { + return nil, nil + } + st := &AutomaticClusterUpdateSetting{} + st.AutomaticClusterUpdateWorkspace = pb.AutomaticClusterUpdateWorkspace + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *automaticClusterUpdateSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st automaticClusterUpdateSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func booleanMessageToPb(st *BooleanMessage) (*booleanMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &booleanMessagePb{} + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type booleanMessagePb struct { + Value bool `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func booleanMessageFromPb(pb *booleanMessagePb) (*BooleanMessage, error) { + if pb == nil { + return nil, nil + } + st := &BooleanMessage{} + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *booleanMessagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st booleanMessagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterAutoRestartMessageToPb(st *ClusterAutoRestartMessage) (*clusterAutoRestartMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAutoRestartMessagePb{} + pb.CanToggle = st.CanToggle + + pb.Enabled = st.Enabled + + pb.EnablementDetails = st.EnablementDetails + + pb.MaintenanceWindow = st.MaintenanceWindow + + pb.RestartEvenIfNoUpdatesAvailable = st.RestartEvenIfNoUpdatesAvailable + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAutoRestartMessagePb struct { + CanToggle bool `json:"can_toggle,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + EnablementDetails *ClusterAutoRestartMessageEnablementDetails `json:"enablement_details,omitempty"` + + MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow `json:"maintenance_window,omitempty"` + + RestartEvenIfNoUpdatesAvailable bool `json:"restart_even_if_no_updates_available,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAutoRestartMessageFromPb(pb *clusterAutoRestartMessagePb) (*ClusterAutoRestartMessage, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAutoRestartMessage{} + st.CanToggle = pb.CanToggle + st.Enabled = pb.Enabled + st.EnablementDetails = pb.EnablementDetails + st.MaintenanceWindow = pb.MaintenanceWindow + st.RestartEvenIfNoUpdatesAvailable = pb.RestartEvenIfNoUpdatesAvailable + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAutoRestartMessagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAutoRestartMessagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterAutoRestartMessageEnablementDetailsToPb(st *ClusterAutoRestartMessageEnablementDetails) (*clusterAutoRestartMessageEnablementDetailsPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAutoRestartMessageEnablementDetailsPb{} + pb.ForcedForComplianceMode = st.ForcedForComplianceMode + + pb.UnavailableForDisabledEntitlement = st.UnavailableForDisabledEntitlement + + pb.UnavailableForNonEnterpriseTier = st.UnavailableForNonEnterpriseTier + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAutoRestartMessageEnablementDetailsPb struct { + ForcedForComplianceMode bool `json:"forced_for_compliance_mode,omitempty"` + + UnavailableForDisabledEntitlement bool `json:"unavailable_for_disabled_entitlement,omitempty"` + + UnavailableForNonEnterpriseTier bool `json:"unavailable_for_non_enterprise_tier,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAutoRestartMessageEnablementDetailsFromPb(pb *clusterAutoRestartMessageEnablementDetailsPb) (*ClusterAutoRestartMessageEnablementDetails, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAutoRestartMessageEnablementDetails{} + st.ForcedForComplianceMode = pb.ForcedForComplianceMode + st.UnavailableForDisabledEntitlement = pb.UnavailableForDisabledEntitlement + st.UnavailableForNonEnterpriseTier = pb.UnavailableForNonEnterpriseTier + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAutoRestartMessageEnablementDetailsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAutoRestartMessageEnablementDetailsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clusterAutoRestartMessageMaintenanceWindowToPb(st *ClusterAutoRestartMessageMaintenanceWindow) (*clusterAutoRestartMessageMaintenanceWindowPb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAutoRestartMessageMaintenanceWindowPb{} + pb.WeekDayBasedSchedule = st.WeekDayBasedSchedule + + return pb, nil +} + +type clusterAutoRestartMessageMaintenanceWindowPb struct { + WeekDayBasedSchedule *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule `json:"week_day_based_schedule,omitempty"` +} + +func clusterAutoRestartMessageMaintenanceWindowFromPb(pb *clusterAutoRestartMessageMaintenanceWindowPb) (*ClusterAutoRestartMessageMaintenanceWindow, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAutoRestartMessageMaintenanceWindow{} + st.WeekDayBasedSchedule = pb.WeekDayBasedSchedule + + return st, nil +} + +func clusterAutoRestartMessageMaintenanceWindowWeekDayBasedScheduleToPb(st *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) (*clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb{} + pb.DayOfWeek = st.DayOfWeek + + pb.Frequency = st.Frequency + + pb.WindowStartTime = st.WindowStartTime + + return pb, nil +} + +type clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb struct { + DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"` + + Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency `json:"frequency,omitempty"` + + WindowStartTime *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime `json:"window_start_time,omitempty"` +} + +func clusterAutoRestartMessageMaintenanceWindowWeekDayBasedScheduleFromPb(pb *clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb) (*ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule{} + st.DayOfWeek = pb.DayOfWeek + st.Frequency = pb.Frequency + st.WindowStartTime = pb.WindowStartTime + + return st, nil +} + +func clusterAutoRestartMessageMaintenanceWindowWindowStartTimeToPb(st *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) (*clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb, error) { + if st == nil { + return nil, nil + } + pb := &clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb{} + pb.Hours = st.Hours + + pb.Minutes = st.Minutes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb struct { + Hours int `json:"hours,omitempty"` + + Minutes int `json:"minutes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clusterAutoRestartMessageMaintenanceWindowWindowStartTimeFromPb(pb *clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb) (*ClusterAutoRestartMessageMaintenanceWindowWindowStartTime, error) { + if pb == nil { + return nil, nil + } + st := &ClusterAutoRestartMessageMaintenanceWindowWindowStartTime{} + st.Hours = pb.Hours + st.Minutes = pb.Minutes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSecurityProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &complianceSecurityProfilePb{} + pb.ComplianceStandards = st.ComplianceStandards + + pb.IsEnabled = st.IsEnabled + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type complianceSecurityProfilePb struct { + ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` + + IsEnabled bool `json:"is_enabled,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func complianceSecurityProfileFromPb(pb *complianceSecurityProfilePb) (*ComplianceSecurityProfile, error) { + if pb == nil { + return nil, nil + } + st := &ComplianceSecurityProfile{} + st.ComplianceStandards = pb.ComplianceStandards + st.IsEnabled = pb.IsEnabled + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *complianceSecurityProfilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st complianceSecurityProfilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func complianceSecurityProfileSettingToPb(st *ComplianceSecurityProfileSetting) (*complianceSecurityProfileSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &complianceSecurityProfileSettingPb{} + pb.ComplianceSecurityProfileWorkspace = st.ComplianceSecurityProfileWorkspace + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type complianceSecurityProfileSettingPb struct { + ComplianceSecurityProfileWorkspace ComplianceSecurityProfile `json:"compliance_security_profile_workspace"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func complianceSecurityProfileSettingFromPb(pb *complianceSecurityProfileSettingPb) (*ComplianceSecurityProfileSetting, error) { + if pb == nil { + return nil, nil + } + st := &ComplianceSecurityProfileSetting{} + st.ComplianceSecurityProfileWorkspace = pb.ComplianceSecurityProfileWorkspace + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *complianceSecurityProfileSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st complianceSecurityProfileSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func configToPb(st *Config) (*configPb, error) { + if st == nil { + return nil, nil + } + pb := &configPb{} + pb.Email = st.Email + + pb.GenericWebhook = st.GenericWebhook + + pb.MicrosoftTeams = st.MicrosoftTeams + + pb.Pagerduty = st.Pagerduty + + pb.Slack = st.Slack + + return pb, nil +} + +type configPb struct { + Email *EmailConfig `json:"email,omitempty"` + + GenericWebhook *GenericWebhookConfig `json:"generic_webhook,omitempty"` + + MicrosoftTeams *MicrosoftTeamsConfig `json:"microsoft_teams,omitempty"` + + Pagerduty *PagerdutyConfig `json:"pagerduty,omitempty"` + + Slack *SlackConfig `json:"slack,omitempty"` +} + +func configFromPb(pb *configPb) (*Config, error) { + if pb == nil { + return nil, nil + } + st := &Config{} + st.Email = pb.Email + st.GenericWebhook = pb.GenericWebhook + st.MicrosoftTeams = pb.MicrosoftTeams + st.Pagerduty = pb.Pagerduty + st.Slack = pb.Slack + + return st, nil +} + +func createIpAccessListToPb(st *CreateIpAccessList) (*createIpAccessListPb, error) { + if st == nil { + return nil, nil + } + pb := &createIpAccessListPb{} + pb.IpAddresses = st.IpAddresses + + pb.Label = st.Label + + pb.ListType = st.ListType + + return pb, nil +} + +type createIpAccessListPb struct { + IpAddresses []string `json:"ip_addresses,omitempty"` + + Label string `json:"label"` + + ListType ListType `json:"list_type"` +} + +func createIpAccessListFromPb(pb *createIpAccessListPb) (*CreateIpAccessList, error) { + if pb == nil { + return nil, nil + } + st := &CreateIpAccessList{} + st.IpAddresses = pb.IpAddresses + st.Label = pb.Label + st.ListType = pb.ListType + + return st, nil +} + +func createIpAccessListResponseToPb(st *CreateIpAccessListResponse) (*createIpAccessListResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createIpAccessListResponsePb{} + pb.IpAccessList = st.IpAccessList + + return pb, nil +} + +type createIpAccessListResponsePb struct { + IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` +} + +func createIpAccessListResponseFromPb(pb *createIpAccessListResponsePb) (*CreateIpAccessListResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateIpAccessListResponse{} + st.IpAccessList = pb.IpAccessList + + return st, nil +} + +func createNetworkConnectivityConfigRequestToPb(st *CreateNetworkConnectivityConfigRequest) (*createNetworkConnectivityConfigRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createNetworkConnectivityConfigRequestPb{} + pb.NetworkConnectivityConfig = st.NetworkConnectivityConfig + + return pb, nil +} + +type createNetworkConnectivityConfigRequestPb struct { + NetworkConnectivityConfig CreateNetworkConnectivityConfiguration `json:"network_connectivity_config"` +} + +func createNetworkConnectivityConfigRequestFromPb(pb *createNetworkConnectivityConfigRequestPb) (*CreateNetworkConnectivityConfigRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateNetworkConnectivityConfigRequest{} + st.NetworkConnectivityConfig = pb.NetworkConnectivityConfig + + return st, nil +} + +func createNetworkConnectivityConfigurationToPb(st *CreateNetworkConnectivityConfiguration) (*createNetworkConnectivityConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &createNetworkConnectivityConfigurationPb{} + pb.Name = st.Name + + pb.Region = st.Region + + return pb, nil +} + +type createNetworkConnectivityConfigurationPb struct { + Name string `json:"name"` + + Region string `json:"region"` +} + +func createNetworkConnectivityConfigurationFromPb(pb *createNetworkConnectivityConfigurationPb) (*CreateNetworkConnectivityConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &CreateNetworkConnectivityConfiguration{} + st.Name = pb.Name + st.Region = pb.Region + + return st, nil +} + +func createNetworkPolicyRequestToPb(st *CreateNetworkPolicyRequest) (*createNetworkPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createNetworkPolicyRequestPb{} + pb.NetworkPolicy = st.NetworkPolicy + + return pb, nil +} + +type createNetworkPolicyRequestPb struct { + NetworkPolicy AccountNetworkPolicy `json:"network_policy"` +} + +func createNetworkPolicyRequestFromPb(pb *createNetworkPolicyRequestPb) (*CreateNetworkPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateNetworkPolicyRequest{} + st.NetworkPolicy = pb.NetworkPolicy + + return st, nil +} + +func createNotificationDestinationRequestToPb(st *CreateNotificationDestinationRequest) (*createNotificationDestinationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createNotificationDestinationRequestPb{} + pb.Config = st.Config + + pb.DisplayName = st.DisplayName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createNotificationDestinationRequestPb struct { + Config *Config `json:"config,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createNotificationDestinationRequestFromPb(pb *createNotificationDestinationRequestPb) (*CreateNotificationDestinationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateNotificationDestinationRequest{} + st.Config = pb.Config + st.DisplayName = pb.DisplayName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createNotificationDestinationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createNotificationDestinationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createOboTokenRequestToPb(st *CreateOboTokenRequest) (*createOboTokenRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createOboTokenRequestPb{} + pb.ApplicationId = st.ApplicationId + + pb.Comment = st.Comment + + pb.LifetimeSeconds = st.LifetimeSeconds + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createOboTokenRequestPb struct { + ApplicationId string `json:"application_id"` + + Comment string `json:"comment,omitempty"` + + LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createOboTokenRequestFromPb(pb *createOboTokenRequestPb) (*CreateOboTokenRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateOboTokenRequest{} + st.ApplicationId = pb.ApplicationId + st.Comment = pb.Comment + st.LifetimeSeconds = pb.LifetimeSeconds + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createOboTokenRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createOboTokenRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createOboTokenResponseToPb(st *CreateOboTokenResponse) (*createOboTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createOboTokenResponsePb{} + pb.TokenInfo = st.TokenInfo + + pb.TokenValue = st.TokenValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createOboTokenResponsePb struct { + TokenInfo *TokenInfo `json:"token_info,omitempty"` + + TokenValue string `json:"token_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createOboTokenResponseFromPb(pb *createOboTokenResponsePb) (*CreateOboTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateOboTokenResponse{} + st.TokenInfo = pb.TokenInfo + st.TokenValue = pb.TokenValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createOboTokenResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createOboTokenResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPrivateEndpointRuleToPb(st *CreatePrivateEndpointRule) (*createPrivateEndpointRulePb, error) { + if st == nil { + return nil, nil + } + pb := &createPrivateEndpointRulePb{} + pb.DomainNames = st.DomainNames + + pb.GroupId = st.GroupId + + pb.ResourceId = st.ResourceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createPrivateEndpointRulePb struct { + DomainNames []string `json:"domain_names,omitempty"` + + GroupId string `json:"group_id,omitempty"` + + ResourceId string `json:"resource_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createPrivateEndpointRuleFromPb(pb *createPrivateEndpointRulePb) (*CreatePrivateEndpointRule, error) { + if pb == nil { + return nil, nil + } + st := &CreatePrivateEndpointRule{} + st.DomainNames = pb.DomainNames + st.GroupId = pb.GroupId + st.ResourceId = pb.ResourceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createPrivateEndpointRulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createPrivateEndpointRulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createPrivateEndpointRuleRequestToPb(st *CreatePrivateEndpointRuleRequest) (*createPrivateEndpointRuleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createPrivateEndpointRuleRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.PrivateEndpointRule = st.PrivateEndpointRule + + return pb, nil +} + +type createPrivateEndpointRuleRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` + + PrivateEndpointRule CreatePrivateEndpointRule `json:"private_endpoint_rule"` +} + +func createPrivateEndpointRuleRequestFromPb(pb *createPrivateEndpointRuleRequestPb) (*CreatePrivateEndpointRuleRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreatePrivateEndpointRuleRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.PrivateEndpointRule = pb.PrivateEndpointRule + + return st, nil +} + +func createTokenRequestToPb(st *CreateTokenRequest) (*createTokenRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createTokenRequestPb{} + pb.Comment = st.Comment + + pb.LifetimeSeconds = st.LifetimeSeconds + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createTokenRequestPb struct { + Comment string `json:"comment,omitempty"` + + LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createTokenRequestFromPb(pb *createTokenRequestPb) (*CreateTokenRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateTokenRequest{} + st.Comment = pb.Comment + st.LifetimeSeconds = pb.LifetimeSeconds + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createTokenRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createTokenRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createTokenResponseToPb(st *CreateTokenResponse) (*createTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createTokenResponsePb{} + pb.TokenInfo = st.TokenInfo + + pb.TokenValue = st.TokenValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createTokenResponsePb struct { + TokenInfo *PublicTokenInfo `json:"token_info,omitempty"` + + TokenValue string `json:"token_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createTokenResponseFromPb(pb *createTokenResponsePb) (*CreateTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateTokenResponse{} + st.TokenInfo = pb.TokenInfo + st.TokenValue = pb.TokenValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createTokenResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createTokenResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cspEnablementAccountToPb(st *CspEnablementAccount) (*cspEnablementAccountPb, error) { + if st == nil { + return nil, nil + } + pb := &cspEnablementAccountPb{} + pb.ComplianceStandards = st.ComplianceStandards + + pb.IsEnforced = st.IsEnforced + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cspEnablementAccountPb struct { + ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` + + IsEnforced bool `json:"is_enforced,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cspEnablementAccountFromPb(pb *cspEnablementAccountPb) (*CspEnablementAccount, error) { + if pb == nil { + return nil, nil + } + st := &CspEnablementAccount{} + st.ComplianceStandards = pb.ComplianceStandards + st.IsEnforced = pb.IsEnforced + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cspEnablementAccountPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cspEnablementAccountPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cspEnablementAccountSettingToPb(st *CspEnablementAccountSetting) (*cspEnablementAccountSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &cspEnablementAccountSettingPb{} + pb.CspEnablementAccount = st.CspEnablementAccount + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cspEnablementAccountSettingPb struct { + CspEnablementAccount CspEnablementAccount `json:"csp_enablement_account"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cspEnablementAccountSettingFromPb(pb *cspEnablementAccountSettingPb) (*CspEnablementAccountSetting, error) { + if pb == nil { + return nil, nil + } + st := &CspEnablementAccountSetting{} + st.CspEnablementAccount = pb.CspEnablementAccount + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cspEnablementAccountSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cspEnablementAccountSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func defaultNamespaceSettingToPb(st *DefaultNamespaceSetting) (*defaultNamespaceSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &defaultNamespaceSettingPb{} + pb.Etag = st.Etag + + pb.Namespace = st.Namespace + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type defaultNamespaceSettingPb struct { + Etag string `json:"etag,omitempty"` + + Namespace StringMessage `json:"namespace"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func defaultNamespaceSettingFromPb(pb *defaultNamespaceSettingPb) (*DefaultNamespaceSetting, error) { + if pb == nil { + return nil, nil + } + st := &DefaultNamespaceSetting{} + st.Etag = pb.Etag + st.Namespace = pb.Namespace + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *defaultNamespaceSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st defaultNamespaceSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAccountIpAccessEnableRequestToPb(st *DeleteAccountIpAccessEnableRequest) (*deleteAccountIpAccessEnableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountIpAccessEnableRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteAccountIpAccessEnableRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteAccountIpAccessEnableRequestFromPb(pb *deleteAccountIpAccessEnableRequestPb) (*DeleteAccountIpAccessEnableRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountIpAccessEnableRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteAccountIpAccessEnableRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteAccountIpAccessEnableRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAccountIpAccessEnableResponseToPb(st *DeleteAccountIpAccessEnableResponse) (*deleteAccountIpAccessEnableResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountIpAccessEnableResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteAccountIpAccessEnableResponsePb struct { + Etag string `json:"etag"` +} + +func deleteAccountIpAccessEnableResponseFromPb(pb *deleteAccountIpAccessEnableResponsePb) (*DeleteAccountIpAccessEnableResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountIpAccessEnableResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteAccountIpAccessListRequestToPb(st *DeleteAccountIpAccessListRequest) (*deleteAccountIpAccessListRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAccountIpAccessListRequestPb{} + pb.IpAccessListId = st.IpAccessListId + + return pb, nil +} + +type deleteAccountIpAccessListRequestPb struct { + IpAccessListId string `json:"-" url:"-"` +} + +func deleteAccountIpAccessListRequestFromPb(pb *deleteAccountIpAccessListRequestPb) (*DeleteAccountIpAccessListRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAccountIpAccessListRequest{} + st.IpAccessListId = pb.IpAccessListId + + return st, nil +} + +func deleteAibiDashboardEmbeddingAccessPolicySettingRequestToPb(st *DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb *deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb) (*DeleteAibiDashboardEmbeddingAccessPolicySettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAibiDashboardEmbeddingAccessPolicySettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAibiDashboardEmbeddingAccessPolicySettingResponseToPb(st *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) (*deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb struct { + Etag string `json:"etag"` +} + +func deleteAibiDashboardEmbeddingAccessPolicySettingResponseFromPb(pb *deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAibiDashboardEmbeddingAccessPolicySettingResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(st *DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb *deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAibiDashboardEmbeddingApprovedDomainsSettingResponseToPb(st *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) (*deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb struct { + Etag string `json:"etag"` +} + +func deleteAibiDashboardEmbeddingApprovedDomainsSettingResponseFromPb(pb *deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteDefaultNamespaceSettingRequestToPb(st *DeleteDefaultNamespaceSettingRequest) (*deleteDefaultNamespaceSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDefaultNamespaceSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDefaultNamespaceSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDefaultNamespaceSettingRequestFromPb(pb *deleteDefaultNamespaceSettingRequestPb) (*DeleteDefaultNamespaceSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDefaultNamespaceSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDefaultNamespaceSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDefaultNamespaceSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDefaultNamespaceSettingResponseToPb(st *DeleteDefaultNamespaceSettingResponse) (*deleteDefaultNamespaceSettingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDefaultNamespaceSettingResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteDefaultNamespaceSettingResponsePb struct { + Etag string `json:"etag"` +} + +func deleteDefaultNamespaceSettingResponseFromPb(pb *deleteDefaultNamespaceSettingResponsePb) (*DeleteDefaultNamespaceSettingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDefaultNamespaceSettingResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteDisableLegacyAccessRequestToPb(st *DeleteDisableLegacyAccessRequest) (*deleteDisableLegacyAccessRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyAccessRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDisableLegacyAccessRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDisableLegacyAccessRequestFromPb(pb *deleteDisableLegacyAccessRequestPb) (*DeleteDisableLegacyAccessRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyAccessRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDisableLegacyAccessRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDisableLegacyAccessRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDisableLegacyAccessResponseToPb(st *DeleteDisableLegacyAccessResponse) (*deleteDisableLegacyAccessResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyAccessResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteDisableLegacyAccessResponsePb struct { + Etag string `json:"etag"` +} + +func deleteDisableLegacyAccessResponseFromPb(pb *deleteDisableLegacyAccessResponsePb) (*DeleteDisableLegacyAccessResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyAccessResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteDisableLegacyDbfsRequestToPb(st *DeleteDisableLegacyDbfsRequest) (*deleteDisableLegacyDbfsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyDbfsRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDisableLegacyDbfsRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDisableLegacyDbfsRequestFromPb(pb *deleteDisableLegacyDbfsRequestPb) (*DeleteDisableLegacyDbfsRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyDbfsRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDisableLegacyDbfsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDisableLegacyDbfsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDisableLegacyDbfsResponseToPb(st *DeleteDisableLegacyDbfsResponse) (*deleteDisableLegacyDbfsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyDbfsResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteDisableLegacyDbfsResponsePb struct { + Etag string `json:"etag"` +} + +func deleteDisableLegacyDbfsResponseFromPb(pb *deleteDisableLegacyDbfsResponsePb) (*DeleteDisableLegacyDbfsResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyDbfsResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteDisableLegacyFeaturesRequestToPb(st *DeleteDisableLegacyFeaturesRequest) (*deleteDisableLegacyFeaturesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyFeaturesRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDisableLegacyFeaturesRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDisableLegacyFeaturesRequestFromPb(pb *deleteDisableLegacyFeaturesRequestPb) (*DeleteDisableLegacyFeaturesRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyFeaturesRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDisableLegacyFeaturesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDisableLegacyFeaturesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDisableLegacyFeaturesResponseToPb(st *DeleteDisableLegacyFeaturesResponse) (*deleteDisableLegacyFeaturesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDisableLegacyFeaturesResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteDisableLegacyFeaturesResponsePb struct { + Etag string `json:"etag"` +} + +func deleteDisableLegacyFeaturesResponseFromPb(pb *deleteDisableLegacyFeaturesResponsePb) (*DeleteDisableLegacyFeaturesResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDisableLegacyFeaturesResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteIpAccessListRequestToPb(st *DeleteIpAccessListRequest) (*deleteIpAccessListRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteIpAccessListRequestPb{} + pb.IpAccessListId = st.IpAccessListId + + return pb, nil +} + +type deleteIpAccessListRequestPb struct { + IpAccessListId string `json:"-" url:"-"` +} + +func deleteIpAccessListRequestFromPb(pb *deleteIpAccessListRequestPb) (*DeleteIpAccessListRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteIpAccessListRequest{} + st.IpAccessListId = pb.IpAccessListId + + return st, nil +} + +func deleteLlmProxyPartnerPoweredWorkspaceRequestToPb(st *DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*deleteLlmProxyPartnerPoweredWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLlmProxyPartnerPoweredWorkspaceRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteLlmProxyPartnerPoweredWorkspaceRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb *deleteLlmProxyPartnerPoweredWorkspaceRequestPb) (*DeleteLlmProxyPartnerPoweredWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLlmProxyPartnerPoweredWorkspaceRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteLlmProxyPartnerPoweredWorkspaceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteLlmProxyPartnerPoweredWorkspaceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteLlmProxyPartnerPoweredWorkspaceResponseToPb(st *DeleteLlmProxyPartnerPoweredWorkspaceResponse) (*deleteLlmProxyPartnerPoweredWorkspaceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteLlmProxyPartnerPoweredWorkspaceResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteLlmProxyPartnerPoweredWorkspaceResponsePb struct { + Etag string `json:"etag"` +} + +func deleteLlmProxyPartnerPoweredWorkspaceResponseFromPb(pb *deleteLlmProxyPartnerPoweredWorkspaceResponsePb) (*DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteLlmProxyPartnerPoweredWorkspaceResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteNetworkConnectivityConfigurationRequestToPb(st *DeleteNetworkConnectivityConfigurationRequest) (*deleteNetworkConnectivityConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNetworkConnectivityConfigurationRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + return pb, nil +} + +type deleteNetworkConnectivityConfigurationRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` +} + +func deleteNetworkConnectivityConfigurationRequestFromPb(pb *deleteNetworkConnectivityConfigurationRequestPb) (*DeleteNetworkConnectivityConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNetworkConnectivityConfigurationRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + + return st, nil +} + +func deleteNetworkConnectivityConfigurationResponseToPb(st *DeleteNetworkConnectivityConfigurationResponse) (*deleteNetworkConnectivityConfigurationResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNetworkConnectivityConfigurationResponsePb{} + + return pb, nil +} + +type deleteNetworkConnectivityConfigurationResponsePb struct { +} + +func deleteNetworkConnectivityConfigurationResponseFromPb(pb *deleteNetworkConnectivityConfigurationResponsePb) (*DeleteNetworkConnectivityConfigurationResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNetworkConnectivityConfigurationResponse{} + + return st, nil +} + +func deleteNetworkPolicyRequestToPb(st *DeleteNetworkPolicyRequest) (*deleteNetworkPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNetworkPolicyRequestPb{} + pb.NetworkPolicyId = st.NetworkPolicyId + + return pb, nil +} + +type deleteNetworkPolicyRequestPb struct { + NetworkPolicyId string `json:"-" url:"-"` +} + +func deleteNetworkPolicyRequestFromPb(pb *deleteNetworkPolicyRequestPb) (*DeleteNetworkPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNetworkPolicyRequest{} + st.NetworkPolicyId = pb.NetworkPolicyId + + return st, nil +} + +func deleteNetworkPolicyRpcResponseToPb(st *DeleteNetworkPolicyRpcResponse) (*deleteNetworkPolicyRpcResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNetworkPolicyRpcResponsePb{} + + return pb, nil +} + +type deleteNetworkPolicyRpcResponsePb struct { +} + +func deleteNetworkPolicyRpcResponseFromPb(pb *deleteNetworkPolicyRpcResponsePb) (*DeleteNetworkPolicyRpcResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNetworkPolicyRpcResponse{} + + return st, nil +} + +func deleteNotificationDestinationRequestToPb(st *DeleteNotificationDestinationRequest) (*deleteNotificationDestinationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteNotificationDestinationRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteNotificationDestinationRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteNotificationDestinationRequestFromPb(pb *deleteNotificationDestinationRequestPb) (*DeleteNotificationDestinationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteNotificationDestinationRequest{} + st.Id = pb.Id + + return st, nil +} + +func deletePersonalComputeSettingRequestToPb(st *DeletePersonalComputeSettingRequest) (*deletePersonalComputeSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePersonalComputeSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deletePersonalComputeSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deletePersonalComputeSettingRequestFromPb(pb *deletePersonalComputeSettingRequestPb) (*DeletePersonalComputeSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeletePersonalComputeSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deletePersonalComputeSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deletePersonalComputeSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deletePersonalComputeSettingResponseToPb(st *DeletePersonalComputeSettingResponse) (*deletePersonalComputeSettingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deletePersonalComputeSettingResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deletePersonalComputeSettingResponsePb struct { + Etag string `json:"etag"` +} + +func deletePersonalComputeSettingResponseFromPb(pb *deletePersonalComputeSettingResponsePb) (*DeletePersonalComputeSettingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeletePersonalComputeSettingResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deletePrivateEndpointRuleRequestToPb(st *DeletePrivateEndpointRuleRequest) (*deletePrivateEndpointRuleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deletePrivateEndpointRuleRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId + + return pb, nil +} + +type deletePrivateEndpointRuleRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` + + PrivateEndpointRuleId string `json:"-" url:"-"` +} + +func deletePrivateEndpointRuleRequestFromPb(pb *deletePrivateEndpointRuleRequestPb) (*DeletePrivateEndpointRuleRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeletePrivateEndpointRuleRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.PrivateEndpointRuleId = pb.PrivateEndpointRuleId + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteRestrictWorkspaceAdminsSettingRequestToPb(st *DeleteRestrictWorkspaceAdminsSettingRequest) (*deleteRestrictWorkspaceAdminsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRestrictWorkspaceAdminsSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteRestrictWorkspaceAdminsSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteRestrictWorkspaceAdminsSettingRequestFromPb(pb *deleteRestrictWorkspaceAdminsSettingRequestPb) (*DeleteRestrictWorkspaceAdminsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRestrictWorkspaceAdminsSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteRestrictWorkspaceAdminsSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteRestrictWorkspaceAdminsSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteRestrictWorkspaceAdminsSettingResponseToPb(st *DeleteRestrictWorkspaceAdminsSettingResponse) (*deleteRestrictWorkspaceAdminsSettingResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRestrictWorkspaceAdminsSettingResponsePb{} + pb.Etag = st.Etag + + return pb, nil +} + +type deleteRestrictWorkspaceAdminsSettingResponsePb struct { + Etag string `json:"etag"` +} + +func deleteRestrictWorkspaceAdminsSettingResponseFromPb(pb *deleteRestrictWorkspaceAdminsSettingResponsePb) (*DeleteRestrictWorkspaceAdminsSettingResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRestrictWorkspaceAdminsSettingResponse{} + st.Etag = pb.Etag + + return st, nil +} + +func deleteTokenManagementRequestToPb(st *DeleteTokenManagementRequest) (*deleteTokenManagementRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteTokenManagementRequestPb{} + pb.TokenId = st.TokenId + + return pb, nil +} + +type deleteTokenManagementRequestPb struct { + TokenId string `json:"-" url:"-"` +} + +func deleteTokenManagementRequestFromPb(pb *deleteTokenManagementRequestPb) (*DeleteTokenManagementRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteTokenManagementRequest{} + st.TokenId = pb.TokenId + + return st, nil +} + +func disableLegacyAccessToPb(st *DisableLegacyAccess) (*disableLegacyAccessPb, error) { + if st == nil { + return nil, nil + } + pb := &disableLegacyAccessPb{} + pb.DisableLegacyAccess = st.DisableLegacyAccess + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type disableLegacyAccessPb struct { + DisableLegacyAccess BooleanMessage `json:"disable_legacy_access"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func disableLegacyAccessFromPb(pb *disableLegacyAccessPb) (*DisableLegacyAccess, error) { + if pb == nil { + return nil, nil + } + st := &DisableLegacyAccess{} + st.DisableLegacyAccess = pb.DisableLegacyAccess + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *disableLegacyAccessPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st disableLegacyAccessPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func disableLegacyDbfsToPb(st *DisableLegacyDbfs) (*disableLegacyDbfsPb, error) { + if st == nil { + return nil, nil + } + pb := &disableLegacyDbfsPb{} + pb.DisableLegacyDbfs = st.DisableLegacyDbfs + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type disableLegacyDbfsPb struct { + DisableLegacyDbfs BooleanMessage `json:"disable_legacy_dbfs"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func disableLegacyDbfsFromPb(pb *disableLegacyDbfsPb) (*DisableLegacyDbfs, error) { + if pb == nil { + return nil, nil + } + st := &DisableLegacyDbfs{} + st.DisableLegacyDbfs = pb.DisableLegacyDbfs + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *disableLegacyDbfsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st disableLegacyDbfsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func disableLegacyFeaturesToPb(st *DisableLegacyFeatures) (*disableLegacyFeaturesPb, error) { + if st == nil { + return nil, nil + } + pb := &disableLegacyFeaturesPb{} + pb.DisableLegacyFeatures = st.DisableLegacyFeatures + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type disableLegacyFeaturesPb struct { + DisableLegacyFeatures BooleanMessage `json:"disable_legacy_features"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func disableLegacyFeaturesFromPb(pb *disableLegacyFeaturesPb) (*DisableLegacyFeatures, error) { + if pb == nil { + return nil, nil + } + st := &DisableLegacyFeatures{} + st.DisableLegacyFeatures = pb.DisableLegacyFeatures + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *disableLegacyFeaturesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st disableLegacyFeaturesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func egressNetworkPolicyToPb(st *EgressNetworkPolicy) (*egressNetworkPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyPb{} + pb.InternetAccess = st.InternetAccess + + return pb, nil +} + +type egressNetworkPolicyPb struct { + InternetAccess *EgressNetworkPolicyInternetAccessPolicy `json:"internet_access,omitempty"` +} + +func egressNetworkPolicyFromPb(pb *egressNetworkPolicyPb) (*EgressNetworkPolicy, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicy{} + st.InternetAccess = pb.InternetAccess + + return st, nil +} + +func egressNetworkPolicyInternetAccessPolicyToPb(st *EgressNetworkPolicyInternetAccessPolicy) (*egressNetworkPolicyInternetAccessPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyInternetAccessPolicyPb{} + pb.AllowedInternetDestinations = st.AllowedInternetDestinations + + pb.AllowedStorageDestinations = st.AllowedStorageDestinations + + pb.LogOnlyMode = st.LogOnlyMode + + pb.RestrictionMode = st.RestrictionMode + + return pb, nil +} + +type egressNetworkPolicyInternetAccessPolicyPb struct { + AllowedInternetDestinations []EgressNetworkPolicyInternetAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` + + AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + + LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode `json:"log_only_mode,omitempty"` + + RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode `json:"restriction_mode,omitempty"` +} + +func egressNetworkPolicyInternetAccessPolicyFromPb(pb *egressNetworkPolicyInternetAccessPolicyPb) (*EgressNetworkPolicyInternetAccessPolicy, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyInternetAccessPolicy{} + st.AllowedInternetDestinations = pb.AllowedInternetDestinations + st.AllowedStorageDestinations = pb.AllowedStorageDestinations + st.LogOnlyMode = pb.LogOnlyMode + st.RestrictionMode = pb.RestrictionMode + + return st, nil +} + +func egressNetworkPolicyInternetAccessPolicyInternetDestinationToPb(st *EgressNetworkPolicyInternetAccessPolicyInternetDestination) (*egressNetworkPolicyInternetAccessPolicyInternetDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyInternetAccessPolicyInternetDestinationPb{} + pb.Destination = st.Destination + + pb.Protocol = st.Protocol + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type egressNetworkPolicyInternetAccessPolicyInternetDestinationPb struct { + Destination string `json:"destination,omitempty"` + + Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol `json:"protocol,omitempty"` + + Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func egressNetworkPolicyInternetAccessPolicyInternetDestinationFromPb(pb *egressNetworkPolicyInternetAccessPolicyInternetDestinationPb) (*EgressNetworkPolicyInternetAccessPolicyInternetDestination, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyInternetAccessPolicyInternetDestination{} + st.Destination = pb.Destination + st.Protocol = pb.Protocol + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *egressNetworkPolicyInternetAccessPolicyInternetDestinationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st egressNetworkPolicyInternetAccessPolicyInternetDestinationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeToPb(st *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) (*egressNetworkPolicyInternetAccessPolicyLogOnlyModePb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyInternetAccessPolicyLogOnlyModePb{} + pb.LogOnlyModeType = st.LogOnlyModeType + + pb.Workloads = st.Workloads + + return pb, nil +} + +type egressNetworkPolicyInternetAccessPolicyLogOnlyModePb struct { + LogOnlyModeType EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType `json:"log_only_mode_type,omitempty"` + + Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType `json:"workloads,omitempty"` +} + +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyMode, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyInternetAccessPolicyLogOnlyMode{} + st.LogOnlyModeType = pb.LogOnlyModeType + st.Workloads = pb.Workloads + + return st, nil +} + +func egressNetworkPolicyInternetAccessPolicyStorageDestinationToPb(st *EgressNetworkPolicyInternetAccessPolicyStorageDestination) (*egressNetworkPolicyInternetAccessPolicyStorageDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyInternetAccessPolicyStorageDestinationPb{} + pb.AllowedPaths = st.AllowedPaths + + pb.AzureContainer = st.AzureContainer + + pb.AzureDnsZone = st.AzureDnsZone + + pb.AzureStorageAccount = st.AzureStorageAccount + + pb.AzureStorageService = st.AzureStorageService + + pb.BucketName = st.BucketName + + pb.Region = st.Region + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type egressNetworkPolicyInternetAccessPolicyStorageDestinationPb struct { + AllowedPaths []string `json:"allowed_paths,omitempty"` + + AzureContainer string `json:"azure_container,omitempty"` + + AzureDnsZone string `json:"azure_dns_zone,omitempty"` + + AzureStorageAccount string `json:"azure_storage_account,omitempty"` + + AzureStorageService string `json:"azure_storage_service,omitempty"` + + BucketName string `json:"bucket_name,omitempty"` + + Region string `json:"region,omitempty"` + + Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func egressNetworkPolicyInternetAccessPolicyStorageDestinationFromPb(pb *egressNetworkPolicyInternetAccessPolicyStorageDestinationPb) (*EgressNetworkPolicyInternetAccessPolicyStorageDestination, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyInternetAccessPolicyStorageDestination{} + st.AllowedPaths = pb.AllowedPaths + st.AzureContainer = pb.AzureContainer + st.AzureDnsZone = pb.AzureDnsZone + st.AzureStorageAccount = pb.AzureStorageAccount + st.AzureStorageService = pb.AzureStorageService + st.BucketName = pb.BucketName + st.Region = pb.Region + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *egressNetworkPolicyInternetAccessPolicyStorageDestinationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st egressNetworkPolicyInternetAccessPolicyStorageDestinationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func egressNetworkPolicyNetworkAccessPolicyToPb(st *EgressNetworkPolicyNetworkAccessPolicy) (*egressNetworkPolicyNetworkAccessPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyNetworkAccessPolicyPb{} + pb.AllowedInternetDestinations = st.AllowedInternetDestinations + + pb.AllowedStorageDestinations = st.AllowedStorageDestinations + + pb.PolicyEnforcement = st.PolicyEnforcement + + pb.RestrictionMode = st.RestrictionMode + + return pb, nil +} + +type egressNetworkPolicyNetworkAccessPolicyPb struct { + AllowedInternetDestinations []EgressNetworkPolicyNetworkAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` + + AllowedStorageDestinations []EgressNetworkPolicyNetworkAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + + PolicyEnforcement *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement `json:"policy_enforcement,omitempty"` + + RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode `json:"restriction_mode"` +} + +func egressNetworkPolicyNetworkAccessPolicyFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPb) (*EgressNetworkPolicyNetworkAccessPolicy, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyNetworkAccessPolicy{} + st.AllowedInternetDestinations = pb.AllowedInternetDestinations + st.AllowedStorageDestinations = pb.AllowedStorageDestinations + st.PolicyEnforcement = pb.PolicyEnforcement + st.RestrictionMode = pb.RestrictionMode + + return st, nil +} + +func egressNetworkPolicyNetworkAccessPolicyInternetDestinationToPb(st *EgressNetworkPolicyNetworkAccessPolicyInternetDestination) (*egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb{} + pb.Destination = st.Destination + + pb.InternetDestinationType = st.InternetDestinationType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb struct { + Destination string `json:"destination,omitempty"` + + InternetDestinationType EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType `json:"internet_destination_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func egressNetworkPolicyNetworkAccessPolicyInternetDestinationFromPb(pb *egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb) (*EgressNetworkPolicyNetworkAccessPolicyInternetDestination, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyNetworkAccessPolicyInternetDestination{} + st.Destination = pb.Destination + st.InternetDestinationType = pb.InternetDestinationType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementToPb(st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement) (*egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb{} + pb.DryRunModeProductFilter = st.DryRunModeProductFilter + + pb.EnforcementMode = st.EnforcementMode + + return pb, nil +} + +type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb struct { + DryRunModeProductFilter []EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter `json:"dry_run_mode_product_filter,omitempty"` + + EnforcementMode EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode `json:"enforcement_mode,omitempty"` +} + +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement{} + st.DryRunModeProductFilter = pb.DryRunModeProductFilter + st.EnforcementMode = pb.EnforcementMode + + return st, nil +} + +func egressNetworkPolicyNetworkAccessPolicyStorageDestinationToPb(st *EgressNetworkPolicyNetworkAccessPolicyStorageDestination) (*egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := &egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb{} + pb.AzureStorageAccount = st.AzureStorageAccount + + pb.AzureStorageService = st.AzureStorageService + + pb.BucketName = st.BucketName + + pb.Region = st.Region + + pb.StorageDestinationType = st.StorageDestinationType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb struct { + AzureStorageAccount string `json:"azure_storage_account,omitempty"` + + AzureStorageService string `json:"azure_storage_service,omitempty"` + + BucketName string `json:"bucket_name,omitempty"` + + Region string `json:"region,omitempty"` + + StorageDestinationType EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType `json:"storage_destination_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func egressNetworkPolicyNetworkAccessPolicyStorageDestinationFromPb(pb *egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb) (*EgressNetworkPolicyNetworkAccessPolicyStorageDestination, error) { + if pb == nil { + return nil, nil + } + st := &EgressNetworkPolicyNetworkAccessPolicyStorageDestination{} + st.AzureStorageAccount = pb.AzureStorageAccount + st.AzureStorageService = pb.AzureStorageService + st.BucketName = pb.BucketName + st.Region = pb.Region + st.StorageDestinationType = pb.StorageDestinationType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func emailConfigToPb(st *EmailConfig) (*emailConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &emailConfigPb{} + pb.Addresses = st.Addresses + + return pb, nil +} + +type emailConfigPb struct { + Addresses []string `json:"addresses,omitempty"` +} + +func emailConfigFromPb(pb *emailConfigPb) (*EmailConfig, error) { + if pb == nil { + return nil, nil + } + st := &EmailConfig{} + st.Addresses = pb.Addresses + + return st, nil +} + +func emptyToPb(st *Empty) (*emptyPb, error) { + if st == nil { + return nil, nil + } + pb := &emptyPb{} + + return pb, nil +} + +type emptyPb struct { +} + +func emptyFromPb(pb *emptyPb) (*Empty, error) { + if pb == nil { + return nil, nil + } + st := &Empty{} + + return st, nil +} + +func enableExportNotebookToPb(st *EnableExportNotebook) (*enableExportNotebookPb, error) { + if st == nil { + return nil, nil + } + pb := &enableExportNotebookPb{} + pb.BooleanVal = st.BooleanVal + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enableExportNotebookPb struct { + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enableExportNotebookFromPb(pb *enableExportNotebookPb) (*EnableExportNotebook, error) { + if pb == nil { + return nil, nil + } + st := &EnableExportNotebook{} + st.BooleanVal = pb.BooleanVal + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enableExportNotebookPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enableExportNotebookPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enableNotebookTableClipboardToPb(st *EnableNotebookTableClipboard) (*enableNotebookTableClipboardPb, error) { + if st == nil { + return nil, nil + } + pb := &enableNotebookTableClipboardPb{} + pb.BooleanVal = st.BooleanVal + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enableNotebookTableClipboardPb struct { + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enableNotebookTableClipboardFromPb(pb *enableNotebookTableClipboardPb) (*EnableNotebookTableClipboard, error) { + if pb == nil { + return nil, nil + } + st := &EnableNotebookTableClipboard{} + st.BooleanVal = pb.BooleanVal + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enableNotebookTableClipboardPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enableNotebookTableClipboardPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enableResultsDownloadingToPb(st *EnableResultsDownloading) (*enableResultsDownloadingPb, error) { + if st == nil { + return nil, nil + } + pb := &enableResultsDownloadingPb{} + pb.BooleanVal = st.BooleanVal + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enableResultsDownloadingPb struct { + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enableResultsDownloadingFromPb(pb *enableResultsDownloadingPb) (*EnableResultsDownloading, error) { + if pb == nil { + return nil, nil + } + st := &EnableResultsDownloading{} + st.BooleanVal = pb.BooleanVal + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enableResultsDownloadingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enableResultsDownloadingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enhancedSecurityMonitoringToPb(st *EnhancedSecurityMonitoring) (*enhancedSecurityMonitoringPb, error) { + if st == nil { + return nil, nil + } + pb := &enhancedSecurityMonitoringPb{} + pb.IsEnabled = st.IsEnabled + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enhancedSecurityMonitoringPb struct { + IsEnabled bool `json:"is_enabled,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enhancedSecurityMonitoringFromPb(pb *enhancedSecurityMonitoringPb) (*EnhancedSecurityMonitoring, error) { + if pb == nil { + return nil, nil + } + st := &EnhancedSecurityMonitoring{} + st.IsEnabled = pb.IsEnabled + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enhancedSecurityMonitoringPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enhancedSecurityMonitoringPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func enhancedSecurityMonitoringSettingToPb(st *EnhancedSecurityMonitoringSetting) (*enhancedSecurityMonitoringSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &enhancedSecurityMonitoringSettingPb{} + pb.EnhancedSecurityMonitoringWorkspace = st.EnhancedSecurityMonitoringWorkspace + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enhancedSecurityMonitoringSettingPb struct { + EnhancedSecurityMonitoringWorkspace EnhancedSecurityMonitoring `json:"enhanced_security_monitoring_workspace"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enhancedSecurityMonitoringSettingFromPb(pb *enhancedSecurityMonitoringSettingPb) (*EnhancedSecurityMonitoringSetting, error) { + if pb == nil { + return nil, nil + } + st := &EnhancedSecurityMonitoringSetting{} + st.EnhancedSecurityMonitoringWorkspace = pb.EnhancedSecurityMonitoringWorkspace + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enhancedSecurityMonitoringSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enhancedSecurityMonitoringSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func esmEnablementAccountToPb(st *EsmEnablementAccount) (*esmEnablementAccountPb, error) { + if st == nil { + return nil, nil + } + pb := &esmEnablementAccountPb{} + pb.IsEnforced = st.IsEnforced + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type esmEnablementAccountPb struct { + IsEnforced bool `json:"is_enforced,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func esmEnablementAccountFromPb(pb *esmEnablementAccountPb) (*EsmEnablementAccount, error) { + if pb == nil { + return nil, nil + } + st := &EsmEnablementAccount{} + st.IsEnforced = pb.IsEnforced + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *esmEnablementAccountPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st esmEnablementAccountPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func esmEnablementAccountSettingToPb(st *EsmEnablementAccountSetting) (*esmEnablementAccountSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &esmEnablementAccountSettingPb{} + pb.EsmEnablementAccount = st.EsmEnablementAccount + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type esmEnablementAccountSettingPb struct { + EsmEnablementAccount EsmEnablementAccount `json:"esm_enablement_account"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func esmEnablementAccountSettingFromPb(pb *esmEnablementAccountSettingPb) (*EsmEnablementAccountSetting, error) { + if pb == nil { + return nil, nil + } + st := &EsmEnablementAccountSetting{} + st.EsmEnablementAccount = pb.EsmEnablementAccount + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *esmEnablementAccountSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st esmEnablementAccountSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func exchangeTokenToPb(st *ExchangeToken) (*exchangeTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &exchangeTokenPb{} + pb.Credential = st.Credential + + pb.CredentialEolTime = st.CredentialEolTime + + pb.OwnerId = st.OwnerId + + pb.Scopes = st.Scopes + + pb.TokenType = st.TokenType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type exchangeTokenPb struct { + Credential string `json:"credential,omitempty"` + + CredentialEolTime int64 `json:"credentialEolTime,omitempty"` + + OwnerId int64 `json:"ownerId,omitempty"` + + Scopes []string `json:"scopes,omitempty"` + + TokenType TokenType `json:"tokenType,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func exchangeTokenFromPb(pb *exchangeTokenPb) (*ExchangeToken, error) { + if pb == nil { + return nil, nil + } + st := &ExchangeToken{} + st.Credential = pb.Credential + st.CredentialEolTime = pb.CredentialEolTime + st.OwnerId = pb.OwnerId + st.Scopes = pb.Scopes + st.TokenType = pb.TokenType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *exchangeTokenPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st exchangeTokenPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func exchangeTokenRequestToPb(st *ExchangeTokenRequest) (*exchangeTokenRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &exchangeTokenRequestPb{} + pb.PartitionId = st.PartitionId + + pb.Scopes = st.Scopes + + pb.TokenType = st.TokenType + + return pb, nil +} + +type exchangeTokenRequestPb struct { + PartitionId PartitionId `json:"partitionId"` + + Scopes []string `json:"scopes"` + + TokenType []TokenType `json:"tokenType"` +} + +func exchangeTokenRequestFromPb(pb *exchangeTokenRequestPb) (*ExchangeTokenRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExchangeTokenRequest{} + st.PartitionId = pb.PartitionId + st.Scopes = pb.Scopes + st.TokenType = pb.TokenType + + return st, nil +} + +func exchangeTokenResponseToPb(st *ExchangeTokenResponse) (*exchangeTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &exchangeTokenResponsePb{} + pb.Values = st.Values + + return pb, nil +} + +type exchangeTokenResponsePb struct { + Values []ExchangeToken `json:"values,omitempty"` +} + +func exchangeTokenResponseFromPb(pb *exchangeTokenResponsePb) (*ExchangeTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &ExchangeTokenResponse{} + st.Values = pb.Values + + return st, nil +} + +func fetchIpAccessListResponseToPb(st *FetchIpAccessListResponse) (*fetchIpAccessListResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &fetchIpAccessListResponsePb{} + pb.IpAccessList = st.IpAccessList + + return pb, nil +} + +type fetchIpAccessListResponsePb struct { + IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` +} + +func fetchIpAccessListResponseFromPb(pb *fetchIpAccessListResponsePb) (*FetchIpAccessListResponse, error) { + if pb == nil { + return nil, nil + } + st := &FetchIpAccessListResponse{} + st.IpAccessList = pb.IpAccessList + + return st, nil +} + +func genericWebhookConfigToPb(st *GenericWebhookConfig) (*genericWebhookConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &genericWebhookConfigPb{} + pb.Password = st.Password + + pb.PasswordSet = st.PasswordSet + + pb.Url = st.Url + + pb.UrlSet = st.UrlSet + + pb.Username = st.Username + + pb.UsernameSet = st.UsernameSet + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type genericWebhookConfigPb struct { + Password string `json:"password,omitempty"` + + PasswordSet bool `json:"password_set,omitempty"` + + Url string `json:"url,omitempty"` + + UrlSet bool `json:"url_set,omitempty"` + + Username string `json:"username,omitempty"` + + UsernameSet bool `json:"username_set,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func genericWebhookConfigFromPb(pb *genericWebhookConfigPb) (*GenericWebhookConfig, error) { + if pb == nil { + return nil, nil + } + st := &GenericWebhookConfig{} + st.Password = pb.Password + st.PasswordSet = pb.PasswordSet + st.Url = pb.Url + st.UrlSet = pb.UrlSet + st.Username = pb.Username + st.UsernameSet = pb.UsernameSet + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *genericWebhookConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st genericWebhookConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAccountIpAccessEnableRequestToPb(st *GetAccountIpAccessEnableRequest) (*getAccountIpAccessEnableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountIpAccessEnableRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getAccountIpAccessEnableRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getAccountIpAccessEnableRequestFromPb(pb *getAccountIpAccessEnableRequestPb) (*GetAccountIpAccessEnableRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountIpAccessEnableRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getAccountIpAccessEnableRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getAccountIpAccessEnableRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAccountIpAccessListRequestToPb(st *GetAccountIpAccessListRequest) (*getAccountIpAccessListRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAccountIpAccessListRequestPb{} + pb.IpAccessListId = st.IpAccessListId + + return pb, nil +} + +type getAccountIpAccessListRequestPb struct { + IpAccessListId string `json:"-" url:"-"` +} + +func getAccountIpAccessListRequestFromPb(pb *getAccountIpAccessListRequestPb) (*GetAccountIpAccessListRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAccountIpAccessListRequest{} + st.IpAccessListId = pb.IpAccessListId + + return st, nil +} + +func getAibiDashboardEmbeddingAccessPolicySettingRequestToPb(st *GetAibiDashboardEmbeddingAccessPolicySettingRequest) (*getAibiDashboardEmbeddingAccessPolicySettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getAibiDashboardEmbeddingAccessPolicySettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb *getAibiDashboardEmbeddingAccessPolicySettingRequestPb) (*GetAibiDashboardEmbeddingAccessPolicySettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAibiDashboardEmbeddingAccessPolicySettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getAibiDashboardEmbeddingAccessPolicySettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getAibiDashboardEmbeddingAccessPolicySettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(st *GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb *getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) (*GetAibiDashboardEmbeddingApprovedDomainsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAibiDashboardEmbeddingApprovedDomainsSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAutomaticClusterUpdateSettingRequestToPb(st *GetAutomaticClusterUpdateSettingRequest) (*getAutomaticClusterUpdateSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAutomaticClusterUpdateSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getAutomaticClusterUpdateSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getAutomaticClusterUpdateSettingRequestFromPb(pb *getAutomaticClusterUpdateSettingRequestPb) (*GetAutomaticClusterUpdateSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAutomaticClusterUpdateSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getAutomaticClusterUpdateSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getAutomaticClusterUpdateSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getComplianceSecurityProfileSettingRequestToPb(st *GetComplianceSecurityProfileSettingRequest) (*getComplianceSecurityProfileSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getComplianceSecurityProfileSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getComplianceSecurityProfileSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getComplianceSecurityProfileSettingRequestFromPb(pb *getComplianceSecurityProfileSettingRequestPb) (*GetComplianceSecurityProfileSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetComplianceSecurityProfileSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getComplianceSecurityProfileSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getComplianceSecurityProfileSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getCspEnablementAccountSettingRequestToPb(st *GetCspEnablementAccountSettingRequest) (*getCspEnablementAccountSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCspEnablementAccountSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getCspEnablementAccountSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getCspEnablementAccountSettingRequestFromPb(pb *getCspEnablementAccountSettingRequestPb) (*GetCspEnablementAccountSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCspEnablementAccountSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getCspEnablementAccountSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getCspEnablementAccountSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getDefaultNamespaceSettingRequestToPb(st *GetDefaultNamespaceSettingRequest) (*getDefaultNamespaceSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDefaultNamespaceSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getDefaultNamespaceSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getDefaultNamespaceSettingRequestFromPb(pb *getDefaultNamespaceSettingRequestPb) (*GetDefaultNamespaceSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDefaultNamespaceSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getDefaultNamespaceSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getDefaultNamespaceSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getDisableLegacyAccessRequestToPb(st *GetDisableLegacyAccessRequest) (*getDisableLegacyAccessRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDisableLegacyAccessRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getDisableLegacyAccessRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getDisableLegacyAccessRequestFromPb(pb *getDisableLegacyAccessRequestPb) (*GetDisableLegacyAccessRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDisableLegacyAccessRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getDisableLegacyAccessRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getDisableLegacyAccessRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getDisableLegacyDbfsRequestToPb(st *GetDisableLegacyDbfsRequest) (*getDisableLegacyDbfsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDisableLegacyDbfsRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getDisableLegacyDbfsRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getDisableLegacyDbfsRequestFromPb(pb *getDisableLegacyDbfsRequestPb) (*GetDisableLegacyDbfsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDisableLegacyDbfsRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getDisableLegacyDbfsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getDisableLegacyDbfsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getDisableLegacyFeaturesRequestToPb(st *GetDisableLegacyFeaturesRequest) (*getDisableLegacyFeaturesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDisableLegacyFeaturesRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getDisableLegacyFeaturesRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getDisableLegacyFeaturesRequestFromPb(pb *getDisableLegacyFeaturesRequestPb) (*GetDisableLegacyFeaturesRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDisableLegacyFeaturesRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getDisableLegacyFeaturesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getDisableLegacyFeaturesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getEnhancedSecurityMonitoringSettingRequestToPb(st *GetEnhancedSecurityMonitoringSettingRequest) (*getEnhancedSecurityMonitoringSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getEnhancedSecurityMonitoringSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getEnhancedSecurityMonitoringSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getEnhancedSecurityMonitoringSettingRequestFromPb(pb *getEnhancedSecurityMonitoringSettingRequestPb) (*GetEnhancedSecurityMonitoringSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetEnhancedSecurityMonitoringSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getEnhancedSecurityMonitoringSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getEnhancedSecurityMonitoringSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getEsmEnablementAccountSettingRequestToPb(st *GetEsmEnablementAccountSettingRequest) (*getEsmEnablementAccountSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getEsmEnablementAccountSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getEsmEnablementAccountSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getEsmEnablementAccountSettingRequestFromPb(pb *getEsmEnablementAccountSettingRequestPb) (*GetEsmEnablementAccountSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetEsmEnablementAccountSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getEsmEnablementAccountSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getEsmEnablementAccountSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getIpAccessListRequestToPb(st *GetIpAccessListRequest) (*getIpAccessListRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getIpAccessListRequestPb{} + pb.IpAccessListId = st.IpAccessListId + + return pb, nil +} + +type getIpAccessListRequestPb struct { + IpAccessListId string `json:"-" url:"-"` +} + +func getIpAccessListRequestFromPb(pb *getIpAccessListRequestPb) (*GetIpAccessListRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetIpAccessListRequest{} + st.IpAccessListId = pb.IpAccessListId + + return st, nil +} + +func getIpAccessListResponseToPb(st *GetIpAccessListResponse) (*getIpAccessListResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getIpAccessListResponsePb{} + pb.IpAccessList = st.IpAccessList + + return pb, nil +} + +type getIpAccessListResponsePb struct { + IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` +} + +func getIpAccessListResponseFromPb(pb *getIpAccessListResponsePb) (*GetIpAccessListResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetIpAccessListResponse{} + st.IpAccessList = pb.IpAccessList + + return st, nil +} + +func getIpAccessListsResponseToPb(st *GetIpAccessListsResponse) (*getIpAccessListsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getIpAccessListsResponsePb{} + pb.IpAccessLists = st.IpAccessLists + + return pb, nil +} + +type getIpAccessListsResponsePb struct { + IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` +} + +func getIpAccessListsResponseFromPb(pb *getIpAccessListsResponsePb) (*GetIpAccessListsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetIpAccessListsResponse{} + st.IpAccessLists = pb.IpAccessLists + + return st, nil +} + +func getLlmProxyPartnerPoweredAccountRequestToPb(st *GetLlmProxyPartnerPoweredAccountRequest) (*getLlmProxyPartnerPoweredAccountRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLlmProxyPartnerPoweredAccountRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getLlmProxyPartnerPoweredAccountRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getLlmProxyPartnerPoweredAccountRequestFromPb(pb *getLlmProxyPartnerPoweredAccountRequestPb) (*GetLlmProxyPartnerPoweredAccountRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLlmProxyPartnerPoweredAccountRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getLlmProxyPartnerPoweredAccountRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getLlmProxyPartnerPoweredAccountRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getLlmProxyPartnerPoweredEnforceRequestToPb(st *GetLlmProxyPartnerPoweredEnforceRequest) (*getLlmProxyPartnerPoweredEnforceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLlmProxyPartnerPoweredEnforceRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getLlmProxyPartnerPoweredEnforceRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getLlmProxyPartnerPoweredEnforceRequestFromPb(pb *getLlmProxyPartnerPoweredEnforceRequestPb) (*GetLlmProxyPartnerPoweredEnforceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLlmProxyPartnerPoweredEnforceRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getLlmProxyPartnerPoweredEnforceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getLlmProxyPartnerPoweredEnforceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getLlmProxyPartnerPoweredWorkspaceRequestToPb(st *GetLlmProxyPartnerPoweredWorkspaceRequest) (*getLlmProxyPartnerPoweredWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getLlmProxyPartnerPoweredWorkspaceRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getLlmProxyPartnerPoweredWorkspaceRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb *getLlmProxyPartnerPoweredWorkspaceRequestPb) (*GetLlmProxyPartnerPoweredWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetLlmProxyPartnerPoweredWorkspaceRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getLlmProxyPartnerPoweredWorkspaceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getLlmProxyPartnerPoweredWorkspaceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getNetworkConnectivityConfigurationRequestToPb(st *GetNetworkConnectivityConfigurationRequest) (*getNetworkConnectivityConfigurationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getNetworkConnectivityConfigurationRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + return pb, nil +} + +type getNetworkConnectivityConfigurationRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` +} + +func getNetworkConnectivityConfigurationRequestFromPb(pb *getNetworkConnectivityConfigurationRequestPb) (*GetNetworkConnectivityConfigurationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetNetworkConnectivityConfigurationRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + + return st, nil +} + +func getNetworkPolicyRequestToPb(st *GetNetworkPolicyRequest) (*getNetworkPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getNetworkPolicyRequestPb{} + pb.NetworkPolicyId = st.NetworkPolicyId + + return pb, nil +} + +type getNetworkPolicyRequestPb struct { + NetworkPolicyId string `json:"-" url:"-"` +} + +func getNetworkPolicyRequestFromPb(pb *getNetworkPolicyRequestPb) (*GetNetworkPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetNetworkPolicyRequest{} + st.NetworkPolicyId = pb.NetworkPolicyId + + return st, nil +} + +func getNotificationDestinationRequestToPb(st *GetNotificationDestinationRequest) (*getNotificationDestinationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getNotificationDestinationRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getNotificationDestinationRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getNotificationDestinationRequestFromPb(pb *getNotificationDestinationRequestPb) (*GetNotificationDestinationRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetNotificationDestinationRequest{} + st.Id = pb.Id + + return st, nil +} + +func getPersonalComputeSettingRequestToPb(st *GetPersonalComputeSettingRequest) (*getPersonalComputeSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPersonalComputeSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getPersonalComputeSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getPersonalComputeSettingRequestFromPb(pb *getPersonalComputeSettingRequestPb) (*GetPersonalComputeSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPersonalComputeSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getPersonalComputeSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getPersonalComputeSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getPrivateEndpointRuleRequestToPb(st *GetPrivateEndpointRuleRequest) (*getPrivateEndpointRuleRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getPrivateEndpointRuleRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId + + return pb, nil +} + +type getPrivateEndpointRuleRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` + + PrivateEndpointRuleId string `json:"-" url:"-"` +} + +func getPrivateEndpointRuleRequestFromPb(pb *getPrivateEndpointRuleRequestPb) (*GetPrivateEndpointRuleRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetPrivateEndpointRuleRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.PrivateEndpointRuleId = pb.PrivateEndpointRuleId + + return st, nil +} + +func getRestrictWorkspaceAdminsSettingRequestToPb(st *GetRestrictWorkspaceAdminsSettingRequest) (*getRestrictWorkspaceAdminsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRestrictWorkspaceAdminsSettingRequestPb{} + pb.Etag = st.Etag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRestrictWorkspaceAdminsSettingRequestPb struct { + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRestrictWorkspaceAdminsSettingRequestFromPb(pb *getRestrictWorkspaceAdminsSettingRequestPb) (*GetRestrictWorkspaceAdminsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRestrictWorkspaceAdminsSettingRequest{} + st.Etag = pb.Etag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRestrictWorkspaceAdminsSettingRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRestrictWorkspaceAdminsSettingRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getStatusRequestToPb(st *GetStatusRequest) (*getStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStatusRequestPb{} + pb.Keys = st.Keys + + return pb, nil +} + +type getStatusRequestPb struct { + Keys string `json:"-" url:"keys"` +} + +func getStatusRequestFromPb(pb *getStatusRequestPb) (*GetStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStatusRequest{} + st.Keys = pb.Keys + + return st, nil +} + +func getTokenManagementRequestToPb(st *GetTokenManagementRequest) (*getTokenManagementRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getTokenManagementRequestPb{} + pb.TokenId = st.TokenId + + return pb, nil +} + +type getTokenManagementRequestPb struct { + TokenId string `json:"-" url:"-"` +} + +func getTokenManagementRequestFromPb(pb *getTokenManagementRequestPb) (*GetTokenManagementRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetTokenManagementRequest{} + st.TokenId = pb.TokenId + + return st, nil +} + +func getTokenPermissionLevelsResponseToPb(st *GetTokenPermissionLevelsResponse) (*getTokenPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getTokenPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getTokenPermissionLevelsResponsePb struct { + PermissionLevels []TokenPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getTokenPermissionLevelsResponseFromPb(pb *getTokenPermissionLevelsResponsePb) (*GetTokenPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetTokenPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getTokenResponseToPb(st *GetTokenResponse) (*getTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getTokenResponsePb{} + pb.TokenInfo = st.TokenInfo + + return pb, nil +} + +type getTokenResponsePb struct { + TokenInfo *TokenInfo `json:"token_info,omitempty"` +} + +func getTokenResponseFromPb(pb *getTokenResponsePb) (*GetTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetTokenResponse{} + st.TokenInfo = pb.TokenInfo + + return st, nil +} + +func getWorkspaceNetworkOptionRequestToPb(st *GetWorkspaceNetworkOptionRequest) (*getWorkspaceNetworkOptionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceNetworkOptionRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + return pb, nil +} + +type getWorkspaceNetworkOptionRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` +} + +func getWorkspaceNetworkOptionRequestFromPb(pb *getWorkspaceNetworkOptionRequestPb) (*GetWorkspaceNetworkOptionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceNetworkOptionRequest{} + st.WorkspaceId = pb.WorkspaceId + + return st, nil +} + +func ipAccessListInfoToPb(st *IpAccessListInfo) (*ipAccessListInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &ipAccessListInfoPb{} + pb.AddressCount = st.AddressCount + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Enabled = st.Enabled + + pb.IpAddresses = st.IpAddresses + + pb.Label = st.Label + + pb.ListId = st.ListId + + pb.ListType = st.ListType + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type ipAccessListInfoPb struct { + AddressCount int `json:"address_count,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy int64 `json:"created_by,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + IpAddresses []string `json:"ip_addresses,omitempty"` + + Label string `json:"label,omitempty"` + + ListId string `json:"list_id,omitempty"` + + ListType ListType `json:"list_type,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy int64 `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func ipAccessListInfoFromPb(pb *ipAccessListInfoPb) (*IpAccessListInfo, error) { + if pb == nil { + return nil, nil + } + st := &IpAccessListInfo{} + st.AddressCount = pb.AddressCount + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Enabled = pb.Enabled + st.IpAddresses = pb.IpAddresses + st.Label = pb.Label + st.ListId = pb.ListId + st.ListType = pb.ListType + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *ipAccessListInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st ipAccessListInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listIpAccessListResponseToPb(st *ListIpAccessListResponse) (*listIpAccessListResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listIpAccessListResponsePb{} + pb.IpAccessLists = st.IpAccessLists + + return pb, nil +} + +type listIpAccessListResponsePb struct { + IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` +} + +func listIpAccessListResponseFromPb(pb *listIpAccessListResponsePb) (*ListIpAccessListResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListIpAccessListResponse{} + st.IpAccessLists = pb.IpAccessLists + + return st, nil +} + +func listNccAzurePrivateEndpointRulesResponseToPb(st *ListNccAzurePrivateEndpointRulesResponse) (*listNccAzurePrivateEndpointRulesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listNccAzurePrivateEndpointRulesResponsePb{} + pb.Items = st.Items + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNccAzurePrivateEndpointRulesResponsePb struct { + Items []NccAzurePrivateEndpointRule `json:"items,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNccAzurePrivateEndpointRulesResponseFromPb(pb *listNccAzurePrivateEndpointRulesResponsePb) (*ListNccAzurePrivateEndpointRulesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListNccAzurePrivateEndpointRulesResponse{} + st.Items = pb.Items + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNccAzurePrivateEndpointRulesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNccAzurePrivateEndpointRulesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNetworkConnectivityConfigurationsRequestToPb(st *ListNetworkConnectivityConfigurationsRequest) (*listNetworkConnectivityConfigurationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listNetworkConnectivityConfigurationsRequestPb{} + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNetworkConnectivityConfigurationsRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNetworkConnectivityConfigurationsRequestFromPb(pb *listNetworkConnectivityConfigurationsRequestPb) (*ListNetworkConnectivityConfigurationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListNetworkConnectivityConfigurationsRequest{} + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNetworkConnectivityConfigurationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNetworkConnectivityConfigurationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNetworkConnectivityConfigurationsResponseToPb(st *ListNetworkConnectivityConfigurationsResponse) (*listNetworkConnectivityConfigurationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listNetworkConnectivityConfigurationsResponsePb{} + pb.Items = st.Items + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNetworkConnectivityConfigurationsResponsePb struct { + Items []NetworkConnectivityConfiguration `json:"items,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNetworkConnectivityConfigurationsResponseFromPb(pb *listNetworkConnectivityConfigurationsResponsePb) (*ListNetworkConnectivityConfigurationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListNetworkConnectivityConfigurationsResponse{} + st.Items = pb.Items + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNetworkConnectivityConfigurationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNetworkConnectivityConfigurationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNetworkPoliciesRequestToPb(st *ListNetworkPoliciesRequest) (*listNetworkPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listNetworkPoliciesRequestPb{} + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNetworkPoliciesRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNetworkPoliciesRequestFromPb(pb *listNetworkPoliciesRequestPb) (*ListNetworkPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListNetworkPoliciesRequest{} + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNetworkPoliciesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNetworkPoliciesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNetworkPoliciesResponseToPb(st *ListNetworkPoliciesResponse) (*listNetworkPoliciesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listNetworkPoliciesResponsePb{} + pb.Items = st.Items + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNetworkPoliciesResponsePb struct { + Items []AccountNetworkPolicy `json:"items,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNetworkPoliciesResponseFromPb(pb *listNetworkPoliciesResponsePb) (*ListNetworkPoliciesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListNetworkPoliciesResponse{} + st.Items = pb.Items + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNetworkPoliciesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNetworkPoliciesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNotificationDestinationsRequestToPb(st *ListNotificationDestinationsRequest) (*listNotificationDestinationsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listNotificationDestinationsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNotificationDestinationsRequestPb struct { + PageSize int64 `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNotificationDestinationsRequestFromPb(pb *listNotificationDestinationsRequestPb) (*ListNotificationDestinationsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListNotificationDestinationsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNotificationDestinationsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNotificationDestinationsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNotificationDestinationsResponseToPb(st *ListNotificationDestinationsResponse) (*listNotificationDestinationsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listNotificationDestinationsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNotificationDestinationsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Results []ListNotificationDestinationsResult `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNotificationDestinationsResponseFromPb(pb *listNotificationDestinationsResponsePb) (*ListNotificationDestinationsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListNotificationDestinationsResponse{} + st.NextPageToken = pb.NextPageToken + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNotificationDestinationsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNotificationDestinationsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listNotificationDestinationsResultToPb(st *ListNotificationDestinationsResult) (*listNotificationDestinationsResultPb, error) { + if st == nil { + return nil, nil + } + pb := &listNotificationDestinationsResultPb{} + pb.DestinationType = st.DestinationType + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listNotificationDestinationsResultPb struct { + DestinationType DestinationType `json:"destination_type,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listNotificationDestinationsResultFromPb(pb *listNotificationDestinationsResultPb) (*ListNotificationDestinationsResult, error) { + if pb == nil { + return nil, nil + } + st := &ListNotificationDestinationsResult{} + st.DestinationType = pb.DestinationType + st.DisplayName = pb.DisplayName + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listNotificationDestinationsResultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listNotificationDestinationsResultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPrivateEndpointRulesRequestToPb(st *ListPrivateEndpointRulesRequest) (*listPrivateEndpointRulesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listPrivateEndpointRulesRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listPrivateEndpointRulesRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listPrivateEndpointRulesRequestFromPb(pb *listPrivateEndpointRulesRequestPb) (*ListPrivateEndpointRulesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListPrivateEndpointRulesRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listPrivateEndpointRulesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listPrivateEndpointRulesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listPublicTokensResponseToPb(st *ListPublicTokensResponse) (*listPublicTokensResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listPublicTokensResponsePb{} + pb.TokenInfos = st.TokenInfos + + return pb, nil +} + +type listPublicTokensResponsePb struct { + TokenInfos []PublicTokenInfo `json:"token_infos,omitempty"` +} + +func listPublicTokensResponseFromPb(pb *listPublicTokensResponsePb) (*ListPublicTokensResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListPublicTokensResponse{} + st.TokenInfos = pb.TokenInfos + + return st, nil +} + +func listTokenManagementRequestToPb(st *ListTokenManagementRequest) (*listTokenManagementRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listTokenManagementRequestPb{} + pb.CreatedById = st.CreatedById + + pb.CreatedByUsername = st.CreatedByUsername + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listTokenManagementRequestPb struct { + CreatedById int64 `json:"-" url:"created_by_id,omitempty"` + + CreatedByUsername string `json:"-" url:"created_by_username,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listTokenManagementRequestFromPb(pb *listTokenManagementRequestPb) (*ListTokenManagementRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListTokenManagementRequest{} + st.CreatedById = pb.CreatedById + st.CreatedByUsername = pb.CreatedByUsername + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listTokenManagementRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listTokenManagementRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listTokensResponseToPb(st *ListTokensResponse) (*listTokensResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listTokensResponsePb{} + pb.TokenInfos = st.TokenInfos + + return pb, nil +} + +type listTokensResponsePb struct { + TokenInfos []TokenInfo `json:"token_infos,omitempty"` +} + +func listTokensResponseFromPb(pb *listTokensResponsePb) (*ListTokensResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListTokensResponse{} + st.TokenInfos = pb.TokenInfos + + return st, nil +} + +func llmProxyPartnerPoweredAccountToPb(st *LlmProxyPartnerPoweredAccount) (*llmProxyPartnerPoweredAccountPb, error) { + if st == nil { + return nil, nil + } + pb := &llmProxyPartnerPoweredAccountPb{} + pb.BooleanVal = st.BooleanVal + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type llmProxyPartnerPoweredAccountPb struct { + BooleanVal BooleanMessage `json:"boolean_val"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func llmProxyPartnerPoweredAccountFromPb(pb *llmProxyPartnerPoweredAccountPb) (*LlmProxyPartnerPoweredAccount, error) { + if pb == nil { + return nil, nil + } + st := &LlmProxyPartnerPoweredAccount{} + st.BooleanVal = pb.BooleanVal + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *llmProxyPartnerPoweredAccountPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st llmProxyPartnerPoweredAccountPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func llmProxyPartnerPoweredEnforceToPb(st *LlmProxyPartnerPoweredEnforce) (*llmProxyPartnerPoweredEnforcePb, error) { + if st == nil { + return nil, nil + } + pb := &llmProxyPartnerPoweredEnforcePb{} + pb.BooleanVal = st.BooleanVal + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type llmProxyPartnerPoweredEnforcePb struct { + BooleanVal BooleanMessage `json:"boolean_val"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func llmProxyPartnerPoweredEnforceFromPb(pb *llmProxyPartnerPoweredEnforcePb) (*LlmProxyPartnerPoweredEnforce, error) { + if pb == nil { + return nil, nil + } + st := &LlmProxyPartnerPoweredEnforce{} + st.BooleanVal = pb.BooleanVal + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *llmProxyPartnerPoweredEnforcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st llmProxyPartnerPoweredEnforcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func llmProxyPartnerPoweredWorkspaceToPb(st *LlmProxyPartnerPoweredWorkspace) (*llmProxyPartnerPoweredWorkspacePb, error) { + if st == nil { + return nil, nil + } + pb := &llmProxyPartnerPoweredWorkspacePb{} + pb.BooleanVal = st.BooleanVal + + pb.Etag = st.Etag + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type llmProxyPartnerPoweredWorkspacePb struct { + BooleanVal BooleanMessage `json:"boolean_val"` + + Etag string `json:"etag,omitempty"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func llmProxyPartnerPoweredWorkspaceFromPb(pb *llmProxyPartnerPoweredWorkspacePb) (*LlmProxyPartnerPoweredWorkspace, error) { + if pb == nil { + return nil, nil + } + st := &LlmProxyPartnerPoweredWorkspace{} + st.BooleanVal = pb.BooleanVal + st.Etag = pb.Etag + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *llmProxyPartnerPoweredWorkspacePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st llmProxyPartnerPoweredWorkspacePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func microsoftTeamsConfigToPb(st *MicrosoftTeamsConfig) (*microsoftTeamsConfigPb, error) { + if st == nil { + return nil, nil + } + pb := µsoftTeamsConfigPb{} + pb.Url = st.Url + + pb.UrlSet = st.UrlSet + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type microsoftTeamsConfigPb struct { + Url string `json:"url,omitempty"` + + UrlSet bool `json:"url_set,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func microsoftTeamsConfigFromPb(pb *microsoftTeamsConfigPb) (*MicrosoftTeamsConfig, error) { + if pb == nil { + return nil, nil + } + st := &MicrosoftTeamsConfig{} + st.Url = pb.Url + st.UrlSet = pb.UrlSet + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *microsoftTeamsConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st microsoftTeamsConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nccAwsStableIpRuleToPb(st *NccAwsStableIpRule) (*nccAwsStableIpRulePb, error) { + if st == nil { + return nil, nil + } + pb := &nccAwsStableIpRulePb{} + pb.CidrBlocks = st.CidrBlocks + + return pb, nil +} + +type nccAwsStableIpRulePb struct { + CidrBlocks []string `json:"cidr_blocks,omitempty"` +} + +func nccAwsStableIpRuleFromPb(pb *nccAwsStableIpRulePb) (*NccAwsStableIpRule, error) { + if pb == nil { + return nil, nil + } + st := &NccAwsStableIpRule{} + st.CidrBlocks = pb.CidrBlocks + + return st, nil +} + +func nccAzurePrivateEndpointRuleToPb(st *NccAzurePrivateEndpointRule) (*nccAzurePrivateEndpointRulePb, error) { + if st == nil { + return nil, nil + } + pb := &nccAzurePrivateEndpointRulePb{} + pb.ConnectionState = st.ConnectionState + + pb.CreationTime = st.CreationTime + + pb.Deactivated = st.Deactivated + + pb.DeactivatedAt = st.DeactivatedAt + + pb.DomainNames = st.DomainNames + + pb.EndpointName = st.EndpointName + + pb.GroupId = st.GroupId + + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.ResourceId = st.ResourceId + + pb.RuleId = st.RuleId + + pb.UpdatedTime = st.UpdatedTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type nccAzurePrivateEndpointRulePb struct { + ConnectionState NccAzurePrivateEndpointRuleConnectionState `json:"connection_state,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + Deactivated bool `json:"deactivated,omitempty"` + + DeactivatedAt int64 `json:"deactivated_at,omitempty"` + + DomainNames []string `json:"domain_names,omitempty"` + + EndpointName string `json:"endpoint_name,omitempty"` + + GroupId string `json:"group_id,omitempty"` + + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + + ResourceId string `json:"resource_id,omitempty"` + + RuleId string `json:"rule_id,omitempty"` + + UpdatedTime int64 `json:"updated_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func nccAzurePrivateEndpointRuleFromPb(pb *nccAzurePrivateEndpointRulePb) (*NccAzurePrivateEndpointRule, error) { + if pb == nil { + return nil, nil + } + st := &NccAzurePrivateEndpointRule{} + st.ConnectionState = pb.ConnectionState + st.CreationTime = pb.CreationTime + st.Deactivated = pb.Deactivated + st.DeactivatedAt = pb.DeactivatedAt + st.DomainNames = pb.DomainNames + st.EndpointName = pb.EndpointName + st.GroupId = pb.GroupId + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.ResourceId = pb.ResourceId + st.RuleId = pb.RuleId + st.UpdatedTime = pb.UpdatedTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *nccAzurePrivateEndpointRulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st nccAzurePrivateEndpointRulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nccAzureServiceEndpointRuleToPb(st *NccAzureServiceEndpointRule) (*nccAzureServiceEndpointRulePb, error) { + if st == nil { + return nil, nil + } + pb := &nccAzureServiceEndpointRulePb{} + pb.Subnets = st.Subnets + + pb.TargetRegion = st.TargetRegion + + pb.TargetServices = st.TargetServices + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type nccAzureServiceEndpointRulePb struct { + Subnets []string `json:"subnets,omitempty"` + + TargetRegion string `json:"target_region,omitempty"` + + TargetServices []EgressResourceType `json:"target_services,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func nccAzureServiceEndpointRuleFromPb(pb *nccAzureServiceEndpointRulePb) (*NccAzureServiceEndpointRule, error) { + if pb == nil { + return nil, nil + } + st := &NccAzureServiceEndpointRule{} + st.Subnets = pb.Subnets + st.TargetRegion = pb.TargetRegion + st.TargetServices = pb.TargetServices + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *nccAzureServiceEndpointRulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st nccAzureServiceEndpointRulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func nccEgressConfigToPb(st *NccEgressConfig) (*nccEgressConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &nccEgressConfigPb{} + pb.DefaultRules = st.DefaultRules + + pb.TargetRules = st.TargetRules + + return pb, nil +} + +type nccEgressConfigPb struct { + DefaultRules *NccEgressDefaultRules `json:"default_rules,omitempty"` + + TargetRules *NccEgressTargetRules `json:"target_rules,omitempty"` +} + +func nccEgressConfigFromPb(pb *nccEgressConfigPb) (*NccEgressConfig, error) { + if pb == nil { + return nil, nil + } + st := &NccEgressConfig{} + st.DefaultRules = pb.DefaultRules + st.TargetRules = pb.TargetRules + + return st, nil +} + +func nccEgressDefaultRulesToPb(st *NccEgressDefaultRules) (*nccEgressDefaultRulesPb, error) { + if st == nil { + return nil, nil + } + pb := &nccEgressDefaultRulesPb{} + pb.AwsStableIpRule = st.AwsStableIpRule + + pb.AzureServiceEndpointRule = st.AzureServiceEndpointRule + + return pb, nil +} + +type nccEgressDefaultRulesPb struct { + AwsStableIpRule *NccAwsStableIpRule `json:"aws_stable_ip_rule,omitempty"` + + AzureServiceEndpointRule *NccAzureServiceEndpointRule `json:"azure_service_endpoint_rule,omitempty"` +} + +func nccEgressDefaultRulesFromPb(pb *nccEgressDefaultRulesPb) (*NccEgressDefaultRules, error) { + if pb == nil { + return nil, nil + } + st := &NccEgressDefaultRules{} + st.AwsStableIpRule = pb.AwsStableIpRule + st.AzureServiceEndpointRule = pb.AzureServiceEndpointRule + + return st, nil +} + +func nccEgressTargetRulesToPb(st *NccEgressTargetRules) (*nccEgressTargetRulesPb, error) { + if st == nil { + return nil, nil + } + pb := &nccEgressTargetRulesPb{} + pb.AzurePrivateEndpointRules = st.AzurePrivateEndpointRules + + return pb, nil +} + +type nccEgressTargetRulesPb struct { + AzurePrivateEndpointRules []NccAzurePrivateEndpointRule `json:"azure_private_endpoint_rules,omitempty"` +} + +func nccEgressTargetRulesFromPb(pb *nccEgressTargetRulesPb) (*NccEgressTargetRules, error) { + if pb == nil { + return nil, nil + } + st := &NccEgressTargetRules{} + st.AzurePrivateEndpointRules = pb.AzurePrivateEndpointRules + + return st, nil +} + +func networkConnectivityConfigurationToPb(st *NetworkConnectivityConfiguration) (*networkConnectivityConfigurationPb, error) { + if st == nil { + return nil, nil + } + pb := &networkConnectivityConfigurationPb{} + pb.AccountId = st.AccountId + + pb.CreationTime = st.CreationTime + + pb.EgressConfig = st.EgressConfig + + pb.Name = st.Name + + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.Region = st.Region + + pb.UpdatedTime = st.UpdatedTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type networkConnectivityConfigurationPb struct { + AccountId string `json:"account_id,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + EgressConfig *NccEgressConfig `json:"egress_config,omitempty"` + + Name string `json:"name,omitempty"` + + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + + Region string `json:"region,omitempty"` + + UpdatedTime int64 `json:"updated_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func networkConnectivityConfigurationFromPb(pb *networkConnectivityConfigurationPb) (*NetworkConnectivityConfiguration, error) { + if pb == nil { + return nil, nil + } + st := &NetworkConnectivityConfiguration{} + st.AccountId = pb.AccountId + st.CreationTime = pb.CreationTime + st.EgressConfig = pb.EgressConfig + st.Name = pb.Name + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.Region = pb.Region + st.UpdatedTime = pb.UpdatedTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *networkConnectivityConfigurationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st networkConnectivityConfigurationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func networkPolicyEgressToPb(st *NetworkPolicyEgress) (*networkPolicyEgressPb, error) { + if st == nil { + return nil, nil + } + pb := &networkPolicyEgressPb{} + pb.NetworkAccess = st.NetworkAccess + + return pb, nil +} + +type networkPolicyEgressPb struct { + NetworkAccess *EgressNetworkPolicyNetworkAccessPolicy `json:"network_access,omitempty"` +} + +func networkPolicyEgressFromPb(pb *networkPolicyEgressPb) (*NetworkPolicyEgress, error) { + if pb == nil { + return nil, nil + } + st := &NetworkPolicyEgress{} + st.NetworkAccess = pb.NetworkAccess + + return st, nil +} + +func notificationDestinationToPb(st *NotificationDestination) (*notificationDestinationPb, error) { + if st == nil { + return nil, nil + } + pb := ¬ificationDestinationPb{} + pb.Config = st.Config + + pb.DestinationType = st.DestinationType + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type notificationDestinationPb struct { + Config *Config `json:"config,omitempty"` + + DestinationType DestinationType `json:"destination_type,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func notificationDestinationFromPb(pb *notificationDestinationPb) (*NotificationDestination, error) { + if pb == nil { + return nil, nil + } + st := &NotificationDestination{} + st.Config = pb.Config + st.DestinationType = pb.DestinationType + st.DisplayName = pb.DisplayName + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *notificationDestinationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st notificationDestinationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func pagerdutyConfigToPb(st *PagerdutyConfig) (*pagerdutyConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &pagerdutyConfigPb{} + pb.IntegrationKey = st.IntegrationKey + + pb.IntegrationKeySet = st.IntegrationKeySet + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type pagerdutyConfigPb struct { + IntegrationKey string `json:"integration_key,omitempty"` + + IntegrationKeySet bool `json:"integration_key_set,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func pagerdutyConfigFromPb(pb *pagerdutyConfigPb) (*PagerdutyConfig, error) { + if pb == nil { + return nil, nil + } + st := &PagerdutyConfig{} + st.IntegrationKey = pb.IntegrationKey + st.IntegrationKeySet = pb.IntegrationKeySet + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *pagerdutyConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st pagerdutyConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func partitionIdToPb(st *PartitionId) (*partitionIdPb, error) { + if st == nil { + return nil, nil + } + pb := &partitionIdPb{} + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type partitionIdPb struct { + WorkspaceId int64 `json:"workspaceId,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func partitionIdFromPb(pb *partitionIdPb) (*PartitionId, error) { + if pb == nil { + return nil, nil + } + st := &PartitionId{} + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *partitionIdPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st partitionIdPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func personalComputeMessageToPb(st *PersonalComputeMessage) (*personalComputeMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &personalComputeMessagePb{} + pb.Value = st.Value + + return pb, nil +} + +type personalComputeMessagePb struct { + Value PersonalComputeMessageEnum `json:"value"` +} + +func personalComputeMessageFromPb(pb *personalComputeMessagePb) (*PersonalComputeMessage, error) { + if pb == nil { + return nil, nil + } + st := &PersonalComputeMessage{} + st.Value = pb.Value + + return st, nil +} + +func personalComputeSettingToPb(st *PersonalComputeSetting) (*personalComputeSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &personalComputeSettingPb{} + pb.Etag = st.Etag + + pb.PersonalCompute = st.PersonalCompute + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type personalComputeSettingPb struct { + Etag string `json:"etag,omitempty"` + + PersonalCompute PersonalComputeMessage `json:"personal_compute"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func personalComputeSettingFromPb(pb *personalComputeSettingPb) (*PersonalComputeSetting, error) { + if pb == nil { + return nil, nil + } + st := &PersonalComputeSetting{} + st.Etag = pb.Etag + st.PersonalCompute = pb.PersonalCompute + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *personalComputeSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st personalComputeSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func publicTokenInfoToPb(st *PublicTokenInfo) (*publicTokenInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &publicTokenInfoPb{} + pb.Comment = st.Comment + + pb.CreationTime = st.CreationTime + + pb.ExpiryTime = st.ExpiryTime + + pb.TokenId = st.TokenId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type publicTokenInfoPb struct { + Comment string `json:"comment,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + ExpiryTime int64 `json:"expiry_time,omitempty"` + + TokenId string `json:"token_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func publicTokenInfoFromPb(pb *publicTokenInfoPb) (*PublicTokenInfo, error) { + if pb == nil { + return nil, nil + } + st := &PublicTokenInfo{} + st.Comment = pb.Comment + st.CreationTime = pb.CreationTime + st.ExpiryTime = pb.ExpiryTime + st.TokenId = pb.TokenId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *publicTokenInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st publicTokenInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func replaceIpAccessListToPb(st *ReplaceIpAccessList) (*replaceIpAccessListPb, error) { + if st == nil { + return nil, nil + } + pb := &replaceIpAccessListPb{} + pb.Enabled = st.Enabled + + pb.IpAccessListId = st.IpAccessListId + + pb.IpAddresses = st.IpAddresses + + pb.Label = st.Label + + pb.ListType = st.ListType + + return pb, nil +} + +type replaceIpAccessListPb struct { + Enabled bool `json:"enabled"` + + IpAccessListId string `json:"-" url:"-"` + + IpAddresses []string `json:"ip_addresses,omitempty"` + + Label string `json:"label"` + + ListType ListType `json:"list_type"` +} + +func replaceIpAccessListFromPb(pb *replaceIpAccessListPb) (*ReplaceIpAccessList, error) { + if pb == nil { + return nil, nil + } + st := &ReplaceIpAccessList{} + st.Enabled = pb.Enabled + st.IpAccessListId = pb.IpAccessListId + st.IpAddresses = pb.IpAddresses + st.Label = pb.Label + st.ListType = pb.ListType + + return st, nil +} + +func replaceResponseToPb(st *ReplaceResponse) (*replaceResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &replaceResponsePb{} + + return pb, nil +} + +type replaceResponsePb struct { +} + +func replaceResponseFromPb(pb *replaceResponsePb) (*ReplaceResponse, error) { + if pb == nil { + return nil, nil + } + st := &ReplaceResponse{} + + return st, nil +} + +func restrictWorkspaceAdminsMessageToPb(st *RestrictWorkspaceAdminsMessage) (*restrictWorkspaceAdminsMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &restrictWorkspaceAdminsMessagePb{} + pb.Status = st.Status + + return pb, nil +} + +type restrictWorkspaceAdminsMessagePb struct { + Status RestrictWorkspaceAdminsMessageStatus `json:"status"` +} + +func restrictWorkspaceAdminsMessageFromPb(pb *restrictWorkspaceAdminsMessagePb) (*RestrictWorkspaceAdminsMessage, error) { + if pb == nil { + return nil, nil + } + st := &RestrictWorkspaceAdminsMessage{} + st.Status = pb.Status + + return st, nil +} + +func restrictWorkspaceAdminsSettingToPb(st *RestrictWorkspaceAdminsSetting) (*restrictWorkspaceAdminsSettingPb, error) { + if st == nil { + return nil, nil + } + pb := &restrictWorkspaceAdminsSettingPb{} + pb.Etag = st.Etag + + pb.RestrictWorkspaceAdmins = st.RestrictWorkspaceAdmins + + pb.SettingName = st.SettingName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type restrictWorkspaceAdminsSettingPb struct { + Etag string `json:"etag,omitempty"` + + RestrictWorkspaceAdmins RestrictWorkspaceAdminsMessage `json:"restrict_workspace_admins"` + + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func restrictWorkspaceAdminsSettingFromPb(pb *restrictWorkspaceAdminsSettingPb) (*RestrictWorkspaceAdminsSetting, error) { + if pb == nil { + return nil, nil + } + st := &RestrictWorkspaceAdminsSetting{} + st.Etag = pb.Etag + st.RestrictWorkspaceAdmins = pb.RestrictWorkspaceAdmins + st.SettingName = pb.SettingName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *restrictWorkspaceAdminsSettingPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st restrictWorkspaceAdminsSettingPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func revokeTokenRequestToPb(st *RevokeTokenRequest) (*revokeTokenRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &revokeTokenRequestPb{} + pb.TokenId = st.TokenId + + return pb, nil +} + +type revokeTokenRequestPb struct { + TokenId string `json:"token_id"` +} + +func revokeTokenRequestFromPb(pb *revokeTokenRequestPb) (*RevokeTokenRequest, error) { + if pb == nil { + return nil, nil + } + st := &RevokeTokenRequest{} + st.TokenId = pb.TokenId + + return st, nil +} + +func revokeTokenResponseToPb(st *RevokeTokenResponse) (*revokeTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &revokeTokenResponsePb{} + + return pb, nil +} + +type revokeTokenResponsePb struct { +} + +func revokeTokenResponseFromPb(pb *revokeTokenResponsePb) (*RevokeTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &RevokeTokenResponse{} + + return st, nil +} + +func setStatusResponseToPb(st *SetStatusResponse) (*setStatusResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setStatusResponsePb{} + + return pb, nil +} + +type setStatusResponsePb struct { +} + +func setStatusResponseFromPb(pb *setStatusResponsePb) (*SetStatusResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetStatusResponse{} + + return st, nil +} + +func slackConfigToPb(st *SlackConfig) (*slackConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &slackConfigPb{} + pb.Url = st.Url + + pb.UrlSet = st.UrlSet + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type slackConfigPb struct { + Url string `json:"url,omitempty"` + + UrlSet bool `json:"url_set,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func slackConfigFromPb(pb *slackConfigPb) (*SlackConfig, error) { + if pb == nil { + return nil, nil + } + st := &SlackConfig{} + st.Url = pb.Url + st.UrlSet = pb.UrlSet + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *slackConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st slackConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func stringMessageToPb(st *StringMessage) (*stringMessagePb, error) { + if st == nil { + return nil, nil + } + pb := &stringMessagePb{} + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type stringMessagePb struct { + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func stringMessageFromPb(pb *stringMessagePb) (*StringMessage, error) { + if pb == nil { + return nil, nil + } + st := &StringMessage{} + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *stringMessagePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st stringMessagePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenAccessControlRequestToPb(st *TokenAccessControlRequest) (*tokenAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenAccessControlRequestFromPb(pb *tokenAccessControlRequestPb) (*TokenAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &TokenAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenAccessControlResponseToPb(st *TokenAccessControlResponse) (*tokenAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &tokenAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenAccessControlResponsePb struct { + AllPermissions []TokenPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenAccessControlResponseFromPb(pb *tokenAccessControlResponsePb) (*TokenAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &TokenAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenInfoPb{} + pb.Comment = st.Comment + + pb.CreatedById = st.CreatedById + + pb.CreatedByUsername = st.CreatedByUsername + + pb.CreationTime = st.CreationTime + + pb.ExpiryTime = st.ExpiryTime + + pb.LastUsedDay = st.LastUsedDay + + pb.OwnerId = st.OwnerId + + pb.TokenId = st.TokenId + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenInfoPb struct { + Comment string `json:"comment,omitempty"` + + CreatedById int64 `json:"created_by_id,omitempty"` + + CreatedByUsername string `json:"created_by_username,omitempty"` + + CreationTime int64 `json:"creation_time,omitempty"` + + ExpiryTime int64 `json:"expiry_time,omitempty"` + + LastUsedDay int64 `json:"last_used_day,omitempty"` + + OwnerId int64 `json:"owner_id,omitempty"` + + TokenId string `json:"token_id,omitempty"` + + WorkspaceId int64 `json:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenInfoFromPb(pb *tokenInfoPb) (*TokenInfo, error) { + if pb == nil { + return nil, nil + } + st := &TokenInfo{} + st.Comment = pb.Comment + st.CreatedById = pb.CreatedById + st.CreatedByUsername = pb.CreatedByUsername + st.CreationTime = pb.CreationTime + st.ExpiryTime = pb.ExpiryTime + st.LastUsedDay = pb.LastUsedDay + st.OwnerId = pb.OwnerId + st.TokenId = pb.TokenId + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenPermissionToPb(st *TokenPermission) (*tokenPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenPermissionFromPb(pb *tokenPermissionPb) (*TokenPermission, error) { + if pb == nil { + return nil, nil + } + st := &TokenPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenPermissionsToPb(st *TokenPermissions) (*tokenPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenPermissionsPb struct { + AccessControlList []TokenAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenPermissionsFromPb(pb *tokenPermissionsPb) (*TokenPermissions, error) { + if pb == nil { + return nil, nil + } + st := &TokenPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenPermissionsDescriptionToPb(st *TokenPermissionsDescription) (*tokenPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tokenPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tokenPermissionsDescriptionFromPb(pb *tokenPermissionsDescriptionPb) (*TokenPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &TokenPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tokenPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tokenPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tokenPermissionsRequestToPb(st *TokenPermissionsRequest) (*tokenPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &tokenPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + return pb, nil +} + +type tokenPermissionsRequestPb struct { + AccessControlList []TokenAccessControlRequest `json:"access_control_list,omitempty"` +} + +func tokenPermissionsRequestFromPb(pb *tokenPermissionsRequestPb) (*TokenPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &TokenPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + + return st, nil +} + +func updateAccountIpAccessEnableRequestToPb(st *UpdateAccountIpAccessEnableRequest) (*updateAccountIpAccessEnableRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAccountIpAccessEnableRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateAccountIpAccessEnableRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting AccountIpAccessEnable `json:"setting"` +} + +func updateAccountIpAccessEnableRequestFromPb(pb *updateAccountIpAccessEnableRequestPb) (*UpdateAccountIpAccessEnableRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAccountIpAccessEnableRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateAibiDashboardEmbeddingAccessPolicySettingRequestToPb(st *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) (*updateAibiDashboardEmbeddingAccessPolicySettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateAibiDashboardEmbeddingAccessPolicySettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting AibiDashboardEmbeddingAccessPolicySetting `json:"setting"` +} + +func updateAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb *updateAibiDashboardEmbeddingAccessPolicySettingRequestPb) (*UpdateAibiDashboardEmbeddingAccessPolicySettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAibiDashboardEmbeddingAccessPolicySettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(st *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting AibiDashboardEmbeddingApprovedDomainsSetting `json:"setting"` +} + +func updateAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb *updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) (*UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateAutomaticClusterUpdateSettingRequestToPb(st *UpdateAutomaticClusterUpdateSettingRequest) (*updateAutomaticClusterUpdateSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAutomaticClusterUpdateSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateAutomaticClusterUpdateSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting AutomaticClusterUpdateSetting `json:"setting"` +} + +func updateAutomaticClusterUpdateSettingRequestFromPb(pb *updateAutomaticClusterUpdateSettingRequestPb) (*UpdateAutomaticClusterUpdateSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAutomaticClusterUpdateSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateComplianceSecurityProfileSettingRequestToPb(st *UpdateComplianceSecurityProfileSettingRequest) (*updateComplianceSecurityProfileSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateComplianceSecurityProfileSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateComplianceSecurityProfileSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting ComplianceSecurityProfileSetting `json:"setting"` +} + +func updateComplianceSecurityProfileSettingRequestFromPb(pb *updateComplianceSecurityProfileSettingRequestPb) (*UpdateComplianceSecurityProfileSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateComplianceSecurityProfileSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateCspEnablementAccountSettingRequestToPb(st *UpdateCspEnablementAccountSettingRequest) (*updateCspEnablementAccountSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCspEnablementAccountSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateCspEnablementAccountSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting CspEnablementAccountSetting `json:"setting"` +} + +func updateCspEnablementAccountSettingRequestFromPb(pb *updateCspEnablementAccountSettingRequestPb) (*UpdateCspEnablementAccountSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCspEnablementAccountSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateDefaultNamespaceSettingRequestToPb(st *UpdateDefaultNamespaceSettingRequest) (*updateDefaultNamespaceSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDefaultNamespaceSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateDefaultNamespaceSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting DefaultNamespaceSetting `json:"setting"` +} + +func updateDefaultNamespaceSettingRequestFromPb(pb *updateDefaultNamespaceSettingRequestPb) (*UpdateDefaultNamespaceSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDefaultNamespaceSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateDisableLegacyAccessRequestToPb(st *UpdateDisableLegacyAccessRequest) (*updateDisableLegacyAccessRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDisableLegacyAccessRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateDisableLegacyAccessRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting DisableLegacyAccess `json:"setting"` +} + +func updateDisableLegacyAccessRequestFromPb(pb *updateDisableLegacyAccessRequestPb) (*UpdateDisableLegacyAccessRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDisableLegacyAccessRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateDisableLegacyDbfsRequestToPb(st *UpdateDisableLegacyDbfsRequest) (*updateDisableLegacyDbfsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDisableLegacyDbfsRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateDisableLegacyDbfsRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting DisableLegacyDbfs `json:"setting"` +} + +func updateDisableLegacyDbfsRequestFromPb(pb *updateDisableLegacyDbfsRequestPb) (*UpdateDisableLegacyDbfsRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDisableLegacyDbfsRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateDisableLegacyFeaturesRequestToPb(st *UpdateDisableLegacyFeaturesRequest) (*updateDisableLegacyFeaturesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateDisableLegacyFeaturesRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateDisableLegacyFeaturesRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting DisableLegacyFeatures `json:"setting"` +} + +func updateDisableLegacyFeaturesRequestFromPb(pb *updateDisableLegacyFeaturesRequestPb) (*UpdateDisableLegacyFeaturesRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateDisableLegacyFeaturesRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateEnableExportNotebookRequestToPb(st *UpdateEnableExportNotebookRequest) (*updateEnableExportNotebookRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEnableExportNotebookRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateEnableExportNotebookRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting EnableExportNotebook `json:"setting"` +} + +func updateEnableExportNotebookRequestFromPb(pb *updateEnableExportNotebookRequestPb) (*UpdateEnableExportNotebookRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEnableExportNotebookRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateEnableNotebookTableClipboardRequestToPb(st *UpdateEnableNotebookTableClipboardRequest) (*updateEnableNotebookTableClipboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEnableNotebookTableClipboardRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateEnableNotebookTableClipboardRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting EnableNotebookTableClipboard `json:"setting"` +} + +func updateEnableNotebookTableClipboardRequestFromPb(pb *updateEnableNotebookTableClipboardRequestPb) (*UpdateEnableNotebookTableClipboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEnableNotebookTableClipboardRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateEnableResultsDownloadingRequestToPb(st *UpdateEnableResultsDownloadingRequest) (*updateEnableResultsDownloadingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEnableResultsDownloadingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateEnableResultsDownloadingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting EnableResultsDownloading `json:"setting"` +} + +func updateEnableResultsDownloadingRequestFromPb(pb *updateEnableResultsDownloadingRequestPb) (*UpdateEnableResultsDownloadingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEnableResultsDownloadingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateEnhancedSecurityMonitoringSettingRequestToPb(st *UpdateEnhancedSecurityMonitoringSettingRequest) (*updateEnhancedSecurityMonitoringSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEnhancedSecurityMonitoringSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateEnhancedSecurityMonitoringSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting EnhancedSecurityMonitoringSetting `json:"setting"` +} + +func updateEnhancedSecurityMonitoringSettingRequestFromPb(pb *updateEnhancedSecurityMonitoringSettingRequestPb) (*UpdateEnhancedSecurityMonitoringSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEnhancedSecurityMonitoringSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateEsmEnablementAccountSettingRequestToPb(st *UpdateEsmEnablementAccountSettingRequest) (*updateEsmEnablementAccountSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEsmEnablementAccountSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateEsmEnablementAccountSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting EsmEnablementAccountSetting `json:"setting"` +} + +func updateEsmEnablementAccountSettingRequestFromPb(pb *updateEsmEnablementAccountSettingRequestPb) (*UpdateEsmEnablementAccountSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEsmEnablementAccountSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateIpAccessListToPb(st *UpdateIpAccessList) (*updateIpAccessListPb, error) { + if st == nil { + return nil, nil + } + pb := &updateIpAccessListPb{} + pb.Enabled = st.Enabled + + pb.IpAccessListId = st.IpAccessListId + + pb.IpAddresses = st.IpAddresses + + pb.Label = st.Label + + pb.ListType = st.ListType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateIpAccessListPb struct { + Enabled bool `json:"enabled,omitempty"` + + IpAccessListId string `json:"-" url:"-"` + + IpAddresses []string `json:"ip_addresses,omitempty"` + + Label string `json:"label,omitempty"` + + ListType ListType `json:"list_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateIpAccessListFromPb(pb *updateIpAccessListPb) (*UpdateIpAccessList, error) { + if pb == nil { + return nil, nil + } + st := &UpdateIpAccessList{} + st.Enabled = pb.Enabled + st.IpAccessListId = pb.IpAccessListId + st.IpAddresses = pb.IpAddresses + st.Label = pb.Label + st.ListType = pb.ListType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateIpAccessListPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateIpAccessListPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateLlmProxyPartnerPoweredAccountRequestToPb(st *UpdateLlmProxyPartnerPoweredAccountRequest) (*updateLlmProxyPartnerPoweredAccountRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateLlmProxyPartnerPoweredAccountRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateLlmProxyPartnerPoweredAccountRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredAccount `json:"setting"` +} + +func updateLlmProxyPartnerPoweredAccountRequestFromPb(pb *updateLlmProxyPartnerPoweredAccountRequestPb) (*UpdateLlmProxyPartnerPoweredAccountRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateLlmProxyPartnerPoweredAccountRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateLlmProxyPartnerPoweredEnforceRequestToPb(st *UpdateLlmProxyPartnerPoweredEnforceRequest) (*updateLlmProxyPartnerPoweredEnforceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateLlmProxyPartnerPoweredEnforceRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateLlmProxyPartnerPoweredEnforceRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredEnforce `json:"setting"` +} + +func updateLlmProxyPartnerPoweredEnforceRequestFromPb(pb *updateLlmProxyPartnerPoweredEnforceRequestPb) (*UpdateLlmProxyPartnerPoweredEnforceRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateLlmProxyPartnerPoweredEnforceRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateLlmProxyPartnerPoweredWorkspaceRequestToPb(st *UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*updateLlmProxyPartnerPoweredWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateLlmProxyPartnerPoweredWorkspaceRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateLlmProxyPartnerPoweredWorkspaceRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` +} + +func updateLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb *updateLlmProxyPartnerPoweredWorkspaceRequestPb) (*UpdateLlmProxyPartnerPoweredWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateLlmProxyPartnerPoweredWorkspaceRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateNccAzurePrivateEndpointRulePublicRequestToPb(st *UpdateNccAzurePrivateEndpointRulePublicRequest) (*updateNccAzurePrivateEndpointRulePublicRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateNccAzurePrivateEndpointRulePublicRequestPb{} + pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId + + pb.PrivateEndpointRule = st.PrivateEndpointRule + + pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId + + pb.UpdateMask = st.UpdateMask + + return pb, nil +} + +type updateNccAzurePrivateEndpointRulePublicRequestPb struct { + NetworkConnectivityConfigId string `json:"-" url:"-"` + + PrivateEndpointRule UpdatePrivateEndpointRule `json:"private_endpoint_rule"` + + PrivateEndpointRuleId string `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask"` +} + +func updateNccAzurePrivateEndpointRulePublicRequestFromPb(pb *updateNccAzurePrivateEndpointRulePublicRequestPb) (*UpdateNccAzurePrivateEndpointRulePublicRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateNccAzurePrivateEndpointRulePublicRequest{} + st.NetworkConnectivityConfigId = pb.NetworkConnectivityConfigId + st.PrivateEndpointRule = pb.PrivateEndpointRule + st.PrivateEndpointRuleId = pb.PrivateEndpointRuleId + st.UpdateMask = pb.UpdateMask + + return st, nil +} + +func updateNetworkPolicyRequestToPb(st *UpdateNetworkPolicyRequest) (*updateNetworkPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateNetworkPolicyRequestPb{} + pb.NetworkPolicy = st.NetworkPolicy + + pb.NetworkPolicyId = st.NetworkPolicyId + + return pb, nil +} + +type updateNetworkPolicyRequestPb struct { + NetworkPolicy AccountNetworkPolicy `json:"network_policy"` + + NetworkPolicyId string `json:"-" url:"-"` +} + +func updateNetworkPolicyRequestFromPb(pb *updateNetworkPolicyRequestPb) (*UpdateNetworkPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateNetworkPolicyRequest{} + st.NetworkPolicy = pb.NetworkPolicy + st.NetworkPolicyId = pb.NetworkPolicyId + + return st, nil +} + +func updateNotificationDestinationRequestToPb(st *UpdateNotificationDestinationRequest) (*updateNotificationDestinationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateNotificationDestinationRequestPb{} + pb.Config = st.Config + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateNotificationDestinationRequestPb struct { + Config *Config `json:"config,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateNotificationDestinationRequestFromPb(pb *updateNotificationDestinationRequestPb) (*UpdateNotificationDestinationRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateNotificationDestinationRequest{} + st.Config = pb.Config + st.DisplayName = pb.DisplayName + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateNotificationDestinationRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateNotificationDestinationRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updatePersonalComputeSettingRequestToPb(st *UpdatePersonalComputeSettingRequest) (*updatePersonalComputeSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updatePersonalComputeSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updatePersonalComputeSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting PersonalComputeSetting `json:"setting"` +} + +func updatePersonalComputeSettingRequestFromPb(pb *updatePersonalComputeSettingRequestPb) (*UpdatePersonalComputeSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePersonalComputeSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updatePrivateEndpointRuleToPb(st *UpdatePrivateEndpointRule) (*updatePrivateEndpointRulePb, error) { + if st == nil { + return nil, nil + } + pb := &updatePrivateEndpointRulePb{} + pb.DomainNames = st.DomainNames + + return pb, nil +} + +type updatePrivateEndpointRulePb struct { + DomainNames []string `json:"domain_names,omitempty"` +} + +func updatePrivateEndpointRuleFromPb(pb *updatePrivateEndpointRulePb) (*UpdatePrivateEndpointRule, error) { + if pb == nil { + return nil, nil + } + st := &UpdatePrivateEndpointRule{} + st.DomainNames = pb.DomainNames + + return st, nil +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func updateRestrictWorkspaceAdminsSettingRequestToPb(st *UpdateRestrictWorkspaceAdminsSettingRequest) (*updateRestrictWorkspaceAdminsSettingRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRestrictWorkspaceAdminsSettingRequestPb{} + pb.AllowMissing = st.AllowMissing + + pb.FieldMask = st.FieldMask + + pb.Setting = st.Setting + + return pb, nil +} + +type updateRestrictWorkspaceAdminsSettingRequestPb struct { + AllowMissing bool `json:"allow_missing"` + + FieldMask string `json:"field_mask"` + + Setting RestrictWorkspaceAdminsSetting `json:"setting"` +} + +func updateRestrictWorkspaceAdminsSettingRequestFromPb(pb *updateRestrictWorkspaceAdminsSettingRequestPb) (*UpdateRestrictWorkspaceAdminsSettingRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRestrictWorkspaceAdminsSettingRequest{} + st.AllowMissing = pb.AllowMissing + st.FieldMask = pb.FieldMask + st.Setting = pb.Setting + + return st, nil +} + +func updateWorkspaceNetworkOptionRequestToPb(st *UpdateWorkspaceNetworkOptionRequest) (*updateWorkspaceNetworkOptionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateWorkspaceNetworkOptionRequestPb{} + pb.WorkspaceId = st.WorkspaceId + + pb.WorkspaceNetworkOption = st.WorkspaceNetworkOption + + return pb, nil +} + +type updateWorkspaceNetworkOptionRequestPb struct { + WorkspaceId int64 `json:"-" url:"-"` + + WorkspaceNetworkOption WorkspaceNetworkOption `json:"workspace_network_option"` +} + +func updateWorkspaceNetworkOptionRequestFromPb(pb *updateWorkspaceNetworkOptionRequestPb) (*UpdateWorkspaceNetworkOptionRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateWorkspaceNetworkOptionRequest{} + st.WorkspaceId = pb.WorkspaceId + st.WorkspaceNetworkOption = pb.WorkspaceNetworkOption + + return st, nil +} + +func workspaceNetworkOptionToPb(st *WorkspaceNetworkOption) (*workspaceNetworkOptionPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceNetworkOptionPb{} + pb.NetworkPolicyId = st.NetworkPolicyId + + pb.WorkspaceId = st.WorkspaceId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceNetworkOptionPb struct { + NetworkPolicyId string `json:"network_policy_id,omitempty"` + + WorkspaceId int64 `json:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceNetworkOptionFromPb(pb *workspaceNetworkOptionPb) (*WorkspaceNetworkOption, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceNetworkOption{} + st.NetworkPolicyId = pb.NetworkPolicyId + st.WorkspaceId = pb.WorkspaceId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceNetworkOptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceNetworkOptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/settings/model.go b/service/settings/model.go index 2a71a9cb0..4e0c5775d 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -3,13 +3,16 @@ package settings import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AccountIpAccessEnable struct { - AcctIpAclEnable BooleanMessage `json:"acct_ip_acl_enable"` + + // Wire name: 'acct_ip_acl_enable' + AcctIpAclEnable BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -17,49 +20,116 @@ type AccountIpAccessEnable struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AccountIpAccessEnable) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AccountIpAccessEnable) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountIpAccessEnablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountIpAccessEnableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AccountIpAccessEnable) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AccountIpAccessEnable) MarshalJSON() ([]byte, error) { + pb, err := accountIpAccessEnableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AccountNetworkPolicy struct { // The associated account ID for this Network Policy object. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // The network policies applying for egress traffic. - Egress *NetworkPolicyEgress `json:"egress,omitempty"` + // Wire name: 'egress' + Egress *NetworkPolicyEgress // The unique identifier for the network policy. - NetworkPolicyId string `json:"network_policy_id,omitempty"` + // Wire name: 'network_policy_id' + NetworkPolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AccountNetworkPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AccountNetworkPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accountNetworkPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accountNetworkPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AccountNetworkPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AccountNetworkPolicy) MarshalJSON() ([]byte, error) { + pb, err := accountNetworkPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AibiDashboardEmbeddingAccessPolicy struct { - AccessPolicyType AibiDashboardEmbeddingAccessPolicyAccessPolicyType `json:"access_policy_type"` + + // Wire name: 'access_policy_type' + AccessPolicyType AibiDashboardEmbeddingAccessPolicyAccessPolicyType +} + +func (st *AibiDashboardEmbeddingAccessPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aibiDashboardEmbeddingAccessPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aibiDashboardEmbeddingAccessPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AibiDashboardEmbeddingAccessPolicy) MarshalJSON() ([]byte, error) { + pb, err := aibiDashboardEmbeddingAccessPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AibiDashboardEmbeddingAccessPolicyAccessPolicyType string +type aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb string const AibiDashboardEmbeddingAccessPolicyAccessPolicyTypeAllowAllDomains AibiDashboardEmbeddingAccessPolicyAccessPolicyType = `ALLOW_ALL_DOMAINS` @@ -88,8 +158,26 @@ func (f *AibiDashboardEmbeddingAccessPolicyAccessPolicyType) Type() string { return "AibiDashboardEmbeddingAccessPolicyAccessPolicyType" } +func aibiDashboardEmbeddingAccessPolicyAccessPolicyTypeToPb(st *AibiDashboardEmbeddingAccessPolicyAccessPolicyType) (*aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb, error) { + if st == nil { + return nil, nil + } + pb := aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb(*st) + return &pb, nil +} + +func aibiDashboardEmbeddingAccessPolicyAccessPolicyTypeFromPb(pb *aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb) (*AibiDashboardEmbeddingAccessPolicyAccessPolicyType, error) { + if pb == nil { + return nil, nil + } + st := AibiDashboardEmbeddingAccessPolicyAccessPolicyType(*pb) + return &st, nil +} + type AibiDashboardEmbeddingAccessPolicySetting struct { - AibiDashboardEmbeddingAccessPolicy AibiDashboardEmbeddingAccessPolicy `json:"aibi_dashboard_embedding_access_policy"` + + // Wire name: 'aibi_dashboard_embedding_access_policy' + AibiDashboardEmbeddingAccessPolicy AibiDashboardEmbeddingAccessPolicy // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -97,31 +185,79 @@ type AibiDashboardEmbeddingAccessPolicySetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AibiDashboardEmbeddingAccessPolicySetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AibiDashboardEmbeddingAccessPolicySetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aibiDashboardEmbeddingAccessPolicySettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aibiDashboardEmbeddingAccessPolicySettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AibiDashboardEmbeddingAccessPolicySetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AibiDashboardEmbeddingAccessPolicySetting) MarshalJSON() ([]byte, error) { + pb, err := aibiDashboardEmbeddingAccessPolicySettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AibiDashboardEmbeddingApprovedDomains struct { - ApprovedDomains []string `json:"approved_domains,omitempty"` + + // Wire name: 'approved_domains' + ApprovedDomains []string +} + +func (st *AibiDashboardEmbeddingApprovedDomains) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aibiDashboardEmbeddingApprovedDomainsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aibiDashboardEmbeddingApprovedDomainsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AibiDashboardEmbeddingApprovedDomains) MarshalJSON() ([]byte, error) { + pb, err := aibiDashboardEmbeddingApprovedDomainsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AibiDashboardEmbeddingApprovedDomainsSetting struct { - AibiDashboardEmbeddingApprovedDomains AibiDashboardEmbeddingApprovedDomains `json:"aibi_dashboard_embedding_approved_domains"` + + // Wire name: 'aibi_dashboard_embedding_approved_domains' + AibiDashboardEmbeddingApprovedDomains AibiDashboardEmbeddingApprovedDomains // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -129,27 +265,48 @@ type AibiDashboardEmbeddingApprovedDomainsSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AibiDashboardEmbeddingApprovedDomainsSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AibiDashboardEmbeddingApprovedDomainsSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aibiDashboardEmbeddingApprovedDomainsSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aibiDashboardEmbeddingApprovedDomainsSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AibiDashboardEmbeddingApprovedDomainsSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AibiDashboardEmbeddingApprovedDomainsSetting) MarshalJSON() ([]byte, error) { + pb, err := aibiDashboardEmbeddingApprovedDomainsSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AutomaticClusterUpdateSetting struct { - AutomaticClusterUpdateWorkspace ClusterAutoRestartMessage `json:"automatic_cluster_update_workspace"` + + // Wire name: 'automatic_cluster_update_workspace' + AutomaticClusterUpdateWorkspace ClusterAutoRestartMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -157,64 +314,125 @@ type AutomaticClusterUpdateSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AutomaticClusterUpdateSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AutomaticClusterUpdateSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &automaticClusterUpdateSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := automaticClusterUpdateSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AutomaticClusterUpdateSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AutomaticClusterUpdateSetting) MarshalJSON() ([]byte, error) { + pb, err := automaticClusterUpdateSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type BooleanMessage struct { - Value bool `json:"value,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'value' + Value bool + + ForceSendFields []string `tf:"-"` } -func (s *BooleanMessage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BooleanMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &booleanMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := booleanMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BooleanMessage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BooleanMessage) MarshalJSON() ([]byte, error) { + pb, err := booleanMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterAutoRestartMessage struct { - CanToggle bool `json:"can_toggle,omitempty"` - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'can_toggle' + CanToggle bool + + // Wire name: 'enabled' + Enabled bool // Contains an information about the enablement status judging (e.g. whether // the enterprise tier is enabled) This is only additional information that // MUST NOT be used to decide whether the setting is enabled or not. This is // intended to use only for purposes like showing an error message to the // customer with the additional details. For example, using these details we // can check why exactly the feature is disabled for this customer. - EnablementDetails *ClusterAutoRestartMessageEnablementDetails `json:"enablement_details,omitempty"` + // Wire name: 'enablement_details' + EnablementDetails *ClusterAutoRestartMessageEnablementDetails - MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow `json:"maintenance_window,omitempty"` + // Wire name: 'maintenance_window' + MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow - RestartEvenIfNoUpdatesAvailable bool `json:"restart_even_if_no_updates_available,omitempty"` + // Wire name: 'restart_even_if_no_updates_available' + RestartEvenIfNoUpdatesAvailable bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAutoRestartMessage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAutoRestartMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAutoRestartMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAutoRestartMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAutoRestartMessage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAutoRestartMessage) MarshalJSON() ([]byte, error) { + pb, err := clusterAutoRestartMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Contains an information about the enablement status judging (e.g. whether the @@ -225,29 +443,77 @@ func (s ClusterAutoRestartMessage) MarshalJSON() ([]byte, error) { // the feature is disabled for this customer. type ClusterAutoRestartMessageEnablementDetails struct { // The feature is force enabled if compliance mode is active - ForcedForComplianceMode bool `json:"forced_for_compliance_mode,omitempty"` + // Wire name: 'forced_for_compliance_mode' + ForcedForComplianceMode bool // The feature is unavailable if the corresponding entitlement disabled (see // getShieldEntitlementEnable) - UnavailableForDisabledEntitlement bool `json:"unavailable_for_disabled_entitlement,omitempty"` + // Wire name: 'unavailable_for_disabled_entitlement' + UnavailableForDisabledEntitlement bool // The feature is unavailable if the customer doesn't have enterprise tier - UnavailableForNonEnterpriseTier bool `json:"unavailable_for_non_enterprise_tier,omitempty"` + // Wire name: 'unavailable_for_non_enterprise_tier' + UnavailableForNonEnterpriseTier bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAutoRestartMessageEnablementDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAutoRestartMessageEnablementDetails) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAutoRestartMessageEnablementDetailsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAutoRestartMessageEnablementDetailsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAutoRestartMessageEnablementDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAutoRestartMessageEnablementDetails) MarshalJSON() ([]byte, error) { + pb, err := clusterAutoRestartMessageEnablementDetailsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterAutoRestartMessageMaintenanceWindow struct { - WeekDayBasedSchedule *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule `json:"week_day_based_schedule,omitempty"` + + // Wire name: 'week_day_based_schedule' + WeekDayBasedSchedule *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule +} + +func (st *ClusterAutoRestartMessageMaintenanceWindow) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAutoRestartMessageMaintenanceWindowPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAutoRestartMessageMaintenanceWindowFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ClusterAutoRestartMessageMaintenanceWindow) MarshalJSON() ([]byte, error) { + pb, err := clusterAutoRestartMessageMaintenanceWindowToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterAutoRestartMessageMaintenanceWindowDayOfWeek string +type clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb string const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekFriday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `FRIDAY` @@ -284,15 +550,61 @@ func (f *ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) Type() string { return "ClusterAutoRestartMessageMaintenanceWindowDayOfWeek" } +func clusterAutoRestartMessageMaintenanceWindowDayOfWeekToPb(st *ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) (*clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb, error) { + if st == nil { + return nil, nil + } + pb := clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb(*st) + return &pb, nil +} + +func clusterAutoRestartMessageMaintenanceWindowDayOfWeekFromPb(pb *clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb) (*ClusterAutoRestartMessageMaintenanceWindowDayOfWeek, error) { + if pb == nil { + return nil, nil + } + st := ClusterAutoRestartMessageMaintenanceWindowDayOfWeek(*pb) + return &st, nil +} + type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule struct { - DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"` - Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency `json:"frequency,omitempty"` + // Wire name: 'day_of_week' + DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek + + // Wire name: 'frequency' + Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency + + // Wire name: 'window_start_time' + WindowStartTime *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime +} + +func (st *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAutoRestartMessageMaintenanceWindowWeekDayBasedScheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - WindowStartTime *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime `json:"window_start_time,omitempty"` +func (st ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) MarshalJSON() ([]byte, error) { + pb, err := clusterAutoRestartMessageMaintenanceWindowWeekDayBasedScheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency string +type clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb string const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyEveryWeek ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `EVERY_WEEK` @@ -329,43 +641,99 @@ func (f *ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) Type() stri return "ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency" } +func clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyToPb(st *ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) (*clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb, error) { + if st == nil { + return nil, nil + } + pb := clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb(*st) + return &pb, nil +} + +func clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyFromPb(pb *clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb) (*ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency, error) { + if pb == nil { + return nil, nil + } + st := ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency(*pb) + return &st, nil +} + type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime struct { - Hours int `json:"hours,omitempty"` - Minutes int `json:"minutes,omitempty"` + // Wire name: 'hours' + Hours int + + // Wire name: 'minutes' + Minutes int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clusterAutoRestartMessageMaintenanceWindowWindowStartTimeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) MarshalJSON() ([]byte, error) { + pb, err := clusterAutoRestartMessageMaintenanceWindowWindowStartTimeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // SHIELD feature: CSP type ComplianceSecurityProfile struct { // Set by customers when they request Compliance Security Profile (CSP) - ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` + // Wire name: 'compliance_standards' + ComplianceStandards []ComplianceStandard - IsEnabled bool `json:"is_enabled,omitempty"` + // Wire name: 'is_enabled' + IsEnabled bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &complianceSecurityProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := complianceSecurityProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { + pb, err := complianceSecurityProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ComplianceSecurityProfileSetting struct { // SHIELD feature: CSP - ComplianceSecurityProfileWorkspace ComplianceSecurityProfile `json:"compliance_security_profile_workspace"` + // Wire name: 'compliance_security_profile_workspace' + ComplianceSecurityProfileWorkspace ComplianceSecurityProfile // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -373,27 +741,47 @@ type ComplianceSecurityProfileSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ComplianceSecurityProfileSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ComplianceSecurityProfileSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &complianceSecurityProfileSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := complianceSecurityProfileSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ComplianceSecurityProfileSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ComplianceSecurityProfileSetting) MarshalJSON() ([]byte, error) { + pb, err := complianceSecurityProfileSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Compliance stardard for SHIELD customers type ComplianceStandard string +type complianceStandardPb string const ComplianceStandardCanadaProtectedB ComplianceStandard = `CANADA_PROTECTED_B` @@ -442,42 +830,170 @@ func (f *ComplianceStandard) Type() string { return "ComplianceStandard" } +func complianceStandardToPb(st *ComplianceStandard) (*complianceStandardPb, error) { + if st == nil { + return nil, nil + } + pb := complianceStandardPb(*st) + return &pb, nil +} + +func complianceStandardFromPb(pb *complianceStandardPb) (*ComplianceStandard, error) { + if pb == nil { + return nil, nil + } + st := ComplianceStandard(*pb) + return &st, nil +} + type Config struct { - Email *EmailConfig `json:"email,omitempty"` - GenericWebhook *GenericWebhookConfig `json:"generic_webhook,omitempty"` + // Wire name: 'email' + Email *EmailConfig - MicrosoftTeams *MicrosoftTeamsConfig `json:"microsoft_teams,omitempty"` + // Wire name: 'generic_webhook' + GenericWebhook *GenericWebhookConfig - Pagerduty *PagerdutyConfig `json:"pagerduty,omitempty"` + // Wire name: 'microsoft_teams' + MicrosoftTeams *MicrosoftTeamsConfig - Slack *SlackConfig `json:"slack,omitempty"` + // Wire name: 'pagerduty' + Pagerduty *PagerdutyConfig + + // Wire name: 'slack' + Slack *SlackConfig +} + +func (st *Config) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &configPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := configFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Config) MarshalJSON() ([]byte, error) { + pb, err := configToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to configure a block list or allow list. type CreateIpAccessList struct { - IpAddresses []string `json:"ip_addresses,omitempty"` + + // Wire name: 'ip_addresses' + IpAddresses []string // Label for the IP access list. This **cannot** be empty. - Label string `json:"label"` + // Wire name: 'label' + Label string // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType ListType `json:"list_type"` + // Wire name: 'list_type' + ListType ListType +} + +func (st *CreateIpAccessList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createIpAccessListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createIpAccessListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateIpAccessList) MarshalJSON() ([]byte, error) { + pb, err := createIpAccessListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An IP access list was successfully created. type CreateIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessListInfo +} + +func (st *CreateIpAccessListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createIpAccessListResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createIpAccessListResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateIpAccessListResponse) MarshalJSON() ([]byte, error) { + pb, err := createIpAccessListResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a network connectivity configuration type CreateNetworkConnectivityConfigRequest struct { // Properties of the new network connectivity configuration. - NetworkConnectivityConfig CreateNetworkConnectivityConfiguration `json:"network_connectivity_config"` + // Wire name: 'network_connectivity_config' + NetworkConnectivityConfig CreateNetworkConnectivityConfiguration +} + +func (st *CreateNetworkConnectivityConfigRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createNetworkConnectivityConfigRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createNetworkConnectivityConfigRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateNetworkConnectivityConfigRequest) MarshalJSON() ([]byte, error) { + pb, err := createNetworkConnectivityConfigRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties of the new network connectivity configuration. @@ -486,71 +1002,184 @@ type CreateNetworkConnectivityConfiguration struct { // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // ^[0-9a-zA-Z-_]{3,30}$ - Name string `json:"name"` + // Wire name: 'name' + Name string // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region string `json:"region"` + // Wire name: 'region' + Region string +} + +func (st *CreateNetworkConnectivityConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createNetworkConnectivityConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createNetworkConnectivityConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateNetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { + pb, err := createNetworkConnectivityConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a network policy type CreateNetworkPolicyRequest struct { - NetworkPolicy AccountNetworkPolicy `json:"network_policy"` + + // Wire name: 'network_policy' + NetworkPolicy AccountNetworkPolicy +} + +func (st *CreateNetworkPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createNetworkPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createNetworkPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := createNetworkPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateNotificationDestinationRequest struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config *Config `json:"config,omitempty"` + // Wire name: 'config' + Config *Config // The display name for the notification destination. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateNotificationDestinationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateNotificationDestinationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createNotificationDestinationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createNotificationDestinationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + pb, err := createNotificationDestinationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Configuration details for creating on-behalf tokens. type CreateOboTokenRequest struct { // Application ID of the service principal. - ApplicationId string `json:"application_id"` + // Wire name: 'application_id' + ApplicationId string // Comment that describes the purpose of the token. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The number of seconds before the token expires. - LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + // Wire name: 'lifetime_seconds' + LifetimeSeconds int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateOboTokenRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateOboTokenRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createOboTokenRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createOboTokenRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateOboTokenRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateOboTokenRequest) MarshalJSON() ([]byte, error) { + pb, err := createOboTokenRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An on-behalf token was successfully created for the service principal. type CreateOboTokenResponse struct { - TokenInfo *TokenInfo `json:"token_info,omitempty"` + + // Wire name: 'token_info' + TokenInfo *TokenInfo // Value of the token. - TokenValue string `json:"token_value,omitempty"` + // Wire name: 'token_value' + TokenValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateOboTokenResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateOboTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createOboTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createOboTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateOboTokenResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateOboTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := createOboTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties of the new private endpoint rule. Note that you must approve the @@ -560,95 +1189,200 @@ type CreatePrivateEndpointRule struct { // // Domain names of target private link service. When updating this field, // the full list of target domain_names must be specified. - DomainNames []string `json:"domain_names,omitempty"` + // Wire name: 'domain_names' + DomainNames []string // Only used by private endpoints to Azure first-party services. Enum: blob // | dfs | sqlServer | mysqlServer // // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for blob and one for dfs. - GroupId string `json:"group_id,omitempty"` + // Wire name: 'group_id' + GroupId string // The Azure resource ID of the target resource. - ResourceId string `json:"resource_id"` + // Wire name: 'resource_id' + ResourceId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreatePrivateEndpointRule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreatePrivateEndpointRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPrivateEndpointRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPrivateEndpointRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreatePrivateEndpointRule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreatePrivateEndpointRule) MarshalJSON() ([]byte, error) { + pb, err := createPrivateEndpointRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create a private endpoint rule type CreatePrivateEndpointRuleRequest struct { // Your Network Connectivity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` // Properties of the new private endpoint rule. Note that you must approve // the endpoint in Azure portal after initialization. - PrivateEndpointRule CreatePrivateEndpointRule `json:"private_endpoint_rule"` + // Wire name: 'private_endpoint_rule' + PrivateEndpointRule CreatePrivateEndpointRule +} + +func (st *CreatePrivateEndpointRuleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createPrivateEndpointRuleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createPrivateEndpointRuleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreatePrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + pb, err := createPrivateEndpointRuleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateTokenRequest struct { // Optional description to attach to the token. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The lifetime of the token, in seconds. // // If the lifetime is not specified, this token remains valid indefinitely. - LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + // Wire name: 'lifetime_seconds' + LifetimeSeconds int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateTokenRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateTokenRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createTokenRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createTokenRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateTokenRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateTokenRequest) MarshalJSON() ([]byte, error) { + pb, err := createTokenRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateTokenResponse struct { // The information for the new token. - TokenInfo *PublicTokenInfo `json:"token_info,omitempty"` + // Wire name: 'token_info' + TokenInfo *PublicTokenInfo // The value of the new token. - TokenValue string `json:"token_value,omitempty"` + // Wire name: 'token_value' + TokenValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateTokenResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateTokenResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := createTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Account level policy for CSP type CspEnablementAccount struct { // Set by customers when they request Compliance Security Profile (CSP) // Invariants are enforced in Settings policy. - ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` + // Wire name: 'compliance_standards' + ComplianceStandards []ComplianceStandard // Enforced = it cannot be overriden at workspace level. - IsEnforced bool `json:"is_enforced,omitempty"` + // Wire name: 'is_enforced' + IsEnforced bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CspEnablementAccount) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CspEnablementAccount) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cspEnablementAccountPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cspEnablementAccountFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CspEnablementAccount) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CspEnablementAccount) MarshalJSON() ([]byte, error) { + pb, err := cspEnablementAccountToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CspEnablementAccountSetting struct { // Account level policy for CSP - CspEnablementAccount CspEnablementAccount `json:"csp_enablement_account"` + // Wire name: 'csp_enablement_account' + CspEnablementAccount CspEnablementAccount // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -656,23 +1390,42 @@ type CspEnablementAccountSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CspEnablementAccountSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CspEnablementAccountSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cspEnablementAccountSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cspEnablementAccountSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CspEnablementAccountSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CspEnablementAccountSetting) MarshalJSON() ([]byte, error) { + pb, err := cspEnablementAccountSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // This represents the setting configuration for the default namespace in the @@ -692,25 +1445,45 @@ type DefaultNamespaceSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string - Namespace StringMessage `json:"namespace"` + // Wire name: 'namespace' + Namespace StringMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DefaultNamespaceSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DefaultNamespaceSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &defaultNamespaceSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := defaultNamespaceSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DefaultNamespaceSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DefaultNamespaceSetting) MarshalJSON() ([]byte, error) { + pb, err := defaultNamespaceSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the account IP access toggle setting @@ -722,17 +1495,35 @@ type DeleteAccountIpAccessEnableRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteAccountIpAccessEnableRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAccountIpAccessEnableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountIpAccessEnableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountIpAccessEnableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountIpAccessEnableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -744,13 +1535,65 @@ type DeleteAccountIpAccessEnableResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteAccountIpAccessEnableResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountIpAccessEnableResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountIpAccessEnableResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountIpAccessEnableResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountIpAccessEnableResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete access list type DeleteAccountIpAccessListRequest struct { // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` +} + +func (st *DeleteAccountIpAccessListRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAccountIpAccessListRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAccountIpAccessListRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAccountIpAccessListRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the AI/BI dashboard embedding access policy @@ -762,17 +1605,35 @@ type DeleteAibiDashboardEmbeddingAccessPolicySettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -784,7 +1645,33 @@ type DeleteAibiDashboardEmbeddingAccessPolicySettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAibiDashboardEmbeddingAccessPolicySettingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAibiDashboardEmbeddingAccessPolicySettingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteAibiDashboardEmbeddingAccessPolicySettingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete AI/BI dashboard embedding approved domains @@ -796,17 +1683,35 @@ type DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -818,7 +1723,33 @@ type DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAibiDashboardEmbeddingApprovedDomainsSettingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteAibiDashboardEmbeddingApprovedDomainsSettingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the default namespace setting @@ -830,17 +1761,35 @@ type DeleteDefaultNamespaceSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDefaultNamespaceSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDefaultNamespaceSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDefaultNamespaceSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -852,7 +1801,33 @@ type DeleteDefaultNamespaceSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteDefaultNamespaceSettingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDefaultNamespaceSettingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDefaultNamespaceSettingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDefaultNamespaceSettingResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDefaultNamespaceSettingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete Legacy Access Disablement Status @@ -864,17 +1839,35 @@ type DeleteDisableLegacyAccessRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDisableLegacyAccessRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDisableLegacyAccessRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyAccessRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyAccessRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyAccessRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -886,7 +1879,33 @@ type DeleteDisableLegacyAccessResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteDisableLegacyAccessResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyAccessResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyAccessResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDisableLegacyAccessResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyAccessResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the disable legacy DBFS setting @@ -898,17 +1917,35 @@ type DeleteDisableLegacyDbfsRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDisableLegacyDbfsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDisableLegacyDbfsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyDbfsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyDbfsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyDbfsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -920,7 +1957,33 @@ type DeleteDisableLegacyDbfsResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteDisableLegacyDbfsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyDbfsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyDbfsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDisableLegacyDbfsResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyDbfsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the disable legacy features setting @@ -932,17 +1995,35 @@ type DeleteDisableLegacyFeaturesRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDisableLegacyFeaturesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDisableLegacyFeaturesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyFeaturesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyFeaturesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyFeaturesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -954,13 +2035,65 @@ type DeleteDisableLegacyFeaturesResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteDisableLegacyFeaturesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDisableLegacyFeaturesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDisableLegacyFeaturesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDisableLegacyFeaturesResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDisableLegacyFeaturesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete access list type DeleteIpAccessListRequest struct { // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` +} + +func (st *DeleteIpAccessListRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteIpAccessListRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteIpAccessListRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteIpAccessListRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteIpAccessListRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete the enable partner powered AI features workspace setting @@ -972,17 +2105,35 @@ type DeleteLlmProxyPartnerPoweredWorkspaceRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLlmProxyPartnerPoweredWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteLlmProxyPartnerPoweredWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -994,30 +2145,185 @@ type DeleteLlmProxyPartnerPoweredWorkspaceResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteLlmProxyPartnerPoweredWorkspaceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteLlmProxyPartnerPoweredWorkspaceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteLlmProxyPartnerPoweredWorkspaceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteLlmProxyPartnerPoweredWorkspaceResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteLlmProxyPartnerPoweredWorkspaceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a network connectivity configuration type DeleteNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` +} + +func (st *DeleteNetworkConnectivityConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNetworkConnectivityConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNetworkConnectivityConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNetworkConnectivityConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteNetworkConnectivityConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteNetworkConnectivityConfigurationResponse struct { } +func (st *DeleteNetworkConnectivityConfigurationResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNetworkConnectivityConfigurationResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNetworkConnectivityConfigurationResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNetworkConnectivityConfigurationResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteNetworkConnectivityConfigurationResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a network policy type DeleteNetworkPolicyRequest struct { // The unique identifier of the network policy to delete. - NetworkPolicyId string `json:"-" url:"-"` + // Wire name: 'network_policy_id' + NetworkPolicyId string `tf:"-"` +} + +func (st *DeleteNetworkPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNetworkPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNetworkPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteNetworkPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteNetworkPolicyRpcResponse struct { } +func (st *DeleteNetworkPolicyRpcResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNetworkPolicyRpcResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNetworkPolicyRpcResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNetworkPolicyRpcResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteNetworkPolicyRpcResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a notification destination type DeleteNotificationDestinationRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteNotificationDestinationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteNotificationDestinationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteNotificationDestinationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteNotificationDestinationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete Personal Compute setting @@ -1029,17 +2335,35 @@ type DeletePersonalComputeSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeletePersonalComputeSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeletePersonalComputeSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePersonalComputeSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePersonalComputeSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeletePersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeletePersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := deletePersonalComputeSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -1051,20 +2375,98 @@ type DeletePersonalComputeSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeletePersonalComputeSettingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePersonalComputeSettingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePersonalComputeSettingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePersonalComputeSettingResponse) MarshalJSON() ([]byte, error) { + pb, err := deletePersonalComputeSettingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a private endpoint rule type DeletePrivateEndpointRuleRequest struct { // Your Network Connectvity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` // Your private endpoint rule ID. - PrivateEndpointRuleId string `json:"-" url:"-"` + // Wire name: 'private_endpoint_rule_id' + PrivateEndpointRuleId string `tf:"-"` +} + +func (st *DeletePrivateEndpointRuleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePrivateEndpointRuleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deletePrivateEndpointRuleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeletePrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + pb, err := deletePrivateEndpointRuleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete the restrict workspace admins setting type DeleteRestrictWorkspaceAdminsSettingRequest struct { // etag used for versioning. The response is at least as fresh as the eTag @@ -1074,17 +2476,35 @@ type DeleteRestrictWorkspaceAdminsSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRestrictWorkspaceAdminsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRestrictWorkspaceAdminsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteRestrictWorkspaceAdminsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The etag is returned. @@ -1096,16 +2516,69 @@ type DeleteRestrictWorkspaceAdminsSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"etag"` + // Wire name: 'etag' + Etag string +} + +func (st *DeleteRestrictWorkspaceAdminsSettingResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRestrictWorkspaceAdminsSettingResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRestrictWorkspaceAdminsSettingResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRestrictWorkspaceAdminsSettingResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteRestrictWorkspaceAdminsSettingResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a token type DeleteTokenManagementRequest struct { // The ID of the token to revoke. - TokenId string `json:"-" url:"-"` + // Wire name: 'token_id' + TokenId string `tf:"-"` +} + +func (st *DeleteTokenManagementRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteTokenManagementRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteTokenManagementRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteTokenManagementRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteTokenManagementRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DestinationType string +type destinationTypePb string const DestinationTypeEmail DestinationType = `EMAIL` @@ -1138,8 +2611,26 @@ func (f *DestinationType) Type() string { return "DestinationType" } +func destinationTypeToPb(st *DestinationType) (*destinationTypePb, error) { + if st == nil { + return nil, nil + } + pb := destinationTypePb(*st) + return &pb, nil +} + +func destinationTypeFromPb(pb *destinationTypePb) (*DestinationType, error) { + if pb == nil { + return nil, nil + } + st := DestinationType(*pb) + return &st, nil +} + type DisableLegacyAccess struct { - DisableLegacyAccess BooleanMessage `json:"disable_legacy_access"` + + // Wire name: 'disable_legacy_access' + DisableLegacyAccess BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -1147,27 +2638,48 @@ type DisableLegacyAccess struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DisableLegacyAccess) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DisableLegacyAccess) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &disableLegacyAccessPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := disableLegacyAccessFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DisableLegacyAccess) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DisableLegacyAccess) MarshalJSON() ([]byte, error) { + pb, err := disableLegacyAccessToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DisableLegacyDbfs struct { - DisableLegacyDbfs BooleanMessage `json:"disable_legacy_dbfs"` + + // Wire name: 'disable_legacy_dbfs' + DisableLegacyDbfs BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -1175,27 +2687,48 @@ type DisableLegacyDbfs struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DisableLegacyDbfs) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DisableLegacyDbfs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &disableLegacyDbfsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := disableLegacyDbfsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DisableLegacyDbfs) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DisableLegacyDbfs) MarshalJSON() ([]byte, error) { + pb, err := disableLegacyDbfsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DisableLegacyFeatures struct { - DisableLegacyFeatures BooleanMessage `json:"disable_legacy_features"` + + // Wire name: 'disable_legacy_features' + DisableLegacyFeatures BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -1203,23 +2736,42 @@ type DisableLegacyFeatures struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DisableLegacyFeatures) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DisableLegacyFeatures) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &disableLegacyFeaturesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := disableLegacyFeaturesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DisableLegacyFeatures) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DisableLegacyFeatures) MarshalJSON() ([]byte, error) { + pb, err := disableLegacyFeaturesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The network policies applying for egress traffic. This message is used by the @@ -1228,48 +2780,125 @@ func (s DisableLegacyFeatures) MarshalJSON() ([]byte, error) { // dataplane, see networkconfig.textproto). type EgressNetworkPolicy struct { // The access policy enforced for egress traffic to the internet. - InternetAccess *EgressNetworkPolicyInternetAccessPolicy `json:"internet_access,omitempty"` + // Wire name: 'internet_access' + InternetAccess *EgressNetworkPolicyInternetAccessPolicy +} + +func (st *EgressNetworkPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicy) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EgressNetworkPolicyInternetAccessPolicy struct { - AllowedInternetDestinations []EgressNetworkPolicyInternetAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` - AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + // Wire name: 'allowed_internet_destinations' + AllowedInternetDestinations []EgressNetworkPolicyInternetAccessPolicyInternetDestination + + // Wire name: 'allowed_storage_destinations' + AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination // Optional. If not specified, assume the policy is enforced for all // workloads. - LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode `json:"log_only_mode,omitempty"` + // Wire name: 'log_only_mode' + LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode // At which level can Databricks and Databricks managed compute access // Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules // will apply. RESTRICTED_ACCESS: Databricks can only access explicitly // allowed internet and storage destinations, as well as UC connections and // external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only // access destinations via private link. - RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode `json:"restriction_mode,omitempty"` + // Wire name: 'restriction_mode' + RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode +} + +func (st *EgressNetworkPolicyInternetAccessPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyInternetAccessPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyInternetAccessPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicyInternetAccessPolicy) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyInternetAccessPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Users can specify accessible internet destinations when outbound access is // restricted. We only support domain name (FQDN) destinations for the time // being, though going forwards we want to support host names and IP addresses. type EgressNetworkPolicyInternetAccessPolicyInternetDestination struct { - Destination string `json:"destination,omitempty"` + + // Wire name: 'destination' + Destination string // The filtering protocol used by the DP. For private and public preview, // SEG will only support TCP filtering (i.e. DNS based filtering, filtering // by destination IP address), so protocol will be set to TCP by default and // hidden from the user. In the future, users may be able to select HTTP // filtering (i.e. SNI based filtering, filtering by FQDN). - Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol `json:"protocol,omitempty"` + // Wire name: 'protocol' + Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol - Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType `json:"type,omitempty"` + // Wire name: 'type' + Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EgressNetworkPolicyInternetAccessPolicyInternetDestination) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EgressNetworkPolicyInternetAccessPolicyInternetDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyInternetAccessPolicyInternetDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyInternetAccessPolicyInternetDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EgressNetworkPolicyInternetAccessPolicyInternetDestination) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EgressNetworkPolicyInternetAccessPolicyInternetDestination) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyInternetAccessPolicyInternetDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The filtering protocol used by the DP. For private and public preview, SEG @@ -1278,6 +2907,7 @@ func (s EgressNetworkPolicyInternetAccessPolicyInternetDestination) MarshalJSON( // from the user. In the future, users may be able to select HTTP filtering // (i.e. SNI based filtering, filtering by FQDN). type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol string +type egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb string const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolTcp EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol = `TCP` @@ -1302,7 +2932,24 @@ func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDesti return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol" } +func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolToPb(st *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol) (*egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolFromPb(pb *egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb) (*EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol(*pb) + return &st, nil +} + type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType string +type egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb string const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeFqdn EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType = `FQDN` @@ -1327,13 +2974,58 @@ func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDesti return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType" } +func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType) (*egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb) (*EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType(*pb) + return &st, nil +} + type EgressNetworkPolicyInternetAccessPolicyLogOnlyMode struct { - LogOnlyModeType EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType `json:"log_only_mode_type,omitempty"` - Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType `json:"workloads,omitempty"` + // Wire name: 'log_only_mode_type' + LogOnlyModeType EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType + + // Wire name: 'workloads' + Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType +} + +func (st *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyInternetAccessPolicyLogOnlyModePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyInternetAccessPolicyLogOnlyModeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyInternetAccessPolicyLogOnlyModeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType string +type egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb string const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeAllServices EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType = `ALL_SERVICES` @@ -1360,8 +3052,25 @@ func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) Type return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType" } +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) (*egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType(*pb) + return &st, nil +} + // The values should match the list of workloads used in networkconfig.proto type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType string +type egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb string const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeDbsql EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType = `DBSQL` @@ -1388,6 +3097,22 @@ func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) Type() return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType" } +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) (*egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(*pb) + return &st, nil +} + // At which level can Databricks and Databricks managed compute access Internet. // FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. // RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and @@ -1395,6 +3120,7 @@ func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) Type() // PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via // private link. type EgressNetworkPolicyInternetAccessPolicyRestrictionMode string +type egressNetworkPolicyInternetAccessPolicyRestrictionModePb string const EgressNetworkPolicyInternetAccessPolicyRestrictionModeFullAccess EgressNetworkPolicyInternetAccessPolicyRestrictionMode = `FULL_ACCESS` @@ -1423,36 +3149,79 @@ func (f *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) Type() string { return "EgressNetworkPolicyInternetAccessPolicyRestrictionMode" } +func egressNetworkPolicyInternetAccessPolicyRestrictionModeToPb(st *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) (*egressNetworkPolicyInternetAccessPolicyRestrictionModePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyRestrictionModePb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyRestrictionModeFromPb(pb *egressNetworkPolicyInternetAccessPolicyRestrictionModePb) (*EgressNetworkPolicyInternetAccessPolicyRestrictionMode, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyRestrictionMode(*pb) + return &st, nil +} + // Users can specify accessible storage destinations. type EgressNetworkPolicyInternetAccessPolicyStorageDestination struct { - AllowedPaths []string `json:"allowed_paths,omitempty"` - AzureContainer string `json:"azure_container,omitempty"` + // Wire name: 'allowed_paths' + AllowedPaths []string + + // Wire name: 'azure_container' + AzureContainer string - AzureDnsZone string `json:"azure_dns_zone,omitempty"` + // Wire name: 'azure_dns_zone' + AzureDnsZone string - AzureStorageAccount string `json:"azure_storage_account,omitempty"` + // Wire name: 'azure_storage_account' + AzureStorageAccount string - AzureStorageService string `json:"azure_storage_service,omitempty"` + // Wire name: 'azure_storage_service' + AzureStorageService string - BucketName string `json:"bucket_name,omitempty"` + // Wire name: 'bucket_name' + BucketName string - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string - Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType `json:"type,omitempty"` + // Wire name: 'type' + Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EgressNetworkPolicyInternetAccessPolicyStorageDestination) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EgressNetworkPolicyInternetAccessPolicyStorageDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyInternetAccessPolicyStorageDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyInternetAccessPolicyStorageDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EgressNetworkPolicyInternetAccessPolicyStorageDestination) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EgressNetworkPolicyInternetAccessPolicyStorageDestination) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyInternetAccessPolicyStorageDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType string +type egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb string const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeAwsS3 EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `AWS_S3` @@ -1483,19 +3252,64 @@ func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestina return "EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType" } +func egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType) (*egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb) (*EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType(*pb) + return &st, nil +} + type EgressNetworkPolicyNetworkAccessPolicy struct { // List of internet destinations that serverless workloads are allowed to // access when in RESTRICTED_ACCESS mode. - AllowedInternetDestinations []EgressNetworkPolicyNetworkAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` + // Wire name: 'allowed_internet_destinations' + AllowedInternetDestinations []EgressNetworkPolicyNetworkAccessPolicyInternetDestination // List of storage destinations that serverless workloads are allowed to // access when in RESTRICTED_ACCESS mode. - AllowedStorageDestinations []EgressNetworkPolicyNetworkAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + // Wire name: 'allowed_storage_destinations' + AllowedStorageDestinations []EgressNetworkPolicyNetworkAccessPolicyStorageDestination // Optional. When policy_enforcement is not provided, we default to // ENFORCE_MODE_ALL_SERVICES - PolicyEnforcement *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement `json:"policy_enforcement,omitempty"` + // Wire name: 'policy_enforcement' + PolicyEnforcement *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement // The restriction mode that controls how serverless workloads can access // the internet. - RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode `json:"restriction_mode"` + // Wire name: 'restriction_mode' + RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode +} + +func (st *EgressNetworkPolicyNetworkAccessPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyNetworkAccessPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyNetworkAccessPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicyNetworkAccessPolicy) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyNetworkAccessPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Users can specify accessible internet destinations when outbound access is @@ -1504,22 +3318,42 @@ type EgressNetworkPolicyNetworkAccessPolicy struct { type EgressNetworkPolicyNetworkAccessPolicyInternetDestination struct { // The internet destination to which access will be allowed. Format // dependent on the destination type. - Destination string `json:"destination,omitempty"` + // Wire name: 'destination' + Destination string // The type of internet destination. Currently only DNS_NAME is supported. - InternetDestinationType EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType `json:"internet_destination_type,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} + // Wire name: 'internet_destination_type' + InternetDestinationType EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType -func (s *EgressNetworkPolicyNetworkAccessPolicyInternetDestination) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) + ForceSendFields []string `tf:"-"` } -func (s EgressNetworkPolicyNetworkAccessPolicyInternetDestination) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *EgressNetworkPolicyNetworkAccessPolicyInternetDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyNetworkAccessPolicyInternetDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicyNetworkAccessPolicyInternetDestination) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyNetworkAccessPolicyInternetDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType string +type egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb string const EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeDnsName EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType = `DNS_NAME` @@ -1544,19 +3378,63 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestin return "EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType" } +func egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeToPb(st *EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType) (*egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb) (*EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType(*pb) + return &st, nil +} + type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement struct { // When empty, it means dry run for all products. When non-empty, it means // dry run for specific products and for the other products, they will run // in enforced mode. - DryRunModeProductFilter []EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter `json:"dry_run_mode_product_filter,omitempty"` + // Wire name: 'dry_run_mode_product_filter' + DryRunModeProductFilter []EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter // The mode of policy enforcement. ENFORCED blocks traffic that violates // policy, while DRY_RUN only logs violations without blocking. When not // specified, defaults to ENFORCED. - EnforcementMode EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode `json:"enforcement_mode,omitempty"` + // Wire name: 'enforcement_mode' + EnforcementMode EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode +} + +func (st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The values should match the list of workloads used in networkconfig.proto type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter string +type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb string const EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterDbsql EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter = `DBSQL` @@ -1583,7 +3461,24 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProduc return "EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter" } +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterToPb(st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter) (*egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb(*st) + return &pb, nil +} + +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter(*pb) + return &st, nil +} + type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode string +type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb string const EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeDryRun EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode = `DRY_RUN` @@ -1610,11 +3505,28 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode) return "EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode" } +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeToPb(st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode) (*egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb(*st) + return &pb, nil +} + +func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode(*pb) + return &st, nil +} + // At which level can Databricks and Databricks managed compute access Internet. // FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. // RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and // storage destinations, as well as UC connections and external locations. type EgressNetworkPolicyNetworkAccessPolicyRestrictionMode string +type egressNetworkPolicyNetworkAccessPolicyRestrictionModePb string const EgressNetworkPolicyNetworkAccessPolicyRestrictionModeFullAccess EgressNetworkPolicyNetworkAccessPolicyRestrictionMode = `FULL_ACCESS` @@ -1641,31 +3553,70 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyRestrictionMode) Type() string { return "EgressNetworkPolicyNetworkAccessPolicyRestrictionMode" } +func egressNetworkPolicyNetworkAccessPolicyRestrictionModeToPb(st *EgressNetworkPolicyNetworkAccessPolicyRestrictionMode) (*egressNetworkPolicyNetworkAccessPolicyRestrictionModePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyNetworkAccessPolicyRestrictionModePb(*st) + return &pb, nil +} + +func egressNetworkPolicyNetworkAccessPolicyRestrictionModeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyRestrictionModePb) (*EgressNetworkPolicyNetworkAccessPolicyRestrictionMode, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyNetworkAccessPolicyRestrictionMode(*pb) + return &st, nil +} + // Users can specify accessible storage destinations. type EgressNetworkPolicyNetworkAccessPolicyStorageDestination struct { // The Azure storage account name. - AzureStorageAccount string `json:"azure_storage_account,omitempty"` + // Wire name: 'azure_storage_account' + AzureStorageAccount string // The Azure storage service type (blob, dfs, etc.). - AzureStorageService string `json:"azure_storage_service,omitempty"` + // Wire name: 'azure_storage_service' + AzureStorageService string - BucketName string `json:"bucket_name,omitempty"` + // Wire name: 'bucket_name' + BucketName string // The region of the S3 bucket. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The type of storage destination. - StorageDestinationType EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType `json:"storage_destination_type,omitempty"` + // Wire name: 'storage_destination_type' + StorageDestinationType EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EgressNetworkPolicyNetworkAccessPolicyStorageDestination) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EgressNetworkPolicyNetworkAccessPolicyStorageDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := egressNetworkPolicyNetworkAccessPolicyStorageDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EgressNetworkPolicyNetworkAccessPolicyStorageDestination) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EgressNetworkPolicyNetworkAccessPolicyStorageDestination) MarshalJSON() ([]byte, error) { + pb, err := egressNetworkPolicyNetworkAccessPolicyStorageDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType string +type egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb string const EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeAwsS3 EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType = `AWS_S3` @@ -1694,11 +3645,28 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinat return "EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType" } +func egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeToPb(st *EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType) (*egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb(*st) + return &pb, nil +} + +func egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb) (*EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType, error) { + if pb == nil { + return nil, nil + } + st := EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType(*pb) + return &st, nil +} + // The target resources that are supported by Network Connectivity Config. Note: // some egress types can support general types that are not defined in // EgressResourceType. E.g.: Azure private endpoint supports private link // enabled Azure services. type EgressResourceType string +type egressResourceTypePb string const EgressResourceTypeAzureBlobStorage EgressResourceType = `AZURE_BLOB_STORAGE` @@ -1723,92 +3691,239 @@ func (f *EgressResourceType) Type() string { return "EgressResourceType" } +func egressResourceTypeToPb(st *EgressResourceType) (*egressResourceTypePb, error) { + if st == nil { + return nil, nil + } + pb := egressResourceTypePb(*st) + return &pb, nil +} + +func egressResourceTypeFromPb(pb *egressResourceTypePb) (*EgressResourceType, error) { + if pb == nil { + return nil, nil + } + st := EgressResourceType(*pb) + return &st, nil +} + type EmailConfig struct { // Email addresses to notify. - Addresses []string `json:"addresses,omitempty"` + // Wire name: 'addresses' + Addresses []string +} + +func (st *EmailConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &emailConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := emailConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EmailConfig) MarshalJSON() ([]byte, error) { + pb, err := emailConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Empty struct { } +func (st *Empty) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &emptyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := emptyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Empty) MarshalJSON() ([]byte, error) { + pb, err := emptyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EnableExportNotebook struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + // Wire name: 'boolean_val' + BooleanVal *BooleanMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnableExportNotebook) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnableExportNotebook) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enableExportNotebookPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enableExportNotebookFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnableExportNotebook) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnableExportNotebook) MarshalJSON() ([]byte, error) { + pb, err := enableExportNotebookToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnableNotebookTableClipboard struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + // Wire name: 'boolean_val' + BooleanVal *BooleanMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnableNotebookTableClipboard) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnableNotebookTableClipboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enableNotebookTableClipboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enableNotebookTableClipboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnableNotebookTableClipboard) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnableNotebookTableClipboard) MarshalJSON() ([]byte, error) { + pb, err := enableNotebookTableClipboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnableResultsDownloading struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + // Wire name: 'boolean_val' + BooleanVal *BooleanMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnableResultsDownloading) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnableResultsDownloading) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enableResultsDownloadingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enableResultsDownloadingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnableResultsDownloading) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnableResultsDownloading) MarshalJSON() ([]byte, error) { + pb, err := enableResultsDownloadingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // SHIELD feature: ESM type EnhancedSecurityMonitoring struct { - IsEnabled bool `json:"is_enabled,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'is_enabled' + IsEnabled bool + + ForceSendFields []string `tf:"-"` } -func (s *EnhancedSecurityMonitoring) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnhancedSecurityMonitoring) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enhancedSecurityMonitoringPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enhancedSecurityMonitoringFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnhancedSecurityMonitoring) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnhancedSecurityMonitoring) MarshalJSON() ([]byte, error) { + pb, err := enhancedSecurityMonitoringToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnhancedSecurityMonitoringSetting struct { // SHIELD feature: ESM - EnhancedSecurityMonitoringWorkspace EnhancedSecurityMonitoring `json:"enhanced_security_monitoring_workspace"` + // Wire name: 'enhanced_security_monitoring_workspace' + EnhancedSecurityMonitoringWorkspace EnhancedSecurityMonitoring // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -1816,43 +3931,82 @@ type EnhancedSecurityMonitoringSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnhancedSecurityMonitoringSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnhancedSecurityMonitoringSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enhancedSecurityMonitoringSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enhancedSecurityMonitoringSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnhancedSecurityMonitoringSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnhancedSecurityMonitoringSetting) MarshalJSON() ([]byte, error) { + pb, err := enhancedSecurityMonitoringSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Account level policy for ESM type EsmEnablementAccount struct { - IsEnforced bool `json:"is_enforced,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'is_enforced' + IsEnforced bool + + ForceSendFields []string `tf:"-"` } -func (s *EsmEnablementAccount) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EsmEnablementAccount) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &esmEnablementAccountPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := esmEnablementAccountFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EsmEnablementAccount) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EsmEnablementAccount) MarshalJSON() ([]byte, error) { + pb, err := esmEnablementAccountToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EsmEnablementAccountSetting struct { // Account level policy for ESM - EsmEnablementAccount EsmEnablementAccount `json:"esm_enablement_account"` + // Wire name: 'esm_enablement_account' + EsmEnablementAccount EsmEnablementAccount // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -1860,94 +4014,239 @@ type EsmEnablementAccountSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EsmEnablementAccountSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EsmEnablementAccountSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &esmEnablementAccountSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := esmEnablementAccountSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EsmEnablementAccountSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EsmEnablementAccountSetting) MarshalJSON() ([]byte, error) { + pb, err := esmEnablementAccountSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The exchange token is the result of the token exchange with the IdP type ExchangeToken struct { // The requested token. - Credential string `json:"credential,omitempty"` + // Wire name: 'credential' + Credential string // The end-of-life timestamp of the token. The value is in milliseconds // since the Unix epoch. - CredentialEolTime int64 `json:"credentialEolTime,omitempty"` + // Wire name: 'credentialEolTime' + CredentialEolTime int64 // User ID of the user that owns this token. - OwnerId int64 `json:"ownerId,omitempty"` + // Wire name: 'ownerId' + OwnerId int64 // The scopes of access granted in the token. - Scopes []string `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []string // The type of this exchange token - TokenType TokenType `json:"tokenType,omitempty"` + // Wire name: 'tokenType' + TokenType TokenType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExchangeToken) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExchangeToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangeTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExchangeToken) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExchangeToken) MarshalJSON() ([]byte, error) { + pb, err := exchangeTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Exchange a token with the IdP type ExchangeTokenRequest struct { // The partition of Credentials store - PartitionId PartitionId `json:"partitionId"` + // Wire name: 'partitionId' + PartitionId PartitionId // Array of scopes for the token request. - Scopes []string `json:"scopes"` + // Wire name: 'scopes' + Scopes []string // A list of token types being requested - TokenType []TokenType `json:"tokenType"` + // Wire name: 'tokenType' + TokenType []TokenType +} + +func (st *ExchangeTokenRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangeTokenRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeTokenRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExchangeTokenRequest) MarshalJSON() ([]byte, error) { + pb, err := exchangeTokenRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Exhanged tokens were successfully returned. type ExchangeTokenResponse struct { - Values []ExchangeToken `json:"values,omitempty"` + + // Wire name: 'values' + Values []ExchangeToken +} + +func (st *ExchangeTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exchangeTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exchangeTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExchangeTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := exchangeTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An IP access list was successfully returned. type FetchIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessListInfo +} + +func (st *FetchIpAccessListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &fetchIpAccessListResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := fetchIpAccessListResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FetchIpAccessListResponse) MarshalJSON() ([]byte, error) { + pb, err := fetchIpAccessListResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GenericWebhookConfig struct { // [Input-Only][Optional] Password for webhook. - Password string `json:"password,omitempty"` + // Wire name: 'password' + Password string // [Output-Only] Whether password is set. - PasswordSet bool `json:"password_set,omitempty"` + // Wire name: 'password_set' + PasswordSet bool // [Input-Only] URL for webhook. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string // [Output-Only] Whether URL is set. - UrlSet bool `json:"url_set,omitempty"` + // Wire name: 'url_set' + UrlSet bool // [Input-Only][Optional] Username for webhook. - Username string `json:"username,omitempty"` + // Wire name: 'username' + Username string // [Output-Only] Whether username is set. - UsernameSet bool `json:"username_set,omitempty"` + // Wire name: 'username_set' + UsernameSet bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GenericWebhookConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GenericWebhookConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &genericWebhookConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := genericWebhookConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GenericWebhookConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GenericWebhookConfig) MarshalJSON() ([]byte, error) { + pb, err := genericWebhookConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the account IP access toggle setting @@ -1959,23 +4258,67 @@ type GetAccountIpAccessEnableRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetAccountIpAccessEnableRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetAccountIpAccessEnableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountIpAccessEnableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountIpAccessEnableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountIpAccessEnableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get IP access list type GetAccountIpAccessListRequest struct { // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` +} + +func (st *GetAccountIpAccessListRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAccountIpAccessListRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAccountIpAccessListRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + pb, err := getAccountIpAccessListRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Retrieve the AI/BI dashboard embedding access policy @@ -1987,17 +4330,35 @@ type GetAibiDashboardEmbeddingAccessPolicySettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Retrieve the list of domains approved to host embedded AI/BI dashboards @@ -2009,17 +4370,35 @@ type GetAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the automatic cluster update setting @@ -2031,17 +4410,35 @@ type GetAutomaticClusterUpdateSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetAutomaticClusterUpdateSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetAutomaticClusterUpdateSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAutomaticClusterUpdateSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAutomaticClusterUpdateSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetAutomaticClusterUpdateSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetAutomaticClusterUpdateSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getAutomaticClusterUpdateSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the compliance security profile setting @@ -2053,17 +4450,35 @@ type GetComplianceSecurityProfileSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetComplianceSecurityProfileSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetComplianceSecurityProfileSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getComplianceSecurityProfileSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getComplianceSecurityProfileSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetComplianceSecurityProfileSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetComplianceSecurityProfileSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getComplianceSecurityProfileSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the compliance security profile setting for new workspaces @@ -2075,17 +4490,35 @@ type GetCspEnablementAccountSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetCspEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetCspEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCspEnablementAccountSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCspEnablementAccountSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetCspEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetCspEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getCspEnablementAccountSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the default namespace setting @@ -2097,17 +4530,35 @@ type GetDefaultNamespaceSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDefaultNamespaceSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDefaultNamespaceSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getDefaultNamespaceSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Retrieve Legacy Access Disablement Status @@ -2119,17 +4570,35 @@ type GetDisableLegacyAccessRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetDisableLegacyAccessRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetDisableLegacyAccessRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDisableLegacyAccessRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDisableLegacyAccessRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { + pb, err := getDisableLegacyAccessRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the disable legacy DBFS setting @@ -2141,17 +4610,35 @@ type GetDisableLegacyDbfsRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetDisableLegacyDbfsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetDisableLegacyDbfsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDisableLegacyDbfsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDisableLegacyDbfsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { + pb, err := getDisableLegacyDbfsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the disable legacy features setting @@ -2163,17 +4650,35 @@ type GetDisableLegacyFeaturesRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetDisableLegacyFeaturesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetDisableLegacyFeaturesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDisableLegacyFeaturesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDisableLegacyFeaturesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { + pb, err := getDisableLegacyFeaturesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the enhanced security monitoring setting @@ -2185,17 +4690,35 @@ type GetEnhancedSecurityMonitoringSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetEnhancedSecurityMonitoringSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetEnhancedSecurityMonitoringSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEnhancedSecurityMonitoringSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEnhancedSecurityMonitoringSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetEnhancedSecurityMonitoringSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetEnhancedSecurityMonitoringSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getEnhancedSecurityMonitoringSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the enhanced security monitoring setting for new workspaces @@ -2207,33 +4730,130 @@ type GetEsmEnablementAccountSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetEsmEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetEsmEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEsmEnablementAccountSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEsmEnablementAccountSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetEsmEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetEsmEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getEsmEnablementAccountSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get access list type GetIpAccessListRequest struct { // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` +} + +func (st *GetIpAccessListRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getIpAccessListRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getIpAccessListRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetIpAccessListRequest) MarshalJSON() ([]byte, error) { + pb, err := getIpAccessListRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessListInfo +} + +func (st *GetIpAccessListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getIpAccessListResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getIpAccessListResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetIpAccessListResponse) MarshalJSON() ([]byte, error) { + pb, err := getIpAccessListResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // IP access lists were successfully returned. type GetIpAccessListsResponse struct { - IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` + + // Wire name: 'ip_access_lists' + IpAccessLists []IpAccessListInfo +} + +func (st *GetIpAccessListsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getIpAccessListsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getIpAccessListsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetIpAccessListsResponse) MarshalJSON() ([]byte, error) { + pb, err := getIpAccessListsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the enable partner powered AI features account setting @@ -2245,17 +4865,35 @@ type GetLlmProxyPartnerPoweredAccountRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetLlmProxyPartnerPoweredAccountRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetLlmProxyPartnerPoweredAccountRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLlmProxyPartnerPoweredAccountRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLlmProxyPartnerPoweredAccountRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetLlmProxyPartnerPoweredAccountRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetLlmProxyPartnerPoweredAccountRequest) MarshalJSON() ([]byte, error) { + pb, err := getLlmProxyPartnerPoweredAccountRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the enforcement status of partner powered AI features account setting @@ -2267,17 +4905,35 @@ type GetLlmProxyPartnerPoweredEnforceRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetLlmProxyPartnerPoweredEnforceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetLlmProxyPartnerPoweredEnforceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLlmProxyPartnerPoweredEnforceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLlmProxyPartnerPoweredEnforceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetLlmProxyPartnerPoweredEnforceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetLlmProxyPartnerPoweredEnforceRequest) MarshalJSON() ([]byte, error) { + pb, err := getLlmProxyPartnerPoweredEnforceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the enable partner powered AI features workspace setting @@ -2289,34 +4945,131 @@ type GetLlmProxyPartnerPoweredWorkspaceRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getLlmProxyPartnerPoweredWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := getLlmProxyPartnerPoweredWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a network connectivity configuration type GetNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` +} + +func (st *GetNetworkConnectivityConfigurationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getNetworkConnectivityConfigurationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getNetworkConnectivityConfigurationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetNetworkConnectivityConfigurationRequest) MarshalJSON() ([]byte, error) { + pb, err := getNetworkConnectivityConfigurationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a network policy type GetNetworkPolicyRequest struct { // The unique identifier of the network policy to retrieve. - NetworkPolicyId string `json:"-" url:"-"` + // Wire name: 'network_policy_id' + NetworkPolicyId string `tf:"-"` +} + +func (st *GetNetworkPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getNetworkPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getNetworkPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getNetworkPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a notification destination type GetNotificationDestinationRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetNotificationDestinationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getNotificationDestinationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getNotificationDestinationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + pb, err := getNotificationDestinationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get Personal Compute setting @@ -2328,25 +5081,70 @@ type GetPersonalComputeSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} + // Wire name: 'etag' + Etag string `tf:"-"` -func (s *GetPersonalComputeSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) + ForceSendFields []string `tf:"-"` } -func (s GetPersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *GetPersonalComputeSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPersonalComputeSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPersonalComputeSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getPersonalComputeSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Gets a private endpoint rule type GetPrivateEndpointRuleRequest struct { // Your Network Connectvity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` // Your private endpoint rule ID. - PrivateEndpointRuleId string `json:"-" url:"-"` + // Wire name: 'private_endpoint_rule_id' + PrivateEndpointRuleId string `tf:"-"` +} + +func (st *GetPrivateEndpointRuleRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getPrivateEndpointRuleRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getPrivateEndpointRuleRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetPrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + pb, err := getPrivateEndpointRuleRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get the restrict workspace admins setting @@ -2358,275 +5156,723 @@ type GetRestrictWorkspaceAdminsSettingRequest struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag string `json:"-" url:"etag,omitempty"` + // Wire name: 'etag' + Etag string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRestrictWorkspaceAdminsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRestrictWorkspaceAdminsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := getRestrictWorkspaceAdminsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Check configuration status type GetStatusRequest struct { - Keys string `json:"-" url:"keys"` + + // Wire name: 'keys' + Keys string `tf:"-"` +} + +func (st *GetStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := getStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get token info type GetTokenManagementRequest struct { // The ID of the token to get. - TokenId string `json:"-" url:"-"` + // Wire name: 'token_id' + TokenId string `tf:"-"` +} + +func (st *GetTokenManagementRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getTokenManagementRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getTokenManagementRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetTokenManagementRequest) MarshalJSON() ([]byte, error) { + pb, err := getTokenManagementRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetTokenPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []TokenPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []TokenPermissionsDescription +} + +func (st *GetTokenPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getTokenPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getTokenPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetTokenPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getTokenPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Token with specified Token ID was successfully returned. type GetTokenResponse struct { - TokenInfo *TokenInfo `json:"token_info,omitempty"` + + // Wire name: 'token_info' + TokenInfo *TokenInfo +} + +func (st *GetTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := getTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get workspace network configuration type GetWorkspaceNetworkOptionRequest struct { // The workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` +} + +func (st *GetWorkspaceNetworkOptionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceNetworkOptionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceNetworkOptionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceNetworkOptionRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceNetworkOptionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Definition of an IP Access list type IpAccessListInfo struct { // Total number of IP or CIDR values. - AddressCount int `json:"address_count,omitempty"` + // Wire name: 'address_count' + AddressCount int // Creation timestamp in milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // User ID of the user who created this list. - CreatedBy int64 `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy int64 // Specifies whether this IP access list is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool - IpAddresses []string `json:"ip_addresses,omitempty"` + // Wire name: 'ip_addresses' + IpAddresses []string // Label for the IP access list. This **cannot** be empty. - Label string `json:"label,omitempty"` + // Wire name: 'label' + Label string // Universally unique identifier (UUID) of the IP access list. - ListId string `json:"list_id,omitempty"` + // Wire name: 'list_id' + ListId string // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType ListType `json:"list_type,omitempty"` + // Wire name: 'list_type' + ListType ListType // Update timestamp in milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // User ID of the user who updated this list. - UpdatedBy int64 `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *IpAccessListInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *IpAccessListInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ipAccessListInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ipAccessListInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s IpAccessListInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st IpAccessListInfo) MarshalJSON() ([]byte, error) { + pb, err := ipAccessListInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // IP access lists were successfully returned. type ListIpAccessListResponse struct { - IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` + + // Wire name: 'ip_access_lists' + IpAccessLists []IpAccessListInfo +} + +func (st *ListIpAccessListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listIpAccessListResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listIpAccessListResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListIpAccessListResponse) MarshalJSON() ([]byte, error) { + pb, err := listIpAccessListResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The private endpoint rule list was successfully retrieved. type ListNccAzurePrivateEndpointRulesResponse struct { - Items []NccAzurePrivateEndpointRule `json:"items,omitempty"` + + // Wire name: 'items' + Items []NccAzurePrivateEndpointRule // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNccAzurePrivateEndpointRulesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNccAzurePrivateEndpointRulesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNccAzurePrivateEndpointRulesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNccAzurePrivateEndpointRulesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNccAzurePrivateEndpointRulesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNccAzurePrivateEndpointRulesResponse) MarshalJSON() ([]byte, error) { + pb, err := listNccAzurePrivateEndpointRulesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List network connectivity configurations type ListNetworkConnectivityConfigurationsRequest struct { // Pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNetworkConnectivityConfigurationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNetworkConnectivityConfigurationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNetworkConnectivityConfigurationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNetworkConnectivityConfigurationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNetworkConnectivityConfigurationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNetworkConnectivityConfigurationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listNetworkConnectivityConfigurationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The network connectivity configuration list was successfully retrieved. type ListNetworkConnectivityConfigurationsResponse struct { - Items []NetworkConnectivityConfiguration `json:"items,omitempty"` + + // Wire name: 'items' + Items []NetworkConnectivityConfiguration // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNetworkConnectivityConfigurationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNetworkConnectivityConfigurationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNetworkConnectivityConfigurationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNetworkConnectivityConfigurationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNetworkConnectivityConfigurationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNetworkConnectivityConfigurationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listNetworkConnectivityConfigurationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List network policies type ListNetworkPoliciesRequest struct { // Pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNetworkPoliciesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNetworkPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNetworkPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNetworkPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listNetworkPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListNetworkPoliciesResponse struct { // List of network policies. - Items []AccountNetworkPolicy `json:"items,omitempty"` + // Wire name: 'items' + Items []AccountNetworkPolicy // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNetworkPoliciesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNetworkPoliciesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNetworkPoliciesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNetworkPoliciesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNetworkPoliciesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNetworkPoliciesResponse) MarshalJSON() ([]byte, error) { + pb, err := listNetworkPoliciesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List notification destinations type ListNotificationDestinationsRequest struct { - PageSize int64 `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int64 `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNotificationDestinationsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNotificationDestinationsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNotificationDestinationsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNotificationDestinationsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNotificationDestinationsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNotificationDestinationsRequest) MarshalJSON() ([]byte, error) { + pb, err := listNotificationDestinationsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListNotificationDestinationsResponse struct { // Page token for next of results. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - Results []ListNotificationDestinationsResult `json:"results,omitempty"` + // Wire name: 'results' + Results []ListNotificationDestinationsResult - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNotificationDestinationsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNotificationDestinationsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNotificationDestinationsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNotificationDestinationsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNotificationDestinationsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNotificationDestinationsResponse) MarshalJSON() ([]byte, error) { + pb, err := listNotificationDestinationsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListNotificationDestinationsResult struct { // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType DestinationType `json:"destination_type,omitempty"` + // Wire name: 'destination_type' + DestinationType DestinationType // The display name for the notification destination. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying notification destination. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListNotificationDestinationsResult) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListNotificationDestinationsResult) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listNotificationDestinationsResultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listNotificationDestinationsResultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListNotificationDestinationsResult) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListNotificationDestinationsResult) MarshalJSON() ([]byte, error) { + pb, err := listNotificationDestinationsResultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List private endpoint rules type ListPrivateEndpointRulesRequest struct { // Your Network Connectvity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` // Pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListPrivateEndpointRulesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListPrivateEndpointRulesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPrivateEndpointRulesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPrivateEndpointRulesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListPrivateEndpointRulesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListPrivateEndpointRulesRequest) MarshalJSON() ([]byte, error) { + pb, err := listPrivateEndpointRulesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListPublicTokensResponse struct { // The information for each token. - TokenInfos []PublicTokenInfo `json:"token_infos,omitempty"` + // Wire name: 'token_infos' + TokenInfos []PublicTokenInfo +} + +func (st *ListPublicTokensResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listPublicTokensResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listPublicTokensResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListPublicTokensResponse) MarshalJSON() ([]byte, error) { + pb, err := listPublicTokensResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List all tokens type ListTokenManagementRequest struct { // User ID of the user that created the token. - CreatedById int64 `json:"-" url:"created_by_id,omitempty"` + // Wire name: 'created_by_id' + CreatedById int64 `tf:"-"` // Username of the user that created the token. - CreatedByUsername string `json:"-" url:"created_by_username,omitempty"` + // Wire name: 'created_by_username' + CreatedByUsername string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListTokenManagementRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListTokenManagementRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTokenManagementRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTokenManagementRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListTokenManagementRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListTokenManagementRequest) MarshalJSON() ([]byte, error) { + pb, err := listTokenManagementRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Tokens were successfully returned. type ListTokensResponse struct { // Token metadata of each user-created token in the workspace - TokenInfos []TokenInfo `json:"token_infos,omitempty"` + // Wire name: 'token_infos' + TokenInfos []TokenInfo +} + +func (st *ListTokensResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listTokensResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listTokensResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListTokensResponse) MarshalJSON() ([]byte, error) { + pb, err := listTokensResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Type of IP access list. Valid values are as follows and are case-sensitive: @@ -2635,6 +5881,7 @@ type ListTokensResponse struct { // Exclude this IP or range. IP addresses in the block list are excluded even if // they are included in an allow list. type ListType string +type listTypePb string // An allow list. Include this IP or range. const ListTypeAllow ListType = `ALLOW` @@ -2664,8 +5911,26 @@ func (f *ListType) Type() string { return "ListType" } +func listTypeToPb(st *ListType) (*listTypePb, error) { + if st == nil { + return nil, nil + } + pb := listTypePb(*st) + return &pb, nil +} + +func listTypeFromPb(pb *listTypePb) (*ListType, error) { + if pb == nil { + return nil, nil + } + st := ListType(*pb) + return &st, nil +} + type LlmProxyPartnerPoweredAccount struct { - BooleanVal BooleanMessage `json:"boolean_val"` + + // Wire name: 'boolean_val' + BooleanVal BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -2673,27 +5938,48 @@ type LlmProxyPartnerPoweredAccount struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LlmProxyPartnerPoweredAccount) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LlmProxyPartnerPoweredAccount) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &llmProxyPartnerPoweredAccountPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := llmProxyPartnerPoweredAccountFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LlmProxyPartnerPoweredAccount) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LlmProxyPartnerPoweredAccount) MarshalJSON() ([]byte, error) { + pb, err := llmProxyPartnerPoweredAccountToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LlmProxyPartnerPoweredEnforce struct { - BooleanVal BooleanMessage `json:"boolean_val"` + + // Wire name: 'boolean_val' + BooleanVal BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -2701,27 +5987,48 @@ type LlmProxyPartnerPoweredEnforce struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LlmProxyPartnerPoweredEnforce) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LlmProxyPartnerPoweredEnforce) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &llmProxyPartnerPoweredEnforcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := llmProxyPartnerPoweredEnforceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LlmProxyPartnerPoweredEnforce) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LlmProxyPartnerPoweredEnforce) MarshalJSON() ([]byte, error) { + pb, err := llmProxyPartnerPoweredEnforceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LlmProxyPartnerPoweredWorkspace struct { - BooleanVal BooleanMessage `json:"boolean_val"` + + // Wire name: 'boolean_val' + BooleanVal BooleanMessage // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -2729,40 +6036,78 @@ type LlmProxyPartnerPoweredWorkspace struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LlmProxyPartnerPoweredWorkspace) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LlmProxyPartnerPoweredWorkspace) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &llmProxyPartnerPoweredWorkspacePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := llmProxyPartnerPoweredWorkspaceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LlmProxyPartnerPoweredWorkspace) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LlmProxyPartnerPoweredWorkspace) MarshalJSON() ([]byte, error) { + pb, err := llmProxyPartnerPoweredWorkspaceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MicrosoftTeamsConfig struct { // [Input-Only] URL for Microsoft Teams. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string // [Output-Only] Whether URL is set. - UrlSet bool `json:"url_set,omitempty"` + // Wire name: 'url_set' + UrlSet bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MicrosoftTeamsConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MicrosoftTeamsConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := µsoftTeamsConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := microsoftTeamsConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MicrosoftTeamsConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MicrosoftTeamsConfig) MarshalJSON() ([]byte, error) { + pb, err := microsoftTeamsConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The stable AWS IP CIDR blocks. You can use these to configure the firewall of @@ -2770,7 +6115,33 @@ func (s MicrosoftTeamsConfig) MarshalJSON() ([]byte, error) { type NccAwsStableIpRule struct { // The list of stable IP CIDR blocks from which Databricks network traffic // originates when accessing your resources. - CidrBlocks []string `json:"cidr_blocks,omitempty"` + // Wire name: 'cidr_blocks' + CidrBlocks []string +} + +func (st *NccAwsStableIpRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccAwsStableIpRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccAwsStableIpRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NccAwsStableIpRule) MarshalJSON() ([]byte, error) { + pb, err := nccAwsStableIpRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties of the new private endpoint rule. Note that you must approve the @@ -2788,49 +6159,78 @@ type NccAzurePrivateEndpointRule struct { // link resource owner, the private endpoint becomes informative and should // be deleted for clean-up. - EXPIRED: If the endpoint was created but not // approved in 14 days, it will be EXPIRED. - ConnectionState NccAzurePrivateEndpointRuleConnectionState `json:"connection_state,omitempty"` + // Wire name: 'connection_state' + ConnectionState NccAzurePrivateEndpointRuleConnectionState // Time in epoch milliseconds when this object was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Whether this private endpoint is deactivated. - Deactivated bool `json:"deactivated,omitempty"` + // Wire name: 'deactivated' + Deactivated bool // Time in epoch milliseconds when this object was deactivated. - DeactivatedAt int64 `json:"deactivated_at,omitempty"` + // Wire name: 'deactivated_at' + DeactivatedAt int64 // Only used by private endpoints to customer-managed resources. // // Domain names of target private link service. When updating this field, // the full list of target domain_names must be specified. - DomainNames []string `json:"domain_names,omitempty"` + // Wire name: 'domain_names' + DomainNames []string // The name of the Azure private endpoint resource. - EndpointName string `json:"endpoint_name,omitempty"` + // Wire name: 'endpoint_name' + EndpointName string // Only used by private endpoints to Azure first-party services. Enum: blob // | dfs | sqlServer | mysqlServer // // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for blob and one for dfs. - GroupId string `json:"group_id,omitempty"` + // Wire name: 'group_id' + GroupId string // The ID of a network connectivity configuration, which is the parent // resource of this private endpoint rule object. - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string // The Azure resource ID of the target resource. - ResourceId string `json:"resource_id,omitempty"` + // Wire name: 'resource_id' + ResourceId string // The ID of a private endpoint rule. - RuleId string `json:"rule_id,omitempty"` + // Wire name: 'rule_id' + RuleId string // Time in epoch milliseconds when this object was updated. - UpdatedTime int64 `json:"updated_time,omitempty"` + // Wire name: 'updated_time' + UpdatedTime int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NccAzurePrivateEndpointRule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NccAzurePrivateEndpointRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccAzurePrivateEndpointRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccAzurePrivateEndpointRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NccAzurePrivateEndpointRule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NccAzurePrivateEndpointRule) MarshalJSON() ([]byte, error) { + pb, err := nccAzurePrivateEndpointRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NccAzurePrivateEndpointRuleConnectionState string +type nccAzurePrivateEndpointRuleConnectionStatePb string const NccAzurePrivateEndpointRuleConnectionStateDisconnected NccAzurePrivateEndpointRuleConnectionState = `DISCONNECTED` @@ -2865,37 +6265,100 @@ func (f *NccAzurePrivateEndpointRuleConnectionState) Type() string { return "NccAzurePrivateEndpointRuleConnectionState" } +func nccAzurePrivateEndpointRuleConnectionStateToPb(st *NccAzurePrivateEndpointRuleConnectionState) (*nccAzurePrivateEndpointRuleConnectionStatePb, error) { + if st == nil { + return nil, nil + } + pb := nccAzurePrivateEndpointRuleConnectionStatePb(*st) + return &pb, nil +} + +func nccAzurePrivateEndpointRuleConnectionStateFromPb(pb *nccAzurePrivateEndpointRuleConnectionStatePb) (*NccAzurePrivateEndpointRuleConnectionState, error) { + if pb == nil { + return nil, nil + } + st := NccAzurePrivateEndpointRuleConnectionState(*pb) + return &st, nil +} + // The stable Azure service endpoints. You can configure the firewall of your // Azure resources to allow traffic from your Databricks serverless compute // resources. type NccAzureServiceEndpointRule struct { // The list of subnets from which Databricks network traffic originates when // accessing your Azure resources. - Subnets []string `json:"subnets,omitempty"` + // Wire name: 'subnets' + Subnets []string // The Azure region in which this service endpoint rule applies.. - TargetRegion string `json:"target_region,omitempty"` + // Wire name: 'target_region' + TargetRegion string // The Azure services to which this service endpoint rule applies to. - TargetServices []EgressResourceType `json:"target_services,omitempty"` + // Wire name: 'target_services' + TargetServices []EgressResourceType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NccAzureServiceEndpointRule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NccAzureServiceEndpointRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccAzureServiceEndpointRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccAzureServiceEndpointRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NccAzureServiceEndpointRule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NccAzureServiceEndpointRule) MarshalJSON() ([]byte, error) { + pb, err := nccAzureServiceEndpointRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NccEgressConfig struct { // The network connectivity rules that are applied by default without // resource specific configurations. You can find the stable network // information of your serverless compute resources here. - DefaultRules *NccEgressDefaultRules `json:"default_rules,omitempty"` + // Wire name: 'default_rules' + DefaultRules *NccEgressDefaultRules // The network connectivity rules that configured for each destinations. // These rules override default rules. - TargetRules *NccEgressTargetRules `json:"target_rules,omitempty"` + // Wire name: 'target_rules' + TargetRules *NccEgressTargetRules +} + +func (st *NccEgressConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccEgressConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccEgressConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NccEgressConfig) MarshalJSON() ([]byte, error) { + pb, err := nccEgressConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Default rules don't have specific targets. @@ -2903,51 +6366,129 @@ type NccEgressDefaultRules struct { // The stable AWS IP CIDR blocks. You can use these to configure the // firewall of your resources to allow traffic from your Databricks // workspace. - AwsStableIpRule *NccAwsStableIpRule `json:"aws_stable_ip_rule,omitempty"` + // Wire name: 'aws_stable_ip_rule' + AwsStableIpRule *NccAwsStableIpRule // The stable Azure service endpoints. You can configure the firewall of // your Azure resources to allow traffic from your Databricks serverless // compute resources. - AzureServiceEndpointRule *NccAzureServiceEndpointRule `json:"azure_service_endpoint_rule,omitempty"` + // Wire name: 'azure_service_endpoint_rule' + AzureServiceEndpointRule *NccAzureServiceEndpointRule +} + +func (st *NccEgressDefaultRules) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccEgressDefaultRulesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccEgressDefaultRulesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NccEgressDefaultRules) MarshalJSON() ([]byte, error) { + pb, err := nccEgressDefaultRulesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Target rule controls the egress rules that are dedicated to specific // resources. type NccEgressTargetRules struct { - AzurePrivateEndpointRules []NccAzurePrivateEndpointRule `json:"azure_private_endpoint_rules,omitempty"` + + // Wire name: 'azure_private_endpoint_rules' + AzurePrivateEndpointRules []NccAzurePrivateEndpointRule +} + +func (st *NccEgressTargetRules) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &nccEgressTargetRulesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := nccEgressTargetRulesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NccEgressTargetRules) MarshalJSON() ([]byte, error) { + pb, err := nccEgressTargetRulesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties of the new network connectivity configuration. type NetworkConnectivityConfiguration struct { // The Databricks account ID that hosts the credential. - AccountId string `json:"account_id,omitempty"` + // Wire name: 'account_id' + AccountId string // Time in epoch milliseconds when this object was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // The network connectivity rules that apply to network traffic from your // serverless compute resources. - EgressConfig *NccEgressConfig `json:"egress_config,omitempty"` + // Wire name: 'egress_config' + EgressConfig *NccEgressConfig // The name of the network connectivity configuration. The name can contain // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // ^[0-9a-zA-Z-_]{3,30}$ - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Databricks network connectivity configuration ID. - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // Time in epoch milliseconds when this object was updated. - UpdatedTime int64 `json:"updated_time,omitempty"` + // Wire name: 'updated_time' + UpdatedTime int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NetworkConnectivityConfiguration) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NetworkConnectivityConfiguration) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkConnectivityConfigurationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkConnectivityConfigurationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { + pb, err := networkConnectivityConfigurationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The network policies applying for egress traffic. This message is used by the @@ -2959,64 +6500,148 @@ func (s NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { // https://docs.google.com/document/d/1DKWO_FpZMCY4cF2O62LpwII1lx8gsnDGG-qgE3t3TOA/ type NetworkPolicyEgress struct { // The access policy enforced for egress traffic to the internet. - NetworkAccess *EgressNetworkPolicyNetworkAccessPolicy `json:"network_access,omitempty"` + // Wire name: 'network_access' + NetworkAccess *EgressNetworkPolicyNetworkAccessPolicy +} + +func (st *NetworkPolicyEgress) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &networkPolicyEgressPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := networkPolicyEgressFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st NetworkPolicyEgress) MarshalJSON() ([]byte, error) { + pb, err := networkPolicyEgressToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NotificationDestination struct { // The configuration for the notification destination. Will be exactly one // of the nested configs. Only returns for users with workspace admin // permissions. - Config *Config `json:"config,omitempty"` + // Wire name: 'config' + Config *Config // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType DestinationType `json:"destination_type,omitempty"` + // Wire name: 'destination_type' + DestinationType DestinationType // The display name for the notification destination. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying notification destination. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NotificationDestination) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NotificationDestination) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ificationDestinationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notificationDestinationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NotificationDestination) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NotificationDestination) MarshalJSON() ([]byte, error) { + pb, err := notificationDestinationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PagerdutyConfig struct { // [Input-Only] Integration key for PagerDuty. - IntegrationKey string `json:"integration_key,omitempty"` + // Wire name: 'integration_key' + IntegrationKey string // [Output-Only] Whether integration key is set. - IntegrationKeySet bool `json:"integration_key_set,omitempty"` + // Wire name: 'integration_key_set' + IntegrationKeySet bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PagerdutyConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PagerdutyConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &pagerdutyConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := pagerdutyConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PagerdutyConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PagerdutyConfig) MarshalJSON() ([]byte, error) { + pb, err := pagerdutyConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Partition by workspace or account type PartitionId struct { // The ID of the workspace. - WorkspaceId int64 `json:"workspaceId,omitempty"` + // Wire name: 'workspaceId' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PartitionId) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PartitionId) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &partitionIdPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := partitionIdFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PartitionId) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PartitionId) MarshalJSON() ([]byte, error) { + pb, err := partitionIdToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PersonalComputeMessage struct { @@ -3027,7 +6652,33 @@ type PersonalComputeMessage struct { // users or groups to be added to the ACLs of that workspace’s Personal // Compute default policy before they will be able to create compute // resources through that policy. - Value PersonalComputeMessageEnum `json:"value"` + // Wire name: 'value' + Value PersonalComputeMessageEnum +} + +func (st *PersonalComputeMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &personalComputeMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := personalComputeMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PersonalComputeMessage) MarshalJSON() ([]byte, error) { + pb, err := personalComputeMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // ON: Grants all users in all workspaces access to the Personal Compute default @@ -3037,6 +6688,7 @@ type PersonalComputeMessage struct { // added to the ACLs of that workspace’s Personal Compute default policy // before they will be able to create compute resources through that policy. type PersonalComputeMessageEnum string +type personalComputeMessageEnumPb string const PersonalComputeMessageEnumDelegate PersonalComputeMessageEnum = `DELEGATE` @@ -3063,6 +6715,22 @@ func (f *PersonalComputeMessageEnum) Type() string { return "PersonalComputeMessageEnum" } +func personalComputeMessageEnumToPb(st *PersonalComputeMessageEnum) (*personalComputeMessageEnumPb, error) { + if st == nil { + return nil, nil + } + pb := personalComputeMessageEnumPb(*st) + return &pb, nil +} + +func personalComputeMessageEnumFromPb(pb *personalComputeMessageEnumPb) (*PersonalComputeMessageEnum, error) { + if pb == nil { + return nil, nil + } + st := PersonalComputeMessageEnum(*pb) + return &st, nil +} + type PersonalComputeSetting struct { // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to @@ -3071,76 +6739,200 @@ type PersonalComputeSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string - PersonalCompute PersonalComputeMessage `json:"personal_compute"` + // Wire name: 'personal_compute' + PersonalCompute PersonalComputeMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PersonalComputeSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PersonalComputeSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &personalComputeSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := personalComputeSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PersonalComputeSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PersonalComputeSetting) MarshalJSON() ([]byte, error) { + pb, err := personalComputeSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PublicTokenInfo struct { // Comment the token was created with, if applicable. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Server time (in epoch milliseconds) when the token was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Server time (in epoch milliseconds) when the token will expire, or -1 if // not applicable. - ExpiryTime int64 `json:"expiry_time,omitempty"` + // Wire name: 'expiry_time' + ExpiryTime int64 // The ID of this token. - TokenId string `json:"token_id,omitempty"` + // Wire name: 'token_id' + TokenId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PublicTokenInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PublicTokenInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &publicTokenInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := publicTokenInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PublicTokenInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PublicTokenInfo) MarshalJSON() ([]byte, error) { + pb, err := publicTokenInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to replace an IP access list. type ReplaceIpAccessList struct { // Specifies whether this IP access list is enabled. - Enabled bool `json:"enabled"` + // Wire name: 'enabled' + Enabled bool // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` - IpAddresses []string `json:"ip_addresses,omitempty"` + // Wire name: 'ip_addresses' + IpAddresses []string // Label for the IP access list. This **cannot** be empty. - Label string `json:"label"` + // Wire name: 'label' + Label string // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType ListType `json:"list_type"` + // Wire name: 'list_type' + ListType ListType } -type ReplaceResponse struct { +func (st *ReplaceIpAccessList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &replaceIpAccessListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := replaceIpAccessListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type RestrictWorkspaceAdminsMessage struct { - Status RestrictWorkspaceAdminsMessageStatus `json:"status"` +func (st ReplaceIpAccessList) MarshalJSON() ([]byte, error) { + pb, err := replaceIpAccessListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type ReplaceResponse struct { +} + +func (st *ReplaceResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &replaceResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := replaceResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ReplaceResponse) MarshalJSON() ([]byte, error) { + pb, err := replaceResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type RestrictWorkspaceAdminsMessage struct { + + // Wire name: 'status' + Status RestrictWorkspaceAdminsMessageStatus +} + +func (st *RestrictWorkspaceAdminsMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restrictWorkspaceAdminsMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restrictWorkspaceAdminsMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestrictWorkspaceAdminsMessage) MarshalJSON() ([]byte, error) { + pb, err := restrictWorkspaceAdminsMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestrictWorkspaceAdminsMessageStatus string +type restrictWorkspaceAdminsMessageStatusPb string const RestrictWorkspaceAdminsMessageStatusAllowAll RestrictWorkspaceAdminsMessageStatus = `ALLOW_ALL` @@ -3167,6 +6959,22 @@ func (f *RestrictWorkspaceAdminsMessageStatus) Type() string { return "RestrictWorkspaceAdminsMessageStatus" } +func restrictWorkspaceAdminsMessageStatusToPb(st *RestrictWorkspaceAdminsMessageStatus) (*restrictWorkspaceAdminsMessageStatusPb, error) { + if st == nil { + return nil, nil + } + pb := restrictWorkspaceAdminsMessageStatusPb(*st) + return &pb, nil +} + +func restrictWorkspaceAdminsMessageStatusFromPb(pb *restrictWorkspaceAdminsMessageStatusPb) (*RestrictWorkspaceAdminsMessageStatus, error) { + if pb == nil { + return nil, nil + } + st := RestrictWorkspaceAdminsMessageStatus(*pb) + return &st, nil +} + type RestrictWorkspaceAdminsSetting struct { // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to @@ -3175,167 +6983,391 @@ type RestrictWorkspaceAdminsSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag string `json:"etag,omitempty"` + // Wire name: 'etag' + Etag string - RestrictWorkspaceAdmins RestrictWorkspaceAdminsMessage `json:"restrict_workspace_admins"` + // Wire name: 'restrict_workspace_admins' + RestrictWorkspaceAdmins RestrictWorkspaceAdminsMessage // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName string `json:"setting_name,omitempty"` + // Wire name: 'setting_name' + SettingName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RestrictWorkspaceAdminsSetting) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RestrictWorkspaceAdminsSetting) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restrictWorkspaceAdminsSettingPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restrictWorkspaceAdminsSettingFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RestrictWorkspaceAdminsSetting) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RestrictWorkspaceAdminsSetting) MarshalJSON() ([]byte, error) { + pb, err := restrictWorkspaceAdminsSettingToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RevokeTokenRequest struct { // The ID of the token to be revoked. - TokenId string `json:"token_id"` + // Wire name: 'token_id' + TokenId string +} + +func (st *RevokeTokenRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &revokeTokenRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := revokeTokenRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RevokeTokenRequest) MarshalJSON() ([]byte, error) { + pb, err := revokeTokenRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RevokeTokenResponse struct { } +func (st *RevokeTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &revokeTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := revokeTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RevokeTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := revokeTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SetStatusResponse struct { } +func (st *SetStatusResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setStatusResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setStatusResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetStatusResponse) MarshalJSON() ([]byte, error) { + pb, err := setStatusResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type SlackConfig struct { // [Input-Only] URL for Slack destination. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string // [Output-Only] Whether URL is set. - UrlSet bool `json:"url_set,omitempty"` + // Wire name: 'url_set' + UrlSet bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SlackConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SlackConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &slackConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := slackConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SlackConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SlackConfig) MarshalJSON() ([]byte, error) { + pb, err := slackConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StringMessage struct { // Represents a generic string value. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StringMessage) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StringMessage) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stringMessagePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stringMessageFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StringMessage) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StringMessage) MarshalJSON() ([]byte, error) { + pb, err := stringMessageToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel TokenPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := tokenAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenAccessControlResponse struct { // All permissions. - AllPermissions []TokenPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []TokenPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := tokenAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenInfo struct { // Comment that describes the purpose of the token, specified by the token // creator. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // User ID of the user that created the token. - CreatedById int64 `json:"created_by_id,omitempty"` + // Wire name: 'created_by_id' + CreatedById int64 // Username of the user that created the token. - CreatedByUsername string `json:"created_by_username,omitempty"` + // Wire name: 'created_by_username' + CreatedByUsername string // Timestamp when the token was created. - CreationTime int64 `json:"creation_time,omitempty"` + // Wire name: 'creation_time' + CreationTime int64 // Timestamp when the token expires. - ExpiryTime int64 `json:"expiry_time,omitempty"` + // Wire name: 'expiry_time' + ExpiryTime int64 // Approximate timestamp for the day the token was last used. Accurate up to // 1 day. - LastUsedDay int64 `json:"last_used_day,omitempty"` + // Wire name: 'last_used_day' + LastUsedDay int64 // User ID of the user that owns the token. - OwnerId int64 `json:"owner_id,omitempty"` + // Wire name: 'owner_id' + OwnerId int64 // ID of the token. - TokenId string `json:"token_id,omitempty"` + // Wire name: 'token_id' + TokenId string // If applicable, the ID of the workspace that the token was created in. - WorkspaceId int64 `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenInfo) MarshalJSON() ([]byte, error) { + pb, err := tokenInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel TokenPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenPermission) MarshalJSON() ([]byte, error) { + pb, err := tokenPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type TokenPermissionLevel string +type tokenPermissionLevelPb string const TokenPermissionLevelCanUse TokenPermissionLevel = `CAN_USE` @@ -3360,47 +7392,132 @@ func (f *TokenPermissionLevel) Type() string { return "TokenPermissionLevel" } +func tokenPermissionLevelToPb(st *TokenPermissionLevel) (*tokenPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := tokenPermissionLevelPb(*st) + return &pb, nil +} + +func tokenPermissionLevelFromPb(pb *tokenPermissionLevelPb) (*TokenPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := TokenPermissionLevel(*pb) + return &st, nil +} + type TokenPermissions struct { - AccessControlList []TokenAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []TokenAccessControlResponse - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_id' + ObjectId string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'object_type' + ObjectType string + + ForceSendFields []string `tf:"-"` } -func (s *TokenPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenPermissions) MarshalJSON() ([]byte, error) { + pb, err := tokenPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel TokenPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TokenPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TokenPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TokenPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TokenPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := tokenPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TokenPermissionsRequest struct { - AccessControlList []TokenAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []TokenAccessControlRequest +} + +func (st *TokenPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tokenPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tokenPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TokenPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := tokenPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of token request. As of now, only `AZURE_ACTIVE_DIRECTORY_TOKEN` is // supported. type TokenType string +type tokenTypePb string const TokenTypeArclightAzureExchangeToken TokenType = `ARCLIGHT_AZURE_EXCHANGE_TOKEN` @@ -3433,11 +7550,28 @@ func (f *TokenType) Type() string { return "TokenType" } +func tokenTypeToPb(st *TokenType) (*tokenTypePb, error) { + if st == nil { + return nil, nil + } + pb := tokenTypePb(*st) + return &pb, nil +} + +func tokenTypeFromPb(pb *tokenTypePb) (*TokenType, error) { + if pb == nil { + return nil, nil + } + st := TokenType(*pb) + return &st, nil +} + // Details required to update a setting. type UpdateAccountIpAccessEnableRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3449,16 +7583,44 @@ type UpdateAccountIpAccessEnableRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting AccountIpAccessEnable `json:"setting"` + // Wire name: 'setting' + Setting AccountIpAccessEnable +} + +func (st *UpdateAccountIpAccessEnableRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAccountIpAccessEnableRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAccountIpAccessEnableRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAccountIpAccessEnableRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateAibiDashboardEmbeddingAccessPolicySettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3470,16 +7632,44 @@ type UpdateAibiDashboardEmbeddingAccessPolicySettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting AibiDashboardEmbeddingAccessPolicySetting `json:"setting"` + // Wire name: 'setting' + Setting AibiDashboardEmbeddingAccessPolicySetting +} + +func (st *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAibiDashboardEmbeddingAccessPolicySettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAibiDashboardEmbeddingAccessPolicySettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3491,16 +7681,44 @@ type UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting AibiDashboardEmbeddingApprovedDomainsSetting +} + +func (st *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting AibiDashboardEmbeddingApprovedDomainsSetting `json:"setting"` +func (st UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateAutomaticClusterUpdateSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3512,16 +7730,44 @@ type UpdateAutomaticClusterUpdateSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting AutomaticClusterUpdateSetting +} + +func (st *UpdateAutomaticClusterUpdateSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAutomaticClusterUpdateSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAutomaticClusterUpdateSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting AutomaticClusterUpdateSetting `json:"setting"` +func (st UpdateAutomaticClusterUpdateSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAutomaticClusterUpdateSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateComplianceSecurityProfileSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3533,16 +7779,44 @@ type UpdateComplianceSecurityProfileSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting ComplianceSecurityProfileSetting `json:"setting"` + // Wire name: 'setting' + Setting ComplianceSecurityProfileSetting +} + +func (st *UpdateComplianceSecurityProfileSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateComplianceSecurityProfileSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateComplianceSecurityProfileSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateComplianceSecurityProfileSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateComplianceSecurityProfileSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateCspEnablementAccountSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3554,16 +7828,44 @@ type UpdateCspEnablementAccountSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting CspEnablementAccountSetting +} - Setting CspEnablementAccountSetting `json:"setting"` +func (st *UpdateCspEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCspEnablementAccountSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCspEnablementAccountSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCspEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateCspEnablementAccountSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateDefaultNamespaceSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3575,7 +7877,8 @@ type UpdateDefaultNamespaceSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string // This represents the setting configuration for the default namespace in // the Databricks workspace. Setting the default catalog for the workspace // determines the catalog that is used when queries do not reference a fully @@ -3585,14 +7888,41 @@ type UpdateDefaultNamespaceSettingRequest struct { // assumed). This setting requires a restart of clusters and SQL warehouses // to take effect. Additionally, the default namespace only applies when // using Unity Catalog-enabled compute. - Setting DefaultNamespaceSetting `json:"setting"` + // Wire name: 'setting' + Setting DefaultNamespaceSetting +} + +func (st *UpdateDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDefaultNamespaceSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDefaultNamespaceSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDefaultNamespaceSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateDisableLegacyAccessRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3604,16 +7934,44 @@ type UpdateDisableLegacyAccessRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting DisableLegacyAccess `json:"setting"` + // Wire name: 'setting' + Setting DisableLegacyAccess +} + +func (st *UpdateDisableLegacyAccessRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDisableLegacyAccessRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDisableLegacyAccessRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDisableLegacyAccessRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateDisableLegacyDbfsRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3625,16 +7983,44 @@ type UpdateDisableLegacyDbfsRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting DisableLegacyDbfs +} - Setting DisableLegacyDbfs `json:"setting"` +func (st *UpdateDisableLegacyDbfsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDisableLegacyDbfsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDisableLegacyDbfsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDisableLegacyDbfsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateDisableLegacyFeaturesRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3646,16 +8032,44 @@ type UpdateDisableLegacyFeaturesRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting DisableLegacyFeatures +} - Setting DisableLegacyFeatures `json:"setting"` +func (st *UpdateDisableLegacyFeaturesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateDisableLegacyFeaturesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateDisableLegacyFeaturesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { + pb, err := updateDisableLegacyFeaturesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateEnableExportNotebookRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3667,16 +8081,44 @@ type UpdateEnableExportNotebookRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting EnableExportNotebook +} + +func (st *UpdateEnableExportNotebookRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEnableExportNotebookRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEnableExportNotebookRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting EnableExportNotebook `json:"setting"` +func (st UpdateEnableExportNotebookRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEnableExportNotebookRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateEnableNotebookTableClipboardRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3688,16 +8130,44 @@ type UpdateEnableNotebookTableClipboardRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting EnableNotebookTableClipboard `json:"setting"` + // Wire name: 'setting' + Setting EnableNotebookTableClipboard +} + +func (st *UpdateEnableNotebookTableClipboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEnableNotebookTableClipboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEnableNotebookTableClipboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateEnableNotebookTableClipboardRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEnableNotebookTableClipboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateEnableResultsDownloadingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3709,16 +8179,44 @@ type UpdateEnableResultsDownloadingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting EnableResultsDownloading `json:"setting"` + // Wire name: 'setting' + Setting EnableResultsDownloading +} + +func (st *UpdateEnableResultsDownloadingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEnableResultsDownloadingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEnableResultsDownloadingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateEnableResultsDownloadingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEnableResultsDownloadingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateEnhancedSecurityMonitoringSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3730,16 +8228,44 @@ type UpdateEnhancedSecurityMonitoringSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting EnhancedSecurityMonitoringSetting +} + +func (st *UpdateEnhancedSecurityMonitoringSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEnhancedSecurityMonitoringSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEnhancedSecurityMonitoringSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting EnhancedSecurityMonitoringSetting `json:"setting"` +func (st UpdateEnhancedSecurityMonitoringSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEnhancedSecurityMonitoringSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateEsmEnablementAccountSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3751,45 +8277,95 @@ type UpdateEsmEnablementAccountSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting EsmEnablementAccountSetting +} + +func (st *UpdateEsmEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEsmEnablementAccountSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEsmEnablementAccountSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting EsmEnablementAccountSetting `json:"setting"` +func (st UpdateEsmEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEsmEnablementAccountSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update an IP access list. type UpdateIpAccessList struct { // Specifies whether this IP access list is enabled. - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // The ID for the corresponding IP access list - IpAccessListId string `json:"-" url:"-"` + // Wire name: 'ip_access_list_id' + IpAccessListId string `tf:"-"` - IpAddresses []string `json:"ip_addresses,omitempty"` + // Wire name: 'ip_addresses' + IpAddresses []string // Label for the IP access list. This **cannot** be empty. - Label string `json:"label,omitempty"` + // Wire name: 'label' + Label string // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType ListType `json:"list_type,omitempty"` + // Wire name: 'list_type' + ListType ListType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateIpAccessList) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateIpAccessList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateIpAccessListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateIpAccessListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateIpAccessList) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateIpAccessList) MarshalJSON() ([]byte, error) { + pb, err := updateIpAccessListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateLlmProxyPartnerPoweredAccountRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3801,16 +8377,44 @@ type UpdateLlmProxyPartnerPoweredAccountRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting LlmProxyPartnerPoweredAccount +} + +func (st *UpdateLlmProxyPartnerPoweredAccountRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateLlmProxyPartnerPoweredAccountRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateLlmProxyPartnerPoweredAccountRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting LlmProxyPartnerPoweredAccount `json:"setting"` +func (st UpdateLlmProxyPartnerPoweredAccountRequest) MarshalJSON() ([]byte, error) { + pb, err := updateLlmProxyPartnerPoweredAccountRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateLlmProxyPartnerPoweredEnforceRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3822,16 +8426,44 @@ type UpdateLlmProxyPartnerPoweredEnforceRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting LlmProxyPartnerPoweredEnforce `json:"setting"` + // Wire name: 'setting' + Setting LlmProxyPartnerPoweredEnforce +} + +func (st *UpdateLlmProxyPartnerPoweredEnforceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateLlmProxyPartnerPoweredEnforceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateLlmProxyPartnerPoweredEnforceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateLlmProxyPartnerPoweredEnforceRequest) MarshalJSON() ([]byte, error) { + pb, err := updateLlmProxyPartnerPoweredEnforceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdateLlmProxyPartnerPoweredWorkspaceRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3843,61 +8475,166 @@ type UpdateLlmProxyPartnerPoweredWorkspaceRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` + // Wire name: 'setting' + Setting LlmProxyPartnerPoweredWorkspace +} + +func (st *UpdateLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateLlmProxyPartnerPoweredWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := updateLlmProxyPartnerPoweredWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update a private endpoint rule type UpdateNccAzurePrivateEndpointRulePublicRequest struct { // Your Network Connectivity Configuration ID. - NetworkConnectivityConfigId string `json:"-" url:"-"` + // Wire name: 'network_connectivity_config_id' + NetworkConnectivityConfigId string `tf:"-"` // Properties of the new private endpoint rule. Note that you must approve // the endpoint in Azure portal after initialization. - PrivateEndpointRule UpdatePrivateEndpointRule `json:"private_endpoint_rule"` + // Wire name: 'private_endpoint_rule' + PrivateEndpointRule UpdatePrivateEndpointRule // Your private endpoint rule ID. - PrivateEndpointRuleId string `json:"-" url:"-"` + // Wire name: 'private_endpoint_rule_id' + PrivateEndpointRuleId string `tf:"-"` // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). // Specification of elements in sequence or map fields is not allowed, as // only the entire collection field can be specified. Field names must // exactly match the resource field names. - UpdateMask string `json:"-" url:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` +} + +func (st *UpdateNccAzurePrivateEndpointRulePublicRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateNccAzurePrivateEndpointRulePublicRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateNccAzurePrivateEndpointRulePublicRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateNccAzurePrivateEndpointRulePublicRequest) MarshalJSON() ([]byte, error) { + pb, err := updateNccAzurePrivateEndpointRulePublicRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update a network policy type UpdateNetworkPolicyRequest struct { - NetworkPolicy AccountNetworkPolicy `json:"network_policy"` + + // Wire name: 'network_policy' + NetworkPolicy AccountNetworkPolicy // The unique identifier for the network policy. - NetworkPolicyId string `json:"-" url:"-"` + // Wire name: 'network_policy_id' + NetworkPolicyId string `tf:"-"` +} + +func (st *UpdateNetworkPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateNetworkPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateNetworkPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := updateNetworkPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateNotificationDestinationRequest struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config *Config `json:"config,omitempty"` + // Wire name: 'config' + Config *Config // The display name for the notification destination. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying notification destination. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateNotificationDestinationRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateNotificationDestinationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateNotificationDestinationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateNotificationDestinationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + pb, err := updateNotificationDestinationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details required to update a setting. type UpdatePersonalComputeSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3909,9 +8646,36 @@ type UpdatePersonalComputeSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string + + // Wire name: 'setting' + Setting PersonalComputeSetting +} + +func (st *UpdatePersonalComputeSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePersonalComputeSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePersonalComputeSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Setting PersonalComputeSetting `json:"setting"` +func (st UpdatePersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updatePersonalComputeSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Properties of the new private endpoint rule. Note that you must approve the @@ -3921,17 +8685,69 @@ type UpdatePrivateEndpointRule struct { // // Domain names of target private link service. When updating this field, // the full list of target domain_names must be specified. - DomainNames []string `json:"domain_names,omitempty"` + // Wire name: 'domain_names' + DomainNames []string +} + +func (st *UpdatePrivateEndpointRule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updatePrivateEndpointRulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updatePrivateEndpointRuleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdatePrivateEndpointRule) MarshalJSON() ([]byte, error) { + pb, err := updatePrivateEndpointRuleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Details required to update a setting. type UpdateRestrictWorkspaceAdminsSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing bool `json:"allow_missing"` + // Wire name: 'allow_missing' + AllowMissing bool // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -3943,20 +8759,90 @@ type UpdateRestrictWorkspaceAdminsSettingRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - FieldMask string `json:"field_mask"` + // Wire name: 'field_mask' + FieldMask string - Setting RestrictWorkspaceAdminsSetting `json:"setting"` + // Wire name: 'setting' + Setting RestrictWorkspaceAdminsSetting +} + +func (st *UpdateRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRestrictWorkspaceAdminsSettingRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRestrictWorkspaceAdminsSettingRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) { + pb, err := updateRestrictWorkspaceAdminsSettingRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update workspace network configuration type UpdateWorkspaceNetworkOptionRequest struct { // The workspace ID. - WorkspaceId int64 `json:"-" url:"-"` + // Wire name: 'workspace_id' + WorkspaceId int64 `tf:"-"` + + // Wire name: 'workspace_network_option' + WorkspaceNetworkOption WorkspaceNetworkOption +} + +func (st *UpdateWorkspaceNetworkOptionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateWorkspaceNetworkOptionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateWorkspaceNetworkOptionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - WorkspaceNetworkOption WorkspaceNetworkOption `json:"workspace_network_option"` +func (st UpdateWorkspaceNetworkOptionRequest) MarshalJSON() ([]byte, error) { + pb, err := updateWorkspaceNetworkOptionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WorkspaceConf map[string]string +type workspaceConfPb WorkspaceConf + +func workspaceConfToPb(st *WorkspaceConf) (*workspaceConfPb, error) { + if st == nil { + return nil, nil + } + stPb := workspaceConfPb(*st) + return &stPb, nil +} +func workspaceConfFromPb(stPb *workspaceConfPb) (*WorkspaceConf, error) { + if stPb == nil { + return nil, nil + } + st := WorkspaceConf(*stPb) + return &st, nil +} type WorkspaceNetworkOption struct { // The network policy ID to apply to the workspace. This controls the @@ -3964,17 +8850,90 @@ type WorkspaceNetworkOption struct { // workspace. Each workspace can only be linked to one policy at a time. If // no policy is explicitly assigned, the workspace will use // 'default-policy'. - NetworkPolicyId string `json:"network_policy_id,omitempty"` + // Wire name: 'network_policy_id' + NetworkPolicyId string // The workspace ID. - WorkspaceId int64 `json:"workspace_id,omitempty"` + // Wire name: 'workspace_id' + WorkspaceId int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceNetworkOption) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceNetworkOption) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceNetworkOptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceNetworkOptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceNetworkOption) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceNetworkOption) MarshalJSON() ([]byte, error) { + pb, err := workspaceNetworkOptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/sharing/impl.go b/service/sharing/impl.go index 38b194198..ced0886a2 100755 --- a/service/sharing/impl.go +++ b/service/sharing/impl.go @@ -19,33 +19,95 @@ type providersImpl struct { } func (a *providersImpl) Create(ctx context.Context, request CreateProvider) (*ProviderInfo, error) { - var providerInfo ProviderInfo + + requestPb, pbErr := createProviderToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var providerInfoPb providerInfoPb path := "/api/2.1/unity-catalog/providers" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &providerInfo) - return &providerInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &providerInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := providerInfoFromPb(&providerInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + + requestPb, pbErr := deleteProviderRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *providersImpl) Get(ctx context.Context, request GetProviderRequest) (*ProviderInfo, error) { - var providerInfo ProviderInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + + requestPb, pbErr := getProviderRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var providerInfoPb providerInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &providerInfo) - return &providerInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &providerInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := providerInfoFromPb(&providerInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List providers. @@ -92,23 +154,67 @@ func (a *providersImpl) ListAll(ctx context.Context, request ListProvidersReques } func (a *providersImpl) internalList(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { - var listProvidersResponse ListProvidersResponse + + requestPb, pbErr := listProvidersRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listProvidersResponsePb listProvidersResponsePb path := "/api/2.1/unity-catalog/providers" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) - return &listProvidersResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listProvidersResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProvidersResponseFromPb(&listProvidersResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providersImpl) ListProviderShareAssets(ctx context.Context, request ListProviderShareAssetsRequest) (*ListProviderShareAssetsResponse, error) { - var listProviderShareAssetsResponse ListProviderShareAssetsResponse - path := fmt.Sprintf("/api/2.1/data-sharing/providers/%v/shares/%v", request.ProviderName, request.ShareName) + + requestPb, pbErr := listProviderShareAssetsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listProviderShareAssetsResponsePb listProviderShareAssetsResponsePb + path := fmt.Sprintf("/api/2.1/data-sharing/providers/%v/shares/%v", requestPb.ProviderName, requestPb.ShareName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProviderShareAssetsResponse) - return &listProviderShareAssetsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listProviderShareAssetsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProviderShareAssetsResponseFromPb(&listProviderShareAssetsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List shares by Provider. @@ -153,24 +259,68 @@ func (a *providersImpl) ListSharesAll(ctx context.Context, request ListSharesReq } func (a *providersImpl) internalListShares(ctx context.Context, request ListSharesRequest) (*ListProviderSharesResponse, error) { - var listProviderSharesResponse ListProviderSharesResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v/shares", request.Name) + + requestPb, pbErr := listSharesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listProviderSharesResponsePb listProviderSharesResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v/shares", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProviderSharesResponse) - return &listProviderSharesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listProviderSharesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listProviderSharesResponseFromPb(&listProviderSharesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *providersImpl) Update(ctx context.Context, request UpdateProvider) (*ProviderInfo, error) { - var providerInfo ProviderInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + + requestPb, pbErr := updateProviderToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var providerInfoPb providerInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &providerInfo) - return &providerInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &providerInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := providerInfoFromPb(&providerInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just RecipientActivation API methods @@ -179,23 +329,63 @@ type recipientActivationImpl struct { } func (a *recipientActivationImpl) GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error { - var getActivationUrlInfoResponse GetActivationUrlInfoResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation_info/%v", request.ActivationUrl) + + requestPb, pbErr := getActivationUrlInfoRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var getActivationUrlInfoResponsePb getActivationUrlInfoResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation_info/%v", requestPb.ActivationUrl) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getActivationUrlInfoResponse) + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getActivationUrlInfoResponsePb, + ) + if err != nil { + return err + } + return err } func (a *recipientActivationImpl) RetrieveToken(ctx context.Context, request RetrieveTokenRequest) (*RetrieveTokenResponse, error) { - var retrieveTokenResponse RetrieveTokenResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation/%v", request.ActivationUrl) + + requestPb, pbErr := retrieveTokenRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var retrieveTokenResponsePb retrieveTokenResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation/%v", requestPb.ActivationUrl) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &retrieveTokenResponse) - return &retrieveTokenResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &retrieveTokenResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := retrieveTokenResponseFromPb(&retrieveTokenResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just RecipientFederationPolicies API methods @@ -204,34 +394,96 @@ type recipientFederationPoliciesImpl struct { } func (a *recipientFederationPoliciesImpl) Create(ctx context.Context, request CreateFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies", request.RecipientName) + + requestPb, pbErr := createFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies", requestPb.RecipientName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientFederationPoliciesImpl) Delete(ctx context.Context, request DeleteFederationPolicyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", request.RecipientName, request.Name) + + requestPb, pbErr := deleteFederationPolicyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", requestPb.RecipientName, requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *recipientFederationPoliciesImpl) GetFederationPolicy(ctx context.Context, request GetFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", request.RecipientName, request.Name) + + requestPb, pbErr := getFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", requestPb.RecipientName, requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // List recipient federation policies. @@ -274,27 +526,71 @@ func (a *recipientFederationPoliciesImpl) ListAll(ctx context.Context, request L } func (a *recipientFederationPoliciesImpl) internalList(ctx context.Context, request ListFederationPoliciesRequest) (*ListFederationPoliciesResponse, error) { - var listFederationPoliciesResponse ListFederationPoliciesResponse - path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies", request.RecipientName) + + requestPb, pbErr := listFederationPoliciesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listFederationPoliciesResponsePb listFederationPoliciesResponsePb + path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies", requestPb.RecipientName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFederationPoliciesResponse) - return &listFederationPoliciesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listFederationPoliciesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listFederationPoliciesResponseFromPb(&listFederationPoliciesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientFederationPoliciesImpl) Update(ctx context.Context, request UpdateFederationPolicyRequest) (*FederationPolicy, error) { - var federationPolicy FederationPolicy - path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", request.RecipientName, request.Name) + + requestPb, pbErr := updateFederationPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var federationPolicyPb federationPolicyPb + path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", requestPb.RecipientName, requestPb.Name) queryParams := make(map[string]any) - if request.UpdateMask != "" || slices.Contains(request.ForceSendFields, "UpdateMask") { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" || slices.Contains(requestPb.ForceSendFields, "UpdateMask") { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &federationPolicy) - return &federationPolicy, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Policy, + &federationPolicyPb, + ) + if err != nil { + return nil, err + } + resp, err := federationPolicyFromPb(&federationPolicyPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Recipients API methods @@ -303,33 +599,95 @@ type recipientsImpl struct { } func (a *recipientsImpl) Create(ctx context.Context, request CreateRecipient) (*RecipientInfo, error) { - var recipientInfo RecipientInfo + + requestPb, pbErr := createRecipientToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var recipientInfoPb recipientInfoPb path := "/api/2.1/unity-catalog/recipients" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &recipientInfo) - return &recipientInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &recipientInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := recipientInfoFromPb(&recipientInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientsImpl) Delete(ctx context.Context, request DeleteRecipientRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + + requestPb, pbErr := deleteRecipientRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *recipientsImpl) Get(ctx context.Context, request GetRecipientRequest) (*RecipientInfo, error) { - var recipientInfo RecipientInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + + requestPb, pbErr := getRecipientRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var recipientInfoPb recipientInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &recipientInfo) - return &recipientInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &recipientInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := recipientInfoFromPb(&recipientInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List share recipients. @@ -376,45 +734,133 @@ func (a *recipientsImpl) ListAll(ctx context.Context, request ListRecipientsRequ } func (a *recipientsImpl) internalList(ctx context.Context, request ListRecipientsRequest) (*ListRecipientsResponse, error) { - var listRecipientsResponse ListRecipientsResponse + + requestPb, pbErr := listRecipientsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listRecipientsResponsePb listRecipientsResponsePb path := "/api/2.1/unity-catalog/recipients" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRecipientsResponse) - return &listRecipientsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listRecipientsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listRecipientsResponseFromPb(&listRecipientsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientsImpl) RotateToken(ctx context.Context, request RotateRecipientToken) (*RecipientInfo, error) { - var recipientInfo RecipientInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/rotate-token", request.Name) + + requestPb, pbErr := rotateRecipientTokenToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var recipientInfoPb recipientInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/rotate-token", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &recipientInfo) - return &recipientInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &recipientInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := recipientInfoFromPb(&recipientInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientsImpl) SharePermissions(ctx context.Context, request SharePermissionsRequest) (*GetRecipientSharePermissionsResponse, error) { - var getRecipientSharePermissionsResponse GetRecipientSharePermissionsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/share-permissions", request.Name) + + requestPb, pbErr := sharePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getRecipientSharePermissionsResponsePb getRecipientSharePermissionsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/share-permissions", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRecipientSharePermissionsResponse) - return &getRecipientSharePermissionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getRecipientSharePermissionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getRecipientSharePermissionsResponseFromPb(&getRecipientSharePermissionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *recipientsImpl) Update(ctx context.Context, request UpdateRecipient) (*RecipientInfo, error) { - var recipientInfo RecipientInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + + requestPb, pbErr := updateRecipientToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var recipientInfoPb recipientInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &recipientInfo) - return &recipientInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &recipientInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := recipientInfoFromPb(&recipientInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Shares API methods @@ -423,33 +869,95 @@ type sharesImpl struct { } func (a *sharesImpl) Create(ctx context.Context, request CreateShare) (*ShareInfo, error) { - var shareInfo ShareInfo + + requestPb, pbErr := createShareToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var shareInfoPb shareInfoPb path := "/api/2.1/unity-catalog/shares" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &shareInfo) - return &shareInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &shareInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := shareInfoFromPb(&shareInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *sharesImpl) Delete(ctx context.Context, request DeleteShareRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + + requestPb, pbErr := deleteShareRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *sharesImpl) Get(ctx context.Context, request GetShareRequest) (*ShareInfo, error) { - var shareInfo ShareInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + + requestPb, pbErr := getShareRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var shareInfoPb shareInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &shareInfo) - return &shareInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &shareInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := shareInfoFromPb(&shareInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List shares. @@ -494,43 +1002,131 @@ func (a *sharesImpl) ListAll(ctx context.Context, request ListSharesRequest) ([] } func (a *sharesImpl) internalList(ctx context.Context, request ListSharesRequest) (*ListSharesResponse, error) { - var listSharesResponse ListSharesResponse + + requestPb, pbErr := listSharesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSharesResponsePb listSharesResponsePb path := "/api/2.1/unity-catalog/shares" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSharesResponse) - return &listSharesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSharesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSharesResponseFromPb(&listSharesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *sharesImpl) SharePermissions(ctx context.Context, request SharePermissionsRequest) (*GetSharePermissionsResponse, error) { - var getSharePermissionsResponse GetSharePermissionsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", request.Name) + + requestPb, pbErr := sharePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getSharePermissionsResponsePb getSharePermissionsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getSharePermissionsResponse) - return &getSharePermissionsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getSharePermissionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getSharePermissionsResponseFromPb(&getSharePermissionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *sharesImpl) Update(ctx context.Context, request UpdateShare) (*ShareInfo, error) { - var shareInfo ShareInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + + requestPb, pbErr := updateShareToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var shareInfoPb shareInfoPb + path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &shareInfo) - return &shareInfo, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &shareInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := shareInfoFromPb(&shareInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *sharesImpl) UpdatePermissions(ctx context.Context, request UpdateSharePermissions) (*UpdateSharePermissionsResponse, error) { - var updateSharePermissionsResponse UpdateSharePermissionsResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", request.Name) + + requestPb, pbErr := updateSharePermissionsToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateSharePermissionsResponsePb updateSharePermissionsResponsePb + path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", requestPb.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateSharePermissionsResponse) - return &updateSharePermissionsResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateSharePermissionsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateSharePermissionsResponseFromPb(&updateSharePermissionsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/sharing/internal.go b/service/sharing/internal.go new file mode 100755 index 000000000..6081eb482 --- /dev/null +++ b/service/sharing/internal.go @@ -0,0 +1,3159 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package sharing + +import ( + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/catalog" +) + +func createFederationPolicyRequestToPb(st *CreateFederationPolicyRequest) (*createFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createFederationPolicyRequestPb{} + pb.Policy = st.Policy + + pb.RecipientName = st.RecipientName + + return pb, nil +} + +type createFederationPolicyRequestPb struct { + Policy FederationPolicy `json:"policy"` + + RecipientName string `json:"-" url:"-"` +} + +func createFederationPolicyRequestFromPb(pb *createFederationPolicyRequestPb) (*CreateFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateFederationPolicyRequest{} + st.Policy = pb.Policy + st.RecipientName = pb.RecipientName + + return st, nil +} + +func createProviderToPb(st *CreateProvider) (*createProviderPb, error) { + if st == nil { + return nil, nil + } + pb := &createProviderPb{} + pb.AuthenticationType = st.AuthenticationType + + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.RecipientProfileStr = st.RecipientProfileStr + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createProviderPb struct { + AuthenticationType AuthenticationType `json:"authentication_type"` + + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createProviderFromPb(pb *createProviderPb) (*CreateProvider, error) { + if pb == nil { + return nil, nil + } + st := &CreateProvider{} + st.AuthenticationType = pb.AuthenticationType + st.Comment = pb.Comment + st.Name = pb.Name + st.RecipientProfileStr = pb.RecipientProfileStr + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createProviderPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createProviderPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createRecipientToPb(st *CreateRecipient) (*createRecipientPb, error) { + if st == nil { + return nil, nil + } + pb := &createRecipientPb{} + pb.AuthenticationType = st.AuthenticationType + + pb.Comment = st.Comment + + pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId + + pb.ExpirationTime = st.ExpirationTime + + pb.IpAccessList = st.IpAccessList + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.PropertiesKvpairs = st.PropertiesKvpairs + + pb.SharingCode = st.SharingCode + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRecipientPb struct { + AuthenticationType AuthenticationType `json:"authentication_type"` + + Comment string `json:"comment,omitempty"` + + DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + + Name string `json:"name"` + + Owner string `json:"owner,omitempty"` + + PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + + SharingCode string `json:"sharing_code,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRecipientFromPb(pb *createRecipientPb) (*CreateRecipient, error) { + if pb == nil { + return nil, nil + } + st := &CreateRecipient{} + st.AuthenticationType = pb.AuthenticationType + st.Comment = pb.Comment + st.DataRecipientGlobalMetastoreId = pb.DataRecipientGlobalMetastoreId + st.ExpirationTime = pb.ExpirationTime + st.IpAccessList = pb.IpAccessList + st.Name = pb.Name + st.Owner = pb.Owner + st.PropertiesKvpairs = pb.PropertiesKvpairs + st.SharingCode = pb.SharingCode + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRecipientPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRecipientPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createShareToPb(st *CreateShare) (*createSharePb, error) { + if st == nil { + return nil, nil + } + pb := &createSharePb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.StorageRoot = st.StorageRoot + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createSharePb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"name"` + + StorageRoot string `json:"storage_root,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createShareFromPb(pb *createSharePb) (*CreateShare, error) { + if pb == nil { + return nil, nil + } + st := &CreateShare{} + st.Comment = pb.Comment + st.Name = pb.Name + st.StorageRoot = pb.StorageRoot + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createSharePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createSharePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteFederationPolicyRequestToPb(st *DeleteFederationPolicyRequest) (*deleteFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteFederationPolicyRequestPb{} + pb.Name = st.Name + + pb.RecipientName = st.RecipientName + + return pb, nil +} + +type deleteFederationPolicyRequestPb struct { + Name string `json:"-" url:"-"` + + RecipientName string `json:"-" url:"-"` +} + +func deleteFederationPolicyRequestFromPb(pb *deleteFederationPolicyRequestPb) (*DeleteFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteFederationPolicyRequest{} + st.Name = pb.Name + st.RecipientName = pb.RecipientName + + return st, nil +} + +func deleteProviderRequestToPb(st *DeleteProviderRequest) (*deleteProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteProviderRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteProviderRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteProviderRequestFromPb(pb *deleteProviderRequestPb) (*DeleteProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteProviderRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteRecipientRequestToPb(st *DeleteRecipientRequest) (*deleteRecipientRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRecipientRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteRecipientRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteRecipientRequestFromPb(pb *deleteRecipientRequestPb) (*DeleteRecipientRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRecipientRequest{} + st.Name = pb.Name + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteShareRequestToPb(st *DeleteShareRequest) (*deleteShareRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteShareRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type deleteShareRequestPb struct { + Name string `json:"-" url:"-"` +} + +func deleteShareRequestFromPb(pb *deleteShareRequestPb) (*DeleteShareRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteShareRequest{} + st.Name = pb.Name + + return st, nil +} + +func deltaSharingDependencyToPb(st *DeltaSharingDependency) (*deltaSharingDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSharingDependencyPb{} + pb.Function = st.Function + + pb.Table = st.Table + + return pb, nil +} + +type deltaSharingDependencyPb struct { + Function *DeltaSharingFunctionDependency `json:"function,omitempty"` + + Table *DeltaSharingTableDependency `json:"table,omitempty"` +} + +func deltaSharingDependencyFromPb(pb *deltaSharingDependencyPb) (*DeltaSharingDependency, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSharingDependency{} + st.Function = pb.Function + st.Table = pb.Table + + return st, nil +} + +func deltaSharingDependencyListToPb(st *DeltaSharingDependencyList) (*deltaSharingDependencyListPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSharingDependencyListPb{} + pb.Dependencies = st.Dependencies + + return pb, nil +} + +type deltaSharingDependencyListPb struct { + Dependencies []DeltaSharingDependency `json:"dependencies,omitempty"` +} + +func deltaSharingDependencyListFromPb(pb *deltaSharingDependencyListPb) (*DeltaSharingDependencyList, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSharingDependencyList{} + st.Dependencies = pb.Dependencies + + return st, nil +} + +func deltaSharingFunctionToPb(st *DeltaSharingFunction) (*deltaSharingFunctionPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSharingFunctionPb{} + pb.Aliases = st.Aliases + + pb.Comment = st.Comment + + pb.DataType = st.DataType + + pb.DependencyList = st.DependencyList + + pb.FullDataType = st.FullDataType + + pb.Id = st.Id + + pb.InputParams = st.InputParams + + pb.Name = st.Name + + pb.Properties = st.Properties + + pb.RoutineDefinition = st.RoutineDefinition + + pb.Schema = st.Schema + + pb.SecurableKind = st.SecurableKind + + pb.Share = st.Share + + pb.ShareId = st.ShareId + + pb.StorageLocation = st.StorageLocation + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deltaSharingFunctionPb struct { + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + + Comment string `json:"comment,omitempty"` + + DataType ColumnTypeName `json:"data_type,omitempty"` + + DependencyList *DeltaSharingDependencyList `json:"dependency_list,omitempty"` + + FullDataType string `json:"full_data_type,omitempty"` + + Id string `json:"id,omitempty"` + + InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + + Name string `json:"name,omitempty"` + + Properties string `json:"properties,omitempty"` + + RoutineDefinition string `json:"routine_definition,omitempty"` + + Schema string `json:"schema,omitempty"` + + SecurableKind SharedSecurableKind `json:"securable_kind,omitempty"` + + Share string `json:"share,omitempty"` + + ShareId string `json:"share_id,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + Tags []catalog.TagKeyValue `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deltaSharingFunctionFromPb(pb *deltaSharingFunctionPb) (*DeltaSharingFunction, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSharingFunction{} + st.Aliases = pb.Aliases + st.Comment = pb.Comment + st.DataType = pb.DataType + st.DependencyList = pb.DependencyList + st.FullDataType = pb.FullDataType + st.Id = pb.Id + st.InputParams = pb.InputParams + st.Name = pb.Name + st.Properties = pb.Properties + st.RoutineDefinition = pb.RoutineDefinition + st.Schema = pb.Schema + st.SecurableKind = pb.SecurableKind + st.Share = pb.Share + st.ShareId = pb.ShareId + st.StorageLocation = pb.StorageLocation + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deltaSharingFunctionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deltaSharingFunctionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deltaSharingFunctionDependencyToPb(st *DeltaSharingFunctionDependency) (*deltaSharingFunctionDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSharingFunctionDependencyPb{} + pb.FunctionName = st.FunctionName + + pb.SchemaName = st.SchemaName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deltaSharingFunctionDependencyPb struct { + FunctionName string `json:"function_name,omitempty"` + + SchemaName string `json:"schema_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deltaSharingFunctionDependencyFromPb(pb *deltaSharingFunctionDependencyPb) (*DeltaSharingFunctionDependency, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSharingFunctionDependency{} + st.FunctionName = pb.FunctionName + st.SchemaName = pb.SchemaName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deltaSharingFunctionDependencyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deltaSharingFunctionDependencyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deltaSharingTableDependencyToPb(st *DeltaSharingTableDependency) (*deltaSharingTableDependencyPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSharingTableDependencyPb{} + pb.SchemaName = st.SchemaName + + pb.TableName = st.TableName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deltaSharingTableDependencyPb struct { + SchemaName string `json:"schema_name,omitempty"` + + TableName string `json:"table_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deltaSharingTableDependencyFromPb(pb *deltaSharingTableDependencyPb) (*DeltaSharingTableDependency, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSharingTableDependency{} + st.SchemaName = pb.SchemaName + st.TableName = pb.TableName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deltaSharingTableDependencyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deltaSharingTableDependencyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &federationPolicyPb{} + pb.Comment = st.Comment + + pb.CreateTime = st.CreateTime + + pb.Id = st.Id + + pb.Name = st.Name + + pb.OidcPolicy = st.OidcPolicy + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type federationPolicyPb struct { + Comment string `json:"comment,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func federationPolicyFromPb(pb *federationPolicyPb) (*FederationPolicy, error) { + if pb == nil { + return nil, nil + } + st := &FederationPolicy{} + st.Comment = pb.Comment + st.CreateTime = pb.CreateTime + st.Id = pb.Id + st.Name = pb.Name + st.OidcPolicy = pb.OidcPolicy + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *federationPolicyPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st federationPolicyPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &functionParameterInfoPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.ParameterDefault = st.ParameterDefault + + pb.ParameterMode = st.ParameterMode + + pb.ParameterType = st.ParameterType + + pb.Position = st.Position + + pb.TypeIntervalType = st.TypeIntervalType + + pb.TypeJson = st.TypeJson + + pb.TypeName = st.TypeName + + pb.TypePrecision = st.TypePrecision + + pb.TypeScale = st.TypeScale + + pb.TypeText = st.TypeText + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type functionParameterInfoPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"name,omitempty"` + + ParameterDefault string `json:"parameter_default,omitempty"` + + ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + + ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + + Position int `json:"position,omitempty"` + + TypeIntervalType string `json:"type_interval_type,omitempty"` + + TypeJson string `json:"type_json,omitempty"` + + TypeName ColumnTypeName `json:"type_name,omitempty"` + + TypePrecision int `json:"type_precision,omitempty"` + + TypeScale int `json:"type_scale,omitempty"` + + TypeText string `json:"type_text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func functionParameterInfoFromPb(pb *functionParameterInfoPb) (*FunctionParameterInfo, error) { + if pb == nil { + return nil, nil + } + st := &FunctionParameterInfo{} + st.Comment = pb.Comment + st.Name = pb.Name + st.ParameterDefault = pb.ParameterDefault + st.ParameterMode = pb.ParameterMode + st.ParameterType = pb.ParameterType + st.Position = pb.Position + st.TypeIntervalType = pb.TypeIntervalType + st.TypeJson = pb.TypeJson + st.TypeName = pb.TypeName + st.TypePrecision = pb.TypePrecision + st.TypeScale = pb.TypeScale + st.TypeText = pb.TypeText + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *functionParameterInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st functionParameterInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func functionParameterInfosToPb(st *FunctionParameterInfos) (*functionParameterInfosPb, error) { + if st == nil { + return nil, nil + } + pb := &functionParameterInfosPb{} + pb.Parameters = st.Parameters + + return pb, nil +} + +type functionParameterInfosPb struct { + Parameters []FunctionParameterInfo `json:"parameters,omitempty"` +} + +func functionParameterInfosFromPb(pb *functionParameterInfosPb) (*FunctionParameterInfos, error) { + if pb == nil { + return nil, nil + } + st := &FunctionParameterInfos{} + st.Parameters = pb.Parameters + + return st, nil +} + +func getActivationUrlInfoRequestToPb(st *GetActivationUrlInfoRequest) (*getActivationUrlInfoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getActivationUrlInfoRequestPb{} + pb.ActivationUrl = st.ActivationUrl + + return pb, nil +} + +type getActivationUrlInfoRequestPb struct { + ActivationUrl string `json:"-" url:"-"` +} + +func getActivationUrlInfoRequestFromPb(pb *getActivationUrlInfoRequestPb) (*GetActivationUrlInfoRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetActivationUrlInfoRequest{} + st.ActivationUrl = pb.ActivationUrl + + return st, nil +} + +func getActivationUrlInfoResponseToPb(st *GetActivationUrlInfoResponse) (*getActivationUrlInfoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getActivationUrlInfoResponsePb{} + + return pb, nil +} + +type getActivationUrlInfoResponsePb struct { +} + +func getActivationUrlInfoResponseFromPb(pb *getActivationUrlInfoResponsePb) (*GetActivationUrlInfoResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetActivationUrlInfoResponse{} + + return st, nil +} + +func getFederationPolicyRequestToPb(st *GetFederationPolicyRequest) (*getFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getFederationPolicyRequestPb{} + pb.Name = st.Name + + pb.RecipientName = st.RecipientName + + return pb, nil +} + +type getFederationPolicyRequestPb struct { + Name string `json:"-" url:"-"` + + RecipientName string `json:"-" url:"-"` +} + +func getFederationPolicyRequestFromPb(pb *getFederationPolicyRequestPb) (*GetFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetFederationPolicyRequest{} + st.Name = pb.Name + st.RecipientName = pb.RecipientName + + return st, nil +} + +func getProviderRequestToPb(st *GetProviderRequest) (*getProviderRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getProviderRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getProviderRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getProviderRequestFromPb(pb *getProviderRequestPb) (*GetProviderRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetProviderRequest{} + st.Name = pb.Name + + return st, nil +} + +func getRecipientRequestToPb(st *GetRecipientRequest) (*getRecipientRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRecipientRequestPb{} + pb.Name = st.Name + + return pb, nil +} + +type getRecipientRequestPb struct { + Name string `json:"-" url:"-"` +} + +func getRecipientRequestFromPb(pb *getRecipientRequestPb) (*GetRecipientRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRecipientRequest{} + st.Name = pb.Name + + return st, nil +} + +func getRecipientSharePermissionsResponseToPb(st *GetRecipientSharePermissionsResponse) (*getRecipientSharePermissionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getRecipientSharePermissionsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.PermissionsOut = st.PermissionsOut + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRecipientSharePermissionsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PermissionsOut []ShareToPrivilegeAssignment `json:"permissions_out,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRecipientSharePermissionsResponseFromPb(pb *getRecipientSharePermissionsResponsePb) (*GetRecipientSharePermissionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetRecipientSharePermissionsResponse{} + st.NextPageToken = pb.NextPageToken + st.PermissionsOut = pb.PermissionsOut + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRecipientSharePermissionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRecipientSharePermissionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getSharePermissionsResponseToPb(st *GetSharePermissionsResponse) (*getSharePermissionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getSharePermissionsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.PrivilegeAssignments = st.PrivilegeAssignments + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getSharePermissionsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getSharePermissionsResponseFromPb(pb *getSharePermissionsResponsePb) (*GetSharePermissionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetSharePermissionsResponse{} + st.NextPageToken = pb.NextPageToken + st.PrivilegeAssignments = pb.PrivilegeAssignments + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getSharePermissionsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getSharePermissionsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getShareRequestToPb(st *GetShareRequest) (*getShareRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getShareRequestPb{} + pb.IncludeSharedData = st.IncludeSharedData + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getShareRequestPb struct { + IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"` + + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getShareRequestFromPb(pb *getShareRequestPb) (*GetShareRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetShareRequest{} + st.IncludeSharedData = pb.IncludeSharedData + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getShareRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getShareRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func ipAccessListToPb(st *IpAccessList) (*ipAccessListPb, error) { + if st == nil { + return nil, nil + } + pb := &ipAccessListPb{} + pb.AllowedIpAddresses = st.AllowedIpAddresses + + return pb, nil +} + +type ipAccessListPb struct { + AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"` +} + +func ipAccessListFromPb(pb *ipAccessListPb) (*IpAccessList, error) { + if pb == nil { + return nil, nil + } + st := &IpAccessList{} + st.AllowedIpAddresses = pb.AllowedIpAddresses + + return st, nil +} + +func listFederationPoliciesRequestToPb(st *ListFederationPoliciesRequest) (*listFederationPoliciesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listFederationPoliciesRequestPb{} + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.RecipientName = st.RecipientName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFederationPoliciesRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + RecipientName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFederationPoliciesRequestFromPb(pb *listFederationPoliciesRequestPb) (*ListFederationPoliciesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListFederationPoliciesRequest{} + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + st.RecipientName = pb.RecipientName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFederationPoliciesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFederationPoliciesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*listFederationPoliciesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listFederationPoliciesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Policies = st.Policies + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listFederationPoliciesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Policies []FederationPolicy `json:"policies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listFederationPoliciesResponseFromPb(pb *listFederationPoliciesResponsePb) (*ListFederationPoliciesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListFederationPoliciesResponse{} + st.NextPageToken = pb.NextPageToken + st.Policies = pb.Policies + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listFederationPoliciesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listFederationPoliciesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProviderShareAssetsRequestToPb(st *ListProviderShareAssetsRequest) (*listProviderShareAssetsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listProviderShareAssetsRequestPb{} + pb.FunctionMaxResults = st.FunctionMaxResults + + pb.NotebookMaxResults = st.NotebookMaxResults + + pb.ProviderName = st.ProviderName + + pb.ShareName = st.ShareName + + pb.TableMaxResults = st.TableMaxResults + + pb.VolumeMaxResults = st.VolumeMaxResults + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProviderShareAssetsRequestPb struct { + FunctionMaxResults int `json:"-" url:"function_max_results,omitempty"` + + NotebookMaxResults int `json:"-" url:"notebook_max_results,omitempty"` + + ProviderName string `json:"-" url:"-"` + + ShareName string `json:"-" url:"-"` + + TableMaxResults int `json:"-" url:"table_max_results,omitempty"` + + VolumeMaxResults int `json:"-" url:"volume_max_results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProviderShareAssetsRequestFromPb(pb *listProviderShareAssetsRequestPb) (*ListProviderShareAssetsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListProviderShareAssetsRequest{} + st.FunctionMaxResults = pb.FunctionMaxResults + st.NotebookMaxResults = pb.NotebookMaxResults + st.ProviderName = pb.ProviderName + st.ShareName = pb.ShareName + st.TableMaxResults = pb.TableMaxResults + st.VolumeMaxResults = pb.VolumeMaxResults + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProviderShareAssetsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProviderShareAssetsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProviderShareAssetsResponseToPb(st *ListProviderShareAssetsResponse) (*listProviderShareAssetsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listProviderShareAssetsResponsePb{} + pb.Functions = st.Functions + + pb.Notebooks = st.Notebooks + + pb.Tables = st.Tables + + pb.Volumes = st.Volumes + + return pb, nil +} + +type listProviderShareAssetsResponsePb struct { + Functions []DeltaSharingFunction `json:"functions,omitempty"` + + Notebooks []NotebookFile `json:"notebooks,omitempty"` + + Tables []Table `json:"tables,omitempty"` + + Volumes []Volume `json:"volumes,omitempty"` +} + +func listProviderShareAssetsResponseFromPb(pb *listProviderShareAssetsResponsePb) (*ListProviderShareAssetsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListProviderShareAssetsResponse{} + st.Functions = pb.Functions + st.Notebooks = pb.Notebooks + st.Tables = pb.Tables + st.Volumes = pb.Volumes + + return st, nil +} + +func listProviderSharesResponseToPb(st *ListProviderSharesResponse) (*listProviderSharesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listProviderSharesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Shares = st.Shares + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProviderSharesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Shares []ProviderShare `json:"shares,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProviderSharesResponseFromPb(pb *listProviderSharesResponsePb) (*ListProviderSharesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListProviderSharesResponse{} + st.NextPageToken = pb.NextPageToken + st.Shares = pb.Shares + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProviderSharesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProviderSharesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listProvidersRequestPb{} + pb.DataProviderGlobalMetastoreId = st.DataProviderGlobalMetastoreId + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProvidersRequestPb struct { + DataProviderGlobalMetastoreId string `json:"-" url:"data_provider_global_metastore_id,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProvidersRequestFromPb(pb *listProvidersRequestPb) (*ListProvidersRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListProvidersRequest{} + st.DataProviderGlobalMetastoreId = pb.DataProviderGlobalMetastoreId + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProvidersRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProvidersRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listProvidersResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Providers = st.Providers + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listProvidersResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Providers []ProviderInfo `json:"providers,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listProvidersResponseFromPb(pb *listProvidersResponsePb) (*ListProvidersResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListProvidersResponse{} + st.NextPageToken = pb.NextPageToken + st.Providers = pb.Providers + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listProvidersResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listProvidersResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRecipientsRequestToPb(st *ListRecipientsRequest) (*listRecipientsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listRecipientsRequestPb{} + pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRecipientsRequestPb struct { + DataRecipientGlobalMetastoreId string `json:"-" url:"data_recipient_global_metastore_id,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRecipientsRequestFromPb(pb *listRecipientsRequestPb) (*ListRecipientsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListRecipientsRequest{} + st.DataRecipientGlobalMetastoreId = pb.DataRecipientGlobalMetastoreId + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRecipientsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRecipientsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listRecipientsResponseToPb(st *ListRecipientsResponse) (*listRecipientsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listRecipientsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Recipients = st.Recipients + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listRecipientsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Recipients []RecipientInfo `json:"recipients,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listRecipientsResponseFromPb(pb *listRecipientsResponsePb) (*ListRecipientsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListRecipientsResponse{} + st.NextPageToken = pb.NextPageToken + st.Recipients = pb.Recipients + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listRecipientsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listRecipientsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSharesRequestToPb(st *ListSharesRequest) (*listSharesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSharesRequestPb{} + pb.MaxResults = st.MaxResults + + pb.Name = st.Name + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSharesRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + Name string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSharesRequestFromPb(pb *listSharesRequestPb) (*ListSharesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSharesRequest{} + st.MaxResults = pb.MaxResults + st.Name = pb.Name + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSharesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSharesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listSharesResponseToPb(st *ListSharesResponse) (*listSharesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSharesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Shares = st.Shares + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listSharesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Shares []ShareInfo `json:"shares,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listSharesResponseFromPb(pb *listSharesResponsePb) (*ListSharesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSharesResponse{} + st.NextPageToken = pb.NextPageToken + st.Shares = pb.Shares + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listSharesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listSharesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func notebookFileToPb(st *NotebookFile) (*notebookFilePb, error) { + if st == nil { + return nil, nil + } + pb := ¬ebookFilePb{} + pb.Comment = st.Comment + + pb.Id = st.Id + + pb.Name = st.Name + + pb.Share = st.Share + + pb.ShareId = st.ShareId + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type notebookFilePb struct { + Comment string `json:"comment,omitempty"` + + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + Share string `json:"share,omitempty"` + + ShareId string `json:"share_id,omitempty"` + + Tags []catalog.TagKeyValue `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func notebookFileFromPb(pb *notebookFilePb) (*NotebookFile, error) { + if pb == nil { + return nil, nil + } + st := &NotebookFile{} + st.Comment = pb.Comment + st.Id = pb.Id + st.Name = pb.Name + st.Share = pb.Share + st.ShareId = pb.ShareId + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *notebookFilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st notebookFilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func oidcFederationPolicyToPb(st *OidcFederationPolicy) (*oidcFederationPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := &oidcFederationPolicyPb{} + pb.Audiences = st.Audiences + + pb.Issuer = st.Issuer + + pb.Subject = st.Subject + + pb.SubjectClaim = st.SubjectClaim + + return pb, nil +} + +type oidcFederationPolicyPb struct { + Audiences []string `json:"audiences,omitempty"` + + Issuer string `json:"issuer"` + + Subject string `json:"subject"` + + SubjectClaim string `json:"subject_claim"` +} + +func oidcFederationPolicyFromPb(pb *oidcFederationPolicyPb) (*OidcFederationPolicy, error) { + if pb == nil { + return nil, nil + } + st := &OidcFederationPolicy{} + st.Audiences = pb.Audiences + st.Issuer = pb.Issuer + st.Subject = pb.Subject + st.SubjectClaim = pb.SubjectClaim + + return st, nil +} + +func partitionToPb(st *Partition) (*partitionPb, error) { + if st == nil { + return nil, nil + } + pb := &partitionPb{} + pb.Values = st.Values + + return pb, nil +} + +type partitionPb struct { + Values []PartitionValue `json:"values,omitempty"` +} + +func partitionFromPb(pb *partitionPb) (*Partition, error) { + if pb == nil { + return nil, nil + } + st := &Partition{} + st.Values = pb.Values + + return st, nil +} + +func partitionValueToPb(st *PartitionValue) (*partitionValuePb, error) { + if st == nil { + return nil, nil + } + pb := &partitionValuePb{} + pb.Name = st.Name + + pb.Op = st.Op + + pb.RecipientPropertyKey = st.RecipientPropertyKey + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type partitionValuePb struct { + Name string `json:"name,omitempty"` + + Op PartitionValueOp `json:"op,omitempty"` + + RecipientPropertyKey string `json:"recipient_property_key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func partitionValueFromPb(pb *partitionValuePb) (*PartitionValue, error) { + if pb == nil { + return nil, nil + } + st := &PartitionValue{} + st.Name = pb.Name + st.Op = pb.Op + st.RecipientPropertyKey = pb.RecipientPropertyKey + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *partitionValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st partitionValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) { + if st == nil { + return nil, nil + } + pb := &permissionsChangePb{} + pb.Add = st.Add + + pb.Principal = st.Principal + + pb.Remove = st.Remove + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type permissionsChangePb struct { + Add []string `json:"add,omitempty"` + + Principal string `json:"principal,omitempty"` + + Remove []string `json:"remove,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func permissionsChangeFromPb(pb *permissionsChangePb) (*PermissionsChange, error) { + if pb == nil { + return nil, nil + } + st := &PermissionsChange{} + st.Add = pb.Add + st.Principal = pb.Principal + st.Remove = pb.Remove + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *permissionsChangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st permissionsChangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &privilegeAssignmentPb{} + pb.Principal = st.Principal + + pb.Privileges = st.Privileges + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type privilegeAssignmentPb struct { + Principal string `json:"principal,omitempty"` + + Privileges []Privilege `json:"privileges,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func privilegeAssignmentFromPb(pb *privilegeAssignmentPb) (*PrivilegeAssignment, error) { + if pb == nil { + return nil, nil + } + st := &PrivilegeAssignment{} + st.Principal = pb.Principal + st.Privileges = pb.Privileges + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *privilegeAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st privilegeAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &providerInfoPb{} + pb.AuthenticationType = st.AuthenticationType + + pb.Cloud = st.Cloud + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DataProviderGlobalMetastoreId = st.DataProviderGlobalMetastoreId + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.RecipientProfile = st.RecipientProfile + + pb.RecipientProfileStr = st.RecipientProfileStr + + pb.Region = st.Region + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type providerInfoPb struct { + AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + + Cloud string `json:"cloud,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"` + + RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + + Region string `json:"region,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func providerInfoFromPb(pb *providerInfoPb) (*ProviderInfo, error) { + if pb == nil { + return nil, nil + } + st := &ProviderInfo{} + st.AuthenticationType = pb.AuthenticationType + st.Cloud = pb.Cloud + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DataProviderGlobalMetastoreId = pb.DataProviderGlobalMetastoreId + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.RecipientProfile = pb.RecipientProfile + st.RecipientProfileStr = pb.RecipientProfileStr + st.Region = pb.Region + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *providerInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st providerInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func providerShareToPb(st *ProviderShare) (*providerSharePb, error) { + if st == nil { + return nil, nil + } + pb := &providerSharePb{} + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type providerSharePb struct { + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func providerShareFromPb(pb *providerSharePb) (*ProviderShare, error) { + if pb == nil { + return nil, nil + } + st := &ProviderShare{} + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *providerSharePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st providerSharePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func recipientInfoToPb(st *RecipientInfo) (*recipientInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &recipientInfoPb{} + pb.Activated = st.Activated + + pb.ActivationUrl = st.ActivationUrl + + pb.AuthenticationType = st.AuthenticationType + + pb.Cloud = st.Cloud + + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId + + pb.ExpirationTime = st.ExpirationTime + + pb.IpAccessList = st.IpAccessList + + pb.MetastoreId = st.MetastoreId + + pb.Name = st.Name + + pb.Owner = st.Owner + + pb.PropertiesKvpairs = st.PropertiesKvpairs + + pb.Region = st.Region + + pb.SharingCode = st.SharingCode + + pb.Tokens = st.Tokens + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type recipientInfoPb struct { + Activated bool `json:"activated,omitempty"` + + ActivationUrl string `json:"activation_url,omitempty"` + + AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + + Cloud string `json:"cloud,omitempty"` + + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + + Region string `json:"region,omitempty"` + + SharingCode string `json:"sharing_code,omitempty"` + + Tokens []RecipientTokenInfo `json:"tokens,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func recipientInfoFromPb(pb *recipientInfoPb) (*RecipientInfo, error) { + if pb == nil { + return nil, nil + } + st := &RecipientInfo{} + st.Activated = pb.Activated + st.ActivationUrl = pb.ActivationUrl + st.AuthenticationType = pb.AuthenticationType + st.Cloud = pb.Cloud + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.DataRecipientGlobalMetastoreId = pb.DataRecipientGlobalMetastoreId + st.ExpirationTime = pb.ExpirationTime + st.IpAccessList = pb.IpAccessList + st.MetastoreId = pb.MetastoreId + st.Name = pb.Name + st.Owner = pb.Owner + st.PropertiesKvpairs = pb.PropertiesKvpairs + st.Region = pb.Region + st.SharingCode = pb.SharingCode + st.Tokens = pb.Tokens + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *recipientInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st recipientInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func recipientProfileToPb(st *RecipientProfile) (*recipientProfilePb, error) { + if st == nil { + return nil, nil + } + pb := &recipientProfilePb{} + pb.BearerToken = st.BearerToken + + pb.Endpoint = st.Endpoint + + pb.ShareCredentialsVersion = st.ShareCredentialsVersion + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type recipientProfilePb struct { + BearerToken string `json:"bearer_token,omitempty"` + + Endpoint string `json:"endpoint,omitempty"` + + ShareCredentialsVersion int `json:"share_credentials_version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func recipientProfileFromPb(pb *recipientProfilePb) (*RecipientProfile, error) { + if pb == nil { + return nil, nil + } + st := &RecipientProfile{} + st.BearerToken = pb.BearerToken + st.Endpoint = pb.Endpoint + st.ShareCredentialsVersion = pb.ShareCredentialsVersion + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *recipientProfilePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st recipientProfilePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func recipientTokenInfoToPb(st *RecipientTokenInfo) (*recipientTokenInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &recipientTokenInfoPb{} + pb.ActivationUrl = st.ActivationUrl + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.ExpirationTime = st.ExpirationTime + + pb.Id = st.Id + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type recipientTokenInfoPb struct { + ActivationUrl string `json:"activation_url,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + Id string `json:"id,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func recipientTokenInfoFromPb(pb *recipientTokenInfoPb) (*RecipientTokenInfo, error) { + if pb == nil { + return nil, nil + } + st := &RecipientTokenInfo{} + st.ActivationUrl = pb.ActivationUrl + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.ExpirationTime = pb.ExpirationTime + st.Id = pb.Id + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *recipientTokenInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st recipientTokenInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb, error) { + if st == nil { + return nil, nil + } + pb := ®isteredModelAliasPb{} + pb.AliasName = st.AliasName + + pb.VersionNum = st.VersionNum + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type registeredModelAliasPb struct { + AliasName string `json:"alias_name,omitempty"` + + VersionNum int64 `json:"version_num,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func registeredModelAliasFromPb(pb *registeredModelAliasPb) (*RegisteredModelAlias, error) { + if pb == nil { + return nil, nil + } + st := &RegisteredModelAlias{} + st.AliasName = pb.AliasName + st.VersionNum = pb.VersionNum + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *registeredModelAliasPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st registeredModelAliasPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func retrieveTokenRequestToPb(st *RetrieveTokenRequest) (*retrieveTokenRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &retrieveTokenRequestPb{} + pb.ActivationUrl = st.ActivationUrl + + return pb, nil +} + +type retrieveTokenRequestPb struct { + ActivationUrl string `json:"-" url:"-"` +} + +func retrieveTokenRequestFromPb(pb *retrieveTokenRequestPb) (*RetrieveTokenRequest, error) { + if pb == nil { + return nil, nil + } + st := &RetrieveTokenRequest{} + st.ActivationUrl = pb.ActivationUrl + + return st, nil +} + +func retrieveTokenResponseToPb(st *RetrieveTokenResponse) (*retrieveTokenResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &retrieveTokenResponsePb{} + pb.BearerToken = st.BearerToken + + pb.Endpoint = st.Endpoint + + pb.ExpirationTime = st.ExpirationTime + + pb.ShareCredentialsVersion = st.ShareCredentialsVersion + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type retrieveTokenResponsePb struct { + BearerToken string `json:"bearerToken,omitempty"` + + Endpoint string `json:"endpoint,omitempty"` + + ExpirationTime string `json:"expirationTime,omitempty"` + + ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func retrieveTokenResponseFromPb(pb *retrieveTokenResponsePb) (*RetrieveTokenResponse, error) { + if pb == nil { + return nil, nil + } + st := &RetrieveTokenResponse{} + st.BearerToken = pb.BearerToken + st.Endpoint = pb.Endpoint + st.ExpirationTime = pb.ExpirationTime + st.ShareCredentialsVersion = pb.ShareCredentialsVersion + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *retrieveTokenResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st retrieveTokenResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func rotateRecipientTokenToPb(st *RotateRecipientToken) (*rotateRecipientTokenPb, error) { + if st == nil { + return nil, nil + } + pb := &rotateRecipientTokenPb{} + pb.ExistingTokenExpireInSeconds = st.ExistingTokenExpireInSeconds + + pb.Name = st.Name + + return pb, nil +} + +type rotateRecipientTokenPb struct { + ExistingTokenExpireInSeconds int64 `json:"existing_token_expire_in_seconds"` + + Name string `json:"-" url:"-"` +} + +func rotateRecipientTokenFromPb(pb *rotateRecipientTokenPb) (*RotateRecipientToken, error) { + if pb == nil { + return nil, nil + } + st := &RotateRecipientToken{} + st.ExistingTokenExpireInSeconds = pb.ExistingTokenExpireInSeconds + st.Name = pb.Name + + return st, nil +} + +func securablePropertiesKvPairsToPb(st *SecurablePropertiesKvPairs) (*securablePropertiesKvPairsPb, error) { + if st == nil { + return nil, nil + } + pb := &securablePropertiesKvPairsPb{} + pb.Properties = st.Properties + + return pb, nil +} + +type securablePropertiesKvPairsPb struct { + Properties map[string]string `json:"properties"` +} + +func securablePropertiesKvPairsFromPb(pb *securablePropertiesKvPairsPb) (*SecurablePropertiesKvPairs, error) { + if pb == nil { + return nil, nil + } + st := &SecurablePropertiesKvPairs{} + st.Properties = pb.Properties + + return st, nil +} + +func shareInfoToPb(st *ShareInfo) (*shareInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &shareInfoPb{} + pb.Comment = st.Comment + + pb.CreatedAt = st.CreatedAt + + pb.CreatedBy = st.CreatedBy + + pb.Name = st.Name + + pb.Objects = st.Objects + + pb.Owner = st.Owner + + pb.StorageLocation = st.StorageLocation + + pb.StorageRoot = st.StorageRoot + + pb.UpdatedAt = st.UpdatedAt + + pb.UpdatedBy = st.UpdatedBy + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type shareInfoPb struct { + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Name string `json:"name,omitempty"` + + Objects []SharedDataObject `json:"objects,omitempty"` + + Owner string `json:"owner,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func shareInfoFromPb(pb *shareInfoPb) (*ShareInfo, error) { + if pb == nil { + return nil, nil + } + st := &ShareInfo{} + st.Comment = pb.Comment + st.CreatedAt = pb.CreatedAt + st.CreatedBy = pb.CreatedBy + st.Name = pb.Name + st.Objects = pb.Objects + st.Owner = pb.Owner + st.StorageLocation = pb.StorageLocation + st.StorageRoot = pb.StorageRoot + st.UpdatedAt = pb.UpdatedAt + st.UpdatedBy = pb.UpdatedBy + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *shareInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st shareInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sharePermissionsRequestToPb(st *SharePermissionsRequest) (*sharePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &sharePermissionsRequestPb{} + pb.MaxResults = st.MaxResults + + pb.Name = st.Name + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sharePermissionsRequestPb struct { + MaxResults int `json:"-" url:"max_results,omitempty"` + + Name string `json:"-" url:"-"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sharePermissionsRequestFromPb(pb *sharePermissionsRequestPb) (*SharePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &SharePermissionsRequest{} + st.MaxResults = pb.MaxResults + st.Name = pb.Name + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sharePermissionsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sharePermissionsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func shareToPrivilegeAssignmentToPb(st *ShareToPrivilegeAssignment) (*shareToPrivilegeAssignmentPb, error) { + if st == nil { + return nil, nil + } + pb := &shareToPrivilegeAssignmentPb{} + pb.PrivilegeAssignments = st.PrivilegeAssignments + + pb.ShareName = st.ShareName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type shareToPrivilegeAssignmentPb struct { + PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func shareToPrivilegeAssignmentFromPb(pb *shareToPrivilegeAssignmentPb) (*ShareToPrivilegeAssignment, error) { + if pb == nil { + return nil, nil + } + st := &ShareToPrivilegeAssignment{} + st.PrivilegeAssignments = pb.PrivilegeAssignments + st.ShareName = pb.ShareName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *shareToPrivilegeAssignmentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st shareToPrivilegeAssignmentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { + if st == nil { + return nil, nil + } + pb := &sharedDataObjectPb{} + pb.AddedAt = st.AddedAt + + pb.AddedBy = st.AddedBy + + pb.CdfEnabled = st.CdfEnabled + + pb.Comment = st.Comment + + pb.Content = st.Content + + pb.DataObjectType = st.DataObjectType + + pb.HistoryDataSharingStatus = st.HistoryDataSharingStatus + + pb.Name = st.Name + + pb.Partitions = st.Partitions + + pb.SharedAs = st.SharedAs + + pb.StartVersion = st.StartVersion + + pb.Status = st.Status + + pb.StringSharedAs = st.StringSharedAs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type sharedDataObjectPb struct { + AddedAt int64 `json:"added_at,omitempty"` + + AddedBy string `json:"added_by,omitempty"` + + CdfEnabled bool `json:"cdf_enabled,omitempty"` + + Comment string `json:"comment,omitempty"` + + Content string `json:"content,omitempty"` + + DataObjectType SharedDataObjectDataObjectType `json:"data_object_type,omitempty"` + + HistoryDataSharingStatus SharedDataObjectHistoryDataSharingStatus `json:"history_data_sharing_status,omitempty"` + + Name string `json:"name"` + + Partitions []Partition `json:"partitions,omitempty"` + + SharedAs string `json:"shared_as,omitempty"` + + StartVersion int64 `json:"start_version,omitempty"` + + Status SharedDataObjectStatus `json:"status,omitempty"` + + StringSharedAs string `json:"string_shared_as,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func sharedDataObjectFromPb(pb *sharedDataObjectPb) (*SharedDataObject, error) { + if pb == nil { + return nil, nil + } + st := &SharedDataObject{} + st.AddedAt = pb.AddedAt + st.AddedBy = pb.AddedBy + st.CdfEnabled = pb.CdfEnabled + st.Comment = pb.Comment + st.Content = pb.Content + st.DataObjectType = pb.DataObjectType + st.HistoryDataSharingStatus = pb.HistoryDataSharingStatus + st.Name = pb.Name + st.Partitions = pb.Partitions + st.SharedAs = pb.SharedAs + st.StartVersion = pb.StartVersion + st.Status = pb.Status + st.StringSharedAs = pb.StringSharedAs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *sharedDataObjectPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st sharedDataObjectPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sharedDataObjectUpdateToPb(st *SharedDataObjectUpdate) (*sharedDataObjectUpdatePb, error) { + if st == nil { + return nil, nil + } + pb := &sharedDataObjectUpdatePb{} + pb.Action = st.Action + + pb.DataObject = st.DataObject + + return pb, nil +} + +type sharedDataObjectUpdatePb struct { + Action SharedDataObjectUpdateAction `json:"action,omitempty"` + + DataObject *SharedDataObject `json:"data_object,omitempty"` +} + +func sharedDataObjectUpdateFromPb(pb *sharedDataObjectUpdatePb) (*SharedDataObjectUpdate, error) { + if pb == nil { + return nil, nil + } + st := &SharedDataObjectUpdate{} + st.Action = pb.Action + st.DataObject = pb.DataObject + + return st, nil +} + +func tableToPb(st *Table) (*tablePb, error) { + if st == nil { + return nil, nil + } + pb := &tablePb{} + pb.Comment = st.Comment + + pb.Id = st.Id + + pb.InternalAttributes = st.InternalAttributes + + pb.MaterializationNamespace = st.MaterializationNamespace + + pb.MaterializedTableName = st.MaterializedTableName + + pb.Name = st.Name + + pb.Schema = st.Schema + + pb.Share = st.Share + + pb.ShareId = st.ShareId + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tablePb struct { + Comment string `json:"comment,omitempty"` + + Id string `json:"id,omitempty"` + + InternalAttributes *TableInternalAttributes `json:"internal_attributes,omitempty"` + + MaterializationNamespace string `json:"materialization_namespace,omitempty"` + + MaterializedTableName string `json:"materialized_table_name,omitempty"` + + Name string `json:"name,omitempty"` + + Schema string `json:"schema,omitempty"` + + Share string `json:"share,omitempty"` + + ShareId string `json:"share_id,omitempty"` + + Tags []catalog.TagKeyValue `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableFromPb(pb *tablePb) (*Table, error) { + if pb == nil { + return nil, nil + } + st := &Table{} + st.Comment = pb.Comment + st.Id = pb.Id + st.InternalAttributes = pb.InternalAttributes + st.MaterializationNamespace = pb.MaterializationNamespace + st.MaterializedTableName = pb.MaterializedTableName + st.Name = pb.Name + st.Schema = pb.Schema + st.Share = pb.Share + st.ShareId = pb.ShareId + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tablePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tablePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func tableInternalAttributesToPb(st *TableInternalAttributes) (*tableInternalAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &tableInternalAttributesPb{} + pb.ParentStorageLocation = st.ParentStorageLocation + + pb.StorageLocation = st.StorageLocation + + pb.Type = st.Type + + pb.ViewDefinition = st.ViewDefinition + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type tableInternalAttributesPb struct { + ParentStorageLocation string `json:"parent_storage_location,omitempty"` + + StorageLocation string `json:"storage_location,omitempty"` + + Type TableInternalAttributesSharedTableType `json:"type,omitempty"` + + ViewDefinition string `json:"view_definition,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func tableInternalAttributesFromPb(pb *tableInternalAttributesPb) (*TableInternalAttributes, error) { + if pb == nil { + return nil, nil + } + st := &TableInternalAttributes{} + st.ParentStorageLocation = pb.ParentStorageLocation + st.StorageLocation = pb.StorageLocation + st.Type = pb.Type + st.ViewDefinition = pb.ViewDefinition + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *tableInternalAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st tableInternalAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateFederationPolicyRequestToPb(st *UpdateFederationPolicyRequest) (*updateFederationPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateFederationPolicyRequestPb{} + pb.Name = st.Name + + pb.Policy = st.Policy + + pb.RecipientName = st.RecipientName + + pb.UpdateMask = st.UpdateMask + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateFederationPolicyRequestPb struct { + Name string `json:"-" url:"-"` + + Policy FederationPolicy `json:"policy"` + + RecipientName string `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateFederationPolicyRequestFromPb(pb *updateFederationPolicyRequestPb) (*UpdateFederationPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateFederationPolicyRequest{} + st.Name = pb.Name + st.Policy = pb.Policy + st.RecipientName = pb.RecipientName + st.UpdateMask = pb.UpdateMask + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateFederationPolicyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateProviderToPb(st *UpdateProvider) (*updateProviderPb, error) { + if st == nil { + return nil, nil + } + pb := &updateProviderPb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.RecipientProfileStr = st.RecipientProfileStr + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateProviderPb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateProviderFromPb(pb *updateProviderPb) (*UpdateProvider, error) { + if pb == nil { + return nil, nil + } + st := &UpdateProvider{} + st.Comment = pb.Comment + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + st.RecipientProfileStr = pb.RecipientProfileStr + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateProviderPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateProviderPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateRecipientToPb(st *UpdateRecipient) (*updateRecipientPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRecipientPb{} + pb.Comment = st.Comment + + pb.ExpirationTime = st.ExpirationTime + + pb.IpAccessList = st.IpAccessList + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.PropertiesKvpairs = st.PropertiesKvpairs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateRecipientPb struct { + Comment string `json:"comment,omitempty"` + + ExpirationTime int64 `json:"expiration_time,omitempty"` + + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateRecipientFromPb(pb *updateRecipientPb) (*UpdateRecipient, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRecipient{} + st.Comment = pb.Comment + st.ExpirationTime = pb.ExpirationTime + st.IpAccessList = pb.IpAccessList + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + st.PropertiesKvpairs = pb.PropertiesKvpairs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateRecipientPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateRecipientPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateShareToPb(st *UpdateShare) (*updateSharePb, error) { + if st == nil { + return nil, nil + } + pb := &updateSharePb{} + pb.Comment = st.Comment + + pb.Name = st.Name + + pb.NewName = st.NewName + + pb.Owner = st.Owner + + pb.StorageRoot = st.StorageRoot + + pb.Updates = st.Updates + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateSharePb struct { + Comment string `json:"comment,omitempty"` + + Name string `json:"-" url:"-"` + + NewName string `json:"new_name,omitempty"` + + Owner string `json:"owner,omitempty"` + + StorageRoot string `json:"storage_root,omitempty"` + + Updates []SharedDataObjectUpdate `json:"updates,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateShareFromPb(pb *updateSharePb) (*UpdateShare, error) { + if pb == nil { + return nil, nil + } + st := &UpdateShare{} + st.Comment = pb.Comment + st.Name = pb.Name + st.NewName = pb.NewName + st.Owner = pb.Owner + st.StorageRoot = pb.StorageRoot + st.Updates = pb.Updates + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateSharePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateSharePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateSharePermissionsToPb(st *UpdateSharePermissions) (*updateSharePermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &updateSharePermissionsPb{} + pb.Changes = st.Changes + + pb.Name = st.Name + + pb.OmitPermissionsList = st.OmitPermissionsList + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateSharePermissionsPb struct { + Changes []PermissionsChange `json:"changes,omitempty"` + + Name string `json:"-" url:"-"` + + OmitPermissionsList bool `json:"omit_permissions_list,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateSharePermissionsFromPb(pb *updateSharePermissionsPb) (*UpdateSharePermissions, error) { + if pb == nil { + return nil, nil + } + st := &UpdateSharePermissions{} + st.Changes = pb.Changes + st.Name = pb.Name + st.OmitPermissionsList = pb.OmitPermissionsList + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateSharePermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateSharePermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateSharePermissionsResponseToPb(st *UpdateSharePermissionsResponse) (*updateSharePermissionsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateSharePermissionsResponsePb{} + pb.PrivilegeAssignments = st.PrivilegeAssignments + + return pb, nil +} + +type updateSharePermissionsResponsePb struct { + PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` +} + +func updateSharePermissionsResponseFromPb(pb *updateSharePermissionsResponsePb) (*UpdateSharePermissionsResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateSharePermissionsResponse{} + st.PrivilegeAssignments = pb.PrivilegeAssignments + + return st, nil +} + +func volumeToPb(st *Volume) (*volumePb, error) { + if st == nil { + return nil, nil + } + pb := &volumePb{} + pb.Comment = st.Comment + + pb.Id = st.Id + + pb.InternalAttributes = st.InternalAttributes + + pb.Name = st.Name + + pb.Schema = st.Schema + + pb.Share = st.Share + + pb.ShareId = st.ShareId + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type volumePb struct { + Comment string `json:"comment,omitempty"` + + Id string `json:"id,omitempty"` + + InternalAttributes *VolumeInternalAttributes `json:"internal_attributes,omitempty"` + + Name string `json:"name,omitempty"` + + Schema string `json:"schema,omitempty"` + + Share string `json:"share,omitempty"` + + ShareId string `json:"share_id,omitempty"` + + Tags []catalog.TagKeyValue `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func volumeFromPb(pb *volumePb) (*Volume, error) { + if pb == nil { + return nil, nil + } + st := &Volume{} + st.Comment = pb.Comment + st.Id = pb.Id + st.InternalAttributes = pb.InternalAttributes + st.Name = pb.Name + st.Schema = pb.Schema + st.Share = pb.Share + st.ShareId = pb.ShareId + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *volumePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st volumePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func volumeInternalAttributesToPb(st *VolumeInternalAttributes) (*volumeInternalAttributesPb, error) { + if st == nil { + return nil, nil + } + pb := &volumeInternalAttributesPb{} + pb.StorageLocation = st.StorageLocation + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type volumeInternalAttributesPb struct { + StorageLocation string `json:"storage_location,omitempty"` + + Type string `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func volumeInternalAttributesFromPb(pb *volumeInternalAttributesPb) (*VolumeInternalAttributes, error) { + if pb == nil { + return nil, nil + } + st := &VolumeInternalAttributes{} + st.StorageLocation = pb.StorageLocation + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *volumeInternalAttributesPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st volumeInternalAttributesPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/sharing/model.go b/service/sharing/model.go index d54e5421f..d321bcb60 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -3,14 +3,17 @@ package sharing import ( + "encoding/json" "fmt" + "strings" + "time" - "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/catalog" ) // The delta sharing authentication type. type AuthenticationType string +type authenticationTypePb string const AuthenticationTypeDatabricks AuthenticationType = `DATABRICKS` @@ -39,9 +42,26 @@ func (f *AuthenticationType) Type() string { return "AuthenticationType" } +func authenticationTypeToPb(st *AuthenticationType) (*authenticationTypePb, error) { + if st == nil { + return nil, nil + } + pb := authenticationTypePb(*st) + return &pb, nil +} + +func authenticationTypeFromPb(pb *authenticationTypePb) (*AuthenticationType, error) { + if pb == nil { + return nil, nil + } + st := AuthenticationType(*pb) + return &st, nil +} + // UC supported column types Copied from // https://src.dev.databricks.com/databricks/universe@23a85902bb58695ab9293adc9f327b0714b55e72/-/blob/managed-catalog/api/messages/table.proto?L68 type ColumnTypeName string +type columnTypeNamePb string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -108,289 +128,735 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } +func columnTypeNameToPb(st *ColumnTypeName) (*columnTypeNamePb, error) { + if st == nil { + return nil, nil + } + pb := columnTypeNamePb(*st) + return &pb, nil +} + +func columnTypeNameFromPb(pb *columnTypeNamePb) (*ColumnTypeName, error) { + if pb == nil { + return nil, nil + } + st := ColumnTypeName(*pb) + return &st, nil +} + // Create recipient federation policy type CreateFederationPolicyRequest struct { - Policy FederationPolicy `json:"policy"` + + // Wire name: 'policy' + Policy FederationPolicy // Name of the recipient. This is the name of the recipient for which the // policy is being created. - RecipientName string `json:"-" url:"-"` + // Wire name: 'recipient_name' + RecipientName string `tf:"-"` +} + +func (st *CreateFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := createFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateProvider struct { // The delta sharing authentication type. - AuthenticationType AuthenticationType `json:"authentication_type"` + // Wire name: 'authentication_type' + AuthenticationType AuthenticationType // Description about the provider. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the Provider. - Name string `json:"name"` + // Wire name: 'name' + Name string // This field is required when the __authentication_type__ is **TOKEN**, // **OAUTH_CLIENT_CREDENTIALS** or not provided. - RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + // Wire name: 'recipient_profile_str' + RecipientProfileStr string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateProvider) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateProvider) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createProviderPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createProviderFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateProvider) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateProvider) MarshalJSON() ([]byte, error) { + pb, err := createProviderToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRecipient struct { // The delta sharing authentication type. - AuthenticationType AuthenticationType `json:"authentication_type"` + // Wire name: 'authentication_type' + AuthenticationType AuthenticationType // Description about the recipient. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The global Unity Catalog metastore id provided by the data recipient. // This field is only present when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + // Wire name: 'data_recipient_global_metastore_id' + DataRecipientGlobalMetastoreId string // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // IP Access List - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessList // Name of Recipient. - Name string `json:"name"` + // Wire name: 'name' + Name string // Username of the recipient owner. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Recipient properties as map of string key-value pairs. When provided in // update request, the specified properties will override the existing // properties. To add and remove properties, one would need to perform a // read-modify-write. - PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + // Wire name: 'properties_kvpairs' + PropertiesKvpairs *SecurablePropertiesKvPairs // The one-time sharing code provided by the data recipient. This field is // only present when the __authentication_type__ is **DATABRICKS**. - SharingCode string `json:"sharing_code,omitempty"` + // Wire name: 'sharing_code' + SharingCode string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRecipient) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRecipient) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRecipientPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRecipientFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRecipient) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRecipient) MarshalJSON() ([]byte, error) { + pb, err := createRecipientToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateShare struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the share. - Name string `json:"name"` + // Wire name: 'name' + Name string // Storage root URL for the share. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateShare) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateShare) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createSharePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createShareFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateShare) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateShare) MarshalJSON() ([]byte, error) { + pb, err := createShareToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete recipient federation policy type DeleteFederationPolicyRequest struct { // Name of the policy. This is the name of the policy to be deleted. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Name of the recipient. This is the name of the recipient for which the // policy is being deleted. - RecipientName string `json:"-" url:"-"` + // Wire name: 'recipient_name' + RecipientName string `tf:"-"` +} + +func (st *DeleteFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a provider type DeleteProviderRequest struct { // Name of the provider. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a share recipient type DeleteRecipientRequest struct { // Name of the recipient. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteRecipientRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRecipientRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRecipientRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRecipientRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteRecipientRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a share type DeleteShareRequest struct { // The name of the share. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *DeleteShareRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteShareRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteShareRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteShareRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteShareRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a UC dependency. type DeltaSharingDependency struct { // A Function in UC as a dependency. - Function *DeltaSharingFunctionDependency `json:"function,omitempty"` + // Wire name: 'function' + Function *DeltaSharingFunctionDependency // A Table in UC as a dependency. - Table *DeltaSharingTableDependency `json:"table,omitempty"` + // Wire name: 'table' + Table *DeltaSharingTableDependency +} + +func (st *DeltaSharingDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSharingDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSharingDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeltaSharingDependency) MarshalJSON() ([]byte, error) { + pb, err := deltaSharingDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a list of dependencies. type DeltaSharingDependencyList struct { // An array of Dependency. - Dependencies []DeltaSharingDependency `json:"dependencies,omitempty"` + // Wire name: 'dependencies' + Dependencies []DeltaSharingDependency +} + +func (st *DeltaSharingDependencyList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSharingDependencyListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSharingDependencyListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeltaSharingDependencyList) MarshalJSON() ([]byte, error) { + pb, err := deltaSharingDependencyListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeltaSharingFunction struct { // The aliass of registered model. - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + // Wire name: 'aliases' + Aliases []RegisteredModelAlias // The comment of the function. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The data type of the function. - DataType ColumnTypeName `json:"data_type,omitempty"` + // Wire name: 'data_type' + DataType ColumnTypeName // The dependency list of the function. - DependencyList *DeltaSharingDependencyList `json:"dependency_list,omitempty"` + // Wire name: 'dependency_list' + DependencyList *DeltaSharingDependencyList // The full data type of the function. - FullDataType string `json:"full_data_type,omitempty"` + // Wire name: 'full_data_type' + FullDataType string // The id of the function. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The function parameter information. - InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + // Wire name: 'input_params' + InputParams *FunctionParameterInfos // The name of the function. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The properties of the function. - Properties string `json:"properties,omitempty"` + // Wire name: 'properties' + Properties string // The routine definition of the function. - RoutineDefinition string `json:"routine_definition,omitempty"` + // Wire name: 'routine_definition' + RoutineDefinition string // The name of the schema that the function belongs to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // The securable kind of the function. - SecurableKind SharedSecurableKind `json:"securable_kind,omitempty"` + // Wire name: 'securable_kind' + SecurableKind SharedSecurableKind // The name of the share that the function belongs to. - Share string `json:"share,omitempty"` + // Wire name: 'share' + Share string // The id of the share that the function belongs to. - ShareId string `json:"share_id,omitempty"` + // Wire name: 'share_id' + ShareId string // The storage location of the function. - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // The tags of the function. - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []catalog.TagKeyValue - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeltaSharingFunction) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeltaSharingFunction) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSharingFunctionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSharingFunctionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeltaSharingFunction) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeltaSharingFunction) MarshalJSON() ([]byte, error) { + pb, err := deltaSharingFunctionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A Function in UC as a dependency. type DeltaSharingFunctionDependency struct { - FunctionName string `json:"function_name,omitempty"` - SchemaName string `json:"schema_name,omitempty"` + // Wire name: 'function_name' + FunctionName string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'schema_name' + SchemaName string + + ForceSendFields []string `tf:"-"` } -func (s *DeltaSharingFunctionDependency) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeltaSharingFunctionDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSharingFunctionDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSharingFunctionDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeltaSharingFunctionDependency) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeltaSharingFunctionDependency) MarshalJSON() ([]byte, error) { + pb, err := deltaSharingFunctionDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A Table in UC as a dependency. type DeltaSharingTableDependency struct { - SchemaName string `json:"schema_name,omitempty"` - TableName string `json:"table_name,omitempty"` + // Wire name: 'schema_name' + SchemaName string + + // Wire name: 'table_name' + TableName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeltaSharingTableDependency) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeltaSharingTableDependency) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSharingTableDependencyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSharingTableDependencyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeltaSharingTableDependency) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeltaSharingTableDependency) MarshalJSON() ([]byte, error) { + pb, err := deltaSharingTableDependencyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FederationPolicy struct { // Description of the policy. This is a user-provided description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // System-generated timestamp indicating when the policy was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // Unique, immutable system-generated identifier for the federation policy. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Name of the federation policy. A recipient can have multiple policies // with different names. The name must contain only lowercase alphanumeric // characters, numbers, and hyphens. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Specifies the policy to use for validating OIDC claims in the federated // tokens. - OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` + // Wire name: 'oidc_policy' + OidcPolicy *OidcFederationPolicy // System-generated timestamp indicating when the policy was last updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FederationPolicy) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FederationPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &federationPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := federationPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FederationPolicy) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FederationPolicy) MarshalJSON() ([]byte, error) { + pb, err := federationPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Represents a parameter of a function. The same message is used for both input // and output columns. type FunctionParameterInfo struct { // The comment of the parameter. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the parameter. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The default value of the parameter. - ParameterDefault string `json:"parameter_default,omitempty"` + // Wire name: 'parameter_default' + ParameterDefault string // The mode of the function parameter. - ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + // Wire name: 'parameter_mode' + ParameterMode FunctionParameterMode // The type of the function parameter. - ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + // Wire name: 'parameter_type' + ParameterType FunctionParameterType // The position of the parameter. - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The interval type of the parameter type. - TypeIntervalType string `json:"type_interval_type,omitempty"` + // Wire name: 'type_interval_type' + TypeIntervalType string // The type of the parameter in JSON format. - TypeJson string `json:"type_json,omitempty"` + // Wire name: 'type_json' + TypeJson string // The type of the parameter in Enum format. - TypeName ColumnTypeName `json:"type_name,omitempty"` + // Wire name: 'type_name' + TypeName ColumnTypeName // The precision of the parameter type. - TypePrecision int `json:"type_precision,omitempty"` + // Wire name: 'type_precision' + TypePrecision int // The scale of the parameter type. - TypeScale int `json:"type_scale,omitempty"` + // Wire name: 'type_scale' + TypeScale int // The type of the parameter in text format. - TypeText string `json:"type_text,omitempty"` + // Wire name: 'type_text' + TypeText string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *FunctionParameterInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *FunctionParameterInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionParameterInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionParameterInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s FunctionParameterInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st FunctionParameterInfo) MarshalJSON() ([]byte, error) { + pb, err := functionParameterInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FunctionParameterInfos struct { // The list of parameters of the function. - Parameters []FunctionParameterInfo `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []FunctionParameterInfo +} + +func (st *FunctionParameterInfos) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &functionParameterInfosPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := functionParameterInfosFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st FunctionParameterInfos) MarshalJSON() ([]byte, error) { + pb, err := functionParameterInfosToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type FunctionParameterMode string +type functionParameterModePb string const FunctionParameterModeIn FunctionParameterMode = `IN` @@ -419,7 +885,24 @@ func (f *FunctionParameterMode) Type() string { return "FunctionParameterMode" } +func functionParameterModeToPb(st *FunctionParameterMode) (*functionParameterModePb, error) { + if st == nil { + return nil, nil + } + pb := functionParameterModePb(*st) + return &pb, nil +} + +func functionParameterModeFromPb(pb *functionParameterModePb) (*FunctionParameterMode, error) { + if pb == nil { + return nil, nil + } + st := FunctionParameterMode(*pb) + return &st, nil +} + type FunctionParameterType string +type functionParameterTypePb string const FunctionParameterTypeColumn FunctionParameterType = `COLUMN` @@ -446,196 +929,538 @@ func (f *FunctionParameterType) Type() string { return "FunctionParameterType" } +func functionParameterTypeToPb(st *FunctionParameterType) (*functionParameterTypePb, error) { + if st == nil { + return nil, nil + } + pb := functionParameterTypePb(*st) + return &pb, nil +} + +func functionParameterTypeFromPb(pb *functionParameterTypePb) (*FunctionParameterType, error) { + if pb == nil { + return nil, nil + } + st := FunctionParameterType(*pb) + return &st, nil +} + // Get a share activation URL type GetActivationUrlInfoRequest struct { // The one time activation url. It also accepts activation token. - ActivationUrl string `json:"-" url:"-"` + // Wire name: 'activation_url' + ActivationUrl string `tf:"-"` +} + +func (st *GetActivationUrlInfoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getActivationUrlInfoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getActivationUrlInfoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetActivationUrlInfoRequest) MarshalJSON() ([]byte, error) { + pb, err := getActivationUrlInfoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetActivationUrlInfoResponse struct { } +func (st *GetActivationUrlInfoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getActivationUrlInfoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getActivationUrlInfoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetActivationUrlInfoResponse) MarshalJSON() ([]byte, error) { + pb, err := getActivationUrlInfoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Get recipient federation policy type GetFederationPolicyRequest struct { // Name of the policy. This is the name of the policy to be retrieved. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Name of the recipient. This is the name of the recipient for which the // policy is being retrieved. - RecipientName string `json:"-" url:"-"` + // Wire name: 'recipient_name' + RecipientName string `tf:"-"` +} + +func (st *GetFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := getFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a provider type GetProviderRequest struct { // Name of the provider. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetProviderRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getProviderRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getProviderRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetProviderRequest) MarshalJSON() ([]byte, error) { + pb, err := getProviderRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a share recipient type GetRecipientRequest struct { // Name of the recipient. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *GetRecipientRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRecipientRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRecipientRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRecipientRequest) MarshalJSON() ([]byte, error) { + pb, err := getRecipientRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetRecipientSharePermissionsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of data share permissions for a recipient. - PermissionsOut []ShareToPrivilegeAssignment `json:"permissions_out,omitempty"` + // Wire name: 'permissions_out' + PermissionsOut []ShareToPrivilegeAssignment - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRecipientSharePermissionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRecipientSharePermissionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRecipientSharePermissionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRecipientSharePermissionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRecipientSharePermissionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRecipientSharePermissionsResponse) MarshalJSON() ([]byte, error) { + pb, err := getRecipientSharePermissionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetSharePermissionsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // The privileges assigned to each principal - PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + // Wire name: 'privilege_assignments' + PrivilegeAssignments []PrivilegeAssignment - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetSharePermissionsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetSharePermissionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSharePermissionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSharePermissionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetSharePermissionsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetSharePermissionsResponse) MarshalJSON() ([]byte, error) { + pb, err := getSharePermissionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a share type GetShareRequest struct { // Query for data to include in the share. - IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"` + // Wire name: 'include_shared_data' + IncludeSharedData bool `tf:"-"` // The name of the share. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetShareRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetShareRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getShareRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getShareRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetShareRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetShareRequest) MarshalJSON() ([]byte, error) { + pb, err := getShareRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type IpAccessList struct { // Allowed IP Addresses in CIDR notation. Limit of 100. - AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"` + // Wire name: 'allowed_ip_addresses' + AllowedIpAddresses []string +} + +func (st *IpAccessList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &ipAccessListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := ipAccessListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st IpAccessList) MarshalJSON() ([]byte, error) { + pb, err := ipAccessListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List recipient federation policies type ListFederationPoliciesRequest struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` // Name of the recipient. This is the name of the recipient for which the // policies are being listed. - RecipientName string `json:"-" url:"-"` + // Wire name: 'recipient_name' + RecipientName string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListFederationPoliciesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFederationPoliciesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFederationPoliciesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFederationPoliciesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFederationPoliciesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + pb, err := listFederationPoliciesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListFederationPoliciesResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Policies []FederationPolicy `json:"policies,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'policies' + Policies []FederationPolicy + + ForceSendFields []string `tf:"-"` } -func (s *ListFederationPoliciesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListFederationPoliciesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listFederationPoliciesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listFederationPoliciesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { + pb, err := listFederationPoliciesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List assets by provider share type ListProviderShareAssetsRequest struct { // Maximum number of functions to return. - FunctionMaxResults int `json:"-" url:"function_max_results,omitempty"` + // Wire name: 'function_max_results' + FunctionMaxResults int `tf:"-"` // Maximum number of notebooks to return. - NotebookMaxResults int `json:"-" url:"notebook_max_results,omitempty"` + // Wire name: 'notebook_max_results' + NotebookMaxResults int `tf:"-"` // The name of the provider who owns the share. - ProviderName string `json:"-" url:"-"` + // Wire name: 'provider_name' + ProviderName string `tf:"-"` // The name of the share. - ShareName string `json:"-" url:"-"` + // Wire name: 'share_name' + ShareName string `tf:"-"` // Maximum number of tables to return. - TableMaxResults int `json:"-" url:"table_max_results,omitempty"` + // Wire name: 'table_max_results' + TableMaxResults int `tf:"-"` // Maximum number of volumes to return. - VolumeMaxResults int `json:"-" url:"volume_max_results,omitempty"` + // Wire name: 'volume_max_results' + VolumeMaxResults int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProviderShareAssetsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProviderShareAssetsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProviderShareAssetsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProviderShareAssetsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProviderShareAssetsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProviderShareAssetsRequest) MarshalJSON() ([]byte, error) { + pb, err := listProviderShareAssetsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Response to ListProviderShareAssets, which contains the list of assets of a // share. type ListProviderShareAssetsResponse struct { // The list of functions in the share. - Functions []DeltaSharingFunction `json:"functions,omitempty"` + // Wire name: 'functions' + Functions []DeltaSharingFunction // The list of notebooks in the share. - Notebooks []NotebookFile `json:"notebooks,omitempty"` + // Wire name: 'notebooks' + Notebooks []NotebookFile // The list of tables in the share. - Tables []Table `json:"tables,omitempty"` + // Wire name: 'tables' + Tables []Table // The list of volumes in the share. - Volumes []Volume `json:"volumes,omitempty"` + // Wire name: 'volumes' + Volumes []Volume +} + +func (st *ListProviderShareAssetsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProviderShareAssetsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProviderShareAssetsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListProviderShareAssetsResponse) MarshalJSON() ([]byte, error) { + pb, err := listProviderShareAssetsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListProviderSharesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of provider shares. - Shares []ProviderShare `json:"shares,omitempty"` + // Wire name: 'shares' + Shares []ProviderShare - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProviderSharesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProviderSharesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProviderSharesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProviderSharesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProviderSharesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProviderSharesResponse) MarshalJSON() ([]byte, error) { + pb, err := listProviderSharesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List providers type ListProvidersRequest struct { // If not provided, all providers will be returned. If no providers exist // with this ID, no results will be returned. - DataProviderGlobalMetastoreId string `json:"-" url:"data_provider_global_metastore_id,omitempty"` + // Wire name: 'data_provider_global_metastore_id' + DataProviderGlobalMetastoreId string `tf:"-"` // Maximum number of providers to return. - when set to 0, the page length // is set to a server configured value (recommended); - when set to a value // greater than 0, the page length is the minimum of this value and a server @@ -645,45 +1470,84 @@ type ListProvidersRequest struct { // the specified max_results size, even zero. The only definitive indication // that no further providers can be fetched is when the next_page_token is // unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProvidersRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProvidersRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProvidersRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProvidersRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProvidersRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProvidersRequest) MarshalJSON() ([]byte, error) { + pb, err := listProvidersRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListProvidersResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of provider information objects. - Providers []ProviderInfo `json:"providers,omitempty"` + // Wire name: 'providers' + Providers []ProviderInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListProvidersResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListProvidersResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listProvidersResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listProvidersResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListProvidersResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListProvidersResponse) MarshalJSON() ([]byte, error) { + pb, err := listProvidersResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List share recipients type ListRecipientsRequest struct { // If not provided, all recipients will be returned. If no recipients exist // with this ID, no results will be returned. - DataRecipientGlobalMetastoreId string `json:"-" url:"data_recipient_global_metastore_id,omitempty"` + // Wire name: 'data_recipient_global_metastore_id' + DataRecipientGlobalMetastoreId string `tf:"-"` // Maximum number of recipients to return. - when set to 0, the page length // is set to a server configured value (recommended); - when set to a value // greater than 0, the page length is the minimum of this value and a server @@ -693,38 +1557,76 @@ type ListRecipientsRequest struct { // than the specified max_results size, even zero. The only definitive // indication that no further recipients can be fetched is when the // next_page_token is unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRecipientsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRecipientsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRecipientsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRecipientsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRecipientsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRecipientsRequest) MarshalJSON() ([]byte, error) { + pb, err := listRecipientsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListRecipientsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of recipient information objects. - Recipients []RecipientInfo `json:"recipients,omitempty"` + // Wire name: 'recipients' + Recipients []RecipientInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListRecipientsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListRecipientsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listRecipientsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listRecipientsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListRecipientsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListRecipientsResponse) MarshalJSON() ([]byte, error) { + pb, err := listRecipientsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List shares by Provider @@ -738,65 +1640,127 @@ type ListSharesRequest struct { // the specified max_results size, even zero. The only definitive indication // that no further shares can be fetched is when the next_page_token is // unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // Name of the provider in which to list shares. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSharesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSharesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSharesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSharesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSharesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSharesRequest) MarshalJSON() ([]byte, error) { + pb, err := listSharesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSharesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // An array of data share information objects. - Shares []ShareInfo `json:"shares,omitempty"` + // Wire name: 'shares' + Shares []ShareInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListSharesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListSharesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSharesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSharesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListSharesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListSharesResponse) MarshalJSON() ([]byte, error) { + pb, err := listSharesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NotebookFile struct { // The comment of the notebook file. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The id of the notebook file. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Name of the notebook file. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The name of the share that the notebook file belongs to. - Share string `json:"share,omitempty"` + // Wire name: 'share' + Share string // The id of the share that the notebook file belongs to. - ShareId string `json:"share_id,omitempty"` + // Wire name: 'share_id' + ShareId string // The tags of the notebook file. - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []catalog.TagKeyValue - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *NotebookFile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NotebookFile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¬ebookFilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := notebookFileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NotebookFile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NotebookFile) MarshalJSON() ([]byte, error) { + pb, err := notebookFileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Specifies the policy to use for validating OIDC claims in your federated @@ -808,10 +1772,12 @@ type OidcFederationPolicy struct { // tokens. The audience identifier is intended to represent the recipient of // the token. Can be any non-empty string value. As long as the audience in // the token matches at least one audience in the policy, - Audiences []string `json:"audiences,omitempty"` + // Wire name: 'audiences' + Audiences []string // The required token issuer, as specified in the 'iss' claim of federated // tokens. - Issuer string `json:"issuer"` + // Wire name: 'issuer' + Issuer string // The required token subject, as specified in the subject claim of // federated tokens. The subject claim identifies the identity of the user // or machine accessing the resource. Examples for Entra ID (AAD): - U2M @@ -820,7 +1786,8 @@ type OidcFederationPolicy struct { // subject claim is `oid`, this must be the Object ID of the user in Entra // ID. - M2M flow (OAuth App access): If the subject claim is `azp`, this // must be the client ID of the OAuth app registered in Entra ID. - Subject string `json:"subject"` + // Wire name: 'subject' + Subject string // The claim that contains the subject of the token. Depending on the // identity provider and the use case (U2M or M2M), this can vary: - For // Entra ID (AAD): * U2M flow (group access): Use `groups`. * U2M flow (user @@ -830,40 +1797,114 @@ type OidcFederationPolicy struct { // Supported `subject_claim` values are: - `oid`: Object ID of the user. - // `azp`: Client ID of the OAuth app. - `groups`: Object ID of the group. - // `sub`: Subject identifier for other use cases. - SubjectClaim string `json:"subject_claim"` + // Wire name: 'subject_claim' + SubjectClaim string +} + +func (st *OidcFederationPolicy) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &oidcFederationPolicyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := oidcFederationPolicyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st OidcFederationPolicy) MarshalJSON() ([]byte, error) { + pb, err := oidcFederationPolicyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Partition struct { // An array of partition values. - Values []PartitionValue `json:"values,omitempty"` + // Wire name: 'values' + Values []PartitionValue +} + +func (st *Partition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &partitionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := partitionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Partition) MarshalJSON() ([]byte, error) { + pb, err := partitionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PartitionValue struct { // The name of the partition column. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The operator to apply for the value. - Op PartitionValueOp `json:"op,omitempty"` + // Wire name: 'op' + Op PartitionValueOp // The key of a Delta Sharing recipient's property. For example // "databricks-account-id". When this field is set, field `value` can not be // set. - RecipientPropertyKey string `json:"recipient_property_key,omitempty"` + // Wire name: 'recipient_property_key' + RecipientPropertyKey string // The value of the partition column. When this value is not set, it means // `null` value. When this field is set, field `recipient_property_key` can // not be set. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PartitionValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PartitionValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &partitionValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := partitionValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PartitionValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PartitionValue) MarshalJSON() ([]byte, error) { + pb, err := partitionValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PartitionValueOp string +type partitionValueOpPb string const PartitionValueOpEqual PartitionValueOp = `EQUAL` @@ -890,26 +1931,63 @@ func (f *PartitionValueOp) Type() string { return "PartitionValueOp" } +func partitionValueOpToPb(st *PartitionValueOp) (*partitionValueOpPb, error) { + if st == nil { + return nil, nil + } + pb := partitionValueOpPb(*st) + return &pb, nil +} + +func partitionValueOpFromPb(pb *partitionValueOpPb) (*PartitionValueOp, error) { + if pb == nil { + return nil, nil + } + st := PartitionValueOp(*pb) + return &st, nil +} + type PermissionsChange struct { // The set of privileges to add. - Add []string `json:"add,omitempty"` + // Wire name: 'add' + Add []string // The principal whose privileges we are changing. - Principal string `json:"principal,omitempty"` + // Wire name: 'principal' + Principal string // The set of privileges to remove. - Remove []string `json:"remove,omitempty"` + // Wire name: 'remove' + Remove []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PermissionsChange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PermissionsChange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &permissionsChangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := permissionsChangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PermissionsChange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PermissionsChange) MarshalJSON() ([]byte, error) { + pb, err := permissionsChangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Privilege string +type privilegePb string const PrivilegeAccess Privilege = `ACCESS` @@ -1022,238 +2100,468 @@ func (f *Privilege) Type() string { return "Privilege" } +func privilegeToPb(st *Privilege) (*privilegePb, error) { + if st == nil { + return nil, nil + } + pb := privilegePb(*st) + return &pb, nil +} + +func privilegeFromPb(pb *privilegePb) (*Privilege, error) { + if pb == nil { + return nil, nil + } + st := Privilege(*pb) + return &st, nil +} + type PrivilegeAssignment struct { // The principal (user email address or group name). - Principal string `json:"principal,omitempty"` + // Wire name: 'principal' + Principal string // The privileges assigned to the principal. - Privileges []Privilege `json:"privileges,omitempty"` + // Wire name: 'privileges' + Privileges []Privilege - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PrivilegeAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PrivilegeAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &privilegeAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := privilegeAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PrivilegeAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PrivilegeAssignment) MarshalJSON() ([]byte, error) { + pb, err := privilegeAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ProviderInfo struct { // The delta sharing authentication type. - AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + // Wire name: 'authentication_type' + AuthenticationType AuthenticationType // Cloud vendor of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // Description about the provider. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this Provider was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of Provider creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The global UC metastore id of the data provider. This field is only // present when the __authentication_type__ is **DATABRICKS**. The // identifier is of format __cloud__:__region__:__metastore-uuid__. - DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"` + // Wire name: 'data_provider_global_metastore_id' + DataProviderGlobalMetastoreId string // UUID of the provider's UC metastore. This field is only present when the // __authentication_type__ is **DATABRICKS**. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // The name of the Provider. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of Provider owner. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // The recipient profile. This field is only present when the // authentication_type is `TOKEN` or `OAUTH_CLIENT_CREDENTIALS`. - RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"` + // Wire name: 'recipient_profile' + RecipientProfile *RecipientProfile // This field is required when the __authentication_type__ is **TOKEN**, // **OAUTH_CLIENT_CREDENTIALS** or not provided. - RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + // Wire name: 'recipient_profile_str' + RecipientProfileStr string // Cloud region of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // Time at which this Provider was created, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of user who last modified Provider. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ProviderInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ProviderInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &providerInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := providerInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ProviderInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ProviderInfo) MarshalJSON() ([]byte, error) { + pb, err := providerInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ProviderShare struct { // The name of the Provider Share. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ProviderShare) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ProviderShare) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &providerSharePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := providerShareFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ProviderShare) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ProviderShare) MarshalJSON() ([]byte, error) { + pb, err := providerShareToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RecipientInfo struct { // A boolean status field showing whether the Recipient's activation URL has // been exercised or not. - Activated bool `json:"activated,omitempty"` + // Wire name: 'activated' + Activated bool // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl string `json:"activation_url,omitempty"` + // Wire name: 'activation_url' + ActivationUrl string // The delta sharing authentication type. - AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + // Wire name: 'authentication_type' + AuthenticationType AuthenticationType // Cloud vendor of the recipient's Unity Catalog Metastore. This field is // only present when the __authentication_type__ is **DATABRICKS**. - Cloud string `json:"cloud,omitempty"` + // Wire name: 'cloud' + Cloud string // Description about the recipient. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this recipient was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of recipient creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // The global Unity Catalog metastore id provided by the data recipient. // This field is only present when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + // Wire name: 'data_recipient_global_metastore_id' + DataRecipientGlobalMetastoreId string // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // IP Access List - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessList // Unique identifier of recipient's Unity Catalog Metastore. This field is // only present when the __authentication_type__ is **DATABRICKS**. - MetastoreId string `json:"metastore_id,omitempty"` + // Wire name: 'metastore_id' + MetastoreId string // Name of Recipient. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Username of the recipient owner. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Recipient properties as map of string key-value pairs. When provided in // update request, the specified properties will override the existing // properties. To add and remove properties, one would need to perform a // read-modify-write. - PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + // Wire name: 'properties_kvpairs' + PropertiesKvpairs *SecurablePropertiesKvPairs // Cloud region of the recipient's Unity Catalog Metastore. This field is // only present when the __authentication_type__ is **DATABRICKS**. - Region string `json:"region,omitempty"` + // Wire name: 'region' + Region string // The one-time sharing code provided by the data recipient. This field is // only present when the __authentication_type__ is **DATABRICKS**. - SharingCode string `json:"sharing_code,omitempty"` + // Wire name: 'sharing_code' + SharingCode string // This field is only present when the __authentication_type__ is **TOKEN**. - Tokens []RecipientTokenInfo `json:"tokens,omitempty"` + // Wire name: 'tokens' + Tokens []RecipientTokenInfo // Time at which the recipient was updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of recipient updater. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RecipientInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RecipientInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &recipientInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := recipientInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RecipientInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RecipientInfo) MarshalJSON() ([]byte, error) { + pb, err := recipientInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RecipientProfile struct { // The token used to authorize the recipient. - BearerToken string `json:"bearer_token,omitempty"` + // Wire name: 'bearer_token' + BearerToken string // The endpoint for the share to be used by the recipient. - Endpoint string `json:"endpoint,omitempty"` + // Wire name: 'endpoint' + Endpoint string // The version number of the recipient's credentials on a share. - ShareCredentialsVersion int `json:"share_credentials_version,omitempty"` + // Wire name: 'share_credentials_version' + ShareCredentialsVersion int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RecipientProfile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RecipientProfile) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &recipientProfilePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := recipientProfileFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RecipientProfile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RecipientProfile) MarshalJSON() ([]byte, error) { + pb, err := recipientProfileToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RecipientTokenInfo struct { // Full activation URL to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl string `json:"activation_url,omitempty"` + // Wire name: 'activation_url' + ActivationUrl string // Time at which this recipient token was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of recipient token creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // Unique ID of the recipient token. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Time at which this recipient token was updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of recipient token updater. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RecipientTokenInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RecipientTokenInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &recipientTokenInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := recipientTokenInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RecipientTokenInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RecipientTokenInfo) MarshalJSON() ([]byte, error) { + pb, err := recipientTokenInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RegisteredModelAlias struct { // Name of the alias. - AliasName string `json:"alias_name,omitempty"` + // Wire name: 'alias_name' + AliasName string // Numeric model version that alias will reference. - VersionNum int64 `json:"version_num,omitempty"` + // Wire name: 'version_num' + VersionNum int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RegisteredModelAlias) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RegisteredModelAlias) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ®isteredModelAliasPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := registeredModelAliasFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RegisteredModelAlias) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RegisteredModelAlias) MarshalJSON() ([]byte, error) { + pb, err := registeredModelAliasToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an access token type RetrieveTokenRequest struct { // The one time activation url. It also accepts activation token. - ActivationUrl string `json:"-" url:"-"` + // Wire name: 'activation_url' + ActivationUrl string `tf:"-"` +} + +func (st *RetrieveTokenRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &retrieveTokenRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := retrieveTokenRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RetrieveTokenRequest) MarshalJSON() ([]byte, error) { + pb, err := retrieveTokenRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RetrieveTokenResponse struct { // The token used to authorize the recipient. - BearerToken string `json:"bearerToken,omitempty"` + // Wire name: 'bearerToken' + BearerToken string // The endpoint for the share to be used by the recipient. - Endpoint string `json:"endpoint,omitempty"` + // Wire name: 'endpoint' + Endpoint string // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime string `json:"expirationTime,omitempty"` + // Wire name: 'expirationTime' + ExpirationTime string // These field names must follow the delta sharing protocol. - ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + // Wire name: 'shareCredentialsVersion' + ShareCredentialsVersion int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RetrieveTokenResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RetrieveTokenResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &retrieveTokenResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := retrieveTokenResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RetrieveTokenResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RetrieveTokenResponse) MarshalJSON() ([]byte, error) { + pb, err := retrieveTokenResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RotateRecipientToken struct { @@ -1261,49 +2569,129 @@ type RotateRecipientToken struct { // the expiration_time of existing token only to a smaller timestamp, it // cannot extend the expiration_time. Use 0 to expire the existing token // immediately, negative number will return an error. - ExistingTokenExpireInSeconds int64 `json:"existing_token_expire_in_seconds"` + // Wire name: 'existing_token_expire_in_seconds' + ExistingTokenExpireInSeconds int64 // The name of the Recipient. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` +} + +func (st *RotateRecipientToken) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &rotateRecipientTokenPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := rotateRecipientTokenFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RotateRecipientToken) MarshalJSON() ([]byte, error) { + pb, err := rotateRecipientTokenToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // An object with __properties__ containing map of key-value properties attached // to the securable. type SecurablePropertiesKvPairs struct { // A map of key-value properties attached to the securable. - Properties map[string]string `json:"properties"` + // Wire name: 'properties' + Properties map[string]string +} + +func (st *SecurablePropertiesKvPairs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &securablePropertiesKvPairsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := securablePropertiesKvPairsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SecurablePropertiesKvPairs) MarshalJSON() ([]byte, error) { + pb, err := securablePropertiesKvPairsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ShareInfo struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Time at which this share was created, in epoch milliseconds. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // Username of share creator. - CreatedBy string `json:"created_by,omitempty"` + // Wire name: 'created_by' + CreatedBy string // Name of the share. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // A list of shared data objects within the share. - Objects []SharedDataObject `json:"objects,omitempty"` + // Wire name: 'objects' + Objects []SharedDataObject // Username of current owner of share. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Storage Location URL (full path) for the share. - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // Storage root URL for the share. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // Time at which this share was updated, in epoch milliseconds. - UpdatedAt int64 `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt int64 // Username of share updater. - UpdatedBy string `json:"updated_by,omitempty"` + // Wire name: 'updated_by' + UpdatedBy string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ShareInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ShareInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &shareInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := shareInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ShareInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ShareInfo) MarshalJSON() ([]byte, error) { + pb, err := shareInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get recipient share permissions @@ -1317,70 +2705,119 @@ type SharePermissionsRequest struct { // than the specified max_results size, even zero. The only definitive // indication that no further permissions can be fetched is when the // next_page_token is unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // The name of the Recipient. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SharePermissionsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SharePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sharePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sharePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SharePermissionsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SharePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := sharePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ShareToPrivilegeAssignment struct { // The privileges assigned to the principal. - PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + // Wire name: 'privilege_assignments' + PrivilegeAssignments []PrivilegeAssignment // The share name. - ShareName string `json:"share_name,omitempty"` + // Wire name: 'share_name' + ShareName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ShareToPrivilegeAssignment) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ShareToPrivilegeAssignment) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &shareToPrivilegeAssignmentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := shareToPrivilegeAssignmentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ShareToPrivilegeAssignment) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ShareToPrivilegeAssignment) MarshalJSON() ([]byte, error) { + pb, err := shareToPrivilegeAssignmentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SharedDataObject struct { // The time when this data object is added to the share, in epoch // milliseconds. - AddedAt int64 `json:"added_at,omitempty"` + // Wire name: 'added_at' + AddedAt int64 // Username of the sharer. - AddedBy string `json:"added_by,omitempty"` + // Wire name: 'added_by' + AddedBy string // Whether to enable cdf or indicate if cdf is enabled on the shared object. - CdfEnabled bool `json:"cdf_enabled,omitempty"` + // Wire name: 'cdf_enabled' + CdfEnabled bool // A user-provided comment when adding the data object to the share. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The content of the notebook file when the data object type is // NOTEBOOK_FILE. This should be base64 encoded. Required for adding a // NOTEBOOK_FILE, optional for updating, ignored for other types. - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string // The type of the data object. - DataObjectType SharedDataObjectDataObjectType `json:"data_object_type,omitempty"` + // Wire name: 'data_object_type' + DataObjectType SharedDataObjectDataObjectType // Whether to enable or disable sharing of data history. If not specified, // the default is **DISABLED**. - HistoryDataSharingStatus SharedDataObjectHistoryDataSharingStatus `json:"history_data_sharing_status,omitempty"` + // Wire name: 'history_data_sharing_status' + HistoryDataSharingStatus SharedDataObjectHistoryDataSharingStatus // A fully qualified name that uniquely identifies a data object. For // example, a table's fully qualified name is in the format of // `..`, - Name string `json:"name"` + // Wire name: 'name' + Name string // Array of partitions for the shared data. - Partitions []Partition `json:"partitions,omitempty"` + // Wire name: 'partitions' + Partitions []Partition // A user-provided new name for the data object within the share. If this // new name is not provided, the object's original name will be used as the // `shared_as` name. The `shared_as` name must be unique within a share. For // tables, the new name must follow the format of `.
`. - SharedAs string `json:"shared_as,omitempty"` + // Wire name: 'shared_as' + SharedAs string // The start version associated with the object. This allows data providers // to control the lowest object version that is accessible by clients. If // specified, clients can query snapshots or changes for versions >= @@ -1388,28 +2825,49 @@ type SharedDataObject struct { // version of the object at the time it was added to the share. // // NOTE: The start_version should be <= the `current` version of the object. - StartVersion int64 `json:"start_version,omitempty"` + // Wire name: 'start_version' + StartVersion int64 // One of: **ACTIVE**, **PERMISSION_DENIED**. - Status SharedDataObjectStatus `json:"status,omitempty"` + // Wire name: 'status' + Status SharedDataObjectStatus // A user-provided new name for the shared object within the share. If this // new name is not not provided, the object's original name will be used as // the `string_shared_as` name. The `string_shared_as` name must be unique // for objects of the same type within a Share. For notebooks, the new name // should be the new notebook file name. - StringSharedAs string `json:"string_shared_as,omitempty"` + // Wire name: 'string_shared_as' + StringSharedAs string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SharedDataObject) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SharedDataObject) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sharedDataObjectPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sharedDataObjectFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SharedDataObject) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SharedDataObject) MarshalJSON() ([]byte, error) { + pb, err := sharedDataObjectToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SharedDataObjectDataObjectType string +type sharedDataObjectDataObjectTypePb string const SharedDataObjectDataObjectTypeFeatureSpec SharedDataObjectDataObjectType = `FEATURE_SPEC` @@ -1450,7 +2908,24 @@ func (f *SharedDataObjectDataObjectType) Type() string { return "SharedDataObjectDataObjectType" } +func sharedDataObjectDataObjectTypeToPb(st *SharedDataObjectDataObjectType) (*sharedDataObjectDataObjectTypePb, error) { + if st == nil { + return nil, nil + } + pb := sharedDataObjectDataObjectTypePb(*st) + return &pb, nil +} + +func sharedDataObjectDataObjectTypeFromPb(pb *sharedDataObjectDataObjectTypePb) (*SharedDataObjectDataObjectType, error) { + if pb == nil { + return nil, nil + } + st := SharedDataObjectDataObjectType(*pb) + return &st, nil +} + type SharedDataObjectHistoryDataSharingStatus string +type sharedDataObjectHistoryDataSharingStatusPb string const SharedDataObjectHistoryDataSharingStatusDisabled SharedDataObjectHistoryDataSharingStatus = `DISABLED` @@ -1477,7 +2952,24 @@ func (f *SharedDataObjectHistoryDataSharingStatus) Type() string { return "SharedDataObjectHistoryDataSharingStatus" } +func sharedDataObjectHistoryDataSharingStatusToPb(st *SharedDataObjectHistoryDataSharingStatus) (*sharedDataObjectHistoryDataSharingStatusPb, error) { + if st == nil { + return nil, nil + } + pb := sharedDataObjectHistoryDataSharingStatusPb(*st) + return &pb, nil +} + +func sharedDataObjectHistoryDataSharingStatusFromPb(pb *sharedDataObjectHistoryDataSharingStatusPb) (*SharedDataObjectHistoryDataSharingStatus, error) { + if pb == nil { + return nil, nil + } + st := SharedDataObjectHistoryDataSharingStatus(*pb) + return &st, nil +} + type SharedDataObjectStatus string +type sharedDataObjectStatusPb string const SharedDataObjectStatusActive SharedDataObjectStatus = `ACTIVE` @@ -1504,14 +2996,58 @@ func (f *SharedDataObjectStatus) Type() string { return "SharedDataObjectStatus" } +func sharedDataObjectStatusToPb(st *SharedDataObjectStatus) (*sharedDataObjectStatusPb, error) { + if st == nil { + return nil, nil + } + pb := sharedDataObjectStatusPb(*st) + return &pb, nil +} + +func sharedDataObjectStatusFromPb(pb *sharedDataObjectStatusPb) (*SharedDataObjectStatus, error) { + if pb == nil { + return nil, nil + } + st := SharedDataObjectStatus(*pb) + return &st, nil +} + type SharedDataObjectUpdate struct { // One of: **ADD**, **REMOVE**, **UPDATE**. - Action SharedDataObjectUpdateAction `json:"action,omitempty"` + // Wire name: 'action' + Action SharedDataObjectUpdateAction // The data object that is being added, removed, or updated. - DataObject *SharedDataObject `json:"data_object,omitempty"` + // Wire name: 'data_object' + DataObject *SharedDataObject +} + +func (st *SharedDataObjectUpdate) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sharedDataObjectUpdatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sharedDataObjectUpdateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SharedDataObjectUpdate) MarshalJSON() ([]byte, error) { + pb, err := sharedDataObjectUpdateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SharedDataObjectUpdateAction string +type sharedDataObjectUpdateActionPb string const SharedDataObjectUpdateActionAdd SharedDataObjectUpdateAction = `ADD` @@ -1540,8 +3076,25 @@ func (f *SharedDataObjectUpdateAction) Type() string { return "SharedDataObjectUpdateAction" } +func sharedDataObjectUpdateActionToPb(st *SharedDataObjectUpdateAction) (*sharedDataObjectUpdateActionPb, error) { + if st == nil { + return nil, nil + } + pb := sharedDataObjectUpdateActionPb(*st) + return &pb, nil +} + +func sharedDataObjectUpdateActionFromPb(pb *sharedDataObjectUpdateActionPb) (*SharedDataObjectUpdateAction, error) { + if pb == nil { + return nil, nil + } + st := SharedDataObjectUpdateAction(*pb) + return &st, nil +} + // The SecurableKind of a delta-shared object. type SharedSecurableKind string +type sharedSecurableKindPb string const SharedSecurableKindFunctionFeatureSpec SharedSecurableKind = `FUNCTION_FEATURE_SPEC` @@ -1570,38 +3123,81 @@ func (f *SharedSecurableKind) Type() string { return "SharedSecurableKind" } +func sharedSecurableKindToPb(st *SharedSecurableKind) (*sharedSecurableKindPb, error) { + if st == nil { + return nil, nil + } + pb := sharedSecurableKindPb(*st) + return &pb, nil +} + +func sharedSecurableKindFromPb(pb *sharedSecurableKindPb) (*SharedSecurableKind, error) { + if pb == nil { + return nil, nil + } + st := SharedSecurableKind(*pb) + return &st, nil +} + type Table struct { // The comment of the table. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The id of the table. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Internal information for D2D sharing that should not be disclosed to // external users. - InternalAttributes *TableInternalAttributes `json:"internal_attributes,omitempty"` + // Wire name: 'internal_attributes' + InternalAttributes *TableInternalAttributes // The catalog and schema of the materialized table - MaterializationNamespace string `json:"materialization_namespace,omitempty"` + // Wire name: 'materialization_namespace' + MaterializationNamespace string // The name of a materialized table. - MaterializedTableName string `json:"materialized_table_name,omitempty"` + // Wire name: 'materialized_table_name' + MaterializedTableName string // The name of the table. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The name of the schema that the table belongs to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // The name of the share that the table belongs to. - Share string `json:"share,omitempty"` + // Wire name: 'share' + Share string // The id of the share that the table belongs to. - ShareId string `json:"share_id,omitempty"` + // Wire name: 'share_id' + ShareId string // The Tags of the table. - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []catalog.TagKeyValue - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Table) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Table) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tablePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Table) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Table) MarshalJSON() ([]byte, error) { + pb, err := tableToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Internal information for D2D sharing that should not be disclosed to external @@ -1615,27 +3211,49 @@ type TableInternalAttributes struct { // on the recipient side to be whitelisted when SEG is enabled on the // workspace of the recipient, to allow the recipient users to query this // shared VIEW/FOREIGN_TABLE. - ParentStorageLocation string `json:"parent_storage_location,omitempty"` + // Wire name: 'parent_storage_location' + ParentStorageLocation string // The cloud storage location of a shard table with DIRECTORY_BASED_TABLE // type. - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // The type of the shared table. - Type TableInternalAttributesSharedTableType `json:"type,omitempty"` + // Wire name: 'type' + Type TableInternalAttributesSharedTableType // The view definition of a shared view. DEPRECATED. - ViewDefinition string `json:"view_definition,omitempty"` + // Wire name: 'view_definition' + ViewDefinition string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TableInternalAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TableInternalAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &tableInternalAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := tableInternalAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TableInternalAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TableInternalAttributes) MarshalJSON() ([]byte, error) { + pb, err := tableInternalAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TableInternalAttributesSharedTableType string +type tableInternalAttributesSharedTableTypePb string const TableInternalAttributesSharedTableTypeDirectoryBasedTable TableInternalAttributesSharedTableType = `DIRECTORY_BASED_TABLE` @@ -1670,185 +3288,435 @@ func (f *TableInternalAttributesSharedTableType) Type() string { return "TableInternalAttributesSharedTableType" } +func tableInternalAttributesSharedTableTypeToPb(st *TableInternalAttributesSharedTableType) (*tableInternalAttributesSharedTableTypePb, error) { + if st == nil { + return nil, nil + } + pb := tableInternalAttributesSharedTableTypePb(*st) + return &pb, nil +} + +func tableInternalAttributesSharedTableTypeFromPb(pb *tableInternalAttributesSharedTableTypePb) (*TableInternalAttributesSharedTableType, error) { + if pb == nil { + return nil, nil + } + st := TableInternalAttributesSharedTableType(*pb) + return &st, nil +} + // Update recipient federation policy type UpdateFederationPolicyRequest struct { // Name of the policy. This is the name of the current name of the policy. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` - Policy FederationPolicy `json:"policy"` + // Wire name: 'policy' + Policy FederationPolicy // Name of the recipient. This is the name of the recipient for which the // policy is being updated. - RecipientName string `json:"-" url:"-"` + // Wire name: 'recipient_name' + RecipientName string `tf:"-"` // The field mask specifies which fields of the policy to update. To specify // multiple fields in the field mask, use comma as the separator (no space). // The special value '*' indicates that all fields should be updated (full // replacement). If unspecified, all fields that are set in the policy // provided in the update request will overwrite the corresponding fields in // the existing policy. Example value: 'comment,oidc_policy.audiences'. - UpdateMask string `json:"-" url:"update_mask,omitempty"` + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateFederationPolicyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateFederationPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateFederationPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateFederationPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateFederationPolicyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateFederationPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := updateFederationPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateProvider struct { // Description about the provider. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Name of the provider. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the provider. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of Provider owner. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // This field is required when the __authentication_type__ is **TOKEN**, // **OAUTH_CLIENT_CREDENTIALS** or not provided. - RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + // Wire name: 'recipient_profile_str' + RecipientProfileStr string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateProvider) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateProvider) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateProviderPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateProviderFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateProvider) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateProvider) MarshalJSON() ([]byte, error) { + pb, err := updateProviderToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateRecipient struct { // Description about the recipient. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime int64 `json:"expiration_time,omitempty"` + // Wire name: 'expiration_time' + ExpirationTime int64 // IP Access List - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + // Wire name: 'ip_access_list' + IpAccessList *IpAccessList // Name of the recipient. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the recipient. . - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of the recipient owner. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Recipient properties as map of string key-value pairs. When provided in // update request, the specified properties will override the existing // properties. To add and remove properties, one would need to perform a // read-modify-write. - PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + // Wire name: 'properties_kvpairs' + PropertiesKvpairs *SecurablePropertiesKvPairs - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateRecipient) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateRecipient) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRecipientPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRecipientFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateRecipient) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateRecipient) MarshalJSON() ([]byte, error) { + pb, err := updateRecipientToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateShare struct { // User-provided free-form text description. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // The name of the share. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // New name for the share. - NewName string `json:"new_name,omitempty"` + // Wire name: 'new_name' + NewName string // Username of current owner of share. - Owner string `json:"owner,omitempty"` + // Wire name: 'owner' + Owner string // Storage root URL for the share. - StorageRoot string `json:"storage_root,omitempty"` + // Wire name: 'storage_root' + StorageRoot string // Array of shared data object updates. - Updates []SharedDataObjectUpdate `json:"updates,omitempty"` + // Wire name: 'updates' + Updates []SharedDataObjectUpdate - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateShare) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateShare) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateSharePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateShareFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateShare) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateShare) MarshalJSON() ([]byte, error) { + pb, err := updateShareToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateSharePermissions struct { // Array of permission changes. - Changes []PermissionsChange `json:"changes,omitempty"` + // Wire name: 'changes' + Changes []PermissionsChange // The name of the share. - Name string `json:"-" url:"-"` + // Wire name: 'name' + Name string `tf:"-"` // Optional. Whether to return the latest permissions list of the share in // the response. - OmitPermissionsList bool `json:"omit_permissions_list,omitempty"` + // Wire name: 'omit_permissions_list' + OmitPermissionsList bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateSharePermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateSharePermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateSharePermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateSharePermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateSharePermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateSharePermissions) MarshalJSON() ([]byte, error) { + pb, err := updateSharePermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateSharePermissionsResponse struct { // The privileges assigned to each principal - PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` + // Wire name: 'privilege_assignments' + PrivilegeAssignments []PrivilegeAssignment +} + +func (st *UpdateSharePermissionsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateSharePermissionsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateSharePermissionsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateSharePermissionsResponse) MarshalJSON() ([]byte, error) { + pb, err := updateSharePermissionsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Volume struct { // The comment of the volume. - Comment string `json:"comment,omitempty"` + // Wire name: 'comment' + Comment string // This id maps to the shared_volume_id in database Recipient needs // shared_volume_id for recon to check if this volume is already in // recipient's DB or not. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Internal attributes for D2D sharing that should not be disclosed to // external users. - InternalAttributes *VolumeInternalAttributes `json:"internal_attributes,omitempty"` + // Wire name: 'internal_attributes' + InternalAttributes *VolumeInternalAttributes // The name of the volume. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The name of the schema that the volume belongs to. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // The name of the share that the volume belongs to. - Share string `json:"share,omitempty"` + // Wire name: 'share' + Share string // / The id of the share that the volume belongs to. - ShareId string `json:"share_id,omitempty"` + // Wire name: 'share_id' + ShareId string // The tags of the volume. - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []catalog.TagKeyValue - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Volume) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Volume) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &volumePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := volumeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Volume) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Volume) MarshalJSON() ([]byte, error) { + pb, err := volumeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Internal information for D2D sharing that should not be disclosed to external // users. type VolumeInternalAttributes struct { // The cloud storage location of the volume - StorageLocation string `json:"storage_location,omitempty"` + // Wire name: 'storage_location' + StorageLocation string // The type of the shared volume. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string + + ForceSendFields []string `tf:"-"` +} + +func (st *VolumeInternalAttributes) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &volumeInternalAttributesPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := volumeInternalAttributesFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st VolumeInternalAttributes) MarshalJSON() ([]byte, error) { + pb, err := volumeInternalAttributesToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} - ForceSendFields []string `json:"-" url:"-"` +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil } -func (s *VolumeInternalAttributes) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil } -func (s VolumeInternalAttributes) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/sql/impl.go b/service/sql/impl.go index 23aa103b3..3b4f217a3 100755 --- a/service/sql/impl.go +++ b/service/sql/impl.go @@ -18,34 +18,96 @@ type alertsImpl struct { } func (a *alertsImpl) Create(ctx context.Context, request CreateAlertRequest) (*Alert, error) { - var alert Alert + + requestPb, pbErr := createAlertRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertPb alertPb path := "/api/2.0/sql/alerts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &alert) - return &alert, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &alertPb, + ) + if err != nil { + return nil, err + } + resp, err := alertFromPb(&alertPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsImpl) Delete(ctx context.Context, request TrashAlertRequest) error { - var empty Empty - path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + + requestPb, pbErr := trashAlertRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var emptyPb emptyPb + path := fmt.Sprintf("/api/2.0/sql/alerts/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &emptyPb, + ) + if err != nil { + return err + } + return err } func (a *alertsImpl) Get(ctx context.Context, request GetAlertRequest) (*Alert, error) { - var alert Alert - path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + + requestPb, pbErr := getAlertRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertPb alertPb + path := fmt.Sprintf("/api/2.0/sql/alerts/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &alert) - return &alert, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &alertPb, + ) + if err != nil { + return nil, err + } + resp, err := alertFromPb(&alertPb) + if err != nil { + return nil, err + } + + return resp, err } // List alerts. @@ -88,24 +150,68 @@ func (a *alertsImpl) ListAll(ctx context.Context, request ListAlertsRequest) ([] } func (a *alertsImpl) internalList(ctx context.Context, request ListAlertsRequest) (*ListAlertsResponse, error) { - var listAlertsResponse ListAlertsResponse + + requestPb, pbErr := listAlertsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAlertsResponsePb listAlertsResponsePb path := "/api/2.0/sql/alerts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAlertsResponse) - return &listAlertsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAlertsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAlertsResponseFromPb(&listAlertsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsImpl) Update(ctx context.Context, request UpdateAlertRequest) (*Alert, error) { - var alert Alert - path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + + requestPb, pbErr := updateAlertRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertPb alertPb + path := fmt.Sprintf("/api/2.0/sql/alerts/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &alert) - return &alert, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &alertPb, + ) + if err != nil { + return nil, err + } + resp, err := alertFromPb(&alertPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just AlertsLegacy API methods @@ -114,54 +220,155 @@ type alertsLegacyImpl struct { } func (a *alertsLegacyImpl) Create(ctx context.Context, request CreateAlert) (*LegacyAlert, error) { - var legacyAlert LegacyAlert + + requestPb, pbErr := createAlertToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyAlertPb legacyAlertPb path := "/api/2.0/preview/sql/alerts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyAlert) - return &legacyAlert, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &legacyAlertPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyAlertFromPb(&legacyAlertPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsLegacyImpl) Delete(ctx context.Context, request DeleteAlertsLegacyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + + requestPb, pbErr := deleteAlertsLegacyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", requestPb.AlertId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *alertsLegacyImpl) Get(ctx context.Context, request GetAlertsLegacyRequest) (*LegacyAlert, error) { - var legacyAlert LegacyAlert - path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + + requestPb, pbErr := getAlertsLegacyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyAlertPb legacyAlertPb + path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", requestPb.AlertId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &legacyAlert) - return &legacyAlert, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &legacyAlertPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyAlertFromPb(&legacyAlertPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsLegacyImpl) List(ctx context.Context) ([]LegacyAlert, error) { - var legacyAlertList []LegacyAlert + + var legacyAlertListPb []legacyAlertPb path := "/api/2.0/preview/sql/alerts" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &legacyAlertList) - return legacyAlertList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &legacyAlertListPb, + ) + if err != nil { + return nil, err + } + var resp []LegacyAlert + for _, item := range legacyAlertListPb { + itemResp, err := legacyAlertFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } func (a *alertsLegacyImpl) Update(ctx context.Context, request EditAlert) error { - var updateResponse UpdateResponse - path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + + requestPb, pbErr := editAlertToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateResponsePb updateResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", requestPb.AlertId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &updateResponsePb, + ) + if err != nil { + return err + } + return err } @@ -171,24 +378,68 @@ type alertsV2Impl struct { } func (a *alertsV2Impl) CreateAlert(ctx context.Context, request CreateAlertV2Request) (*AlertV2, error) { - var alertV2 AlertV2 + + requestPb, pbErr := createAlertV2RequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertV2Pb alertV2Pb path := "/api/2.0/alerts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Alert, &alertV2) - return &alertV2, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb).Alert, + &alertV2Pb, + ) + if err != nil { + return nil, err + } + resp, err := alertV2FromPb(&alertV2Pb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsV2Impl) GetAlert(ctx context.Context, request GetAlertV2Request) (*AlertV2, error) { - var alertV2 AlertV2 - path := fmt.Sprintf("/api/2.0/alerts/%v", request.Id) + + requestPb, pbErr := getAlertV2RequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertV2Pb alertV2Pb + path := fmt.Sprintf("/api/2.0/alerts/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &alertV2) - return &alertV2, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &alertV2Pb, + ) + if err != nil { + return nil, err + } + resp, err := alertV2FromPb(&alertV2Pb) + if err != nil { + return nil, err + } + + return resp, err } // List alerts. @@ -227,37 +478,99 @@ func (a *alertsV2Impl) ListAlertsAll(ctx context.Context, request ListAlertsV2Re } func (a *alertsV2Impl) internalListAlerts(ctx context.Context, request ListAlertsV2Request) (*ListAlertsV2Response, error) { - var listAlertsV2Response ListAlertsV2Response + + requestPb, pbErr := listAlertsV2RequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAlertsV2ResponsePb listAlertsV2ResponsePb path := "/api/2.0/alerts" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAlertsV2Response) - return &listAlertsV2Response, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAlertsV2ResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAlertsV2ResponseFromPb(&listAlertsV2ResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *alertsV2Impl) TrashAlert(ctx context.Context, request TrashAlertV2Request) error { - var empty Empty - path := fmt.Sprintf("/api/2.0/alerts/%v", request.Id) + + requestPb, pbErr := trashAlertV2RequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var emptyPb emptyPb + path := fmt.Sprintf("/api/2.0/alerts/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &emptyPb, + ) + if err != nil { + return err + } + return err } func (a *alertsV2Impl) UpdateAlert(ctx context.Context, request UpdateAlertV2Request) (*AlertV2, error) { - var alertV2 AlertV2 - path := fmt.Sprintf("/api/2.0/alerts/%v", request.Id) + + requestPb, pbErr := updateAlertV2RequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var alertV2Pb alertV2Pb + path := fmt.Sprintf("/api/2.0/alerts/%v", requestPb.Id) queryParams := make(map[string]any) - if request.UpdateMask != "" { - queryParams["update_mask"] = request.UpdateMask + if requestPb.UpdateMask != "" { + queryParams["update_mask"] = requestPb.UpdateMask } headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Alert, &alertV2) - return &alertV2, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb).Alert, + &alertV2Pb, + ) + if err != nil { + return nil, err + } + resp, err := alertV2FromPb(&alertV2Pb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DashboardWidgets API methods @@ -266,35 +579,97 @@ type dashboardWidgetsImpl struct { } func (a *dashboardWidgetsImpl) Create(ctx context.Context, request CreateWidget) (*Widget, error) { - var widget Widget + + requestPb, pbErr := createWidgetToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var widgetPb widgetPb path := "/api/2.0/preview/sql/widgets" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &widget) - return &widget, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &widgetPb, + ) + if err != nil { + return nil, err + } + resp, err := widgetFromPb(&widgetPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dashboardWidgetsImpl) Delete(ctx context.Context, request DeleteDashboardWidgetRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) + + requestPb, pbErr := deleteDashboardWidgetRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dashboardWidgetsImpl) Update(ctx context.Context, request CreateWidget) (*Widget, error) { - var widget Widget - path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) + + requestPb, pbErr := createWidgetToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var widgetPb widgetPb + path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &widget) - return &widget, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &widgetPb, + ) + if err != nil { + return nil, err + } + resp, err := widgetFromPb(&widgetPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Dashboards API methods @@ -303,34 +678,96 @@ type dashboardsImpl struct { } func (a *dashboardsImpl) Create(ctx context.Context, request DashboardPostContent) (*Dashboard, error) { - var dashboard Dashboard + + requestPb, pbErr := dashboardPostContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb path := "/api/2.0/preview/sql/dashboards" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dashboardsImpl) Delete(ctx context.Context, request DeleteDashboardRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + + requestPb, pbErr := deleteDashboardRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dashboardsImpl) Get(ctx context.Context, request GetDashboardRequest) (*Dashboard, error) { - var dashboard Dashboard - path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + + requestPb, pbErr := getDashboardRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb + path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, err } // Get dashboard objects. @@ -383,34 +820,96 @@ func (a *dashboardsImpl) ListAll(ctx context.Context, request ListDashboardsRequ } func (a *dashboardsImpl) internalList(ctx context.Context, request ListDashboardsRequest) (*ListResponse, error) { - var listResponse ListResponse + + requestPb, pbErr := listDashboardsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listResponsePb listResponsePb path := "/api/2.0/preview/sql/dashboards" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listResponse) - return &listResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listResponseFromPb(&listResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dashboardsImpl) Restore(ctx context.Context, request RestoreDashboardRequest) error { - var restoreResponse RestoreResponse - path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/trash/%v", request.DashboardId) + + requestPb, pbErr := restoreDashboardRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var restoreResponsePb restoreResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/trash/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &restoreResponsePb, + ) + if err != nil { + return err + } + return err } func (a *dashboardsImpl) Update(ctx context.Context, request DashboardEditContent) (*Dashboard, error) { - var dashboard Dashboard - path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + + requestPb, pbErr := dashboardEditContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var dashboardPb dashboardPb + path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", requestPb.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) - return &dashboard, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &dashboardPb, + ) + if err != nil { + return nil, err + } + resp, err := dashboardFromPb(&dashboardPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just DataSources API methods @@ -419,13 +918,34 @@ type dataSourcesImpl struct { } func (a *dataSourcesImpl) List(ctx context.Context) ([]DataSource, error) { - var dataSourceList []DataSource + + var dataSourceListPb []dataSourcePb path := "/api/2.0/preview/sql/data_sources" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &dataSourceList) - return dataSourceList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &dataSourceListPb, + ) + if err != nil { + return nil, err + } + var resp []DataSource + for _, item := range dataSourceListPb { + itemResp, err := dataSourceFromPb(&item) + if err != nil { + return nil, err + } + resp = append(resp, *itemResp) + } + + return resp, err } // unexported type that holds implementations of just DbsqlPermissions API methods @@ -434,35 +954,101 @@ type dbsqlPermissionsImpl struct { } func (a *dbsqlPermissionsImpl) Get(ctx context.Context, request GetDbsqlPermissionRequest) (*GetResponse, error) { - var getResponse GetResponse - path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", request.ObjectType, request.ObjectId) + + requestPb, pbErr := getDbsqlPermissionRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getResponsePb getResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", requestPb.ObjectType, requestPb.ObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getResponse) - return &getResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getResponseFromPb(&getResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dbsqlPermissionsImpl) Set(ctx context.Context, request SetRequest) (*SetResponse, error) { - var setResponse SetResponse - path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", request.ObjectType, request.ObjectId) + + requestPb, pbErr := setRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var setResponsePb setResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", requestPb.ObjectType, requestPb.ObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setResponse) - return &setResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &setResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := setResponseFromPb(&setResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *dbsqlPermissionsImpl) TransferOwnership(ctx context.Context, request TransferOwnershipRequest) (*Success, error) { - var success Success - path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v/transfer", request.ObjectType, request.ObjectId) + + requestPb, pbErr := transferOwnershipRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var successPb successPb + path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v/transfer", requestPb.ObjectType, requestPb.ObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &success) - return &success, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &successPb, + ) + if err != nil { + return nil, err + } + resp, err := successFromPb(&successPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Queries API methods @@ -471,34 +1057,96 @@ type queriesImpl struct { } func (a *queriesImpl) Create(ctx context.Context, request CreateQueryRequest) (*Query, error) { - var query Query + + requestPb, pbErr := createQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryPb queryPb path := "/api/2.0/sql/queries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &query) - return &query, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &queryPb, + ) + if err != nil { + return nil, err + } + resp, err := queryFromPb(&queryPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queriesImpl) Delete(ctx context.Context, request TrashQueryRequest) error { - var empty Empty - path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + + requestPb, pbErr := trashQueryRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var emptyPb emptyPb + path := fmt.Sprintf("/api/2.0/sql/queries/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &emptyPb, + ) + if err != nil { + return err + } + return err } func (a *queriesImpl) Get(ctx context.Context, request GetQueryRequest) (*Query, error) { - var query Query - path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + + requestPb, pbErr := getQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryPb queryPb + path := fmt.Sprintf("/api/2.0/sql/queries/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &query) - return &query, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &queryPb, + ) + if err != nil { + return nil, err + } + resp, err := queryFromPb(&queryPb) + if err != nil { + return nil, err + } + + return resp, err } // List queries. @@ -541,13 +1189,35 @@ func (a *queriesImpl) ListAll(ctx context.Context, request ListQueriesRequest) ( } func (a *queriesImpl) internalList(ctx context.Context, request ListQueriesRequest) (*ListQueryObjectsResponse, error) { - var listQueryObjectsResponse ListQueryObjectsResponse + + requestPb, pbErr := listQueriesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listQueryObjectsResponsePb listQueryObjectsResponsePb path := "/api/2.0/sql/queries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQueryObjectsResponse) - return &listQueryObjectsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listQueryObjectsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listQueryObjectsResponseFromPb(&listQueryObjectsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List visualizations on a query. @@ -586,24 +1256,68 @@ func (a *queriesImpl) ListVisualizationsAll(ctx context.Context, request ListVis } func (a *queriesImpl) internalListVisualizations(ctx context.Context, request ListVisualizationsForQueryRequest) (*ListVisualizationsForQueryResponse, error) { - var listVisualizationsForQueryResponse ListVisualizationsForQueryResponse - path := fmt.Sprintf("/api/2.0/sql/queries/%v/visualizations", request.Id) + + requestPb, pbErr := listVisualizationsForQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listVisualizationsForQueryResponsePb listVisualizationsForQueryResponsePb + path := fmt.Sprintf("/api/2.0/sql/queries/%v/visualizations", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVisualizationsForQueryResponse) - return &listVisualizationsForQueryResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listVisualizationsForQueryResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listVisualizationsForQueryResponseFromPb(&listVisualizationsForQueryResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queriesImpl) Update(ctx context.Context, request UpdateQueryRequest) (*Query, error) { - var query Query - path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + + requestPb, pbErr := updateQueryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryPb queryPb + path := fmt.Sprintf("/api/2.0/sql/queries/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &query) - return &query, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &queryPb, + ) + if err != nil { + return nil, err + } + resp, err := queryFromPb(&queryPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QueriesLegacy API methods @@ -612,34 +1326,96 @@ type queriesLegacyImpl struct { } func (a *queriesLegacyImpl) Create(ctx context.Context, request QueryPostContent) (*LegacyQuery, error) { - var legacyQuery LegacyQuery + + requestPb, pbErr := queryPostContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyQueryPb legacyQueryPb path := "/api/2.0/preview/sql/queries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyQuery) - return &legacyQuery, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &legacyQueryPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyQueryFromPb(&legacyQueryPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queriesLegacyImpl) Delete(ctx context.Context, request DeleteQueriesLegacyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + + requestPb, pbErr := deleteQueriesLegacyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", requestPb.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *queriesLegacyImpl) Get(ctx context.Context, request GetQueriesLegacyRequest) (*LegacyQuery, error) { - var legacyQuery LegacyQuery - path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + + requestPb, pbErr := getQueriesLegacyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyQueryPb legacyQueryPb + path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", requestPb.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &legacyQuery) - return &legacyQuery, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &legacyQueryPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyQueryFromPb(&legacyQueryPb) + if err != nil { + return nil, err + } + + return resp, err } // Get a list of queries. @@ -704,34 +1480,96 @@ func (a *queriesLegacyImpl) ListAll(ctx context.Context, request ListQueriesLega } func (a *queriesLegacyImpl) internalList(ctx context.Context, request ListQueriesLegacyRequest) (*QueryList, error) { - var queryList QueryList + + requestPb, pbErr := listQueriesLegacyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryListPb queryListPb path := "/api/2.0/preview/sql/queries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &queryList) - return &queryList, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &queryListPb, + ) + if err != nil { + return nil, err + } + resp, err := queryListFromPb(&queryListPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queriesLegacyImpl) Restore(ctx context.Context, request RestoreQueriesLegacyRequest) error { - var restoreResponse RestoreResponse - path := fmt.Sprintf("/api/2.0/preview/sql/queries/trash/%v", request.QueryId) + + requestPb, pbErr := restoreQueriesLegacyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var restoreResponsePb restoreResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/queries/trash/%v", requestPb.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &restoreResponsePb, + ) + if err != nil { + return err + } + return err } func (a *queriesLegacyImpl) Update(ctx context.Context, request QueryEditContent) (*LegacyQuery, error) { - var legacyQuery LegacyQuery - path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + + requestPb, pbErr := queryEditContentToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyQueryPb legacyQueryPb + path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", requestPb.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyQuery) - return &legacyQuery, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &legacyQueryPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyQueryFromPb(&legacyQueryPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QueryHistory API methods @@ -740,13 +1578,35 @@ type queryHistoryImpl struct { } func (a *queryHistoryImpl) List(ctx context.Context, request ListQueryHistoryRequest) (*ListQueriesResponse, error) { - var listQueriesResponse ListQueriesResponse + + requestPb, pbErr := listQueryHistoryRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listQueriesResponsePb listQueriesResponsePb path := "/api/2.0/sql/history/queries" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQueriesResponse) - return &listQueriesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listQueriesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listQueriesResponseFromPb(&listQueriesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QueryVisualizations API methods @@ -755,35 +1615,97 @@ type queryVisualizationsImpl struct { } func (a *queryVisualizationsImpl) Create(ctx context.Context, request CreateVisualizationRequest) (*Visualization, error) { - var visualization Visualization + + requestPb, pbErr := createVisualizationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var visualizationPb visualizationPb path := "/api/2.0/sql/visualizations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &visualization) - return &visualization, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &visualizationPb, + ) + if err != nil { + return nil, err + } + resp, err := visualizationFromPb(&visualizationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queryVisualizationsImpl) Delete(ctx context.Context, request DeleteVisualizationRequest) error { - var empty Empty - path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", request.Id) + + requestPb, pbErr := deleteVisualizationRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var emptyPb emptyPb + path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &emptyPb, + ) + if err != nil { + return err + } + return err } func (a *queryVisualizationsImpl) Update(ctx context.Context, request UpdateVisualizationRequest) (*Visualization, error) { - var visualization Visualization - path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", request.Id) + + requestPb, pbErr := updateVisualizationRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var visualizationPb visualizationPb + path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &visualization) - return &visualization, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &visualizationPb, + ) + if err != nil { + return nil, err + } + resp, err := visualizationFromPb(&visualizationPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just QueryVisualizationsLegacy API methods @@ -792,35 +1714,97 @@ type queryVisualizationsLegacyImpl struct { } func (a *queryVisualizationsLegacyImpl) Create(ctx context.Context, request CreateQueryVisualizationsLegacyRequest) (*LegacyVisualization, error) { - var legacyVisualization LegacyVisualization + + requestPb, pbErr := createQueryVisualizationsLegacyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyVisualizationPb legacyVisualizationPb path := "/api/2.0/preview/sql/visualizations" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyVisualization) - return &legacyVisualization, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &legacyVisualizationPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyVisualizationFromPb(&legacyVisualizationPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *queryVisualizationsLegacyImpl) Delete(ctx context.Context, request DeleteQueryVisualizationsLegacyRequest) error { - var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", request.Id) + + requestPb, pbErr := deleteQueryVisualizationsLegacyRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb + path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *queryVisualizationsLegacyImpl) Update(ctx context.Context, request LegacyVisualization) (*LegacyVisualization, error) { - var legacyVisualization LegacyVisualization - path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", request.Id) + + requestPb, pbErr := legacyVisualizationToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var legacyVisualizationPb legacyVisualizationPb + path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyVisualization) - return &legacyVisualization, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &legacyVisualizationPb, + ) + if err != nil { + return nil, err + } + resp, err := legacyVisualizationFromPb(&legacyVisualizationPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just RedashConfig API methods @@ -829,13 +1813,30 @@ type redashConfigImpl struct { } func (a *redashConfigImpl) GetConfig(ctx context.Context) (*ClientConfig, error) { - var clientConfig ClientConfig + + var clientConfigPb clientConfigPb path := "/api/2.0/redash-v2/config" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &clientConfig) - return &clientConfig, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &clientConfigPb, + ) + if err != nil { + return nil, err + } + resp, err := clientConfigFromPb(&clientConfigPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just StatementExecution API methods @@ -844,43 +1845,127 @@ type statementExecutionImpl struct { } func (a *statementExecutionImpl) CancelExecution(ctx context.Context, request CancelExecutionRequest) error { - var cancelExecutionResponse CancelExecutionResponse - path := fmt.Sprintf("/api/2.0/sql/statements/%v/cancel", request.StatementId) + + requestPb, pbErr := cancelExecutionRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var cancelExecutionResponsePb cancelExecutionResponsePb + path := fmt.Sprintf("/api/2.0/sql/statements/%v/cancel", requestPb.StatementId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelExecutionResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &cancelExecutionResponsePb, + ) + if err != nil { + return err + } + return err } func (a *statementExecutionImpl) ExecuteStatement(ctx context.Context, request ExecuteStatementRequest) (*StatementResponse, error) { - var statementResponse StatementResponse + + requestPb, pbErr := executeStatementRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var statementResponsePb statementResponsePb path := "/api/2.0/sql/statements/" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &statementResponse) - return &statementResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &statementResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := statementResponseFromPb(&statementResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *statementExecutionImpl) GetStatement(ctx context.Context, request GetStatementRequest) (*StatementResponse, error) { - var statementResponse StatementResponse - path := fmt.Sprintf("/api/2.0/sql/statements/%v", request.StatementId) + + requestPb, pbErr := getStatementRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var statementResponsePb statementResponsePb + path := fmt.Sprintf("/api/2.0/sql/statements/%v", requestPb.StatementId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &statementResponse) - return &statementResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &statementResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := statementResponseFromPb(&statementResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *statementExecutionImpl) GetStatementResultChunkN(ctx context.Context, request GetStatementResultChunkNRequest) (*ResultData, error) { - var resultData ResultData - path := fmt.Sprintf("/api/2.0/sql/statements/%v/result/chunks/%v", request.StatementId, request.ChunkIndex) + + requestPb, pbErr := getStatementResultChunkNRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var resultDataPb resultDataPb + path := fmt.Sprintf("/api/2.0/sql/statements/%v/result/chunks/%v", requestPb.StatementId, requestPb.ChunkIndex) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &resultData) - return &resultData, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &resultDataPb, + ) + if err != nil { + return nil, err + } + resp, err := resultDataFromPb(&resultDataPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Warehouses API methods @@ -889,75 +1974,216 @@ type warehousesImpl struct { } func (a *warehousesImpl) Create(ctx context.Context, request CreateWarehouseRequest) (*CreateWarehouseResponse, error) { - var createWarehouseResponse CreateWarehouseResponse + + requestPb, pbErr := createWarehouseRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createWarehouseResponsePb createWarehouseResponsePb path := "/api/2.0/sql/warehouses" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createWarehouseResponse) - return &createWarehouseResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createWarehouseResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createWarehouseResponseFromPb(&createWarehouseResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) Delete(ctx context.Context, request DeleteWarehouseRequest) error { - var deleteWarehouseResponse DeleteWarehouseResponse - path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", request.Id) + + requestPb, pbErr := deleteWarehouseRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteWarehouseResponsePb deleteWarehouseResponsePb + path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWarehouseResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteWarehouseResponsePb, + ) + if err != nil { + return err + } + return err } func (a *warehousesImpl) Edit(ctx context.Context, request EditWarehouseRequest) error { - var editWarehouseResponse EditWarehouseResponse - path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/edit", request.Id) + + requestPb, pbErr := editWarehouseRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var editWarehouseResponsePb editWarehouseResponsePb + path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/edit", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editWarehouseResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &editWarehouseResponsePb, + ) + if err != nil { + return err + } + return err } func (a *warehousesImpl) Get(ctx context.Context, request GetWarehouseRequest) (*GetWarehouseResponse, error) { - var getWarehouseResponse GetWarehouseResponse - path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", request.Id) + + requestPb, pbErr := getWarehouseRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getWarehouseResponsePb getWarehouseResponsePb + path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWarehouseResponse) - return &getWarehouseResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getWarehouseResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getWarehouseResponseFromPb(&getWarehouseResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) GetPermissionLevels(ctx context.Context, request GetWarehousePermissionLevelsRequest) (*GetWarehousePermissionLevelsResponse, error) { - var getWarehousePermissionLevelsResponse GetWarehousePermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v/permissionLevels", request.WarehouseId) + + requestPb, pbErr := getWarehousePermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getWarehousePermissionLevelsResponsePb getWarehousePermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v/permissionLevels", requestPb.WarehouseId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWarehousePermissionLevelsResponse) - return &getWarehousePermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getWarehousePermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getWarehousePermissionLevelsResponseFromPb(&getWarehousePermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) GetPermissions(ctx context.Context, request GetWarehousePermissionsRequest) (*WarehousePermissions, error) { - var warehousePermissions WarehousePermissions - path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + + requestPb, pbErr := getWarehousePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var warehousePermissionsPb warehousePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", requestPb.WarehouseId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &warehousePermissions) - return &warehousePermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &warehousePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := warehousePermissionsFromPb(&warehousePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) GetWorkspaceWarehouseConfig(ctx context.Context) (*GetWorkspaceWarehouseConfigResponse, error) { - var getWorkspaceWarehouseConfigResponse GetWorkspaceWarehouseConfigResponse + + var getWorkspaceWarehouseConfigResponsePb getWorkspaceWarehouseConfigResponsePb path := "/api/2.0/sql/config/warehouses" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getWorkspaceWarehouseConfigResponse) - return &getWorkspaceWarehouseConfigResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &getWorkspaceWarehouseConfigResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getWorkspaceWarehouseConfigResponseFromPb(&getWorkspaceWarehouseConfigResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List warehouses. @@ -990,64 +2216,184 @@ func (a *warehousesImpl) ListAll(ctx context.Context, request ListWarehousesRequ } func (a *warehousesImpl) internalList(ctx context.Context, request ListWarehousesRequest) (*ListWarehousesResponse, error) { - var listWarehousesResponse ListWarehousesResponse + + requestPb, pbErr := listWarehousesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listWarehousesResponsePb listWarehousesResponsePb path := "/api/2.0/sql/warehouses" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listWarehousesResponse) - return &listWarehousesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listWarehousesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listWarehousesResponseFromPb(&listWarehousesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) SetPermissions(ctx context.Context, request WarehousePermissionsRequest) (*WarehousePermissions, error) { - var warehousePermissions WarehousePermissions - path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + + requestPb, pbErr := warehousePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var warehousePermissionsPb warehousePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", requestPb.WarehouseId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &warehousePermissions) - return &warehousePermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &warehousePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := warehousePermissionsFromPb(&warehousePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *warehousesImpl) SetWorkspaceWarehouseConfig(ctx context.Context, request SetWorkspaceWarehouseConfigRequest) error { - var setWorkspaceWarehouseConfigResponse SetWorkspaceWarehouseConfigResponse + + requestPb, pbErr := setWorkspaceWarehouseConfigRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var setWorkspaceWarehouseConfigResponsePb setWorkspaceWarehouseConfigResponsePb path := "/api/2.0/sql/config/warehouses" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &setWorkspaceWarehouseConfigResponse) + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &setWorkspaceWarehouseConfigResponsePb, + ) + if err != nil { + return err + } + return err } func (a *warehousesImpl) Start(ctx context.Context, request StartRequest) error { - var startWarehouseResponse StartWarehouseResponse - path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/start", request.Id) + + requestPb, pbErr := startRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var startWarehouseResponsePb startWarehouseResponsePb + path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/start", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &startWarehouseResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &startWarehouseResponsePb, + ) + if err != nil { + return err + } + return err } func (a *warehousesImpl) Stop(ctx context.Context, request StopRequest) error { - var stopWarehouseResponse StopWarehouseResponse - path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/stop", request.Id) + + requestPb, pbErr := stopRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var stopWarehouseResponsePb stopWarehouseResponsePb + path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/stop", requestPb.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopWarehouseResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &stopWarehouseResponsePb, + ) + if err != nil { + return err + } + return err } func (a *warehousesImpl) UpdatePermissions(ctx context.Context, request WarehousePermissionsRequest) (*WarehousePermissions, error) { - var warehousePermissions WarehousePermissions - path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + + requestPb, pbErr := warehousePermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var warehousePermissionsPb warehousePermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", requestPb.WarehouseId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &warehousePermissions) - return &warehousePermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &warehousePermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := warehousePermissionsFromPb(&warehousePermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/sql/internal.go b/service/sql/internal.go new file mode 100755 index 000000000..a171f6589 --- /dev/null +++ b/service/sql/internal.go @@ -0,0 +1,8120 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package sql + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func accessControlToPb(st *AccessControl) (*accessControlPb, error) { + if st == nil { + return nil, nil + } + pb := &accessControlPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type accessControlPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func accessControlFromPb(pb *accessControlPb) (*AccessControl, error) { + if pb == nil { + return nil, nil + } + st := &AccessControl{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *accessControlPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st accessControlPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertToPb(st *Alert) (*alertPb, error) { + if st == nil { + return nil, nil + } + pb := &alertPb{} + pb.Condition = st.Condition + + pb.CreateTime = st.CreateTime + + pb.CustomBody = st.CustomBody + + pb.CustomSubject = st.CustomSubject + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.LifecycleState = st.LifecycleState + + pb.NotifyOnOk = st.NotifyOnOk + + pb.OwnerUserName = st.OwnerUserName + + pb.ParentPath = st.ParentPath + + pb.QueryId = st.QueryId + + pb.SecondsToRetrigger = st.SecondsToRetrigger + + pb.State = st.State + + pb.TriggerTime = st.TriggerTime + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertPb struct { + Condition *AlertCondition `json:"condition,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + CustomBody string `json:"custom_body,omitempty"` + + CustomSubject string `json:"custom_subject,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + + State AlertState `json:"state,omitempty"` + + TriggerTime string `json:"trigger_time,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertFromPb(pb *alertPb) (*Alert, error) { + if pb == nil { + return nil, nil + } + st := &Alert{} + st.Condition = pb.Condition + st.CreateTime = pb.CreateTime + st.CustomBody = pb.CustomBody + st.CustomSubject = pb.CustomSubject + st.DisplayName = pb.DisplayName + st.Id = pb.Id + st.LifecycleState = pb.LifecycleState + st.NotifyOnOk = pb.NotifyOnOk + st.OwnerUserName = pb.OwnerUserName + st.ParentPath = pb.ParentPath + st.QueryId = pb.QueryId + st.SecondsToRetrigger = pb.SecondsToRetrigger + st.State = pb.State + st.TriggerTime = pb.TriggerTime + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertConditionToPb(st *AlertCondition) (*alertConditionPb, error) { + if st == nil { + return nil, nil + } + pb := &alertConditionPb{} + pb.EmptyResultState = st.EmptyResultState + + pb.Op = st.Op + + pb.Operand = st.Operand + + pb.Threshold = st.Threshold + + return pb, nil +} + +type alertConditionPb struct { + EmptyResultState AlertState `json:"empty_result_state,omitempty"` + + Op AlertOperator `json:"op,omitempty"` + + Operand *AlertConditionOperand `json:"operand,omitempty"` + + Threshold *AlertConditionThreshold `json:"threshold,omitempty"` +} + +func alertConditionFromPb(pb *alertConditionPb) (*AlertCondition, error) { + if pb == nil { + return nil, nil + } + st := &AlertCondition{} + st.EmptyResultState = pb.EmptyResultState + st.Op = pb.Op + st.Operand = pb.Operand + st.Threshold = pb.Threshold + + return st, nil +} + +func alertConditionOperandToPb(st *AlertConditionOperand) (*alertConditionOperandPb, error) { + if st == nil { + return nil, nil + } + pb := &alertConditionOperandPb{} + pb.Column = st.Column + + return pb, nil +} + +type alertConditionOperandPb struct { + Column *AlertOperandColumn `json:"column,omitempty"` +} + +func alertConditionOperandFromPb(pb *alertConditionOperandPb) (*AlertConditionOperand, error) { + if pb == nil { + return nil, nil + } + st := &AlertConditionOperand{} + st.Column = pb.Column + + return st, nil +} + +func alertConditionThresholdToPb(st *AlertConditionThreshold) (*alertConditionThresholdPb, error) { + if st == nil { + return nil, nil + } + pb := &alertConditionThresholdPb{} + pb.Value = st.Value + + return pb, nil +} + +type alertConditionThresholdPb struct { + Value *AlertOperandValue `json:"value,omitempty"` +} + +func alertConditionThresholdFromPb(pb *alertConditionThresholdPb) (*AlertConditionThreshold, error) { + if pb == nil { + return nil, nil + } + st := &AlertConditionThreshold{} + st.Value = pb.Value + + return st, nil +} + +func alertOperandColumnToPb(st *AlertOperandColumn) (*alertOperandColumnPb, error) { + if st == nil { + return nil, nil + } + pb := &alertOperandColumnPb{} + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertOperandColumnPb struct { + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertOperandColumnFromPb(pb *alertOperandColumnPb) (*AlertOperandColumn, error) { + if pb == nil { + return nil, nil + } + st := &AlertOperandColumn{} + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertOperandColumnPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertOperandColumnPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertOperandValueToPb(st *AlertOperandValue) (*alertOperandValuePb, error) { + if st == nil { + return nil, nil + } + pb := &alertOperandValuePb{} + pb.BoolValue = st.BoolValue + + pb.DoubleValue = st.DoubleValue + + pb.StringValue = st.StringValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertOperandValuePb struct { + BoolValue bool `json:"bool_value,omitempty"` + + DoubleValue float64 `json:"double_value,omitempty"` + + StringValue string `json:"string_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertOperandValueFromPb(pb *alertOperandValuePb) (*AlertOperandValue, error) { + if pb == nil { + return nil, nil + } + st := &AlertOperandValue{} + st.BoolValue = pb.BoolValue + st.DoubleValue = pb.DoubleValue + st.StringValue = pb.StringValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertOperandValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertOperandValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertOptionsToPb(st *AlertOptions) (*alertOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &alertOptionsPb{} + pb.Column = st.Column + + pb.CustomBody = st.CustomBody + + pb.CustomSubject = st.CustomSubject + + pb.EmptyResultState = st.EmptyResultState + + pb.Muted = st.Muted + + pb.Op = st.Op + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertOptionsPb struct { + Column string `json:"column"` + + CustomBody string `json:"custom_body,omitempty"` + + CustomSubject string `json:"custom_subject,omitempty"` + + EmptyResultState AlertOptionsEmptyResultState `json:"empty_result_state,omitempty"` + + Muted bool `json:"muted,omitempty"` + + Op string `json:"op"` + + Value any `json:"value"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertOptionsFromPb(pb *alertOptionsPb) (*AlertOptions, error) { + if pb == nil { + return nil, nil + } + st := &AlertOptions{} + st.Column = pb.Column + st.CustomBody = pb.CustomBody + st.CustomSubject = pb.CustomSubject + st.EmptyResultState = pb.EmptyResultState + st.Muted = pb.Muted + st.Op = pb.Op + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertOptionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertOptionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertQueryToPb(st *AlertQuery) (*alertQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &alertQueryPb{} + pb.CreatedAt = st.CreatedAt + + pb.DataSourceId = st.DataSourceId + + pb.Description = st.Description + + pb.Id = st.Id + + pb.IsArchived = st.IsArchived + + pb.IsDraft = st.IsDraft + + pb.IsSafe = st.IsSafe + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Query = st.Query + + pb.Tags = st.Tags + + pb.UpdatedAt = st.UpdatedAt + + pb.UserId = st.UserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertQueryPb struct { + CreatedAt string `json:"created_at,omitempty"` + + DataSourceId string `json:"data_source_id,omitempty"` + + Description string `json:"description,omitempty"` + + Id string `json:"id,omitempty"` + + IsArchived bool `json:"is_archived,omitempty"` + + IsDraft bool `json:"is_draft,omitempty"` + + IsSafe bool `json:"is_safe,omitempty"` + + Name string `json:"name,omitempty"` + + Options *QueryOptions `json:"options,omitempty"` + + Query string `json:"query,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + UserId int `json:"user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertQueryFromPb(pb *alertQueryPb) (*AlertQuery, error) { + if pb == nil { + return nil, nil + } + st := &AlertQuery{} + st.CreatedAt = pb.CreatedAt + st.DataSourceId = pb.DataSourceId + st.Description = pb.Description + st.Id = pb.Id + st.IsArchived = pb.IsArchived + st.IsDraft = pb.IsDraft + st.IsSafe = pb.IsSafe + st.Name = pb.Name + st.Options = pb.Options + st.Query = pb.Query + st.Tags = pb.Tags + st.UpdatedAt = pb.UpdatedAt + st.UserId = pb.UserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertQueryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertQueryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2ToPb(st *AlertV2) (*alertV2Pb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2Pb{} + pb.CreateTime = st.CreateTime + + pb.CustomDescription = st.CustomDescription + + pb.CustomSummary = st.CustomSummary + + pb.DisplayName = st.DisplayName + + pb.Evaluation = st.Evaluation + + pb.Id = st.Id + + pb.LifecycleState = st.LifecycleState + + pb.OwnerUserName = st.OwnerUserName + + pb.ParentPath = st.ParentPath + + pb.QueryText = st.QueryText + + pb.RunAsUserName = st.RunAsUserName + + pb.Schedule = st.Schedule + + pb.UpdateTime = st.UpdateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2Pb struct { + CreateTime string `json:"create_time,omitempty"` + + CustomDescription string `json:"custom_description,omitempty"` + + CustomSummary string `json:"custom_summary,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Evaluation *AlertV2Evaluation `json:"evaluation,omitempty"` + + Id string `json:"id,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RunAsUserName string `json:"run_as_user_name,omitempty"` + + Schedule *CronSchedule `json:"schedule,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2FromPb(pb *alertV2Pb) (*AlertV2, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2{} + st.CreateTime = pb.CreateTime + st.CustomDescription = pb.CustomDescription + st.CustomSummary = pb.CustomSummary + st.DisplayName = pb.DisplayName + st.Evaluation = pb.Evaluation + st.Id = pb.Id + st.LifecycleState = pb.LifecycleState + st.OwnerUserName = pb.OwnerUserName + st.ParentPath = pb.ParentPath + st.QueryText = pb.QueryText + st.RunAsUserName = pb.RunAsUserName + st.Schedule = pb.Schedule + st.UpdateTime = pb.UpdateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2Pb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2Pb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2EvaluationToPb(st *AlertV2Evaluation) (*alertV2EvaluationPb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2EvaluationPb{} + pb.ComparisonOperator = st.ComparisonOperator + + pb.EmptyResultState = st.EmptyResultState + + pb.LastEvaluatedAt = st.LastEvaluatedAt + + pb.Notification = st.Notification + + pb.Source = st.Source + + pb.State = st.State + + pb.Threshold = st.Threshold + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2EvaluationPb struct { + ComparisonOperator ComparisonOperator `json:"comparison_operator,omitempty"` + + EmptyResultState AlertEvaluationState `json:"empty_result_state,omitempty"` + + LastEvaluatedAt string `json:"last_evaluated_at,omitempty"` + + Notification *AlertV2Notification `json:"notification,omitempty"` + + Source *AlertV2OperandColumn `json:"source,omitempty"` + + State AlertEvaluationState `json:"state,omitempty"` + + Threshold *AlertV2Operand `json:"threshold,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2EvaluationFromPb(pb *alertV2EvaluationPb) (*AlertV2Evaluation, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2Evaluation{} + st.ComparisonOperator = pb.ComparisonOperator + st.EmptyResultState = pb.EmptyResultState + st.LastEvaluatedAt = pb.LastEvaluatedAt + st.Notification = pb.Notification + st.Source = pb.Source + st.State = pb.State + st.Threshold = pb.Threshold + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2EvaluationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2EvaluationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2NotificationToPb(st *AlertV2Notification) (*alertV2NotificationPb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2NotificationPb{} + pb.NotifyOnOk = st.NotifyOnOk + + pb.RetriggerSeconds = st.RetriggerSeconds + + pb.Subscriptions = st.Subscriptions + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2NotificationPb struct { + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + + RetriggerSeconds int `json:"retrigger_seconds,omitempty"` + + Subscriptions []AlertV2Subscription `json:"subscriptions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2NotificationFromPb(pb *alertV2NotificationPb) (*AlertV2Notification, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2Notification{} + st.NotifyOnOk = pb.NotifyOnOk + st.RetriggerSeconds = pb.RetriggerSeconds + st.Subscriptions = pb.Subscriptions + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2NotificationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2NotificationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2OperandToPb(st *AlertV2Operand) (*alertV2OperandPb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2OperandPb{} + pb.Column = st.Column + + pb.Value = st.Value + + return pb, nil +} + +type alertV2OperandPb struct { + Column *AlertV2OperandColumn `json:"column,omitempty"` + + Value *AlertV2OperandValue `json:"value,omitempty"` +} + +func alertV2OperandFromPb(pb *alertV2OperandPb) (*AlertV2Operand, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2Operand{} + st.Column = pb.Column + st.Value = pb.Value + + return st, nil +} + +func alertV2OperandColumnToPb(st *AlertV2OperandColumn) (*alertV2OperandColumnPb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2OperandColumnPb{} + pb.Aggregation = st.Aggregation + + pb.Display = st.Display + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2OperandColumnPb struct { + Aggregation Aggregation `json:"aggregation,omitempty"` + + Display string `json:"display,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2OperandColumnFromPb(pb *alertV2OperandColumnPb) (*AlertV2OperandColumn, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2OperandColumn{} + st.Aggregation = pb.Aggregation + st.Display = pb.Display + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2OperandColumnPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2OperandColumnPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2OperandValueToPb(st *AlertV2OperandValue) (*alertV2OperandValuePb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2OperandValuePb{} + pb.BoolValue = st.BoolValue + + pb.DoubleValue = st.DoubleValue + + pb.StringValue = st.StringValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2OperandValuePb struct { + BoolValue bool `json:"bool_value,omitempty"` + + DoubleValue float64 `json:"double_value,omitempty"` + + StringValue string `json:"string_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2OperandValueFromPb(pb *alertV2OperandValuePb) (*AlertV2OperandValue, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2OperandValue{} + st.BoolValue = pb.BoolValue + st.DoubleValue = pb.DoubleValue + st.StringValue = pb.StringValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2OperandValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2OperandValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func alertV2SubscriptionToPb(st *AlertV2Subscription) (*alertV2SubscriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &alertV2SubscriptionPb{} + pb.DestinationId = st.DestinationId + + pb.UserEmail = st.UserEmail + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type alertV2SubscriptionPb struct { + DestinationId string `json:"destination_id,omitempty"` + + UserEmail string `json:"user_email,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func alertV2SubscriptionFromPb(pb *alertV2SubscriptionPb) (*AlertV2Subscription, error) { + if pb == nil { + return nil, nil + } + st := &AlertV2Subscription{} + st.DestinationId = pb.DestinationId + st.UserEmail = pb.UserEmail + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *alertV2SubscriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st alertV2SubscriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func baseChunkInfoToPb(st *BaseChunkInfo) (*baseChunkInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &baseChunkInfoPb{} + pb.ByteCount = st.ByteCount + + pb.ChunkIndex = st.ChunkIndex + + pb.RowCount = st.RowCount + + pb.RowOffset = st.RowOffset + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type baseChunkInfoPb struct { + ByteCount int64 `json:"byte_count,omitempty"` + + ChunkIndex int `json:"chunk_index,omitempty"` + + RowCount int64 `json:"row_count,omitempty"` + + RowOffset int64 `json:"row_offset,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func baseChunkInfoFromPb(pb *baseChunkInfoPb) (*BaseChunkInfo, error) { + if pb == nil { + return nil, nil + } + st := &BaseChunkInfo{} + st.ByteCount = pb.ByteCount + st.ChunkIndex = pb.ChunkIndex + st.RowCount = pb.RowCount + st.RowOffset = pb.RowOffset + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *baseChunkInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st baseChunkInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cancelExecutionRequestToPb(st *CancelExecutionRequest) (*cancelExecutionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &cancelExecutionRequestPb{} + pb.StatementId = st.StatementId + + return pb, nil +} + +type cancelExecutionRequestPb struct { + StatementId string `json:"-" url:"-"` +} + +func cancelExecutionRequestFromPb(pb *cancelExecutionRequestPb) (*CancelExecutionRequest, error) { + if pb == nil { + return nil, nil + } + st := &CancelExecutionRequest{} + st.StatementId = pb.StatementId + + return st, nil +} + +func cancelExecutionResponseToPb(st *CancelExecutionResponse) (*cancelExecutionResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &cancelExecutionResponsePb{} + + return pb, nil +} + +type cancelExecutionResponsePb struct { +} + +func cancelExecutionResponseFromPb(pb *cancelExecutionResponsePb) (*CancelExecutionResponse, error) { + if pb == nil { + return nil, nil + } + st := &CancelExecutionResponse{} + + return st, nil +} + +func channelToPb(st *Channel) (*channelPb, error) { + if st == nil { + return nil, nil + } + pb := &channelPb{} + pb.DbsqlVersion = st.DbsqlVersion + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type channelPb struct { + DbsqlVersion string `json:"dbsql_version,omitempty"` + + Name ChannelName `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func channelFromPb(pb *channelPb) (*Channel, error) { + if pb == nil { + return nil, nil + } + st := &Channel{} + st.DbsqlVersion = pb.DbsqlVersion + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *channelPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st channelPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func channelInfoToPb(st *ChannelInfo) (*channelInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &channelInfoPb{} + pb.DbsqlVersion = st.DbsqlVersion + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type channelInfoPb struct { + DbsqlVersion string `json:"dbsql_version,omitempty"` + + Name ChannelName `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func channelInfoFromPb(pb *channelInfoPb) (*ChannelInfo, error) { + if pb == nil { + return nil, nil + } + st := &ChannelInfo{} + st.DbsqlVersion = pb.DbsqlVersion + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *channelInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st channelInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func clientConfigToPb(st *ClientConfig) (*clientConfigPb, error) { + if st == nil { + return nil, nil + } + pb := &clientConfigPb{} + pb.AllowCustomJsVisualizations = st.AllowCustomJsVisualizations + + pb.AllowDownloads = st.AllowDownloads + + pb.AllowExternalShares = st.AllowExternalShares + + pb.AllowSubscriptions = st.AllowSubscriptions + + pb.DateFormat = st.DateFormat + + pb.DateTimeFormat = st.DateTimeFormat + + pb.DisablePublish = st.DisablePublish + + pb.EnableLegacyAutodetectTypes = st.EnableLegacyAutodetectTypes + + pb.FeatureShowPermissionsControl = st.FeatureShowPermissionsControl + + pb.HidePlotlyModeBar = st.HidePlotlyModeBar + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type clientConfigPb struct { + AllowCustomJsVisualizations bool `json:"allow_custom_js_visualizations,omitempty"` + + AllowDownloads bool `json:"allow_downloads,omitempty"` + + AllowExternalShares bool `json:"allow_external_shares,omitempty"` + + AllowSubscriptions bool `json:"allow_subscriptions,omitempty"` + + DateFormat string `json:"date_format,omitempty"` + + DateTimeFormat string `json:"date_time_format,omitempty"` + + DisablePublish bool `json:"disable_publish,omitempty"` + + EnableLegacyAutodetectTypes bool `json:"enable_legacy_autodetect_types,omitempty"` + + FeatureShowPermissionsControl bool `json:"feature_show_permissions_control,omitempty"` + + HidePlotlyModeBar bool `json:"hide_plotly_mode_bar,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func clientConfigFromPb(pb *clientConfigPb) (*ClientConfig, error) { + if pb == nil { + return nil, nil + } + st := &ClientConfig{} + st.AllowCustomJsVisualizations = pb.AllowCustomJsVisualizations + st.AllowDownloads = pb.AllowDownloads + st.AllowExternalShares = pb.AllowExternalShares + st.AllowSubscriptions = pb.AllowSubscriptions + st.DateFormat = pb.DateFormat + st.DateTimeFormat = pb.DateTimeFormat + st.DisablePublish = pb.DisablePublish + st.EnableLegacyAutodetectTypes = pb.EnableLegacyAutodetectTypes + st.FeatureShowPermissionsControl = pb.FeatureShowPermissionsControl + st.HidePlotlyModeBar = pb.HidePlotlyModeBar + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *clientConfigPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st clientConfigPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &columnInfoPb{} + pb.Name = st.Name + + pb.Position = st.Position + + pb.TypeIntervalType = st.TypeIntervalType + + pb.TypeName = st.TypeName + + pb.TypePrecision = st.TypePrecision + + pb.TypeScale = st.TypeScale + + pb.TypeText = st.TypeText + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type columnInfoPb struct { + Name string `json:"name,omitempty"` + + Position int `json:"position,omitempty"` + + TypeIntervalType string `json:"type_interval_type,omitempty"` + + TypeName ColumnInfoTypeName `json:"type_name,omitempty"` + + TypePrecision int `json:"type_precision,omitempty"` + + TypeScale int `json:"type_scale,omitempty"` + + TypeText string `json:"type_text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func columnInfoFromPb(pb *columnInfoPb) (*ColumnInfo, error) { + if pb == nil { + return nil, nil + } + st := &ColumnInfo{} + st.Name = pb.Name + st.Position = pb.Position + st.TypeIntervalType = pb.TypeIntervalType + st.TypeName = pb.TypeName + st.TypePrecision = pb.TypePrecision + st.TypeScale = pb.TypeScale + st.TypeText = pb.TypeText + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *columnInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st columnInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createAlertToPb(st *CreateAlert) (*createAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &createAlertPb{} + pb.Name = st.Name + + pb.Options = st.Options + + pb.Parent = st.Parent + + pb.QueryId = st.QueryId + + pb.Rearm = st.Rearm + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAlertPb struct { + Name string `json:"name"` + + Options AlertOptions `json:"options"` + + Parent string `json:"parent,omitempty"` + + QueryId string `json:"query_id"` + + Rearm int `json:"rearm,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAlertFromPb(pb *createAlertPb) (*CreateAlert, error) { + if pb == nil { + return nil, nil + } + st := &CreateAlert{} + st.Name = pb.Name + st.Options = pb.Options + st.Parent = pb.Parent + st.QueryId = pb.QueryId + st.Rearm = pb.Rearm + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createAlertRequestToPb(st *CreateAlertRequest) (*createAlertRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createAlertRequestPb{} + pb.Alert = st.Alert + + pb.AutoResolveDisplayName = st.AutoResolveDisplayName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAlertRequestPb struct { + Alert *CreateAlertRequestAlert `json:"alert,omitempty"` + + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAlertRequestFromPb(pb *createAlertRequestPb) (*CreateAlertRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateAlertRequest{} + st.Alert = pb.Alert + st.AutoResolveDisplayName = pb.AutoResolveDisplayName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAlertRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAlertRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createAlertRequestAlertToPb(st *CreateAlertRequestAlert) (*createAlertRequestAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &createAlertRequestAlertPb{} + pb.Condition = st.Condition + + pb.CustomBody = st.CustomBody + + pb.CustomSubject = st.CustomSubject + + pb.DisplayName = st.DisplayName + + pb.NotifyOnOk = st.NotifyOnOk + + pb.ParentPath = st.ParentPath + + pb.QueryId = st.QueryId + + pb.SecondsToRetrigger = st.SecondsToRetrigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createAlertRequestAlertPb struct { + Condition *AlertCondition `json:"condition,omitempty"` + + CustomBody string `json:"custom_body,omitempty"` + + CustomSubject string `json:"custom_subject,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createAlertRequestAlertFromPb(pb *createAlertRequestAlertPb) (*CreateAlertRequestAlert, error) { + if pb == nil { + return nil, nil + } + st := &CreateAlertRequestAlert{} + st.Condition = pb.Condition + st.CustomBody = pb.CustomBody + st.CustomSubject = pb.CustomSubject + st.DisplayName = pb.DisplayName + st.NotifyOnOk = pb.NotifyOnOk + st.ParentPath = pb.ParentPath + st.QueryId = pb.QueryId + st.SecondsToRetrigger = pb.SecondsToRetrigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createAlertRequestAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createAlertRequestAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createAlertV2RequestToPb(st *CreateAlertV2Request) (*createAlertV2RequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createAlertV2RequestPb{} + pb.Alert = st.Alert + + return pb, nil +} + +type createAlertV2RequestPb struct { + Alert AlertV2 `json:"alert"` +} + +func createAlertV2RequestFromPb(pb *createAlertV2RequestPb) (*CreateAlertV2Request, error) { + if pb == nil { + return nil, nil + } + st := &CreateAlertV2Request{} + st.Alert = pb.Alert + + return st, nil +} + +func createQueryRequestToPb(st *CreateQueryRequest) (*createQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createQueryRequestPb{} + pb.AutoResolveDisplayName = st.AutoResolveDisplayName + + pb.Query = st.Query + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createQueryRequestPb struct { + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + + Query *CreateQueryRequestQuery `json:"query,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createQueryRequestFromPb(pb *createQueryRequestPb) (*CreateQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateQueryRequest{} + st.AutoResolveDisplayName = pb.AutoResolveDisplayName + st.Query = pb.Query + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createQueryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createQueryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createQueryRequestQueryToPb(st *CreateQueryRequestQuery) (*createQueryRequestQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &createQueryRequestQueryPb{} + pb.ApplyAutoLimit = st.ApplyAutoLimit + + pb.Catalog = st.Catalog + + pb.Description = st.Description + + pb.DisplayName = st.DisplayName + + pb.Parameters = st.Parameters + + pb.ParentPath = st.ParentPath + + pb.QueryText = st.QueryText + + pb.RunAsMode = st.RunAsMode + + pb.Schema = st.Schema + + pb.Tags = st.Tags + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createQueryRequestQueryPb struct { + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Parameters []QueryParameter `json:"parameters,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + + Schema string `json:"schema,omitempty"` + + Tags []string `json:"tags,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createQueryRequestQueryFromPb(pb *createQueryRequestQueryPb) (*CreateQueryRequestQuery, error) { + if pb == nil { + return nil, nil + } + st := &CreateQueryRequestQuery{} + st.ApplyAutoLimit = pb.ApplyAutoLimit + st.Catalog = pb.Catalog + st.Description = pb.Description + st.DisplayName = pb.DisplayName + st.Parameters = pb.Parameters + st.ParentPath = pb.ParentPath + st.QueryText = pb.QueryText + st.RunAsMode = pb.RunAsMode + st.Schema = pb.Schema + st.Tags = pb.Tags + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createQueryRequestQueryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createQueryRequestQueryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createQueryVisualizationsLegacyRequestToPb(st *CreateQueryVisualizationsLegacyRequest) (*createQueryVisualizationsLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createQueryVisualizationsLegacyRequestPb{} + pb.Description = st.Description + + pb.Name = st.Name + + pb.Options = st.Options + + pb.QueryId = st.QueryId + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createQueryVisualizationsLegacyRequestPb struct { + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + Options any `json:"options"` + + QueryId string `json:"query_id"` + + Type string `json:"type"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createQueryVisualizationsLegacyRequestFromPb(pb *createQueryVisualizationsLegacyRequestPb) (*CreateQueryVisualizationsLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateQueryVisualizationsLegacyRequest{} + st.Description = pb.Description + st.Name = pb.Name + st.Options = pb.Options + st.QueryId = pb.QueryId + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createQueryVisualizationsLegacyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createQueryVisualizationsLegacyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createVisualizationRequestToPb(st *CreateVisualizationRequest) (*createVisualizationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createVisualizationRequestPb{} + pb.Visualization = st.Visualization + + return pb, nil +} + +type createVisualizationRequestPb struct { + Visualization *CreateVisualizationRequestVisualization `json:"visualization,omitempty"` +} + +func createVisualizationRequestFromPb(pb *createVisualizationRequestPb) (*CreateVisualizationRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateVisualizationRequest{} + st.Visualization = pb.Visualization + + return st, nil +} + +func createVisualizationRequestVisualizationToPb(st *CreateVisualizationRequestVisualization) (*createVisualizationRequestVisualizationPb, error) { + if st == nil { + return nil, nil + } + pb := &createVisualizationRequestVisualizationPb{} + pb.DisplayName = st.DisplayName + + pb.QueryId = st.QueryId + + pb.SerializedOptions = st.SerializedOptions + + pb.SerializedQueryPlan = st.SerializedQueryPlan + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createVisualizationRequestVisualizationPb struct { + DisplayName string `json:"display_name,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SerializedOptions string `json:"serialized_options,omitempty"` + + SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + + Type string `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createVisualizationRequestVisualizationFromPb(pb *createVisualizationRequestVisualizationPb) (*CreateVisualizationRequestVisualization, error) { + if pb == nil { + return nil, nil + } + st := &CreateVisualizationRequestVisualization{} + st.DisplayName = pb.DisplayName + st.QueryId = pb.QueryId + st.SerializedOptions = pb.SerializedOptions + st.SerializedQueryPlan = pb.SerializedQueryPlan + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createVisualizationRequestVisualizationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createVisualizationRequestVisualizationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createWarehouseRequestToPb(st *CreateWarehouseRequest) (*createWarehouseRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createWarehouseRequestPb{} + pb.AutoStopMins = st.AutoStopMins + + pb.Channel = st.Channel + + pb.ClusterSize = st.ClusterSize + + pb.CreatorName = st.CreatorName + + pb.EnablePhoton = st.EnablePhoton + + pb.EnableServerlessCompute = st.EnableServerlessCompute + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.MaxNumClusters = st.MaxNumClusters + + pb.MinNumClusters = st.MinNumClusters + + pb.Name = st.Name + + pb.SpotInstancePolicy = st.SpotInstancePolicy + + pb.Tags = st.Tags + + pb.WarehouseType = st.WarehouseType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createWarehouseRequestPb struct { + AutoStopMins int `json:"auto_stop_mins,omitempty"` + + Channel *Channel `json:"channel,omitempty"` + + ClusterSize string `json:"cluster_size,omitempty"` + + CreatorName string `json:"creator_name,omitempty"` + + EnablePhoton bool `json:"enable_photon,omitempty"` + + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + MaxNumClusters int `json:"max_num_clusters,omitempty"` + + MinNumClusters int `json:"min_num_clusters,omitempty"` + + Name string `json:"name,omitempty"` + + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + + Tags *EndpointTags `json:"tags,omitempty"` + + WarehouseType CreateWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createWarehouseRequestFromPb(pb *createWarehouseRequestPb) (*CreateWarehouseRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateWarehouseRequest{} + st.AutoStopMins = pb.AutoStopMins + st.Channel = pb.Channel + st.ClusterSize = pb.ClusterSize + st.CreatorName = pb.CreatorName + st.EnablePhoton = pb.EnablePhoton + st.EnableServerlessCompute = pb.EnableServerlessCompute + st.InstanceProfileArn = pb.InstanceProfileArn + st.MaxNumClusters = pb.MaxNumClusters + st.MinNumClusters = pb.MinNumClusters + st.Name = pb.Name + st.SpotInstancePolicy = pb.SpotInstancePolicy + st.Tags = pb.Tags + st.WarehouseType = pb.WarehouseType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createWarehouseRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createWarehouseRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createWarehouseResponseToPb(st *CreateWarehouseResponse) (*createWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createWarehouseResponsePb{} + pb.Id = st.Id + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createWarehouseResponsePb struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createWarehouseResponseFromPb(pb *createWarehouseResponsePb) (*CreateWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateWarehouseResponse{} + st.Id = pb.Id + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createWarehouseResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createWarehouseResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createWidgetToPb(st *CreateWidget) (*createWidgetPb, error) { + if st == nil { + return nil, nil + } + pb := &createWidgetPb{} + pb.DashboardId = st.DashboardId + + pb.Id = st.Id + + pb.Options = st.Options + + pb.Text = st.Text + + pb.VisualizationId = st.VisualizationId + + pb.Width = st.Width + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createWidgetPb struct { + DashboardId string `json:"dashboard_id"` + + Id string `json:"-" url:"-"` + + Options WidgetOptions `json:"options"` + + Text string `json:"text,omitempty"` + + VisualizationId string `json:"visualization_id,omitempty"` + + Width int `json:"width"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createWidgetFromPb(pb *createWidgetPb) (*CreateWidget, error) { + if pb == nil { + return nil, nil + } + st := &CreateWidget{} + st.DashboardId = pb.DashboardId + st.Id = pb.Id + st.Options = pb.Options + st.Text = pb.Text + st.VisualizationId = pb.VisualizationId + st.Width = pb.Width + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createWidgetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createWidgetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { + if st == nil { + return nil, nil + } + pb := &cronSchedulePb{} + pb.PauseStatus = st.PauseStatus + + pb.QuartzCronSchedule = st.QuartzCronSchedule + + pb.TimezoneId = st.TimezoneId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type cronSchedulePb struct { + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + + QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` + + TimezoneId string `json:"timezone_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func cronScheduleFromPb(pb *cronSchedulePb) (*CronSchedule, error) { + if pb == nil { + return nil, nil + } + st := &CronSchedule{} + st.PauseStatus = pb.PauseStatus + st.QuartzCronSchedule = pb.QuartzCronSchedule + st.TimezoneId = pb.TimezoneId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *cronSchedulePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st cronSchedulePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardToPb(st *Dashboard) (*dashboardPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardPb{} + pb.CanEdit = st.CanEdit + + pb.CreatedAt = st.CreatedAt + + pb.DashboardFiltersEnabled = st.DashboardFiltersEnabled + + pb.Id = st.Id + + pb.IsArchived = st.IsArchived + + pb.IsDraft = st.IsDraft + + pb.IsFavorite = st.IsFavorite + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Parent = st.Parent + + pb.PermissionTier = st.PermissionTier + + pb.Slug = st.Slug + + pb.Tags = st.Tags + + pb.UpdatedAt = st.UpdatedAt + + pb.User = st.User + + pb.UserId = st.UserId + + pb.Widgets = st.Widgets + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardPb struct { + CanEdit bool `json:"can_edit,omitempty"` + + CreatedAt string `json:"created_at,omitempty"` + + DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + + Id string `json:"id,omitempty"` + + IsArchived bool `json:"is_archived,omitempty"` + + IsDraft bool `json:"is_draft,omitempty"` + + IsFavorite bool `json:"is_favorite,omitempty"` + + Name string `json:"name,omitempty"` + + Options *DashboardOptions `json:"options,omitempty"` + + Parent string `json:"parent,omitempty"` + + PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + + Slug string `json:"slug,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + User *User `json:"user,omitempty"` + + UserId int `json:"user_id,omitempty"` + + Widgets []Widget `json:"widgets,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardFromPb(pb *dashboardPb) (*Dashboard, error) { + if pb == nil { + return nil, nil + } + st := &Dashboard{} + st.CanEdit = pb.CanEdit + st.CreatedAt = pb.CreatedAt + st.DashboardFiltersEnabled = pb.DashboardFiltersEnabled + st.Id = pb.Id + st.IsArchived = pb.IsArchived + st.IsDraft = pb.IsDraft + st.IsFavorite = pb.IsFavorite + st.Name = pb.Name + st.Options = pb.Options + st.Parent = pb.Parent + st.PermissionTier = pb.PermissionTier + st.Slug = pb.Slug + st.Tags = pb.Tags + st.UpdatedAt = pb.UpdatedAt + st.User = pb.User + st.UserId = pb.UserId + st.Widgets = pb.Widgets + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardEditContentToPb(st *DashboardEditContent) (*dashboardEditContentPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardEditContentPb{} + pb.DashboardId = st.DashboardId + + pb.Name = st.Name + + pb.RunAsRole = st.RunAsRole + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardEditContentPb struct { + DashboardId string `json:"-" url:"-"` + + Name string `json:"name,omitempty"` + + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + + Tags []string `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardEditContentFromPb(pb *dashboardEditContentPb) (*DashboardEditContent, error) { + if pb == nil { + return nil, nil + } + st := &DashboardEditContent{} + st.DashboardId = pb.DashboardId + st.Name = pb.Name + st.RunAsRole = pb.RunAsRole + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardEditContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardEditContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardOptionsToPb(st *DashboardOptions) (*dashboardOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardOptionsPb{} + pb.MovedToTrashAt = st.MovedToTrashAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardOptionsPb struct { + MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardOptionsFromPb(pb *dashboardOptionsPb) (*DashboardOptions, error) { + if pb == nil { + return nil, nil + } + st := &DashboardOptions{} + st.MovedToTrashAt = pb.MovedToTrashAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardOptionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardOptionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dashboardPostContentToPb(st *DashboardPostContent) (*dashboardPostContentPb, error) { + if st == nil { + return nil, nil + } + pb := &dashboardPostContentPb{} + pb.DashboardFiltersEnabled = st.DashboardFiltersEnabled + + pb.IsFavorite = st.IsFavorite + + pb.Name = st.Name + + pb.Parent = st.Parent + + pb.RunAsRole = st.RunAsRole + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dashboardPostContentPb struct { + DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + + IsFavorite bool `json:"is_favorite,omitempty"` + + Name string `json:"name"` + + Parent string `json:"parent,omitempty"` + + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + + Tags []string `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dashboardPostContentFromPb(pb *dashboardPostContentPb) (*DashboardPostContent, error) { + if pb == nil { + return nil, nil + } + st := &DashboardPostContent{} + st.DashboardFiltersEnabled = pb.DashboardFiltersEnabled + st.IsFavorite = pb.IsFavorite + st.Name = pb.Name + st.Parent = pb.Parent + st.RunAsRole = pb.RunAsRole + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dashboardPostContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dashboardPostContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dataSourceToPb(st *DataSource) (*dataSourcePb, error) { + if st == nil { + return nil, nil + } + pb := &dataSourcePb{} + pb.Id = st.Id + + pb.Name = st.Name + + pb.PauseReason = st.PauseReason + + pb.Paused = st.Paused + + pb.SupportsAutoLimit = st.SupportsAutoLimit + + pb.Syntax = st.Syntax + + pb.Type = st.Type + + pb.ViewOnly = st.ViewOnly + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dataSourcePb struct { + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + PauseReason string `json:"pause_reason,omitempty"` + + Paused int `json:"paused,omitempty"` + + SupportsAutoLimit bool `json:"supports_auto_limit,omitempty"` + + Syntax string `json:"syntax,omitempty"` + + Type string `json:"type,omitempty"` + + ViewOnly bool `json:"view_only,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dataSourceFromPb(pb *dataSourcePb) (*DataSource, error) { + if pb == nil { + return nil, nil + } + st := &DataSource{} + st.Id = pb.Id + st.Name = pb.Name + st.PauseReason = pb.PauseReason + st.Paused = pb.Paused + st.SupportsAutoLimit = pb.SupportsAutoLimit + st.Syntax = pb.Syntax + st.Type = pb.Type + st.ViewOnly = pb.ViewOnly + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dataSourcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dataSourcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dateRangeToPb(st *DateRange) (*dateRangePb, error) { + if st == nil { + return nil, nil + } + pb := &dateRangePb{} + pb.End = st.End + + pb.Start = st.Start + + return pb, nil +} + +type dateRangePb struct { + End string `json:"end"` + + Start string `json:"start"` +} + +func dateRangeFromPb(pb *dateRangePb) (*DateRange, error) { + if pb == nil { + return nil, nil + } + st := &DateRange{} + st.End = pb.End + st.Start = pb.Start + + return st, nil +} + +func dateRangeValueToPb(st *DateRangeValue) (*dateRangeValuePb, error) { + if st == nil { + return nil, nil + } + pb := &dateRangeValuePb{} + pb.DateRangeValue = st.DateRangeValue + + pb.DynamicDateRangeValue = st.DynamicDateRangeValue + + pb.Precision = st.Precision + + pb.StartDayOfWeek = st.StartDayOfWeek + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dateRangeValuePb struct { + DateRangeValue *DateRange `json:"date_range_value,omitempty"` + + DynamicDateRangeValue DateRangeValueDynamicDateRange `json:"dynamic_date_range_value,omitempty"` + + Precision DatePrecision `json:"precision,omitempty"` + + StartDayOfWeek int `json:"start_day_of_week,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dateRangeValueFromPb(pb *dateRangeValuePb) (*DateRangeValue, error) { + if pb == nil { + return nil, nil + } + st := &DateRangeValue{} + st.DateRangeValue = pb.DateRangeValue + st.DynamicDateRangeValue = pb.DynamicDateRangeValue + st.Precision = pb.Precision + st.StartDayOfWeek = pb.StartDayOfWeek + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dateRangeValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dateRangeValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func dateValueToPb(st *DateValue) (*dateValuePb, error) { + if st == nil { + return nil, nil + } + pb := &dateValuePb{} + pb.DateValue = st.DateValue + + pb.DynamicDateValue = st.DynamicDateValue + + pb.Precision = st.Precision + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type dateValuePb struct { + DateValue string `json:"date_value,omitempty"` + + DynamicDateValue DateValueDynamicDate `json:"dynamic_date_value,omitempty"` + + Precision DatePrecision `json:"precision,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func dateValueFromPb(pb *dateValuePb) (*DateValue, error) { + if pb == nil { + return nil, nil + } + st := &DateValue{} + st.DateValue = pb.DateValue + st.DynamicDateValue = pb.DynamicDateValue + st.Precision = pb.Precision + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *dateValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st dateValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAlertsLegacyRequestToPb(st *DeleteAlertsLegacyRequest) (*deleteAlertsLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAlertsLegacyRequestPb{} + pb.AlertId = st.AlertId + + return pb, nil +} + +type deleteAlertsLegacyRequestPb struct { + AlertId string `json:"-" url:"-"` +} + +func deleteAlertsLegacyRequestFromPb(pb *deleteAlertsLegacyRequestPb) (*DeleteAlertsLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAlertsLegacyRequest{} + st.AlertId = pb.AlertId + + return st, nil +} + +func deleteDashboardRequestToPb(st *DeleteDashboardRequest) (*deleteDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type deleteDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func deleteDashboardRequestFromPb(pb *deleteDashboardRequestPb) (*DeleteDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func deleteDashboardWidgetRequestToPb(st *DeleteDashboardWidgetRequest) (*deleteDashboardWidgetRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDashboardWidgetRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteDashboardWidgetRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteDashboardWidgetRequestFromPb(pb *deleteDashboardWidgetRequestPb) (*DeleteDashboardWidgetRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDashboardWidgetRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteQueriesLegacyRequestToPb(st *DeleteQueriesLegacyRequest) (*deleteQueriesLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteQueriesLegacyRequestPb{} + pb.QueryId = st.QueryId + + return pb, nil +} + +type deleteQueriesLegacyRequestPb struct { + QueryId string `json:"-" url:"-"` +} + +func deleteQueriesLegacyRequestFromPb(pb *deleteQueriesLegacyRequestPb) (*DeleteQueriesLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteQueriesLegacyRequest{} + st.QueryId = pb.QueryId + + return st, nil +} + +func deleteQueryVisualizationsLegacyRequestToPb(st *DeleteQueryVisualizationsLegacyRequest) (*deleteQueryVisualizationsLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteQueryVisualizationsLegacyRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteQueryVisualizationsLegacyRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteQueryVisualizationsLegacyRequestFromPb(pb *deleteQueryVisualizationsLegacyRequestPb) (*DeleteQueryVisualizationsLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteQueryVisualizationsLegacyRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteVisualizationRequestToPb(st *DeleteVisualizationRequest) (*deleteVisualizationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteVisualizationRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteVisualizationRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteVisualizationRequestFromPb(pb *deleteVisualizationRequestPb) (*DeleteVisualizationRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteVisualizationRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteWarehouseRequestToPb(st *DeleteWarehouseRequest) (*deleteWarehouseRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWarehouseRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type deleteWarehouseRequestPb struct { + Id string `json:"-" url:"-"` +} + +func deleteWarehouseRequestFromPb(pb *deleteWarehouseRequestPb) (*DeleteWarehouseRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWarehouseRequest{} + st.Id = pb.Id + + return st, nil +} + +func deleteWarehouseResponseToPb(st *DeleteWarehouseResponse) (*deleteWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteWarehouseResponsePb{} + + return pb, nil +} + +type deleteWarehouseResponsePb struct { +} + +func deleteWarehouseResponseFromPb(pb *deleteWarehouseResponsePb) (*DeleteWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteWarehouseResponse{} + + return st, nil +} + +func editAlertToPb(st *EditAlert) (*editAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &editAlertPb{} + pb.AlertId = st.AlertId + + pb.Name = st.Name + + pb.Options = st.Options + + pb.QueryId = st.QueryId + + pb.Rearm = st.Rearm + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editAlertPb struct { + AlertId string `json:"-" url:"-"` + + Name string `json:"name"` + + Options AlertOptions `json:"options"` + + QueryId string `json:"query_id"` + + Rearm int `json:"rearm,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editAlertFromPb(pb *editAlertPb) (*EditAlert, error) { + if pb == nil { + return nil, nil + } + st := &EditAlert{} + st.AlertId = pb.AlertId + st.Name = pb.Name + st.Options = pb.Options + st.QueryId = pb.QueryId + st.Rearm = pb.Rearm + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editWarehouseRequestToPb(st *EditWarehouseRequest) (*editWarehouseRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &editWarehouseRequestPb{} + pb.AutoStopMins = st.AutoStopMins + + pb.Channel = st.Channel + + pb.ClusterSize = st.ClusterSize + + pb.CreatorName = st.CreatorName + + pb.EnablePhoton = st.EnablePhoton + + pb.EnableServerlessCompute = st.EnableServerlessCompute + + pb.Id = st.Id + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.MaxNumClusters = st.MaxNumClusters + + pb.MinNumClusters = st.MinNumClusters + + pb.Name = st.Name + + pb.SpotInstancePolicy = st.SpotInstancePolicy + + pb.Tags = st.Tags + + pb.WarehouseType = st.WarehouseType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type editWarehouseRequestPb struct { + AutoStopMins int `json:"auto_stop_mins,omitempty"` + + Channel *Channel `json:"channel,omitempty"` + + ClusterSize string `json:"cluster_size,omitempty"` + + CreatorName string `json:"creator_name,omitempty"` + + EnablePhoton bool `json:"enable_photon,omitempty"` + + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + + Id string `json:"-" url:"-"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + MaxNumClusters int `json:"max_num_clusters,omitempty"` + + MinNumClusters int `json:"min_num_clusters,omitempty"` + + Name string `json:"name,omitempty"` + + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + + Tags *EndpointTags `json:"tags,omitempty"` + + WarehouseType EditWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func editWarehouseRequestFromPb(pb *editWarehouseRequestPb) (*EditWarehouseRequest, error) { + if pb == nil { + return nil, nil + } + st := &EditWarehouseRequest{} + st.AutoStopMins = pb.AutoStopMins + st.Channel = pb.Channel + st.ClusterSize = pb.ClusterSize + st.CreatorName = pb.CreatorName + st.EnablePhoton = pb.EnablePhoton + st.EnableServerlessCompute = pb.EnableServerlessCompute + st.Id = pb.Id + st.InstanceProfileArn = pb.InstanceProfileArn + st.MaxNumClusters = pb.MaxNumClusters + st.MinNumClusters = pb.MinNumClusters + st.Name = pb.Name + st.SpotInstancePolicy = pb.SpotInstancePolicy + st.Tags = pb.Tags + st.WarehouseType = pb.WarehouseType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *editWarehouseRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st editWarehouseRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func editWarehouseResponseToPb(st *EditWarehouseResponse) (*editWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &editWarehouseResponsePb{} + + return pb, nil +} + +type editWarehouseResponsePb struct { +} + +func editWarehouseResponseFromPb(pb *editWarehouseResponsePb) (*EditWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &EditWarehouseResponse{} + + return st, nil +} + +func emptyToPb(st *Empty) (*emptyPb, error) { + if st == nil { + return nil, nil + } + pb := &emptyPb{} + + return pb, nil +} + +type emptyPb struct { +} + +func emptyFromPb(pb *emptyPb) (*Empty, error) { + if pb == nil { + return nil, nil + } + st := &Empty{} + + return st, nil +} + +func endpointConfPairToPb(st *EndpointConfPair) (*endpointConfPairPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointConfPairPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointConfPairPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointConfPairFromPb(pb *endpointConfPairPb) (*EndpointConfPair, error) { + if pb == nil { + return nil, nil + } + st := &EndpointConfPair{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointConfPairPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointConfPairPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointHealthToPb(st *EndpointHealth) (*endpointHealthPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointHealthPb{} + pb.Details = st.Details + + pb.FailureReason = st.FailureReason + + pb.Message = st.Message + + pb.Status = st.Status + + pb.Summary = st.Summary + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointHealthPb struct { + Details string `json:"details,omitempty"` + + FailureReason *TerminationReason `json:"failure_reason,omitempty"` + + Message string `json:"message,omitempty"` + + Status Status `json:"status,omitempty"` + + Summary string `json:"summary,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointHealthFromPb(pb *endpointHealthPb) (*EndpointHealth, error) { + if pb == nil { + return nil, nil + } + st := &EndpointHealth{} + st.Details = pb.Details + st.FailureReason = pb.FailureReason + st.Message = pb.Message + st.Status = pb.Status + st.Summary = pb.Summary + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointHealthPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointHealthPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointInfoPb{} + pb.AutoStopMins = st.AutoStopMins + + pb.Channel = st.Channel + + pb.ClusterSize = st.ClusterSize + + pb.CreatorName = st.CreatorName + + pb.EnablePhoton = st.EnablePhoton + + pb.EnableServerlessCompute = st.EnableServerlessCompute + + pb.Health = st.Health + + pb.Id = st.Id + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.JdbcUrl = st.JdbcUrl + + pb.MaxNumClusters = st.MaxNumClusters + + pb.MinNumClusters = st.MinNumClusters + + pb.Name = st.Name + + pb.NumActiveSessions = st.NumActiveSessions + + pb.NumClusters = st.NumClusters + + pb.OdbcParams = st.OdbcParams + + pb.SpotInstancePolicy = st.SpotInstancePolicy + + pb.State = st.State + + pb.Tags = st.Tags + + pb.WarehouseType = st.WarehouseType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointInfoPb struct { + AutoStopMins int `json:"auto_stop_mins,omitempty"` + + Channel *Channel `json:"channel,omitempty"` + + ClusterSize string `json:"cluster_size,omitempty"` + + CreatorName string `json:"creator_name,omitempty"` + + EnablePhoton bool `json:"enable_photon,omitempty"` + + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + + Health *EndpointHealth `json:"health,omitempty"` + + Id string `json:"id,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + JdbcUrl string `json:"jdbc_url,omitempty"` + + MaxNumClusters int `json:"max_num_clusters,omitempty"` + + MinNumClusters int `json:"min_num_clusters,omitempty"` + + Name string `json:"name,omitempty"` + + NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + + NumClusters int `json:"num_clusters,omitempty"` + + OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + + State State `json:"state,omitempty"` + + Tags *EndpointTags `json:"tags,omitempty"` + + WarehouseType EndpointInfoWarehouseType `json:"warehouse_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointInfoFromPb(pb *endpointInfoPb) (*EndpointInfo, error) { + if pb == nil { + return nil, nil + } + st := &EndpointInfo{} + st.AutoStopMins = pb.AutoStopMins + st.Channel = pb.Channel + st.ClusterSize = pb.ClusterSize + st.CreatorName = pb.CreatorName + st.EnablePhoton = pb.EnablePhoton + st.EnableServerlessCompute = pb.EnableServerlessCompute + st.Health = pb.Health + st.Id = pb.Id + st.InstanceProfileArn = pb.InstanceProfileArn + st.JdbcUrl = pb.JdbcUrl + st.MaxNumClusters = pb.MaxNumClusters + st.MinNumClusters = pb.MinNumClusters + st.Name = pb.Name + st.NumActiveSessions = pb.NumActiveSessions + st.NumClusters = pb.NumClusters + st.OdbcParams = pb.OdbcParams + st.SpotInstancePolicy = pb.SpotInstancePolicy + st.State = pb.State + st.Tags = pb.Tags + st.WarehouseType = pb.WarehouseType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointTagPairToPb(st *EndpointTagPair) (*endpointTagPairPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointTagPairPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointTagPairPb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointTagPairFromPb(pb *endpointTagPairPb) (*EndpointTagPair, error) { + if pb == nil { + return nil, nil + } + st := &EndpointTagPair{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointTagPairPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointTagPairPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointTagsToPb(st *EndpointTags) (*endpointTagsPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointTagsPb{} + pb.CustomTags = st.CustomTags + + return pb, nil +} + +type endpointTagsPb struct { + CustomTags []EndpointTagPair `json:"custom_tags,omitempty"` +} + +func endpointTagsFromPb(pb *endpointTagsPb) (*EndpointTags, error) { + if pb == nil { + return nil, nil + } + st := &EndpointTags{} + st.CustomTags = pb.CustomTags + + return st, nil +} + +func enumValueToPb(st *EnumValue) (*enumValuePb, error) { + if st == nil { + return nil, nil + } + pb := &enumValuePb{} + pb.EnumOptions = st.EnumOptions + + pb.MultiValuesOptions = st.MultiValuesOptions + + pb.Values = st.Values + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type enumValuePb struct { + EnumOptions string `json:"enum_options,omitempty"` + + MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` + + Values []string `json:"values,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func enumValueFromPb(pb *enumValuePb) (*EnumValue, error) { + if pb == nil { + return nil, nil + } + st := &EnumValue{} + st.EnumOptions = pb.EnumOptions + st.MultiValuesOptions = pb.MultiValuesOptions + st.Values = pb.Values + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *enumValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st enumValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func executeStatementRequestToPb(st *ExecuteStatementRequest) (*executeStatementRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &executeStatementRequestPb{} + pb.ByteLimit = st.ByteLimit + + pb.Catalog = st.Catalog + + pb.Disposition = st.Disposition + + pb.Format = st.Format + + pb.OnWaitTimeout = st.OnWaitTimeout + + pb.Parameters = st.Parameters + + pb.RowLimit = st.RowLimit + + pb.Schema = st.Schema + + pb.Statement = st.Statement + + pb.WaitTimeout = st.WaitTimeout + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type executeStatementRequestPb struct { + ByteLimit int64 `json:"byte_limit,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Disposition Disposition `json:"disposition,omitempty"` + + Format Format `json:"format,omitempty"` + + OnWaitTimeout ExecuteStatementRequestOnWaitTimeout `json:"on_wait_timeout,omitempty"` + + Parameters []StatementParameterListItem `json:"parameters,omitempty"` + + RowLimit int64 `json:"row_limit,omitempty"` + + Schema string `json:"schema,omitempty"` + + Statement string `json:"statement"` + + WaitTimeout string `json:"wait_timeout,omitempty"` + + WarehouseId string `json:"warehouse_id"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func executeStatementRequestFromPb(pb *executeStatementRequestPb) (*ExecuteStatementRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExecuteStatementRequest{} + st.ByteLimit = pb.ByteLimit + st.Catalog = pb.Catalog + st.Disposition = pb.Disposition + st.Format = pb.Format + st.OnWaitTimeout = pb.OnWaitTimeout + st.Parameters = pb.Parameters + st.RowLimit = pb.RowLimit + st.Schema = pb.Schema + st.Statement = pb.Statement + st.WaitTimeout = pb.WaitTimeout + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *executeStatementRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st executeStatementRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func externalLinkToPb(st *ExternalLink) (*externalLinkPb, error) { + if st == nil { + return nil, nil + } + pb := &externalLinkPb{} + pb.ByteCount = st.ByteCount + + pb.ChunkIndex = st.ChunkIndex + + pb.Expiration = st.Expiration + + pb.ExternalLink = st.ExternalLink + + pb.HttpHeaders = st.HttpHeaders + + pb.NextChunkIndex = st.NextChunkIndex + + pb.NextChunkInternalLink = st.NextChunkInternalLink + + pb.RowCount = st.RowCount + + pb.RowOffset = st.RowOffset + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalLinkPb struct { + ByteCount int64 `json:"byte_count,omitempty"` + + ChunkIndex int `json:"chunk_index,omitempty"` + + Expiration string `json:"expiration,omitempty"` + + ExternalLink string `json:"external_link,omitempty"` + + HttpHeaders map[string]string `json:"http_headers,omitempty"` + + NextChunkIndex int `json:"next_chunk_index,omitempty"` + + NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + + RowCount int64 `json:"row_count,omitempty"` + + RowOffset int64 `json:"row_offset,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalLinkFromPb(pb *externalLinkPb) (*ExternalLink, error) { + if pb == nil { + return nil, nil + } + st := &ExternalLink{} + st.ByteCount = pb.ByteCount + st.ChunkIndex = pb.ChunkIndex + st.Expiration = pb.Expiration + st.ExternalLink = pb.ExternalLink + st.HttpHeaders = pb.HttpHeaders + st.NextChunkIndex = pb.NextChunkIndex + st.NextChunkInternalLink = pb.NextChunkInternalLink + st.RowCount = pb.RowCount + st.RowOffset = pb.RowOffset + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalLinkPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalLinkPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func externalQuerySourceToPb(st *ExternalQuerySource) (*externalQuerySourcePb, error) { + if st == nil { + return nil, nil + } + pb := &externalQuerySourcePb{} + pb.AlertId = st.AlertId + + pb.DashboardId = st.DashboardId + + pb.GenieSpaceId = st.GenieSpaceId + + pb.JobInfo = st.JobInfo + + pb.LegacyDashboardId = st.LegacyDashboardId + + pb.NotebookId = st.NotebookId + + pb.SqlQueryId = st.SqlQueryId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalQuerySourcePb struct { + AlertId string `json:"alert_id,omitempty"` + + DashboardId string `json:"dashboard_id,omitempty"` + + GenieSpaceId string `json:"genie_space_id,omitempty"` + + JobInfo *ExternalQuerySourceJobInfo `json:"job_info,omitempty"` + + LegacyDashboardId string `json:"legacy_dashboard_id,omitempty"` + + NotebookId string `json:"notebook_id,omitempty"` + + SqlQueryId string `json:"sql_query_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalQuerySourceFromPb(pb *externalQuerySourcePb) (*ExternalQuerySource, error) { + if pb == nil { + return nil, nil + } + st := &ExternalQuerySource{} + st.AlertId = pb.AlertId + st.DashboardId = pb.DashboardId + st.GenieSpaceId = pb.GenieSpaceId + st.JobInfo = pb.JobInfo + st.LegacyDashboardId = pb.LegacyDashboardId + st.NotebookId = pb.NotebookId + st.SqlQueryId = pb.SqlQueryId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalQuerySourcePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalQuerySourcePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func externalQuerySourceJobInfoToPb(st *ExternalQuerySourceJobInfo) (*externalQuerySourceJobInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &externalQuerySourceJobInfoPb{} + pb.JobId = st.JobId + + pb.JobRunId = st.JobRunId + + pb.JobTaskRunId = st.JobTaskRunId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type externalQuerySourceJobInfoPb struct { + JobId string `json:"job_id,omitempty"` + + JobRunId string `json:"job_run_id,omitempty"` + + JobTaskRunId string `json:"job_task_run_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func externalQuerySourceJobInfoFromPb(pb *externalQuerySourceJobInfoPb) (*ExternalQuerySourceJobInfo, error) { + if pb == nil { + return nil, nil + } + st := &ExternalQuerySourceJobInfo{} + st.JobId = pb.JobId + st.JobRunId = pb.JobRunId + st.JobTaskRunId = pb.JobTaskRunId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *externalQuerySourceJobInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st externalQuerySourceJobInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAlertRequestToPb(st *GetAlertRequest) (*getAlertRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAlertRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getAlertRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getAlertRequestFromPb(pb *getAlertRequestPb) (*GetAlertRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAlertRequest{} + st.Id = pb.Id + + return st, nil +} + +func getAlertV2RequestToPb(st *GetAlertV2Request) (*getAlertV2RequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAlertV2RequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getAlertV2RequestPb struct { + Id string `json:"-" url:"-"` +} + +func getAlertV2RequestFromPb(pb *getAlertV2RequestPb) (*GetAlertV2Request, error) { + if pb == nil { + return nil, nil + } + st := &GetAlertV2Request{} + st.Id = pb.Id + + return st, nil +} + +func getAlertsLegacyRequestToPb(st *GetAlertsLegacyRequest) (*getAlertsLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAlertsLegacyRequestPb{} + pb.AlertId = st.AlertId + + return pb, nil +} + +type getAlertsLegacyRequestPb struct { + AlertId string `json:"-" url:"-"` +} + +func getAlertsLegacyRequestFromPb(pb *getAlertsLegacyRequestPb) (*GetAlertsLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAlertsLegacyRequest{} + st.AlertId = pb.AlertId + + return st, nil +} + +func getDashboardRequestToPb(st *GetDashboardRequest) (*getDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type getDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func getDashboardRequestFromPb(pb *getDashboardRequestPb) (*GetDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func getDbsqlPermissionRequestToPb(st *GetDbsqlPermissionRequest) (*getDbsqlPermissionRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getDbsqlPermissionRequestPb{} + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + return pb, nil +} + +type getDbsqlPermissionRequestPb struct { + ObjectId string `json:"-" url:"-"` + + ObjectType ObjectTypePlural `json:"-" url:"-"` +} + +func getDbsqlPermissionRequestFromPb(pb *getDbsqlPermissionRequestPb) (*GetDbsqlPermissionRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetDbsqlPermissionRequest{} + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + return st, nil +} + +func getQueriesLegacyRequestToPb(st *GetQueriesLegacyRequest) (*getQueriesLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getQueriesLegacyRequestPb{} + pb.QueryId = st.QueryId + + return pb, nil +} + +type getQueriesLegacyRequestPb struct { + QueryId string `json:"-" url:"-"` +} + +func getQueriesLegacyRequestFromPb(pb *getQueriesLegacyRequestPb) (*GetQueriesLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetQueriesLegacyRequest{} + st.QueryId = pb.QueryId + + return st, nil +} + +func getQueryRequestToPb(st *GetQueryRequest) (*getQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getQueryRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getQueryRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getQueryRequestFromPb(pb *getQueryRequestPb) (*GetQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetQueryRequest{} + st.Id = pb.Id + + return st, nil +} + +func getResponseToPb(st *GetResponse) (*getResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getResponsePb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getResponsePb struct { + AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType ObjectType `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getResponseFromPb(pb *getResponsePb) (*GetResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetResponse{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getStatementRequestToPb(st *GetStatementRequest) (*getStatementRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStatementRequestPb{} + pb.StatementId = st.StatementId + + return pb, nil +} + +type getStatementRequestPb struct { + StatementId string `json:"-" url:"-"` +} + +func getStatementRequestFromPb(pb *getStatementRequestPb) (*GetStatementRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStatementRequest{} + st.StatementId = pb.StatementId + + return st, nil +} + +func getStatementResultChunkNRequestToPb(st *GetStatementResultChunkNRequest) (*getStatementResultChunkNRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStatementResultChunkNRequestPb{} + pb.ChunkIndex = st.ChunkIndex + + pb.StatementId = st.StatementId + + return pb, nil +} + +type getStatementResultChunkNRequestPb struct { + ChunkIndex int `json:"-" url:"-"` + + StatementId string `json:"-" url:"-"` +} + +func getStatementResultChunkNRequestFromPb(pb *getStatementResultChunkNRequestPb) (*GetStatementResultChunkNRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStatementResultChunkNRequest{} + st.ChunkIndex = pb.ChunkIndex + st.StatementId = pb.StatementId + + return st, nil +} + +func getWarehousePermissionLevelsRequestToPb(st *GetWarehousePermissionLevelsRequest) (*getWarehousePermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWarehousePermissionLevelsRequestPb{} + pb.WarehouseId = st.WarehouseId + + return pb, nil +} + +type getWarehousePermissionLevelsRequestPb struct { + WarehouseId string `json:"-" url:"-"` +} + +func getWarehousePermissionLevelsRequestFromPb(pb *getWarehousePermissionLevelsRequestPb) (*GetWarehousePermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWarehousePermissionLevelsRequest{} + st.WarehouseId = pb.WarehouseId + + return st, nil +} + +func getWarehousePermissionLevelsResponseToPb(st *GetWarehousePermissionLevelsResponse) (*getWarehousePermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getWarehousePermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getWarehousePermissionLevelsResponsePb struct { + PermissionLevels []WarehousePermissionsDescription `json:"permission_levels,omitempty"` +} + +func getWarehousePermissionLevelsResponseFromPb(pb *getWarehousePermissionLevelsResponsePb) (*GetWarehousePermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetWarehousePermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getWarehousePermissionsRequestToPb(st *GetWarehousePermissionsRequest) (*getWarehousePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWarehousePermissionsRequestPb{} + pb.WarehouseId = st.WarehouseId + + return pb, nil +} + +type getWarehousePermissionsRequestPb struct { + WarehouseId string `json:"-" url:"-"` +} + +func getWarehousePermissionsRequestFromPb(pb *getWarehousePermissionsRequestPb) (*GetWarehousePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWarehousePermissionsRequest{} + st.WarehouseId = pb.WarehouseId + + return st, nil +} + +func getWarehouseRequestToPb(st *GetWarehouseRequest) (*getWarehouseRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWarehouseRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type getWarehouseRequestPb struct { + Id string `json:"-" url:"-"` +} + +func getWarehouseRequestFromPb(pb *getWarehouseRequestPb) (*GetWarehouseRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWarehouseRequest{} + st.Id = pb.Id + + return st, nil +} + +func getWarehouseResponseToPb(st *GetWarehouseResponse) (*getWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getWarehouseResponsePb{} + pb.AutoStopMins = st.AutoStopMins + + pb.Channel = st.Channel + + pb.ClusterSize = st.ClusterSize + + pb.CreatorName = st.CreatorName + + pb.EnablePhoton = st.EnablePhoton + + pb.EnableServerlessCompute = st.EnableServerlessCompute + + pb.Health = st.Health + + pb.Id = st.Id + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.JdbcUrl = st.JdbcUrl + + pb.MaxNumClusters = st.MaxNumClusters + + pb.MinNumClusters = st.MinNumClusters + + pb.Name = st.Name + + pb.NumActiveSessions = st.NumActiveSessions + + pb.NumClusters = st.NumClusters + + pb.OdbcParams = st.OdbcParams + + pb.SpotInstancePolicy = st.SpotInstancePolicy + + pb.State = st.State + + pb.Tags = st.Tags + + pb.WarehouseType = st.WarehouseType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getWarehouseResponsePb struct { + AutoStopMins int `json:"auto_stop_mins,omitempty"` + + Channel *Channel `json:"channel,omitempty"` + + ClusterSize string `json:"cluster_size,omitempty"` + + CreatorName string `json:"creator_name,omitempty"` + + EnablePhoton bool `json:"enable_photon,omitempty"` + + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + + Health *EndpointHealth `json:"health,omitempty"` + + Id string `json:"id,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + JdbcUrl string `json:"jdbc_url,omitempty"` + + MaxNumClusters int `json:"max_num_clusters,omitempty"` + + MinNumClusters int `json:"min_num_clusters,omitempty"` + + Name string `json:"name,omitempty"` + + NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + + NumClusters int `json:"num_clusters,omitempty"` + + OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + + State State `json:"state,omitempty"` + + Tags *EndpointTags `json:"tags,omitempty"` + + WarehouseType GetWarehouseResponseWarehouseType `json:"warehouse_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getWarehouseResponseFromPb(pb *getWarehouseResponsePb) (*GetWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetWarehouseResponse{} + st.AutoStopMins = pb.AutoStopMins + st.Channel = pb.Channel + st.ClusterSize = pb.ClusterSize + st.CreatorName = pb.CreatorName + st.EnablePhoton = pb.EnablePhoton + st.EnableServerlessCompute = pb.EnableServerlessCompute + st.Health = pb.Health + st.Id = pb.Id + st.InstanceProfileArn = pb.InstanceProfileArn + st.JdbcUrl = pb.JdbcUrl + st.MaxNumClusters = pb.MaxNumClusters + st.MinNumClusters = pb.MinNumClusters + st.Name = pb.Name + st.NumActiveSessions = pb.NumActiveSessions + st.NumClusters = pb.NumClusters + st.OdbcParams = pb.OdbcParams + st.SpotInstancePolicy = pb.SpotInstancePolicy + st.State = pb.State + st.Tags = pb.Tags + st.WarehouseType = pb.WarehouseType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getWarehouseResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getWarehouseResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getWorkspaceWarehouseConfigResponseToPb(st *GetWorkspaceWarehouseConfigResponse) (*getWorkspaceWarehouseConfigResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceWarehouseConfigResponsePb{} + pb.Channel = st.Channel + + pb.ConfigParam = st.ConfigParam + + pb.DataAccessConfig = st.DataAccessConfig + + pb.EnabledWarehouseTypes = st.EnabledWarehouseTypes + + pb.GlobalParam = st.GlobalParam + + pb.GoogleServiceAccount = st.GoogleServiceAccount + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.SecurityPolicy = st.SecurityPolicy + + pb.SqlConfigurationParameters = st.SqlConfigurationParameters + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getWorkspaceWarehouseConfigResponsePb struct { + Channel *Channel `json:"channel,omitempty"` + + ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + + DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + + EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + + GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + + GoogleServiceAccount string `json:"google_service_account,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + SecurityPolicy GetWorkspaceWarehouseConfigResponseSecurityPolicy `json:"security_policy,omitempty"` + + SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getWorkspaceWarehouseConfigResponseFromPb(pb *getWorkspaceWarehouseConfigResponsePb) (*GetWorkspaceWarehouseConfigResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceWarehouseConfigResponse{} + st.Channel = pb.Channel + st.ConfigParam = pb.ConfigParam + st.DataAccessConfig = pb.DataAccessConfig + st.EnabledWarehouseTypes = pb.EnabledWarehouseTypes + st.GlobalParam = pb.GlobalParam + st.GoogleServiceAccount = pb.GoogleServiceAccount + st.InstanceProfileArn = pb.InstanceProfileArn + st.SecurityPolicy = pb.SecurityPolicy + st.SqlConfigurationParameters = pb.SqlConfigurationParameters + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getWorkspaceWarehouseConfigResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getWorkspaceWarehouseConfigResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func legacyAlertToPb(st *LegacyAlert) (*legacyAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &legacyAlertPb{} + pb.CreatedAt = st.CreatedAt + + pb.Id = st.Id + + pb.LastTriggeredAt = st.LastTriggeredAt + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Parent = st.Parent + + pb.Query = st.Query + + pb.Rearm = st.Rearm + + pb.State = st.State + + pb.UpdatedAt = st.UpdatedAt + + pb.User = st.User + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type legacyAlertPb struct { + CreatedAt string `json:"created_at,omitempty"` + + Id string `json:"id,omitempty"` + + LastTriggeredAt string `json:"last_triggered_at,omitempty"` + + Name string `json:"name,omitempty"` + + Options *AlertOptions `json:"options,omitempty"` + + Parent string `json:"parent,omitempty"` + + Query *AlertQuery `json:"query,omitempty"` + + Rearm int `json:"rearm,omitempty"` + + State LegacyAlertState `json:"state,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + User *User `json:"user,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func legacyAlertFromPb(pb *legacyAlertPb) (*LegacyAlert, error) { + if pb == nil { + return nil, nil + } + st := &LegacyAlert{} + st.CreatedAt = pb.CreatedAt + st.Id = pb.Id + st.LastTriggeredAt = pb.LastTriggeredAt + st.Name = pb.Name + st.Options = pb.Options + st.Parent = pb.Parent + st.Query = pb.Query + st.Rearm = pb.Rearm + st.State = pb.State + st.UpdatedAt = pb.UpdatedAt + st.User = pb.User + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *legacyAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st legacyAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func legacyQueryToPb(st *LegacyQuery) (*legacyQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &legacyQueryPb{} + pb.CanEdit = st.CanEdit + + pb.CreatedAt = st.CreatedAt + + pb.DataSourceId = st.DataSourceId + + pb.Description = st.Description + + pb.Id = st.Id + + pb.IsArchived = st.IsArchived + + pb.IsDraft = st.IsDraft + + pb.IsFavorite = st.IsFavorite + + pb.IsSafe = st.IsSafe + + pb.LastModifiedBy = st.LastModifiedBy + + pb.LastModifiedById = st.LastModifiedById + + pb.LatestQueryDataId = st.LatestQueryDataId + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Parent = st.Parent + + pb.PermissionTier = st.PermissionTier + + pb.Query = st.Query + + pb.QueryHash = st.QueryHash + + pb.RunAsRole = st.RunAsRole + + pb.Tags = st.Tags + + pb.UpdatedAt = st.UpdatedAt + + pb.User = st.User + + pb.UserId = st.UserId + + pb.Visualizations = st.Visualizations + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type legacyQueryPb struct { + CanEdit bool `json:"can_edit,omitempty"` + + CreatedAt string `json:"created_at,omitempty"` + + DataSourceId string `json:"data_source_id,omitempty"` + + Description string `json:"description,omitempty"` + + Id string `json:"id,omitempty"` + + IsArchived bool `json:"is_archived,omitempty"` + + IsDraft bool `json:"is_draft,omitempty"` + + IsFavorite bool `json:"is_favorite,omitempty"` + + IsSafe bool `json:"is_safe,omitempty"` + + LastModifiedBy *User `json:"last_modified_by,omitempty"` + + LastModifiedById int `json:"last_modified_by_id,omitempty"` + + LatestQueryDataId string `json:"latest_query_data_id,omitempty"` + + Name string `json:"name,omitempty"` + + Options *QueryOptions `json:"options,omitempty"` + + Parent string `json:"parent,omitempty"` + + PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + + Query string `json:"query,omitempty"` + + QueryHash string `json:"query_hash,omitempty"` + + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + User *User `json:"user,omitempty"` + + UserId int `json:"user_id,omitempty"` + + Visualizations []LegacyVisualization `json:"visualizations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func legacyQueryFromPb(pb *legacyQueryPb) (*LegacyQuery, error) { + if pb == nil { + return nil, nil + } + st := &LegacyQuery{} + st.CanEdit = pb.CanEdit + st.CreatedAt = pb.CreatedAt + st.DataSourceId = pb.DataSourceId + st.Description = pb.Description + st.Id = pb.Id + st.IsArchived = pb.IsArchived + st.IsDraft = pb.IsDraft + st.IsFavorite = pb.IsFavorite + st.IsSafe = pb.IsSafe + st.LastModifiedBy = pb.LastModifiedBy + st.LastModifiedById = pb.LastModifiedById + st.LatestQueryDataId = pb.LatestQueryDataId + st.Name = pb.Name + st.Options = pb.Options + st.Parent = pb.Parent + st.PermissionTier = pb.PermissionTier + st.Query = pb.Query + st.QueryHash = pb.QueryHash + st.RunAsRole = pb.RunAsRole + st.Tags = pb.Tags + st.UpdatedAt = pb.UpdatedAt + st.User = pb.User + st.UserId = pb.UserId + st.Visualizations = pb.Visualizations + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *legacyQueryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st legacyQueryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func legacyVisualizationToPb(st *LegacyVisualization) (*legacyVisualizationPb, error) { + if st == nil { + return nil, nil + } + pb := &legacyVisualizationPb{} + pb.CreatedAt = st.CreatedAt + + pb.Description = st.Description + + pb.Id = st.Id + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Query = st.Query + + pb.Type = st.Type + + pb.UpdatedAt = st.UpdatedAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type legacyVisualizationPb struct { + CreatedAt string `json:"created_at,omitempty"` + + Description string `json:"description,omitempty"` + + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + Options any `json:"options,omitempty"` + + Query *LegacyQuery `json:"query,omitempty"` + + Type string `json:"type,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func legacyVisualizationFromPb(pb *legacyVisualizationPb) (*LegacyVisualization, error) { + if pb == nil { + return nil, nil + } + st := &LegacyVisualization{} + st.CreatedAt = pb.CreatedAt + st.Description = pb.Description + st.Id = pb.Id + st.Name = pb.Name + st.Options = pb.Options + st.Query = pb.Query + st.Type = pb.Type + st.UpdatedAt = pb.UpdatedAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *legacyVisualizationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st legacyVisualizationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAlertsRequestToPb(st *ListAlertsRequest) (*listAlertsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAlertsRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAlertsRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAlertsRequestFromPb(pb *listAlertsRequestPb) (*ListAlertsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAlertsRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAlertsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAlertsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAlertsResponseToPb(st *ListAlertsResponse) (*listAlertsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAlertsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAlertsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Results []ListAlertsResponseAlert `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAlertsResponseFromPb(pb *listAlertsResponsePb) (*ListAlertsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAlertsResponse{} + st.NextPageToken = pb.NextPageToken + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAlertsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAlertsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAlertsResponseAlertToPb(st *ListAlertsResponseAlert) (*listAlertsResponseAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &listAlertsResponseAlertPb{} + pb.Condition = st.Condition + + pb.CreateTime = st.CreateTime + + pb.CustomBody = st.CustomBody + + pb.CustomSubject = st.CustomSubject + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.LifecycleState = st.LifecycleState + + pb.NotifyOnOk = st.NotifyOnOk + + pb.OwnerUserName = st.OwnerUserName + + pb.QueryId = st.QueryId + + pb.SecondsToRetrigger = st.SecondsToRetrigger + + pb.State = st.State + + pb.TriggerTime = st.TriggerTime + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAlertsResponseAlertPb struct { + Condition *AlertCondition `json:"condition,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + CustomBody string `json:"custom_body,omitempty"` + + CustomSubject string `json:"custom_subject,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + + State AlertState `json:"state,omitempty"` + + TriggerTime string `json:"trigger_time,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAlertsResponseAlertFromPb(pb *listAlertsResponseAlertPb) (*ListAlertsResponseAlert, error) { + if pb == nil { + return nil, nil + } + st := &ListAlertsResponseAlert{} + st.Condition = pb.Condition + st.CreateTime = pb.CreateTime + st.CustomBody = pb.CustomBody + st.CustomSubject = pb.CustomSubject + st.DisplayName = pb.DisplayName + st.Id = pb.Id + st.LifecycleState = pb.LifecycleState + st.NotifyOnOk = pb.NotifyOnOk + st.OwnerUserName = pb.OwnerUserName + st.QueryId = pb.QueryId + st.SecondsToRetrigger = pb.SecondsToRetrigger + st.State = pb.State + st.TriggerTime = pb.TriggerTime + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAlertsResponseAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAlertsResponseAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAlertsV2RequestToPb(st *ListAlertsV2Request) (*listAlertsV2RequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAlertsV2RequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAlertsV2RequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAlertsV2RequestFromPb(pb *listAlertsV2RequestPb) (*ListAlertsV2Request, error) { + if pb == nil { + return nil, nil + } + st := &ListAlertsV2Request{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAlertsV2RequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAlertsV2RequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listAlertsV2ResponseToPb(st *ListAlertsV2Response) (*listAlertsV2ResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAlertsV2ResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listAlertsV2ResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Results []AlertV2 `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listAlertsV2ResponseFromPb(pb *listAlertsV2ResponsePb) (*ListAlertsV2Response, error) { + if pb == nil { + return nil, nil + } + st := &ListAlertsV2Response{} + st.NextPageToken = pb.NextPageToken + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listAlertsV2ResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listAlertsV2ResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listDashboardsRequestPb{} + pb.Order = st.Order + + pb.Page = st.Page + + pb.PageSize = st.PageSize + + pb.Q = st.Q + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listDashboardsRequestPb struct { + Order ListOrder `json:"-" url:"order,omitempty"` + + Page int `json:"-" url:"page,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + Q string `json:"-" url:"q,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listDashboardsRequestFromPb(pb *listDashboardsRequestPb) (*ListDashboardsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListDashboardsRequest{} + st.Order = pb.Order + st.Page = pb.Page + st.PageSize = pb.PageSize + st.Q = pb.Q + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listDashboardsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listDashboardsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueriesLegacyRequestToPb(st *ListQueriesLegacyRequest) (*listQueriesLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listQueriesLegacyRequestPb{} + pb.Order = st.Order + + pb.Page = st.Page + + pb.PageSize = st.PageSize + + pb.Q = st.Q + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueriesLegacyRequestPb struct { + Order string `json:"-" url:"order,omitempty"` + + Page int `json:"-" url:"page,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + Q string `json:"-" url:"q,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueriesLegacyRequestFromPb(pb *listQueriesLegacyRequestPb) (*ListQueriesLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListQueriesLegacyRequest{} + st.Order = pb.Order + st.Page = pb.Page + st.PageSize = pb.PageSize + st.Q = pb.Q + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueriesLegacyRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueriesLegacyRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueriesRequestToPb(st *ListQueriesRequest) (*listQueriesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listQueriesRequestPb{} + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueriesRequestPb struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueriesRequestFromPb(pb *listQueriesRequestPb) (*ListQueriesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListQueriesRequest{} + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueriesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueriesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueriesResponseToPb(st *ListQueriesResponse) (*listQueriesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listQueriesResponsePb{} + pb.HasNextPage = st.HasNextPage + + pb.NextPageToken = st.NextPageToken + + pb.Res = st.Res + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueriesResponsePb struct { + HasNextPage bool `json:"has_next_page,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + Res []QueryInfo `json:"res,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueriesResponseFromPb(pb *listQueriesResponsePb) (*ListQueriesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListQueriesResponse{} + st.HasNextPage = pb.HasNextPage + st.NextPageToken = pb.NextPageToken + st.Res = pb.Res + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueriesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueriesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueryHistoryRequestToPb(st *ListQueryHistoryRequest) (*listQueryHistoryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listQueryHistoryRequestPb{} + pb.FilterBy = st.FilterBy + + pb.IncludeMetrics = st.IncludeMetrics + + pb.MaxResults = st.MaxResults + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueryHistoryRequestPb struct { + FilterBy *QueryFilter `json:"-" url:"filter_by,omitempty"` + + IncludeMetrics bool `json:"-" url:"include_metrics,omitempty"` + + MaxResults int `json:"-" url:"max_results,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueryHistoryRequestFromPb(pb *listQueryHistoryRequestPb) (*ListQueryHistoryRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListQueryHistoryRequest{} + st.FilterBy = pb.FilterBy + st.IncludeMetrics = pb.IncludeMetrics + st.MaxResults = pb.MaxResults + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueryHistoryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueryHistoryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueryObjectsResponseToPb(st *ListQueryObjectsResponse) (*listQueryObjectsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listQueryObjectsResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueryObjectsResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Results []ListQueryObjectsResponseQuery `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueryObjectsResponseFromPb(pb *listQueryObjectsResponsePb) (*ListQueryObjectsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListQueryObjectsResponse{} + st.NextPageToken = pb.NextPageToken + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueryObjectsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueryObjectsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listQueryObjectsResponseQueryToPb(st *ListQueryObjectsResponseQuery) (*listQueryObjectsResponseQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &listQueryObjectsResponseQueryPb{} + pb.ApplyAutoLimit = st.ApplyAutoLimit + + pb.Catalog = st.Catalog + + pb.CreateTime = st.CreateTime + + pb.Description = st.Description + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.LastModifierUserName = st.LastModifierUserName + + pb.LifecycleState = st.LifecycleState + + pb.OwnerUserName = st.OwnerUserName + + pb.Parameters = st.Parameters + + pb.QueryText = st.QueryText + + pb.RunAsMode = st.RunAsMode + + pb.Schema = st.Schema + + pb.Tags = st.Tags + + pb.UpdateTime = st.UpdateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listQueryObjectsResponseQueryPb struct { + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + Parameters []QueryParameter `json:"parameters,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + + Schema string `json:"schema,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listQueryObjectsResponseQueryFromPb(pb *listQueryObjectsResponseQueryPb) (*ListQueryObjectsResponseQuery, error) { + if pb == nil { + return nil, nil + } + st := &ListQueryObjectsResponseQuery{} + st.ApplyAutoLimit = pb.ApplyAutoLimit + st.Catalog = pb.Catalog + st.CreateTime = pb.CreateTime + st.Description = pb.Description + st.DisplayName = pb.DisplayName + st.Id = pb.Id + st.LastModifierUserName = pb.LastModifierUserName + st.LifecycleState = pb.LifecycleState + st.OwnerUserName = pb.OwnerUserName + st.Parameters = pb.Parameters + st.QueryText = pb.QueryText + st.RunAsMode = pb.RunAsMode + st.Schema = pb.Schema + st.Tags = pb.Tags + st.UpdateTime = pb.UpdateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listQueryObjectsResponseQueryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listQueryObjectsResponseQueryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listResponseToPb(st *ListResponse) (*listResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listResponsePb{} + pb.Count = st.Count + + pb.Page = st.Page + + pb.PageSize = st.PageSize + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listResponsePb struct { + Count int `json:"count,omitempty"` + + Page int `json:"page,omitempty"` + + PageSize int `json:"page_size,omitempty"` + + Results []Dashboard `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listResponseFromPb(pb *listResponsePb) (*ListResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListResponse{} + st.Count = pb.Count + st.Page = pb.Page + st.PageSize = pb.PageSize + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listVisualizationsForQueryRequestToPb(st *ListVisualizationsForQueryRequest) (*listVisualizationsForQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listVisualizationsForQueryRequestPb{} + pb.Id = st.Id + + pb.PageSize = st.PageSize + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listVisualizationsForQueryRequestPb struct { + Id string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listVisualizationsForQueryRequestFromPb(pb *listVisualizationsForQueryRequestPb) (*ListVisualizationsForQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListVisualizationsForQueryRequest{} + st.Id = pb.Id + st.PageSize = pb.PageSize + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listVisualizationsForQueryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listVisualizationsForQueryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listVisualizationsForQueryResponseToPb(st *ListVisualizationsForQueryResponse) (*listVisualizationsForQueryResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listVisualizationsForQueryResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listVisualizationsForQueryResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Results []Visualization `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listVisualizationsForQueryResponseFromPb(pb *listVisualizationsForQueryResponsePb) (*ListVisualizationsForQueryResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListVisualizationsForQueryResponse{} + st.NextPageToken = pb.NextPageToken + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listVisualizationsForQueryResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listVisualizationsForQueryResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listWarehousesRequestToPb(st *ListWarehousesRequest) (*listWarehousesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listWarehousesRequestPb{} + pb.RunAsUserId = st.RunAsUserId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listWarehousesRequestPb struct { + RunAsUserId int `json:"-" url:"run_as_user_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listWarehousesRequestFromPb(pb *listWarehousesRequestPb) (*ListWarehousesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListWarehousesRequest{} + st.RunAsUserId = pb.RunAsUserId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listWarehousesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listWarehousesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listWarehousesResponseToPb(st *ListWarehousesResponse) (*listWarehousesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listWarehousesResponsePb{} + pb.Warehouses = st.Warehouses + + return pb, nil +} + +type listWarehousesResponsePb struct { + Warehouses []EndpointInfo `json:"warehouses,omitempty"` +} + +func listWarehousesResponseFromPb(pb *listWarehousesResponsePb) (*ListWarehousesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListWarehousesResponse{} + st.Warehouses = pb.Warehouses + + return st, nil +} + +func multiValuesOptionsToPb(st *MultiValuesOptions) (*multiValuesOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &multiValuesOptionsPb{} + pb.Prefix = st.Prefix + + pb.Separator = st.Separator + + pb.Suffix = st.Suffix + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type multiValuesOptionsPb struct { + Prefix string `json:"prefix,omitempty"` + + Separator string `json:"separator,omitempty"` + + Suffix string `json:"suffix,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func multiValuesOptionsFromPb(pb *multiValuesOptionsPb) (*MultiValuesOptions, error) { + if pb == nil { + return nil, nil + } + st := &MultiValuesOptions{} + st.Prefix = pb.Prefix + st.Separator = pb.Separator + st.Suffix = pb.Suffix + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *multiValuesOptionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st multiValuesOptionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func numericValueToPb(st *NumericValue) (*numericValuePb, error) { + if st == nil { + return nil, nil + } + pb := &numericValuePb{} + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type numericValuePb struct { + Value float64 `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func numericValueFromPb(pb *numericValuePb) (*NumericValue, error) { + if pb == nil { + return nil, nil + } + st := &NumericValue{} + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *numericValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st numericValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func odbcParamsToPb(st *OdbcParams) (*odbcParamsPb, error) { + if st == nil { + return nil, nil + } + pb := &odbcParamsPb{} + pb.Hostname = st.Hostname + + pb.Path = st.Path + + pb.Port = st.Port + + pb.Protocol = st.Protocol + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type odbcParamsPb struct { + Hostname string `json:"hostname,omitempty"` + + Path string `json:"path,omitempty"` + + Port int `json:"port,omitempty"` + + Protocol string `json:"protocol,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func odbcParamsFromPb(pb *odbcParamsPb) (*OdbcParams, error) { + if pb == nil { + return nil, nil + } + st := &OdbcParams{} + st.Hostname = pb.Hostname + st.Path = pb.Path + st.Port = pb.Port + st.Protocol = pb.Protocol + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *odbcParamsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st odbcParamsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func parameterToPb(st *Parameter) (*parameterPb, error) { + if st == nil { + return nil, nil + } + pb := ¶meterPb{} + pb.EnumOptions = st.EnumOptions + + pb.MultiValuesOptions = st.MultiValuesOptions + + pb.Name = st.Name + + pb.QueryId = st.QueryId + + pb.Title = st.Title + + pb.Type = st.Type + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type parameterPb struct { + EnumOptions string `json:"enumOptions,omitempty"` + + MultiValuesOptions *MultiValuesOptions `json:"multiValuesOptions,omitempty"` + + Name string `json:"name,omitempty"` + + QueryId string `json:"queryId,omitempty"` + + Title string `json:"title,omitempty"` + + Type ParameterType `json:"type,omitempty"` + + Value any `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func parameterFromPb(pb *parameterPb) (*Parameter, error) { + if pb == nil { + return nil, nil + } + st := &Parameter{} + st.EnumOptions = pb.EnumOptions + st.MultiValuesOptions = pb.MultiValuesOptions + st.Name = pb.Name + st.QueryId = pb.QueryId + st.Title = pb.Title + st.Type = pb.Type + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *parameterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st parameterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryToPb(st *Query) (*queryPb, error) { + if st == nil { + return nil, nil + } + pb := &queryPb{} + pb.ApplyAutoLimit = st.ApplyAutoLimit + + pb.Catalog = st.Catalog + + pb.CreateTime = st.CreateTime + + pb.Description = st.Description + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.LastModifierUserName = st.LastModifierUserName + + pb.LifecycleState = st.LifecycleState + + pb.OwnerUserName = st.OwnerUserName + + pb.Parameters = st.Parameters + + pb.ParentPath = st.ParentPath + + pb.QueryText = st.QueryText + + pb.RunAsMode = st.RunAsMode + + pb.Schema = st.Schema + + pb.Tags = st.Tags + + pb.UpdateTime = st.UpdateTime + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryPb struct { + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + CreateTime string `json:"create_time,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + Parameters []QueryParameter `json:"parameters,omitempty"` + + ParentPath string `json:"parent_path,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + + Schema string `json:"schema,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryFromPb(pb *queryPb) (*Query, error) { + if pb == nil { + return nil, nil + } + st := &Query{} + st.ApplyAutoLimit = pb.ApplyAutoLimit + st.Catalog = pb.Catalog + st.CreateTime = pb.CreateTime + st.Description = pb.Description + st.DisplayName = pb.DisplayName + st.Id = pb.Id + st.LastModifierUserName = pb.LastModifierUserName + st.LifecycleState = pb.LifecycleState + st.OwnerUserName = pb.OwnerUserName + st.Parameters = pb.Parameters + st.ParentPath = pb.ParentPath + st.QueryText = pb.QueryText + st.RunAsMode = pb.RunAsMode + st.Schema = pb.Schema + st.Tags = pb.Tags + st.UpdateTime = pb.UpdateTime + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryBackedValueToPb(st *QueryBackedValue) (*queryBackedValuePb, error) { + if st == nil { + return nil, nil + } + pb := &queryBackedValuePb{} + pb.MultiValuesOptions = st.MultiValuesOptions + + pb.QueryId = st.QueryId + + pb.Values = st.Values + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryBackedValuePb struct { + MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + Values []string `json:"values,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryBackedValueFromPb(pb *queryBackedValuePb) (*QueryBackedValue, error) { + if pb == nil { + return nil, nil + } + st := &QueryBackedValue{} + st.MultiValuesOptions = pb.MultiValuesOptions + st.QueryId = pb.QueryId + st.Values = pb.Values + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryBackedValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryBackedValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryEditContentToPb(st *QueryEditContent) (*queryEditContentPb, error) { + if st == nil { + return nil, nil + } + pb := &queryEditContentPb{} + pb.DataSourceId = st.DataSourceId + + pb.Description = st.Description + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Query = st.Query + + pb.QueryId = st.QueryId + + pb.RunAsRole = st.RunAsRole + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryEditContentPb struct { + DataSourceId string `json:"data_source_id,omitempty"` + + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + Options any `json:"options,omitempty"` + + Query string `json:"query,omitempty"` + + QueryId string `json:"-" url:"-"` + + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + + Tags []string `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryEditContentFromPb(pb *queryEditContentPb) (*QueryEditContent, error) { + if pb == nil { + return nil, nil + } + st := &QueryEditContent{} + st.DataSourceId = pb.DataSourceId + st.Description = pb.Description + st.Name = pb.Name + st.Options = pb.Options + st.Query = pb.Query + st.QueryId = pb.QueryId + st.RunAsRole = pb.RunAsRole + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryEditContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryEditContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryFilterToPb(st *QueryFilter) (*queryFilterPb, error) { + if st == nil { + return nil, nil + } + pb := &queryFilterPb{} + pb.QueryStartTimeRange = st.QueryStartTimeRange + + pb.StatementIds = st.StatementIds + + pb.Statuses = st.Statuses + + pb.UserIds = st.UserIds + + pb.WarehouseIds = st.WarehouseIds + + return pb, nil +} + +type queryFilterPb struct { + QueryStartTimeRange *TimeRange `json:"query_start_time_range,omitempty" url:"query_start_time_range,omitempty"` + + StatementIds []string `json:"statement_ids,omitempty" url:"statement_ids,omitempty"` + + Statuses []QueryStatus `json:"statuses,omitempty" url:"statuses,omitempty"` + + UserIds []int64 `json:"user_ids,omitempty" url:"user_ids,omitempty"` + + WarehouseIds []string `json:"warehouse_ids,omitempty" url:"warehouse_ids,omitempty"` +} + +func queryFilterFromPb(pb *queryFilterPb) (*QueryFilter, error) { + if pb == nil { + return nil, nil + } + st := &QueryFilter{} + st.QueryStartTimeRange = pb.QueryStartTimeRange + st.StatementIds = pb.StatementIds + st.Statuses = pb.Statuses + st.UserIds = pb.UserIds + st.WarehouseIds = pb.WarehouseIds + + return st, nil +} + +func queryInfoToPb(st *QueryInfo) (*queryInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &queryInfoPb{} + pb.ChannelUsed = st.ChannelUsed + + pb.ClientApplication = st.ClientApplication + + pb.Duration = st.Duration + + pb.EndpointId = st.EndpointId + + pb.ErrorMessage = st.ErrorMessage + + pb.ExecutedAsUserId = st.ExecutedAsUserId + + pb.ExecutedAsUserName = st.ExecutedAsUserName + + pb.ExecutionEndTimeMs = st.ExecutionEndTimeMs + + pb.IsFinal = st.IsFinal + + pb.LookupKey = st.LookupKey + + pb.Metrics = st.Metrics + + pb.PlansState = st.PlansState + + pb.QueryEndTimeMs = st.QueryEndTimeMs + + pb.QueryId = st.QueryId + + pb.QuerySource = st.QuerySource + + pb.QueryStartTimeMs = st.QueryStartTimeMs + + pb.QueryText = st.QueryText + + pb.RowsProduced = st.RowsProduced + + pb.SparkUiUrl = st.SparkUiUrl + + pb.StatementType = st.StatementType + + pb.Status = st.Status + + pb.UserId = st.UserId + + pb.UserName = st.UserName + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryInfoPb struct { + ChannelUsed *ChannelInfo `json:"channel_used,omitempty"` + + ClientApplication string `json:"client_application,omitempty"` + + Duration int64 `json:"duration,omitempty"` + + EndpointId string `json:"endpoint_id,omitempty"` + + ErrorMessage string `json:"error_message,omitempty"` + + ExecutedAsUserId int64 `json:"executed_as_user_id,omitempty"` + + ExecutedAsUserName string `json:"executed_as_user_name,omitempty"` + + ExecutionEndTimeMs int64 `json:"execution_end_time_ms,omitempty"` + + IsFinal bool `json:"is_final,omitempty"` + + LookupKey string `json:"lookup_key,omitempty"` + + Metrics *QueryMetrics `json:"metrics,omitempty"` + + PlansState PlansState `json:"plans_state,omitempty"` + + QueryEndTimeMs int64 `json:"query_end_time_ms,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + QuerySource *ExternalQuerySource `json:"query_source,omitempty"` + + QueryStartTimeMs int64 `json:"query_start_time_ms,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RowsProduced int64 `json:"rows_produced,omitempty"` + + SparkUiUrl string `json:"spark_ui_url,omitempty"` + + StatementType QueryStatementType `json:"statement_type,omitempty"` + + Status QueryStatus `json:"status,omitempty"` + + UserId int64 `json:"user_id,omitempty"` + + UserName string `json:"user_name,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryInfoFromPb(pb *queryInfoPb) (*QueryInfo, error) { + if pb == nil { + return nil, nil + } + st := &QueryInfo{} + st.ChannelUsed = pb.ChannelUsed + st.ClientApplication = pb.ClientApplication + st.Duration = pb.Duration + st.EndpointId = pb.EndpointId + st.ErrorMessage = pb.ErrorMessage + st.ExecutedAsUserId = pb.ExecutedAsUserId + st.ExecutedAsUserName = pb.ExecutedAsUserName + st.ExecutionEndTimeMs = pb.ExecutionEndTimeMs + st.IsFinal = pb.IsFinal + st.LookupKey = pb.LookupKey + st.Metrics = pb.Metrics + st.PlansState = pb.PlansState + st.QueryEndTimeMs = pb.QueryEndTimeMs + st.QueryId = pb.QueryId + st.QuerySource = pb.QuerySource + st.QueryStartTimeMs = pb.QueryStartTimeMs + st.QueryText = pb.QueryText + st.RowsProduced = pb.RowsProduced + st.SparkUiUrl = pb.SparkUiUrl + st.StatementType = pb.StatementType + st.Status = pb.Status + st.UserId = pb.UserId + st.UserName = pb.UserName + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryListToPb(st *QueryList) (*queryListPb, error) { + if st == nil { + return nil, nil + } + pb := &queryListPb{} + pb.Count = st.Count + + pb.Page = st.Page + + pb.PageSize = st.PageSize + + pb.Results = st.Results + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryListPb struct { + Count int `json:"count,omitempty"` + + Page int `json:"page,omitempty"` + + PageSize int `json:"page_size,omitempty"` + + Results []LegacyQuery `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryListFromPb(pb *queryListPb) (*QueryList, error) { + if pb == nil { + return nil, nil + } + st := &QueryList{} + st.Count = pb.Count + st.Page = pb.Page + st.PageSize = pb.PageSize + st.Results = pb.Results + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryListPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryListPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryMetricsToPb(st *QueryMetrics) (*queryMetricsPb, error) { + if st == nil { + return nil, nil + } + pb := &queryMetricsPb{} + pb.CompilationTimeMs = st.CompilationTimeMs + + pb.ExecutionTimeMs = st.ExecutionTimeMs + + pb.NetworkSentBytes = st.NetworkSentBytes + + pb.OverloadingQueueStartTimestamp = st.OverloadingQueueStartTimestamp + + pb.PhotonTotalTimeMs = st.PhotonTotalTimeMs + + pb.ProvisioningQueueStartTimestamp = st.ProvisioningQueueStartTimestamp + + pb.PrunedBytes = st.PrunedBytes + + pb.PrunedFilesCount = st.PrunedFilesCount + + pb.QueryCompilationStartTimestamp = st.QueryCompilationStartTimestamp + + pb.ReadBytes = st.ReadBytes + + pb.ReadCacheBytes = st.ReadCacheBytes + + pb.ReadFilesCount = st.ReadFilesCount + + pb.ReadPartitionsCount = st.ReadPartitionsCount + + pb.ReadRemoteBytes = st.ReadRemoteBytes + + pb.ResultFetchTimeMs = st.ResultFetchTimeMs + + pb.ResultFromCache = st.ResultFromCache + + pb.RowsProducedCount = st.RowsProducedCount + + pb.RowsReadCount = st.RowsReadCount + + pb.SpillToDiskBytes = st.SpillToDiskBytes + + pb.TaskTotalTimeMs = st.TaskTotalTimeMs + + pb.TotalTimeMs = st.TotalTimeMs + + pb.WriteRemoteBytes = st.WriteRemoteBytes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryMetricsPb struct { + CompilationTimeMs int64 `json:"compilation_time_ms,omitempty"` + + ExecutionTimeMs int64 `json:"execution_time_ms,omitempty"` + + NetworkSentBytes int64 `json:"network_sent_bytes,omitempty"` + + OverloadingQueueStartTimestamp int64 `json:"overloading_queue_start_timestamp,omitempty"` + + PhotonTotalTimeMs int64 `json:"photon_total_time_ms,omitempty"` + + ProvisioningQueueStartTimestamp int64 `json:"provisioning_queue_start_timestamp,omitempty"` + + PrunedBytes int64 `json:"pruned_bytes,omitempty"` + + PrunedFilesCount int64 `json:"pruned_files_count,omitempty"` + + QueryCompilationStartTimestamp int64 `json:"query_compilation_start_timestamp,omitempty"` + + ReadBytes int64 `json:"read_bytes,omitempty"` + + ReadCacheBytes int64 `json:"read_cache_bytes,omitempty"` + + ReadFilesCount int64 `json:"read_files_count,omitempty"` + + ReadPartitionsCount int64 `json:"read_partitions_count,omitempty"` + + ReadRemoteBytes int64 `json:"read_remote_bytes,omitempty"` + + ResultFetchTimeMs int64 `json:"result_fetch_time_ms,omitempty"` + + ResultFromCache bool `json:"result_from_cache,omitempty"` + + RowsProducedCount int64 `json:"rows_produced_count,omitempty"` + + RowsReadCount int64 `json:"rows_read_count,omitempty"` + + SpillToDiskBytes int64 `json:"spill_to_disk_bytes,omitempty"` + + TaskTotalTimeMs int64 `json:"task_total_time_ms,omitempty"` + + TotalTimeMs int64 `json:"total_time_ms,omitempty"` + + WriteRemoteBytes int64 `json:"write_remote_bytes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryMetricsFromPb(pb *queryMetricsPb) (*QueryMetrics, error) { + if pb == nil { + return nil, nil + } + st := &QueryMetrics{} + st.CompilationTimeMs = pb.CompilationTimeMs + st.ExecutionTimeMs = pb.ExecutionTimeMs + st.NetworkSentBytes = pb.NetworkSentBytes + st.OverloadingQueueStartTimestamp = pb.OverloadingQueueStartTimestamp + st.PhotonTotalTimeMs = pb.PhotonTotalTimeMs + st.ProvisioningQueueStartTimestamp = pb.ProvisioningQueueStartTimestamp + st.PrunedBytes = pb.PrunedBytes + st.PrunedFilesCount = pb.PrunedFilesCount + st.QueryCompilationStartTimestamp = pb.QueryCompilationStartTimestamp + st.ReadBytes = pb.ReadBytes + st.ReadCacheBytes = pb.ReadCacheBytes + st.ReadFilesCount = pb.ReadFilesCount + st.ReadPartitionsCount = pb.ReadPartitionsCount + st.ReadRemoteBytes = pb.ReadRemoteBytes + st.ResultFetchTimeMs = pb.ResultFetchTimeMs + st.ResultFromCache = pb.ResultFromCache + st.RowsProducedCount = pb.RowsProducedCount + st.RowsReadCount = pb.RowsReadCount + st.SpillToDiskBytes = pb.SpillToDiskBytes + st.TaskTotalTimeMs = pb.TaskTotalTimeMs + st.TotalTimeMs = pb.TotalTimeMs + st.WriteRemoteBytes = pb.WriteRemoteBytes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryMetricsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryMetricsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryOptionsToPb(st *QueryOptions) (*queryOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &queryOptionsPb{} + pb.Catalog = st.Catalog + + pb.MovedToTrashAt = st.MovedToTrashAt + + pb.Parameters = st.Parameters + + pb.Schema = st.Schema + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryOptionsPb struct { + Catalog string `json:"catalog,omitempty"` + + MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` + + Parameters []Parameter `json:"parameters,omitempty"` + + Schema string `json:"schema,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryOptionsFromPb(pb *queryOptionsPb) (*QueryOptions, error) { + if pb == nil { + return nil, nil + } + st := &QueryOptions{} + st.Catalog = pb.Catalog + st.MovedToTrashAt = pb.MovedToTrashAt + st.Parameters = pb.Parameters + st.Schema = pb.Schema + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryOptionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryOptionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryParameterToPb(st *QueryParameter) (*queryParameterPb, error) { + if st == nil { + return nil, nil + } + pb := &queryParameterPb{} + pb.DateRangeValue = st.DateRangeValue + + pb.DateValue = st.DateValue + + pb.EnumValue = st.EnumValue + + pb.Name = st.Name + + pb.NumericValue = st.NumericValue + + pb.QueryBackedValue = st.QueryBackedValue + + pb.TextValue = st.TextValue + + pb.Title = st.Title + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryParameterPb struct { + DateRangeValue *DateRangeValue `json:"date_range_value,omitempty"` + + DateValue *DateValue `json:"date_value,omitempty"` + + EnumValue *EnumValue `json:"enum_value,omitempty"` + + Name string `json:"name,omitempty"` + + NumericValue *NumericValue `json:"numeric_value,omitempty"` + + QueryBackedValue *QueryBackedValue `json:"query_backed_value,omitempty"` + + TextValue *TextValue `json:"text_value,omitempty"` + + Title string `json:"title,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryParameterFromPb(pb *queryParameterPb) (*QueryParameter, error) { + if pb == nil { + return nil, nil + } + st := &QueryParameter{} + st.DateRangeValue = pb.DateRangeValue + st.DateValue = pb.DateValue + st.EnumValue = pb.EnumValue + st.Name = pb.Name + st.NumericValue = pb.NumericValue + st.QueryBackedValue = pb.QueryBackedValue + st.TextValue = pb.TextValue + st.Title = pb.Title + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryParameterPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryParameterPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryPostContentToPb(st *QueryPostContent) (*queryPostContentPb, error) { + if st == nil { + return nil, nil + } + pb := &queryPostContentPb{} + pb.DataSourceId = st.DataSourceId + + pb.Description = st.Description + + pb.Name = st.Name + + pb.Options = st.Options + + pb.Parent = st.Parent + + pb.Query = st.Query + + pb.RunAsRole = st.RunAsRole + + pb.Tags = st.Tags + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryPostContentPb struct { + DataSourceId string `json:"data_source_id,omitempty"` + + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + Options any `json:"options,omitempty"` + + Parent string `json:"parent,omitempty"` + + Query string `json:"query,omitempty"` + + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + + Tags []string `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryPostContentFromPb(pb *queryPostContentPb) (*QueryPostContent, error) { + if pb == nil { + return nil, nil + } + st := &QueryPostContent{} + st.DataSourceId = pb.DataSourceId + st.Description = pb.Description + st.Name = pb.Name + st.Options = pb.Options + st.Parent = pb.Parent + st.Query = pb.Query + st.RunAsRole = pb.RunAsRole + st.Tags = pb.Tags + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryPostContentPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryPostContentPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repeatedEndpointConfPairsToPb(st *RepeatedEndpointConfPairs) (*repeatedEndpointConfPairsPb, error) { + if st == nil { + return nil, nil + } + pb := &repeatedEndpointConfPairsPb{} + pb.ConfigPair = st.ConfigPair + + pb.ConfigurationPairs = st.ConfigurationPairs + + return pb, nil +} + +type repeatedEndpointConfPairsPb struct { + ConfigPair []EndpointConfPair `json:"config_pair,omitempty"` + + ConfigurationPairs []EndpointConfPair `json:"configuration_pairs,omitempty"` +} + +func repeatedEndpointConfPairsFromPb(pb *repeatedEndpointConfPairsPb) (*RepeatedEndpointConfPairs, error) { + if pb == nil { + return nil, nil + } + st := &RepeatedEndpointConfPairs{} + st.ConfigPair = pb.ConfigPair + st.ConfigurationPairs = pb.ConfigurationPairs + + return st, nil +} + +func restoreDashboardRequestToPb(st *RestoreDashboardRequest) (*restoreDashboardRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &restoreDashboardRequestPb{} + pb.DashboardId = st.DashboardId + + return pb, nil +} + +type restoreDashboardRequestPb struct { + DashboardId string `json:"-" url:"-"` +} + +func restoreDashboardRequestFromPb(pb *restoreDashboardRequestPb) (*RestoreDashboardRequest, error) { + if pb == nil { + return nil, nil + } + st := &RestoreDashboardRequest{} + st.DashboardId = pb.DashboardId + + return st, nil +} + +func restoreQueriesLegacyRequestToPb(st *RestoreQueriesLegacyRequest) (*restoreQueriesLegacyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &restoreQueriesLegacyRequestPb{} + pb.QueryId = st.QueryId + + return pb, nil +} + +type restoreQueriesLegacyRequestPb struct { + QueryId string `json:"-" url:"-"` +} + +func restoreQueriesLegacyRequestFromPb(pb *restoreQueriesLegacyRequestPb) (*RestoreQueriesLegacyRequest, error) { + if pb == nil { + return nil, nil + } + st := &RestoreQueriesLegacyRequest{} + st.QueryId = pb.QueryId + + return st, nil +} + +func restoreResponseToPb(st *RestoreResponse) (*restoreResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &restoreResponsePb{} + + return pb, nil +} + +type restoreResponsePb struct { +} + +func restoreResponseFromPb(pb *restoreResponsePb) (*RestoreResponse, error) { + if pb == nil { + return nil, nil + } + st := &RestoreResponse{} + + return st, nil +} + +func resultDataToPb(st *ResultData) (*resultDataPb, error) { + if st == nil { + return nil, nil + } + pb := &resultDataPb{} + pb.ByteCount = st.ByteCount + + pb.ChunkIndex = st.ChunkIndex + + pb.DataArray = st.DataArray + + pb.ExternalLinks = st.ExternalLinks + + pb.NextChunkIndex = st.NextChunkIndex + + pb.NextChunkInternalLink = st.NextChunkInternalLink + + pb.RowCount = st.RowCount + + pb.RowOffset = st.RowOffset + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultDataPb struct { + ByteCount int64 `json:"byte_count,omitempty"` + + ChunkIndex int `json:"chunk_index,omitempty"` + + DataArray [][]string `json:"data_array,omitempty"` + + ExternalLinks []ExternalLink `json:"external_links,omitempty"` + + NextChunkIndex int `json:"next_chunk_index,omitempty"` + + NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + + RowCount int64 `json:"row_count,omitempty"` + + RowOffset int64 `json:"row_offset,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultDataFromPb(pb *resultDataPb) (*ResultData, error) { + if pb == nil { + return nil, nil + } + st := &ResultData{} + st.ByteCount = pb.ByteCount + st.ChunkIndex = pb.ChunkIndex + st.DataArray = pb.DataArray + st.ExternalLinks = pb.ExternalLinks + st.NextChunkIndex = pb.NextChunkIndex + st.NextChunkInternalLink = pb.NextChunkInternalLink + st.RowCount = pb.RowCount + st.RowOffset = pb.RowOffset + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultDataPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultDataPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { + if st == nil { + return nil, nil + } + pb := &resultManifestPb{} + pb.Chunks = st.Chunks + + pb.Format = st.Format + + pb.Schema = st.Schema + + pb.TotalByteCount = st.TotalByteCount + + pb.TotalChunkCount = st.TotalChunkCount + + pb.TotalRowCount = st.TotalRowCount + + pb.Truncated = st.Truncated + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultManifestPb struct { + Chunks []BaseChunkInfo `json:"chunks,omitempty"` + + Format Format `json:"format,omitempty"` + + Schema *ResultSchema `json:"schema,omitempty"` + + TotalByteCount int64 `json:"total_byte_count,omitempty"` + + TotalChunkCount int `json:"total_chunk_count,omitempty"` + + TotalRowCount int64 `json:"total_row_count,omitempty"` + + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultManifestFromPb(pb *resultManifestPb) (*ResultManifest, error) { + if pb == nil { + return nil, nil + } + st := &ResultManifest{} + st.Chunks = pb.Chunks + st.Format = pb.Format + st.Schema = pb.Schema + st.TotalByteCount = pb.TotalByteCount + st.TotalChunkCount = pb.TotalChunkCount + st.TotalRowCount = pb.TotalRowCount + st.Truncated = pb.Truncated + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultManifestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultManifestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resultSchemaToPb(st *ResultSchema) (*resultSchemaPb, error) { + if st == nil { + return nil, nil + } + pb := &resultSchemaPb{} + pb.ColumnCount = st.ColumnCount + + pb.Columns = st.Columns + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultSchemaPb struct { + ColumnCount int `json:"column_count,omitempty"` + + Columns []ColumnInfo `json:"columns,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultSchemaFromPb(pb *resultSchemaPb) (*ResultSchema, error) { + if pb == nil { + return nil, nil + } + st := &ResultSchema{} + st.ColumnCount = pb.ColumnCount + st.Columns = pb.Columns + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultSchemaPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultSchemaPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func serviceErrorToPb(st *ServiceError) (*serviceErrorPb, error) { + if st == nil { + return nil, nil + } + pb := &serviceErrorPb{} + pb.ErrorCode = st.ErrorCode + + pb.Message = st.Message + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type serviceErrorPb struct { + ErrorCode ServiceErrorCode `json:"error_code,omitempty"` + + Message string `json:"message,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func serviceErrorFromPb(pb *serviceErrorPb) (*ServiceError, error) { + if pb == nil { + return nil, nil + } + st := &ServiceError{} + st.ErrorCode = pb.ErrorCode + st.Message = pb.Message + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *serviceErrorPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st serviceErrorPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setRequestToPb(st *SetRequest) (*setRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + return pb, nil +} + +type setRequestPb struct { + AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + ObjectId string `json:"-" url:"-"` + + ObjectType ObjectTypePlural `json:"-" url:"-"` +} + +func setRequestFromPb(pb *setRequestPb) (*SetRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetRequest{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + return st, nil +} + +func setResponseToPb(st *SetResponse) (*setResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setResponsePb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type setResponsePb struct { + AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType ObjectType `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func setResponseFromPb(pb *setResponsePb) (*SetResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetResponse{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *setResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st setResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setWorkspaceWarehouseConfigRequestToPb(st *SetWorkspaceWarehouseConfigRequest) (*setWorkspaceWarehouseConfigRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &setWorkspaceWarehouseConfigRequestPb{} + pb.Channel = st.Channel + + pb.ConfigParam = st.ConfigParam + + pb.DataAccessConfig = st.DataAccessConfig + + pb.EnabledWarehouseTypes = st.EnabledWarehouseTypes + + pb.GlobalParam = st.GlobalParam + + pb.GoogleServiceAccount = st.GoogleServiceAccount + + pb.InstanceProfileArn = st.InstanceProfileArn + + pb.SecurityPolicy = st.SecurityPolicy + + pb.SqlConfigurationParameters = st.SqlConfigurationParameters + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type setWorkspaceWarehouseConfigRequestPb struct { + Channel *Channel `json:"channel,omitempty"` + + ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + + DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + + EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + + GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + + GoogleServiceAccount string `json:"google_service_account,omitempty"` + + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + + SecurityPolicy SetWorkspaceWarehouseConfigRequestSecurityPolicy `json:"security_policy,omitempty"` + + SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func setWorkspaceWarehouseConfigRequestFromPb(pb *setWorkspaceWarehouseConfigRequestPb) (*SetWorkspaceWarehouseConfigRequest, error) { + if pb == nil { + return nil, nil + } + st := &SetWorkspaceWarehouseConfigRequest{} + st.Channel = pb.Channel + st.ConfigParam = pb.ConfigParam + st.DataAccessConfig = pb.DataAccessConfig + st.EnabledWarehouseTypes = pb.EnabledWarehouseTypes + st.GlobalParam = pb.GlobalParam + st.GoogleServiceAccount = pb.GoogleServiceAccount + st.InstanceProfileArn = pb.InstanceProfileArn + st.SecurityPolicy = pb.SecurityPolicy + st.SqlConfigurationParameters = pb.SqlConfigurationParameters + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *setWorkspaceWarehouseConfigRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st setWorkspaceWarehouseConfigRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func setWorkspaceWarehouseConfigResponseToPb(st *SetWorkspaceWarehouseConfigResponse) (*setWorkspaceWarehouseConfigResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &setWorkspaceWarehouseConfigResponsePb{} + + return pb, nil +} + +type setWorkspaceWarehouseConfigResponsePb struct { +} + +func setWorkspaceWarehouseConfigResponseFromPb(pb *setWorkspaceWarehouseConfigResponsePb) (*SetWorkspaceWarehouseConfigResponse, error) { + if pb == nil { + return nil, nil + } + st := &SetWorkspaceWarehouseConfigResponse{} + + return st, nil +} + +func startRequestToPb(st *StartRequest) (*startRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &startRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type startRequestPb struct { + Id string `json:"-" url:"-"` +} + +func startRequestFromPb(pb *startRequestPb) (*StartRequest, error) { + if pb == nil { + return nil, nil + } + st := &StartRequest{} + st.Id = pb.Id + + return st, nil +} + +func startWarehouseResponseToPb(st *StartWarehouseResponse) (*startWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &startWarehouseResponsePb{} + + return pb, nil +} + +type startWarehouseResponsePb struct { +} + +func startWarehouseResponseFromPb(pb *startWarehouseResponsePb) (*StartWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &StartWarehouseResponse{} + + return st, nil +} + +func statementParameterListItemToPb(st *StatementParameterListItem) (*statementParameterListItemPb, error) { + if st == nil { + return nil, nil + } + pb := &statementParameterListItemPb{} + pb.Name = st.Name + + pb.Type = st.Type + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type statementParameterListItemPb struct { + Name string `json:"name"` + + Type string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func statementParameterListItemFromPb(pb *statementParameterListItemPb) (*StatementParameterListItem, error) { + if pb == nil { + return nil, nil + } + st := &StatementParameterListItem{} + st.Name = pb.Name + st.Type = pb.Type + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *statementParameterListItemPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st statementParameterListItemPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func statementResponseToPb(st *StatementResponse) (*statementResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &statementResponsePb{} + pb.Manifest = st.Manifest + + pb.Result = st.Result + + pb.StatementId = st.StatementId + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type statementResponsePb struct { + Manifest *ResultManifest `json:"manifest,omitempty"` + + Result *ResultData `json:"result,omitempty"` + + StatementId string `json:"statement_id,omitempty"` + + Status *StatementStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func statementResponseFromPb(pb *statementResponsePb) (*StatementResponse, error) { + if pb == nil { + return nil, nil + } + st := &StatementResponse{} + st.Manifest = pb.Manifest + st.Result = pb.Result + st.StatementId = pb.StatementId + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *statementResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st statementResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func statementStatusToPb(st *StatementStatus) (*statementStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &statementStatusPb{} + pb.Error = st.Error + + pb.State = st.State + + return pb, nil +} + +type statementStatusPb struct { + Error *ServiceError `json:"error,omitempty"` + + State StatementState `json:"state,omitempty"` +} + +func statementStatusFromPb(pb *statementStatusPb) (*StatementStatus, error) { + if pb == nil { + return nil, nil + } + st := &StatementStatus{} + st.Error = pb.Error + st.State = pb.State + + return st, nil +} + +func stopRequestToPb(st *StopRequest) (*stopRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &stopRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type stopRequestPb struct { + Id string `json:"-" url:"-"` +} + +func stopRequestFromPb(pb *stopRequestPb) (*StopRequest, error) { + if pb == nil { + return nil, nil + } + st := &StopRequest{} + st.Id = pb.Id + + return st, nil +} + +func stopWarehouseResponseToPb(st *StopWarehouseResponse) (*stopWarehouseResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &stopWarehouseResponsePb{} + + return pb, nil +} + +type stopWarehouseResponsePb struct { +} + +func stopWarehouseResponseFromPb(pb *stopWarehouseResponsePb) (*StopWarehouseResponse, error) { + if pb == nil { + return nil, nil + } + st := &StopWarehouseResponse{} + + return st, nil +} + +func successToPb(st *Success) (*successPb, error) { + if st == nil { + return nil, nil + } + pb := &successPb{} + pb.Message = st.Message + + return pb, nil +} + +type successPb struct { + Message SuccessMessage `json:"message,omitempty"` +} + +func successFromPb(pb *successPb) (*Success, error) { + if pb == nil { + return nil, nil + } + st := &Success{} + st.Message = pb.Message + + return st, nil +} + +func terminationReasonToPb(st *TerminationReason) (*terminationReasonPb, error) { + if st == nil { + return nil, nil + } + pb := &terminationReasonPb{} + pb.Code = st.Code + + pb.Parameters = st.Parameters + + pb.Type = st.Type + + return pb, nil +} + +type terminationReasonPb struct { + Code TerminationReasonCode `json:"code,omitempty"` + + Parameters map[string]string `json:"parameters,omitempty"` + + Type TerminationReasonType `json:"type,omitempty"` +} + +func terminationReasonFromPb(pb *terminationReasonPb) (*TerminationReason, error) { + if pb == nil { + return nil, nil + } + st := &TerminationReason{} + st.Code = pb.Code + st.Parameters = pb.Parameters + st.Type = pb.Type + + return st, nil +} + +func textValueToPb(st *TextValue) (*textValuePb, error) { + if st == nil { + return nil, nil + } + pb := &textValuePb{} + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type textValuePb struct { + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func textValueFromPb(pb *textValuePb) (*TextValue, error) { + if pb == nil { + return nil, nil + } + st := &TextValue{} + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *textValuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st textValuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func timeRangeToPb(st *TimeRange) (*timeRangePb, error) { + if st == nil { + return nil, nil + } + pb := &timeRangePb{} + pb.EndTimeMs = st.EndTimeMs + + pb.StartTimeMs = st.StartTimeMs + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type timeRangePb struct { + EndTimeMs int64 `json:"end_time_ms,omitempty" url:"end_time_ms,omitempty"` + + StartTimeMs int64 `json:"start_time_ms,omitempty" url:"start_time_ms,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func timeRangeFromPb(pb *timeRangePb) (*TimeRange, error) { + if pb == nil { + return nil, nil + } + st := &TimeRange{} + st.EndTimeMs = pb.EndTimeMs + st.StartTimeMs = pb.StartTimeMs + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *timeRangePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st timeRangePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func transferOwnershipObjectIdToPb(st *TransferOwnershipObjectId) (*transferOwnershipObjectIdPb, error) { + if st == nil { + return nil, nil + } + pb := &transferOwnershipObjectIdPb{} + pb.NewOwner = st.NewOwner + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type transferOwnershipObjectIdPb struct { + NewOwner string `json:"new_owner,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func transferOwnershipObjectIdFromPb(pb *transferOwnershipObjectIdPb) (*TransferOwnershipObjectId, error) { + if pb == nil { + return nil, nil + } + st := &TransferOwnershipObjectId{} + st.NewOwner = pb.NewOwner + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *transferOwnershipObjectIdPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st transferOwnershipObjectIdPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func transferOwnershipRequestToPb(st *TransferOwnershipRequest) (*transferOwnershipRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &transferOwnershipRequestPb{} + pb.NewOwner = st.NewOwner + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type transferOwnershipRequestPb struct { + NewOwner string `json:"new_owner,omitempty"` + + ObjectId TransferOwnershipObjectId `json:"-" url:"-"` + + ObjectType OwnableObjectType `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func transferOwnershipRequestFromPb(pb *transferOwnershipRequestPb) (*TransferOwnershipRequest, error) { + if pb == nil { + return nil, nil + } + st := &TransferOwnershipRequest{} + st.NewOwner = pb.NewOwner + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *transferOwnershipRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st transferOwnershipRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func trashAlertRequestToPb(st *TrashAlertRequest) (*trashAlertRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &trashAlertRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type trashAlertRequestPb struct { + Id string `json:"-" url:"-"` +} + +func trashAlertRequestFromPb(pb *trashAlertRequestPb) (*TrashAlertRequest, error) { + if pb == nil { + return nil, nil + } + st := &TrashAlertRequest{} + st.Id = pb.Id + + return st, nil +} + +func trashAlertV2RequestToPb(st *TrashAlertV2Request) (*trashAlertV2RequestPb, error) { + if st == nil { + return nil, nil + } + pb := &trashAlertV2RequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type trashAlertV2RequestPb struct { + Id string `json:"-" url:"-"` +} + +func trashAlertV2RequestFromPb(pb *trashAlertV2RequestPb) (*TrashAlertV2Request, error) { + if pb == nil { + return nil, nil + } + st := &TrashAlertV2Request{} + st.Id = pb.Id + + return st, nil +} + +func trashQueryRequestToPb(st *TrashQueryRequest) (*trashQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &trashQueryRequestPb{} + pb.Id = st.Id + + return pb, nil +} + +type trashQueryRequestPb struct { + Id string `json:"-" url:"-"` +} + +func trashQueryRequestFromPb(pb *trashQueryRequestPb) (*TrashQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &TrashQueryRequest{} + st.Id = pb.Id + + return st, nil +} + +func updateAlertRequestToPb(st *UpdateAlertRequest) (*updateAlertRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAlertRequestPb{} + pb.Alert = st.Alert + + pb.AutoResolveDisplayName = st.AutoResolveDisplayName + + pb.Id = st.Id + + pb.UpdateMask = st.UpdateMask + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateAlertRequestPb struct { + Alert *UpdateAlertRequestAlert `json:"alert,omitempty"` + + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + + Id string `json:"-" url:"-"` + + UpdateMask string `json:"update_mask"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateAlertRequestFromPb(pb *updateAlertRequestPb) (*UpdateAlertRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAlertRequest{} + st.Alert = pb.Alert + st.AutoResolveDisplayName = pb.AutoResolveDisplayName + st.Id = pb.Id + st.UpdateMask = pb.UpdateMask + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateAlertRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateAlertRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateAlertRequestAlertToPb(st *UpdateAlertRequestAlert) (*updateAlertRequestAlertPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAlertRequestAlertPb{} + pb.Condition = st.Condition + + pb.CustomBody = st.CustomBody + + pb.CustomSubject = st.CustomSubject + + pb.DisplayName = st.DisplayName + + pb.NotifyOnOk = st.NotifyOnOk + + pb.OwnerUserName = st.OwnerUserName + + pb.QueryId = st.QueryId + + pb.SecondsToRetrigger = st.SecondsToRetrigger + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateAlertRequestAlertPb struct { + Condition *AlertCondition `json:"condition,omitempty"` + + CustomBody string `json:"custom_body,omitempty"` + + CustomSubject string `json:"custom_subject,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateAlertRequestAlertFromPb(pb *updateAlertRequestAlertPb) (*UpdateAlertRequestAlert, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAlertRequestAlert{} + st.Condition = pb.Condition + st.CustomBody = pb.CustomBody + st.CustomSubject = pb.CustomSubject + st.DisplayName = pb.DisplayName + st.NotifyOnOk = pb.NotifyOnOk + st.OwnerUserName = pb.OwnerUserName + st.QueryId = pb.QueryId + st.SecondsToRetrigger = pb.SecondsToRetrigger + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateAlertRequestAlertPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateAlertRequestAlertPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateAlertV2RequestToPb(st *UpdateAlertV2Request) (*updateAlertV2RequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateAlertV2RequestPb{} + pb.Alert = st.Alert + + pb.Id = st.Id + + pb.UpdateMask = st.UpdateMask + + return pb, nil +} + +type updateAlertV2RequestPb struct { + Alert AlertV2 `json:"alert"` + + Id string `json:"-" url:"-"` + + UpdateMask string `json:"-" url:"update_mask"` +} + +func updateAlertV2RequestFromPb(pb *updateAlertV2RequestPb) (*UpdateAlertV2Request, error) { + if pb == nil { + return nil, nil + } + st := &UpdateAlertV2Request{} + st.Alert = pb.Alert + st.Id = pb.Id + st.UpdateMask = pb.UpdateMask + + return st, nil +} + +func updateQueryRequestToPb(st *UpdateQueryRequest) (*updateQueryRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateQueryRequestPb{} + pb.AutoResolveDisplayName = st.AutoResolveDisplayName + + pb.Id = st.Id + + pb.Query = st.Query + + pb.UpdateMask = st.UpdateMask + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateQueryRequestPb struct { + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + + Id string `json:"-" url:"-"` + + Query *UpdateQueryRequestQuery `json:"query,omitempty"` + + UpdateMask string `json:"update_mask"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateQueryRequestFromPb(pb *updateQueryRequestPb) (*UpdateQueryRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateQueryRequest{} + st.AutoResolveDisplayName = pb.AutoResolveDisplayName + st.Id = pb.Id + st.Query = pb.Query + st.UpdateMask = pb.UpdateMask + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateQueryRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateQueryRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateQueryRequestQueryToPb(st *UpdateQueryRequestQuery) (*updateQueryRequestQueryPb, error) { + if st == nil { + return nil, nil + } + pb := &updateQueryRequestQueryPb{} + pb.ApplyAutoLimit = st.ApplyAutoLimit + + pb.Catalog = st.Catalog + + pb.Description = st.Description + + pb.DisplayName = st.DisplayName + + pb.OwnerUserName = st.OwnerUserName + + pb.Parameters = st.Parameters + + pb.QueryText = st.QueryText + + pb.RunAsMode = st.RunAsMode + + pb.Schema = st.Schema + + pb.Tags = st.Tags + + pb.WarehouseId = st.WarehouseId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateQueryRequestQueryPb struct { + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + + Catalog string `json:"catalog,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + OwnerUserName string `json:"owner_user_name,omitempty"` + + Parameters []QueryParameter `json:"parameters,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + + Schema string `json:"schema,omitempty"` + + Tags []string `json:"tags,omitempty"` + + WarehouseId string `json:"warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateQueryRequestQueryFromPb(pb *updateQueryRequestQueryPb) (*UpdateQueryRequestQuery, error) { + if pb == nil { + return nil, nil + } + st := &UpdateQueryRequestQuery{} + st.ApplyAutoLimit = pb.ApplyAutoLimit + st.Catalog = pb.Catalog + st.Description = pb.Description + st.DisplayName = pb.DisplayName + st.OwnerUserName = pb.OwnerUserName + st.Parameters = pb.Parameters + st.QueryText = pb.QueryText + st.RunAsMode = pb.RunAsMode + st.Schema = pb.Schema + st.Tags = pb.Tags + st.WarehouseId = pb.WarehouseId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateQueryRequestQueryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateQueryRequestQueryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateResponseToPb(st *UpdateResponse) (*updateResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateResponsePb{} + + return pb, nil +} + +type updateResponsePb struct { +} + +func updateResponseFromPb(pb *updateResponsePb) (*UpdateResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateResponse{} + + return st, nil +} + +func updateVisualizationRequestToPb(st *UpdateVisualizationRequest) (*updateVisualizationRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateVisualizationRequestPb{} + pb.Id = st.Id + + pb.UpdateMask = st.UpdateMask + + pb.Visualization = st.Visualization + + return pb, nil +} + +type updateVisualizationRequestPb struct { + Id string `json:"-" url:"-"` + + UpdateMask string `json:"update_mask"` + + Visualization *UpdateVisualizationRequestVisualization `json:"visualization,omitempty"` +} + +func updateVisualizationRequestFromPb(pb *updateVisualizationRequestPb) (*UpdateVisualizationRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateVisualizationRequest{} + st.Id = pb.Id + st.UpdateMask = pb.UpdateMask + st.Visualization = pb.Visualization + + return st, nil +} + +func updateVisualizationRequestVisualizationToPb(st *UpdateVisualizationRequestVisualization) (*updateVisualizationRequestVisualizationPb, error) { + if st == nil { + return nil, nil + } + pb := &updateVisualizationRequestVisualizationPb{} + pb.DisplayName = st.DisplayName + + pb.SerializedOptions = st.SerializedOptions + + pb.SerializedQueryPlan = st.SerializedQueryPlan + + pb.Type = st.Type + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateVisualizationRequestVisualizationPb struct { + DisplayName string `json:"display_name,omitempty"` + + SerializedOptions string `json:"serialized_options,omitempty"` + + SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + + Type string `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateVisualizationRequestVisualizationFromPb(pb *updateVisualizationRequestVisualizationPb) (*UpdateVisualizationRequestVisualization, error) { + if pb == nil { + return nil, nil + } + st := &UpdateVisualizationRequestVisualization{} + st.DisplayName = pb.DisplayName + st.SerializedOptions = pb.SerializedOptions + st.SerializedQueryPlan = pb.SerializedQueryPlan + st.Type = pb.Type + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateVisualizationRequestVisualizationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateVisualizationRequestVisualizationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func userToPb(st *User) (*userPb, error) { + if st == nil { + return nil, nil + } + pb := &userPb{} + pb.Email = st.Email + + pb.Id = st.Id + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type userPb struct { + Email string `json:"email,omitempty"` + + Id int `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func userFromPb(pb *userPb) (*User, error) { + if pb == nil { + return nil, nil + } + st := &User{} + st.Email = pb.Email + st.Id = pb.Id + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *userPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st userPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func visualizationToPb(st *Visualization) (*visualizationPb, error) { + if st == nil { + return nil, nil + } + pb := &visualizationPb{} + pb.CreateTime = st.CreateTime + + pb.DisplayName = st.DisplayName + + pb.Id = st.Id + + pb.QueryId = st.QueryId + + pb.SerializedOptions = st.SerializedOptions + + pb.SerializedQueryPlan = st.SerializedQueryPlan + + pb.Type = st.Type + + pb.UpdateTime = st.UpdateTime + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type visualizationPb struct { + CreateTime string `json:"create_time,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + Id string `json:"id,omitempty"` + + QueryId string `json:"query_id,omitempty"` + + SerializedOptions string `json:"serialized_options,omitempty"` + + SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + + Type string `json:"type,omitempty"` + + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func visualizationFromPb(pb *visualizationPb) (*Visualization, error) { + if pb == nil { + return nil, nil + } + st := &Visualization{} + st.CreateTime = pb.CreateTime + st.DisplayName = pb.DisplayName + st.Id = pb.Id + st.QueryId = pb.QueryId + st.SerializedOptions = pb.SerializedOptions + st.SerializedQueryPlan = pb.SerializedQueryPlan + st.Type = pb.Type + st.UpdateTime = pb.UpdateTime + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *visualizationPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st visualizationPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehouseAccessControlRequestToPb(st *WarehouseAccessControlRequest) (*warehouseAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &warehouseAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehouseAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehouseAccessControlRequestFromPb(pb *warehouseAccessControlRequestPb) (*WarehouseAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &WarehouseAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehouseAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehouseAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehouseAccessControlResponseToPb(st *WarehouseAccessControlResponse) (*warehouseAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &warehouseAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehouseAccessControlResponsePb struct { + AllPermissions []WarehousePermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehouseAccessControlResponseFromPb(pb *warehouseAccessControlResponsePb) (*WarehouseAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &WarehouseAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehouseAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehouseAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehousePermissionToPb(st *WarehousePermission) (*warehousePermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &warehousePermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehousePermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehousePermissionFromPb(pb *warehousePermissionPb) (*WarehousePermission, error) { + if pb == nil { + return nil, nil + } + st := &WarehousePermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehousePermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehousePermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehousePermissionsToPb(st *WarehousePermissions) (*warehousePermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &warehousePermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehousePermissionsPb struct { + AccessControlList []WarehouseAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehousePermissionsFromPb(pb *warehousePermissionsPb) (*WarehousePermissions, error) { + if pb == nil { + return nil, nil + } + st := &WarehousePermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehousePermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehousePermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehousePermissionsDescriptionToPb(st *WarehousePermissionsDescription) (*warehousePermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &warehousePermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehousePermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehousePermissionsDescriptionFromPb(pb *warehousePermissionsDescriptionPb) (*WarehousePermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &WarehousePermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehousePermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehousePermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func warehousePermissionsRequestToPb(st *WarehousePermissionsRequest) (*warehousePermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &warehousePermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.WarehouseId = st.WarehouseId + + return pb, nil +} + +type warehousePermissionsRequestPb struct { + AccessControlList []WarehouseAccessControlRequest `json:"access_control_list,omitempty"` + + WarehouseId string `json:"-" url:"-"` +} + +func warehousePermissionsRequestFromPb(pb *warehousePermissionsRequestPb) (*WarehousePermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &WarehousePermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.WarehouseId = pb.WarehouseId + + return st, nil +} + +func warehouseTypePairToPb(st *WarehouseTypePair) (*warehouseTypePairPb, error) { + if st == nil { + return nil, nil + } + pb := &warehouseTypePairPb{} + pb.Enabled = st.Enabled + + pb.WarehouseType = st.WarehouseType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type warehouseTypePairPb struct { + Enabled bool `json:"enabled,omitempty"` + + WarehouseType WarehouseTypePairWarehouseType `json:"warehouse_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func warehouseTypePairFromPb(pb *warehouseTypePairPb) (*WarehouseTypePair, error) { + if pb == nil { + return nil, nil + } + st := &WarehouseTypePair{} + st.Enabled = pb.Enabled + st.WarehouseType = pb.WarehouseType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *warehouseTypePairPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st warehouseTypePairPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func widgetToPb(st *Widget) (*widgetPb, error) { + if st == nil { + return nil, nil + } + pb := &widgetPb{} + pb.Id = st.Id + + pb.Options = st.Options + + pb.Visualization = st.Visualization + + pb.Width = st.Width + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type widgetPb struct { + Id string `json:"id,omitempty"` + + Options *WidgetOptions `json:"options,omitempty"` + + Visualization *LegacyVisualization `json:"visualization,omitempty"` + + Width int `json:"width,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func widgetFromPb(pb *widgetPb) (*Widget, error) { + if pb == nil { + return nil, nil + } + st := &Widget{} + st.Id = pb.Id + st.Options = pb.Options + st.Visualization = pb.Visualization + st.Width = pb.Width + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *widgetPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st widgetPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func widgetOptionsToPb(st *WidgetOptions) (*widgetOptionsPb, error) { + if st == nil { + return nil, nil + } + pb := &widgetOptionsPb{} + pb.CreatedAt = st.CreatedAt + + pb.Description = st.Description + + pb.IsHidden = st.IsHidden + + pb.ParameterMappings = st.ParameterMappings + + pb.Position = st.Position + + pb.Title = st.Title + + pb.UpdatedAt = st.UpdatedAt + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type widgetOptionsPb struct { + CreatedAt string `json:"created_at,omitempty"` + + Description string `json:"description,omitempty"` + + IsHidden bool `json:"isHidden,omitempty"` + + ParameterMappings any `json:"parameterMappings,omitempty"` + + Position *WidgetPosition `json:"position,omitempty"` + + Title string `json:"title,omitempty"` + + UpdatedAt string `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func widgetOptionsFromPb(pb *widgetOptionsPb) (*WidgetOptions, error) { + if pb == nil { + return nil, nil + } + st := &WidgetOptions{} + st.CreatedAt = pb.CreatedAt + st.Description = pb.Description + st.IsHidden = pb.IsHidden + st.ParameterMappings = pb.ParameterMappings + st.Position = pb.Position + st.Title = pb.Title + st.UpdatedAt = pb.UpdatedAt + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *widgetOptionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st widgetOptionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func widgetPositionToPb(st *WidgetPosition) (*widgetPositionPb, error) { + if st == nil { + return nil, nil + } + pb := &widgetPositionPb{} + pb.AutoHeight = st.AutoHeight + + pb.Col = st.Col + + pb.Row = st.Row + + pb.SizeX = st.SizeX + + pb.SizeY = st.SizeY + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type widgetPositionPb struct { + AutoHeight bool `json:"autoHeight,omitempty"` + + Col int `json:"col,omitempty"` + + Row int `json:"row,omitempty"` + + SizeX int `json:"sizeX,omitempty"` + + SizeY int `json:"sizeY,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func widgetPositionFromPb(pb *widgetPositionPb) (*WidgetPosition, error) { + if pb == nil { + return nil, nil + } + st := &WidgetPosition{} + st.AutoHeight = pb.AutoHeight + st.Col = pb.Col + st.Row = pb.Row + st.SizeX = pb.SizeX + st.SizeY = pb.SizeY + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *widgetPositionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st widgetPositionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/sql/model.go b/service/sql/model.go index 5ae6fd898..a452930e5 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -3,31 +3,54 @@ package sql import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AccessControl struct { - GroupName string `json:"group_name,omitempty"` + + // Wire name: 'group_name' + GroupName string // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel PermissionLevel - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AccessControl) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AccessControl) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &accessControlPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := accessControlFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AccessControl) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AccessControl) MarshalJSON() ([]byte, error) { + pb, err := accessControlToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Aggregation string +type aggregationPb string const AggregationAvg Aggregation = `AVG` @@ -66,86 +89,218 @@ func (f *Aggregation) Type() string { return "Aggregation" } +func aggregationToPb(st *Aggregation) (*aggregationPb, error) { + if st == nil { + return nil, nil + } + pb := aggregationPb(*st) + return &pb, nil +} + +func aggregationFromPb(pb *aggregationPb) (*Aggregation, error) { + if pb == nil { + return nil, nil + } + st := Aggregation(*pb) + return &st, nil +} + type Alert struct { // Trigger conditions of the alert. - Condition *AlertCondition `json:"condition,omitempty"` + // Wire name: 'condition' + Condition *AlertCondition // The timestamp indicating when the alert was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody string `json:"custom_body,omitempty"` + // Wire name: 'custom_body' + CustomBody string // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // The display name of the alert. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying the alert. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The workspace state of the alert. Used for tracking trashed status. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk bool `json:"notify_on_ok,omitempty"` + // Wire name: 'notify_on_ok' + NotifyOnOk bool // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // The workspace path of the folder containing the alert. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // UUID of the query attached to the alert. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + // Wire name: 'seconds_to_retrigger' + SecondsToRetrigger int // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State AlertState `json:"state,omitempty"` + // Wire name: 'state' + State AlertState // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime string `json:"trigger_time,omitempty"` + // Wire name: 'trigger_time' + TriggerTime string // The timestamp indicating when the alert was updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Alert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Alert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Alert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Alert) MarshalJSON() ([]byte, error) { + pb, err := alertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertCondition struct { // Alert state if result is empty. - EmptyResultState AlertState `json:"empty_result_state,omitempty"` + // Wire name: 'empty_result_state' + EmptyResultState AlertState // Operator used for comparison in alert evaluation. - Op AlertOperator `json:"op,omitempty"` + // Wire name: 'op' + Op AlertOperator // Name of the column from the query result to use for comparison in alert // evaluation. - Operand *AlertConditionOperand `json:"operand,omitempty"` + // Wire name: 'operand' + Operand *AlertConditionOperand // Threshold value used for comparison in alert evaluation. - Threshold *AlertConditionThreshold `json:"threshold,omitempty"` + // Wire name: 'threshold' + Threshold *AlertConditionThreshold +} + +func (st *AlertCondition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertConditionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertConditionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AlertCondition) MarshalJSON() ([]byte, error) { + pb, err := alertConditionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertConditionOperand struct { - Column *AlertOperandColumn `json:"column,omitempty"` + + // Wire name: 'column' + Column *AlertOperandColumn +} + +func (st *AlertConditionOperand) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertConditionOperandPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertConditionOperandFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AlertConditionOperand) MarshalJSON() ([]byte, error) { + pb, err := alertConditionOperandToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertConditionThreshold struct { - Value *AlertOperandValue `json:"value,omitempty"` + + // Wire name: 'value' + Value *AlertOperandValue +} + +func (st *AlertConditionThreshold) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertConditionThresholdPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertConditionThresholdFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AlertConditionThreshold) MarshalJSON() ([]byte, error) { + pb, err := alertConditionThresholdToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // UNSPECIFIED - default unspecify value for proto enum, do not use it in the // code UNKNOWN - alert not yet evaluated TRIGGERED - alert is triggered OK - // alert is not triggered ERROR - alert evaluation failed type AlertEvaluationState string +type alertEvaluationStatePb string const AlertEvaluationStateError AlertEvaluationState = `ERROR` @@ -176,39 +331,96 @@ func (f *AlertEvaluationState) Type() string { return "AlertEvaluationState" } +func alertEvaluationStateToPb(st *AlertEvaluationState) (*alertEvaluationStatePb, error) { + if st == nil { + return nil, nil + } + pb := alertEvaluationStatePb(*st) + return &pb, nil +} + +func alertEvaluationStateFromPb(pb *alertEvaluationStatePb) (*AlertEvaluationState, error) { + if pb == nil { + return nil, nil + } + st := AlertEvaluationState(*pb) + return &st, nil +} + type AlertOperandColumn struct { - Name string `json:"name,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'name' + Name string + + ForceSendFields []string `tf:"-"` } -func (s *AlertOperandColumn) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertOperandColumn) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertOperandColumnPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertOperandColumnFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertOperandColumn) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertOperandColumn) MarshalJSON() ([]byte, error) { + pb, err := alertOperandColumnToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertOperandValue struct { - BoolValue bool `json:"bool_value,omitempty"` - DoubleValue float64 `json:"double_value,omitempty"` + // Wire name: 'bool_value' + BoolValue bool + + // Wire name: 'double_value' + DoubleValue float64 - StringValue string `json:"string_value,omitempty"` + // Wire name: 'string_value' + StringValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertOperandValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertOperandValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertOperandValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertOperandValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertOperandValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertOperandValue) MarshalJSON() ([]byte, error) { + pb, err := alertOperandValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertOperator string +type alertOperatorPb string const AlertOperatorEqual AlertOperator = `EQUAL` @@ -245,46 +457,87 @@ func (f *AlertOperator) Type() string { return "AlertOperator" } +func alertOperatorToPb(st *AlertOperator) (*alertOperatorPb, error) { + if st == nil { + return nil, nil + } + pb := alertOperatorPb(*st) + return &pb, nil +} + +func alertOperatorFromPb(pb *alertOperatorPb) (*AlertOperator, error) { + if pb == nil { + return nil, nil + } + st := AlertOperator(*pb) + return &st, nil +} + // Alert configuration options. type AlertOptions struct { // Name of column in the query result to compare in alert evaluation. - Column string `json:"column"` + // Wire name: 'column' + Column string // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody string `json:"custom_body,omitempty"` + // Wire name: 'custom_body' + CustomBody string // Custom subject of alert notification, if it exists. This includes email // subject, Slack notification header, etc. See [here] for custom templating // instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // State that alert evaluates to when query result is empty. - EmptyResultState AlertOptionsEmptyResultState `json:"empty_result_state,omitempty"` + // Wire name: 'empty_result_state' + EmptyResultState AlertOptionsEmptyResultState // Whether or not the alert is muted. If an alert is muted, it will not // notify users and notification destinations when triggered. - Muted bool `json:"muted,omitempty"` + // Wire name: 'muted' + Muted bool // Operator used to compare in alert evaluation: `>`, `>=`, `<`, `<=`, `==`, // `!=` - Op string `json:"op"` + // Wire name: 'op' + Op string // Value used to compare in alert evaluation. Supported types include // strings (eg. 'foobar'), floats (eg. 123.4), and booleans (true). - Value any `json:"value"` + // Wire name: 'value' + Value any - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertOptions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertOptions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertOptions) MarshalJSON() ([]byte, error) { + pb, err := alertOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // State that alert evaluates to when query result is empty. type AlertOptionsEmptyResultState string +type alertOptionsEmptyResultStatePb string const AlertOptionsEmptyResultStateOk AlertOptionsEmptyResultState = `ok` @@ -313,59 +566,106 @@ func (f *AlertOptionsEmptyResultState) Type() string { return "AlertOptionsEmptyResultState" } +func alertOptionsEmptyResultStateToPb(st *AlertOptionsEmptyResultState) (*alertOptionsEmptyResultStatePb, error) { + if st == nil { + return nil, nil + } + pb := alertOptionsEmptyResultStatePb(*st) + return &pb, nil +} + +func alertOptionsEmptyResultStateFromPb(pb *alertOptionsEmptyResultStatePb) (*AlertOptionsEmptyResultState, error) { + if pb == nil { + return nil, nil + } + st := AlertOptionsEmptyResultState(*pb) + return &st, nil +} + type AlertQuery struct { // The timestamp when this query was created. - CreatedAt string `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt string // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId string `json:"data_source_id,omitempty"` + // Wire name: 'data_source_id' + DataSourceId string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Query ID. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived bool `json:"is_archived,omitempty"` + // Wire name: 'is_archived' + IsArchived bool // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft bool `json:"is_draft,omitempty"` + // Wire name: 'is_draft' + IsDraft bool // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe bool `json:"is_safe,omitempty"` + // Wire name: 'is_safe' + IsSafe bool // The title of this query that appears in list views, widget headings, and // on the query page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - Options *QueryOptions `json:"options,omitempty"` + // Wire name: 'options' + Options *QueryOptions // The text of the query to be run. - Query string `json:"query,omitempty"` + // Wire name: 'query' + Query string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // The timestamp at which this query was last updated. - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string // The ID of the user who owns the query. - UserId int `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertQuery) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertQuery) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertQuery) MarshalJSON() ([]byte, error) { + pb, err := alertQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertState string +type alertStatePb string const AlertStateOk AlertState = `OK` @@ -394,154 +694,335 @@ func (f *AlertState) Type() string { return "AlertState" } +func alertStateToPb(st *AlertState) (*alertStatePb, error) { + if st == nil { + return nil, nil + } + pb := alertStatePb(*st) + return &pb, nil +} + +func alertStateFromPb(pb *alertStatePb) (*AlertState, error) { + if pb == nil { + return nil, nil + } + st := AlertState(*pb) + return &st, nil +} + type AlertV2 struct { // The timestamp indicating when the alert was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // Custom description for the alert. support mustache template. - CustomDescription string `json:"custom_description,omitempty"` + // Wire name: 'custom_description' + CustomDescription string // Custom summary for the alert. support mustache template. - CustomSummary string `json:"custom_summary,omitempty"` + // Wire name: 'custom_summary' + CustomSummary string // The display name of the alert. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string - Evaluation *AlertV2Evaluation `json:"evaluation,omitempty"` + // Wire name: 'evaluation' + Evaluation *AlertV2Evaluation // UUID identifying the alert. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Indicates whether the query is trashed. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // The workspace path of the folder containing the alert. Can only be set on // create, and cannot be updated. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // Text of the query to be run. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // The run as username. This field is set to "Unavailable" if the user has // been deleted. - RunAsUserName string `json:"run_as_user_name,omitempty"` + // Wire name: 'run_as_user_name' + RunAsUserName string - Schedule *CronSchedule `json:"schedule,omitempty"` + // Wire name: 'schedule' + Schedule *CronSchedule // The timestamp indicating when the alert was updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // ID of the SQL warehouse attached to the alert. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertV2) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2Pb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2FromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2) MarshalJSON() ([]byte, error) { + pb, err := alertV2ToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2Evaluation struct { // Operator used for comparison in alert evaluation. - ComparisonOperator ComparisonOperator `json:"comparison_operator,omitempty"` + // Wire name: 'comparison_operator' + ComparisonOperator ComparisonOperator // Alert state if result is empty. - EmptyResultState AlertEvaluationState `json:"empty_result_state,omitempty"` + // Wire name: 'empty_result_state' + EmptyResultState AlertEvaluationState // Timestamp of the last evaluation. - LastEvaluatedAt string `json:"last_evaluated_at,omitempty"` + // Wire name: 'last_evaluated_at' + LastEvaluatedAt string // User or Notification Destination to notify when alert is triggered. - Notification *AlertV2Notification `json:"notification,omitempty"` + // Wire name: 'notification' + Notification *AlertV2Notification // Source column from result to use to evaluate alert - Source *AlertV2OperandColumn `json:"source,omitempty"` + // Wire name: 'source' + Source *AlertV2OperandColumn // Latest state of alert evaluation. - State AlertEvaluationState `json:"state,omitempty"` + // Wire name: 'state' + State AlertEvaluationState // Threshold to user for alert evaluation, can be a column or a value. - Threshold *AlertV2Operand `json:"threshold,omitempty"` + // Wire name: 'threshold' + Threshold *AlertV2Operand - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertV2Evaluation) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2Evaluation) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2EvaluationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2EvaluationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2Evaluation) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2Evaluation) MarshalJSON() ([]byte, error) { + pb, err := alertV2EvaluationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2Notification struct { // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk bool `json:"notify_on_ok,omitempty"` + // Wire name: 'notify_on_ok' + NotifyOnOk bool // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - RetriggerSeconds int `json:"retrigger_seconds,omitempty"` + // Wire name: 'retrigger_seconds' + RetriggerSeconds int - Subscriptions []AlertV2Subscription `json:"subscriptions,omitempty"` + // Wire name: 'subscriptions' + Subscriptions []AlertV2Subscription - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertV2Notification) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2Notification) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2NotificationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2NotificationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2Notification) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2Notification) MarshalJSON() ([]byte, error) { + pb, err := alertV2NotificationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2Operand struct { - Column *AlertV2OperandColumn `json:"column,omitempty"` - Value *AlertV2OperandValue `json:"value,omitempty"` + // Wire name: 'column' + Column *AlertV2OperandColumn + + // Wire name: 'value' + Value *AlertV2OperandValue +} + +func (st *AlertV2Operand) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2OperandPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2OperandFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AlertV2Operand) MarshalJSON() ([]byte, error) { + pb, err := alertV2OperandToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2OperandColumn struct { - Aggregation Aggregation `json:"aggregation,omitempty"` - Display string `json:"display,omitempty"` + // Wire name: 'aggregation' + Aggregation Aggregation + + // Wire name: 'display' + Display string - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertV2OperandColumn) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2OperandColumn) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2OperandColumnPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2OperandColumnFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2OperandColumn) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2OperandColumn) MarshalJSON() ([]byte, error) { + pb, err := alertV2OperandColumnToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2OperandValue struct { - BoolValue bool `json:"bool_value,omitempty"` - DoubleValue float64 `json:"double_value,omitempty"` + // Wire name: 'bool_value' + BoolValue bool - StringValue string `json:"string_value,omitempty"` + // Wire name: 'double_value' + DoubleValue float64 - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'string_value' + StringValue string + + ForceSendFields []string `tf:"-"` } -func (s *AlertV2OperandValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2OperandValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2OperandValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2OperandValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2OperandValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2OperandValue) MarshalJSON() ([]byte, error) { + pb, err := alertV2OperandValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AlertV2Subscription struct { - DestinationId string `json:"destination_id,omitempty"` - UserEmail string `json:"user_email,omitempty"` + // Wire name: 'destination_id' + DestinationId string + + // Wire name: 'user_email' + UserEmail string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *AlertV2Subscription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *AlertV2Subscription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &alertV2SubscriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := alertV2SubscriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s AlertV2Subscription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st AlertV2Subscription) MarshalJSON() ([]byte, error) { + pb, err := alertV2SubscriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Describes metadata for a particular chunk, within a result set; this @@ -550,72 +1031,184 @@ func (s AlertV2Subscription) MarshalJSON() ([]byte, error) { type BaseChunkInfo struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount int64 `json:"byte_count,omitempty"` + // Wire name: 'byte_count' + ByteCount int64 // The position within the sequence of result set chunks. - ChunkIndex int `json:"chunk_index,omitempty"` + // Wire name: 'chunk_index' + ChunkIndex int // The number of rows within the result chunk. - RowCount int64 `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int64 // The starting row offset within the result set. - RowOffset int64 `json:"row_offset,omitempty"` + // Wire name: 'row_offset' + RowOffset int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *BaseChunkInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *BaseChunkInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &baseChunkInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := baseChunkInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s BaseChunkInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st BaseChunkInfo) MarshalJSON() ([]byte, error) { + pb, err := baseChunkInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Cancel statement execution type CancelExecutionRequest struct { // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId string `json:"-" url:"-"` + // Wire name: 'statement_id' + StatementId string `tf:"-"` +} + +func (st *CancelExecutionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelExecutionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelExecutionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelExecutionRequest) MarshalJSON() ([]byte, error) { + pb, err := cancelExecutionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CancelExecutionResponse struct { } +func (st *CancelExecutionResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cancelExecutionResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cancelExecutionResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CancelExecutionResponse) MarshalJSON() ([]byte, error) { + pb, err := cancelExecutionResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Configures the channel name and DBSQL version of the warehouse. // CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified. type Channel struct { - DbsqlVersion string `json:"dbsql_version,omitempty"` - Name ChannelName `json:"name,omitempty"` + // Wire name: 'dbsql_version' + DbsqlVersion string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'name' + Name ChannelName + + ForceSendFields []string `tf:"-"` } -func (s *Channel) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Channel) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &channelPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := channelFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Channel) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Channel) MarshalJSON() ([]byte, error) { + pb, err := channelToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Details about a Channel. type ChannelInfo struct { // DB SQL Version the Channel is mapped to. - DbsqlVersion string `json:"dbsql_version,omitempty"` + // Wire name: 'dbsql_version' + DbsqlVersion string // Name of the channel - Name ChannelName `json:"name,omitempty"` + // Wire name: 'name' + Name ChannelName - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ChannelInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ChannelInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &channelInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := channelInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ChannelInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ChannelInfo) MarshalJSON() ([]byte, error) { + pb, err := channelInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ChannelName string +type channelNamePb string const ChannelNameChannelNameCurrent ChannelName = `CHANNEL_NAME_CURRENT` @@ -646,71 +1239,140 @@ func (f *ChannelName) Type() string { return "ChannelName" } +func channelNameToPb(st *ChannelName) (*channelNamePb, error) { + if st == nil { + return nil, nil + } + pb := channelNamePb(*st) + return &pb, nil +} + +func channelNameFromPb(pb *channelNamePb) (*ChannelName, error) { + if pb == nil { + return nil, nil + } + st := ChannelName(*pb) + return &st, nil +} + type ClientConfig struct { - AllowCustomJsVisualizations bool `json:"allow_custom_js_visualizations,omitempty"` - AllowDownloads bool `json:"allow_downloads,omitempty"` + // Wire name: 'allow_custom_js_visualizations' + AllowCustomJsVisualizations bool + + // Wire name: 'allow_downloads' + AllowDownloads bool - AllowExternalShares bool `json:"allow_external_shares,omitempty"` + // Wire name: 'allow_external_shares' + AllowExternalShares bool - AllowSubscriptions bool `json:"allow_subscriptions,omitempty"` + // Wire name: 'allow_subscriptions' + AllowSubscriptions bool - DateFormat string `json:"date_format,omitempty"` + // Wire name: 'date_format' + DateFormat string - DateTimeFormat string `json:"date_time_format,omitempty"` + // Wire name: 'date_time_format' + DateTimeFormat string - DisablePublish bool `json:"disable_publish,omitempty"` + // Wire name: 'disable_publish' + DisablePublish bool - EnableLegacyAutodetectTypes bool `json:"enable_legacy_autodetect_types,omitempty"` + // Wire name: 'enable_legacy_autodetect_types' + EnableLegacyAutodetectTypes bool - FeatureShowPermissionsControl bool `json:"feature_show_permissions_control,omitempty"` + // Wire name: 'feature_show_permissions_control' + FeatureShowPermissionsControl bool - HidePlotlyModeBar bool `json:"hide_plotly_mode_bar,omitempty"` + // Wire name: 'hide_plotly_mode_bar' + HidePlotlyModeBar bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ClientConfig) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ClientConfig) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &clientConfigPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := clientConfigFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ClientConfig) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ClientConfig) MarshalJSON() ([]byte, error) { + pb, err := clientConfigToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ColumnInfo struct { // The name of the column. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The ordinal position of the column (starting at position 0). - Position int `json:"position,omitempty"` + // Wire name: 'position' + Position int // The format of the interval type. - TypeIntervalType string `json:"type_interval_type,omitempty"` + // Wire name: 'type_interval_type' + TypeIntervalType string // The name of the base data type. This doesn't include details for complex // types such as STRUCT, MAP or ARRAY. - TypeName ColumnInfoTypeName `json:"type_name,omitempty"` + // Wire name: 'type_name' + TypeName ColumnInfoTypeName // Specifies the number of digits in a number. This applies to the DECIMAL // type. - TypePrecision int `json:"type_precision,omitempty"` + // Wire name: 'type_precision' + TypePrecision int // Specifies the number of digits to the right of the decimal point in a // number. This applies to the DECIMAL type. - TypeScale int `json:"type_scale,omitempty"` + // Wire name: 'type_scale' + TypeScale int // The full SQL type specification. - TypeText string `json:"type_text,omitempty"` + // Wire name: 'type_text' + TypeText string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ColumnInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ColumnInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &columnInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := columnInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ColumnInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ColumnInfo) MarshalJSON() ([]byte, error) { + pb, err := columnInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The name of the base data type. This doesn't include details for complex // types such as STRUCT, MAP or ARRAY. type ColumnInfoTypeName string +type columnInfoTypeNamePb string const ColumnInfoTypeNameArray ColumnInfoTypeName = `ARRAY` @@ -771,7 +1433,24 @@ func (f *ColumnInfoTypeName) Type() string { return "ColumnInfoTypeName" } +func columnInfoTypeNameToPb(st *ColumnInfoTypeName) (*columnInfoTypeNamePb, error) { + if st == nil { + return nil, nil + } + pb := columnInfoTypeNamePb(*st) + return &pb, nil +} + +func columnInfoTypeNameFromPb(pb *columnInfoTypeNamePb) (*ColumnInfoTypeName, error) { + if pb == nil { + return nil, nil + } + st := ColumnInfoTypeName(*pb) + return &st, nil +} + type ComparisonOperator string +type comparisonOperatorPb string const ComparisonOperatorEqual ComparisonOperator = `EQUAL` @@ -810,205 +1489,433 @@ func (f *ComparisonOperator) Type() string { return "ComparisonOperator" } +func comparisonOperatorToPb(st *ComparisonOperator) (*comparisonOperatorPb, error) { + if st == nil { + return nil, nil + } + pb := comparisonOperatorPb(*st) + return &pb, nil +} + +func comparisonOperatorFromPb(pb *comparisonOperatorPb) (*ComparisonOperator, error) { + if pb == nil { + return nil, nil + } + st := ComparisonOperator(*pb) + return &st, nil +} + type CreateAlert struct { // Name of the alert. - Name string `json:"name"` + // Wire name: 'name' + Name string // Alert configuration options. - Options AlertOptions `json:"options"` + // Wire name: 'options' + Options AlertOptions // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string // Query ID. - QueryId string `json:"query_id"` + // Wire name: 'query_id' + QueryId string // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm int `json:"rearm,omitempty"` + // Wire name: 'rearm' + Rearm int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAlert) MarshalJSON() ([]byte, error) { + pb, err := createAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateAlertRequest struct { - Alert *CreateAlertRequestAlert `json:"alert,omitempty"` + + // Wire name: 'alert' + Alert *CreateAlertRequestAlert // If true, automatically resolve alert display name conflicts. Otherwise, // fail the request if the alert's display name conflicts with an existing // alert's display name. - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + // Wire name: 'auto_resolve_display_name' + AutoResolveDisplayName bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAlertRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAlertRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAlertRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAlertRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAlertRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAlertRequest) MarshalJSON() ([]byte, error) { + pb, err := createAlertRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateAlertRequestAlert struct { // Trigger conditions of the alert. - Condition *AlertCondition `json:"condition,omitempty"` + // Wire name: 'condition' + Condition *AlertCondition // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody string `json:"custom_body,omitempty"` + // Wire name: 'custom_body' + CustomBody string // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // The display name of the alert. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk bool `json:"notify_on_ok,omitempty"` + // Wire name: 'notify_on_ok' + NotifyOnOk bool // The workspace path of the folder containing the alert. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // UUID of the query attached to the alert. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + // Wire name: 'seconds_to_retrigger' + SecondsToRetrigger int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateAlertRequestAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateAlertRequestAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAlertRequestAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAlertRequestAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateAlertRequestAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateAlertRequestAlert) MarshalJSON() ([]byte, error) { + pb, err := createAlertRequestAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Create an alert type CreateAlertV2Request struct { - Alert AlertV2 `json:"alert"` + + // Wire name: 'alert' + Alert AlertV2 +} + +func (st *CreateAlertV2Request) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createAlertV2RequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createAlertV2RequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateAlertV2Request) MarshalJSON() ([]byte, error) { + pb, err := createAlertV2RequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateQueryRequest struct { // If true, automatically resolve query display name conflicts. Otherwise, // fail the request if the query's display name conflicts with an existing // query's display name. - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + // Wire name: 'auto_resolve_display_name' + AutoResolveDisplayName bool - Query *CreateQueryRequestQuery `json:"query,omitempty"` + // Wire name: 'query' + Query *CreateQueryRequestQuery - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateQueryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateQueryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := createQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateQueryRequestQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + // Wire name: 'apply_auto_limit' + ApplyAutoLimit bool // Name of the catalog where this query will be executed. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // List of query parameter definitions. - Parameters []QueryParameter `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []QueryParameter // Workspace path of the workspace folder containing the object. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // Text of the query to be run. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Sets the "Run as" role for the object. - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + // Wire name: 'run_as_mode' + RunAsMode RunAsMode // Name of the schema where this query will be executed. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // ID of the SQL warehouse attached to the query. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateQueryRequestQuery) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateQueryRequestQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createQueryRequestQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createQueryRequestQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateQueryRequestQuery) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateQueryRequestQuery) MarshalJSON() ([]byte, error) { + pb, err := createQueryRequestQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Add visualization to a query type CreateQueryVisualizationsLegacyRequest struct { // A short description of this visualization. This is not displayed in the // UI. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The name of the visualization that appears on dashboards and the query // screen. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options any `json:"options"` + // Wire name: 'options' + Options any // The identifier returned by :method:queries/create - QueryId string `json:"query_id"` + // Wire name: 'query_id' + QueryId string // The type of visualization: chart, table, pivot table, and so on. - Type string `json:"type"` + // Wire name: 'type' + Type string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateQueryVisualizationsLegacyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateQueryVisualizationsLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createQueryVisualizationsLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createQueryVisualizationsLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateQueryVisualizationsLegacyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateQueryVisualizationsLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := createQueryVisualizationsLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateVisualizationRequest struct { - Visualization *CreateVisualizationRequestVisualization `json:"visualization,omitempty"` + + // Wire name: 'visualization' + Visualization *CreateVisualizationRequestVisualization +} + +func (st *CreateVisualizationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createVisualizationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createVisualizationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateVisualizationRequest) MarshalJSON() ([]byte, error) { + pb, err := createVisualizationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateVisualizationRequestVisualization struct { // The display name of the visualization. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID of the query that the visualization is attached to. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions string `json:"serialized_options,omitempty"` + // Wire name: 'serialized_options' + SerializedOptions string // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + // Wire name: 'serialized_query_plan' + SerializedQueryPlan string // The type of visualization: counter, table, funnel, and so on. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateVisualizationRequestVisualization) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateVisualizationRequestVisualization) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createVisualizationRequestVisualizationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createVisualizationRequestVisualizationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateVisualizationRequestVisualization) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateVisualizationRequestVisualization) MarshalJSON() ([]byte, error) { + pb, err := createVisualizationRequestVisualizationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateWarehouseRequest struct { @@ -1020,33 +1927,41 @@ type CreateWarehouseRequest struct { // autostop. // // Defaults to 120 mins - AutoStopMins int `json:"auto_stop_mins,omitempty"` + // Wire name: 'auto_stop_mins' + AutoStopMins int // Channel Details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize string `json:"cluster_size,omitempty"` + // Wire name: 'cluster_size' + ClusterSize string // warehouse creator name - CreatorName string `json:"creator_name,omitempty"` + // Wire name: 'creator_name' + CreatorName string // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton bool `json:"enable_photon,omitempty"` + // Wire name: 'enable_photon' + EnablePhoton bool // Configures whether the warehouse should use serverless compute - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + // Wire name: 'enable_serverless_compute' + EnableServerlessCompute bool // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters int `json:"max_num_clusters,omitempty"` + // Wire name: 'max_num_clusters' + MaxNumClusters int // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -1056,39 +1971,62 @@ type CreateWarehouseRequest struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters int `json:"min_num_clusters,omitempty"` + // Wire name: 'min_num_clusters' + MinNumClusters int // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + // Wire name: 'spot_instance_policy' + SpotInstancePolicy SpotInstancePolicy // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags *EndpointTags `json:"tags,omitempty"` + // Wire name: 'tags' + Tags *EndpointTags // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType CreateWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + // Wire name: 'warehouse_type' + WarehouseType CreateWarehouseRequestWarehouseType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateWarehouseRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateWarehouseRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createWarehouseRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createWarehouseRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateWarehouseRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateWarehouseRequest) MarshalJSON() ([]byte, error) { + pb, err := createWarehouseRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type CreateWarehouseRequestWarehouseType string +type createWarehouseRequestWarehouseTypePb string const CreateWarehouseRequestWarehouseTypeClassic CreateWarehouseRequestWarehouseType = `CLASSIC` @@ -1117,199 +2055,373 @@ func (f *CreateWarehouseRequestWarehouseType) Type() string { return "CreateWarehouseRequestWarehouseType" } +func createWarehouseRequestWarehouseTypeToPb(st *CreateWarehouseRequestWarehouseType) (*createWarehouseRequestWarehouseTypePb, error) { + if st == nil { + return nil, nil + } + pb := createWarehouseRequestWarehouseTypePb(*st) + return &pb, nil +} + +func createWarehouseRequestWarehouseTypeFromPb(pb *createWarehouseRequestWarehouseTypePb) (*CreateWarehouseRequestWarehouseType, error) { + if pb == nil { + return nil, nil + } + st := CreateWarehouseRequestWarehouseType(*pb) + return &st, nil +} + type CreateWarehouseResponse struct { // Id for the SQL warehouse. This value is unique across all SQL warehouses. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateWarehouseResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateWarehouseResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := createWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateWidget struct { // Dashboard ID returned by :method:dashboards/create. - DashboardId string `json:"dashboard_id"` + // Wire name: 'dashboard_id' + DashboardId string // Widget ID returned by :method:dashboardwidgets/create - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` - Options WidgetOptions `json:"options"` + // Wire name: 'options' + Options WidgetOptions // If this is a textbox widget, the application displays this text. This // field is ignored if the widget contains a visualization in the // `visualization` field. - Text string `json:"text,omitempty"` + // Wire name: 'text' + Text string // Query Vizualization ID returned by :method:queryvisualizations/create. - VisualizationId string `json:"visualization_id,omitempty"` + // Wire name: 'visualization_id' + VisualizationId string // Width of a widget - Width int `json:"width"` + // Wire name: 'width' + Width int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateWidget) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateWidget) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createWidgetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createWidgetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateWidget) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateWidget) MarshalJSON() ([]byte, error) { + pb, err := createWidgetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CronSchedule struct { // Indicate whether this schedule is paused or not. - PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + // Wire name: 'pause_status' + PauseStatus SchedulePauseStatus // A cron expression using quartz syntax that specifies the schedule for // this pipeline. Should use the quartz format described here: // http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html - QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` + // Wire name: 'quartz_cron_schedule' + QuartzCronSchedule string // A Java timezone id. The schedule will be resolved using this timezone. // This will be combined with the quartz_cron_schedule to determine the // schedule. See // https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html // for details. - TimezoneId string `json:"timezone_id,omitempty"` + // Wire name: 'timezone_id' + TimezoneId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CronSchedule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CronSchedule) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &cronSchedulePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := cronScheduleFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CronSchedule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CronSchedule) MarshalJSON() ([]byte, error) { + pb, err := cronScheduleToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A JSON representing a dashboard containing widgets of visualizations and text // boxes. type Dashboard struct { // Whether the authenticated user can edit the query definition. - CanEdit bool `json:"can_edit,omitempty"` + // Wire name: 'can_edit' + CanEdit bool // Timestamp when this dashboard was created. - CreatedAt string `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt string // In the web application, query filters that share a name are coupled to a // single selection box if this value is `true`. - DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + // Wire name: 'dashboard_filters_enabled' + DashboardFiltersEnabled bool // The ID for this dashboard. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Indicates whether a dashboard is trashed. Trashed dashboards won't appear // in list views. If this boolean is `true`, the `options` property for this // dashboard includes a `moved_to_trash_at` timestamp. Items in trash are // permanently deleted after 30 days. - IsArchived bool `json:"is_archived,omitempty"` + // Wire name: 'is_archived' + IsArchived bool // Whether a dashboard is a draft. Draft dashboards only appear in list // views for their owners. - IsDraft bool `json:"is_draft,omitempty"` + // Wire name: 'is_draft' + IsDraft bool // Indicates whether this query object appears in the current user's // favorites list. This flag determines whether the star icon for favorites // is selected. - IsFavorite bool `json:"is_favorite,omitempty"` + // Wire name: 'is_favorite' + IsFavorite bool // The title of the dashboard that appears in list views and at the top of // the dashboard page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - Options *DashboardOptions `json:"options,omitempty"` + // Wire name: 'options' + Options *DashboardOptions // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + // Wire name: 'permission_tier' + PermissionTier PermissionLevel // URL slug. Usually mirrors the query name with dashes (`-`) instead of // spaces. Appears in the URL for this query. - Slug string `json:"slug,omitempty"` + // Wire name: 'slug' + Slug string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // Timestamp when this dashboard was last updated. - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string - User *User `json:"user,omitempty"` + // Wire name: 'user' + User *User // The ID of the user who owns the dashboard. - UserId int `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId int - Widgets []Widget `json:"widgets,omitempty"` + // Wire name: 'widgets' + Widgets []Widget - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Dashboard) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Dashboard) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Dashboard) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Dashboard) MarshalJSON() ([]byte, error) { + pb, err := dashboardToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardEditContent struct { - DashboardId string `json:"-" url:"-"` + + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + // Wire name: 'run_as_role' + RunAsRole RunAsRole - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DashboardEditContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DashboardEditContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardEditContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardEditContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DashboardEditContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DashboardEditContent) MarshalJSON() ([]byte, error) { + pb, err := dashboardEditContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardOptions struct { // The timestamp when this dashboard was moved to trash. Only present when // the `is_archived` property is `true`. Trashed items are deleted after // thirty days. - MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} + // Wire name: 'moved_to_trash_at' + MovedToTrashAt string -func (s *DashboardOptions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) + ForceSendFields []string `tf:"-"` } -func (s DashboardOptions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *DashboardOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DashboardOptions) MarshalJSON() ([]byte, error) { + pb, err := dashboardOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DashboardPostContent struct { // Indicates whether the dashboard filters are enabled - DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + // Wire name: 'dashboard_filters_enabled' + DashboardFiltersEnabled bool // Indicates whether this dashboard object should appear in the current // user's favorites list. - IsFavorite bool `json:"is_favorite,omitempty"` + // Wire name: 'is_favorite' + IsFavorite bool // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name string `json:"name"` + // Wire name: 'name' + Name string // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + // Wire name: 'run_as_role' + RunAsRole RunAsRole - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DashboardPostContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DashboardPostContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dashboardPostContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dashboardPostContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DashboardPostContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DashboardPostContent) MarshalJSON() ([]byte, error) { + pb, err := dashboardPostContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A JSON object representing a DBSQL data source / SQL warehouse. @@ -1318,39 +2430,66 @@ type DataSource struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The string name of this data source / SQL warehouse as it appears in the // Databricks SQL web application. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Reserved for internal use. - PauseReason string `json:"pause_reason,omitempty"` + // Wire name: 'pause_reason' + PauseReason string // Reserved for internal use. - Paused int `json:"paused,omitempty"` + // Wire name: 'paused' + Paused int // Reserved for internal use. - SupportsAutoLimit bool `json:"supports_auto_limit,omitempty"` + // Wire name: 'supports_auto_limit' + SupportsAutoLimit bool // Reserved for internal use. - Syntax string `json:"syntax,omitempty"` + // Wire name: 'syntax' + Syntax string // The type of data source. For SQL warehouses, this will be // `databricks_internal`. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string // Reserved for internal use. - ViewOnly bool `json:"view_only,omitempty"` + // Wire name: 'view_only' + ViewOnly bool // The ID of the associated SQL warehouse, if this data source is backed by // a SQL warehouse. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DataSource) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DataSource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dataSourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dataSourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DataSource) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DataSource) MarshalJSON() ([]byte, error) { + pb, err := dataSourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DatePrecision string +type datePrecisionPb string const DatePrecisionDayPrecision DatePrecision = `DAY_PRECISION` @@ -1379,35 +2518,101 @@ func (f *DatePrecision) Type() string { return "DatePrecision" } +func datePrecisionToPb(st *DatePrecision) (*datePrecisionPb, error) { + if st == nil { + return nil, nil + } + pb := datePrecisionPb(*st) + return &pb, nil +} + +func datePrecisionFromPb(pb *datePrecisionPb) (*DatePrecision, error) { + if pb == nil { + return nil, nil + } + st := DatePrecision(*pb) + return &st, nil +} + type DateRange struct { - End string `json:"end"` - Start string `json:"start"` + // Wire name: 'end' + End string + + // Wire name: 'start' + Start string +} + +func (st *DateRange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dateRangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dateRangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DateRange) MarshalJSON() ([]byte, error) { + pb, err := dateRangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DateRangeValue struct { // Manually specified date-time range value. - DateRangeValue *DateRange `json:"date_range_value,omitempty"` + // Wire name: 'date_range_value' + DateRangeValue *DateRange // Dynamic date-time range value based on current date-time. - DynamicDateRangeValue DateRangeValueDynamicDateRange `json:"dynamic_date_range_value,omitempty"` + // Wire name: 'dynamic_date_range_value' + DynamicDateRangeValue DateRangeValueDynamicDateRange // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision DatePrecision `json:"precision,omitempty"` + // Wire name: 'precision' + Precision DatePrecision - StartDayOfWeek int `json:"start_day_of_week,omitempty"` + // Wire name: 'start_day_of_week' + StartDayOfWeek int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DateRangeValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DateRangeValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dateRangeValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dateRangeValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DateRangeValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DateRangeValue) MarshalJSON() ([]byte, error) { + pb, err := dateRangeValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DateRangeValueDynamicDateRange string +type dateRangeValueDynamicDateRangePb string const DateRangeValueDynamicDateRangeLast12Months DateRangeValueDynamicDateRange = `LAST_12_MONTHS` @@ -1464,27 +2669,64 @@ func (f *DateRangeValueDynamicDateRange) Type() string { return "DateRangeValueDynamicDateRange" } +func dateRangeValueDynamicDateRangeToPb(st *DateRangeValueDynamicDateRange) (*dateRangeValueDynamicDateRangePb, error) { + if st == nil { + return nil, nil + } + pb := dateRangeValueDynamicDateRangePb(*st) + return &pb, nil +} + +func dateRangeValueDynamicDateRangeFromPb(pb *dateRangeValueDynamicDateRangePb) (*DateRangeValueDynamicDateRange, error) { + if pb == nil { + return nil, nil + } + st := DateRangeValueDynamicDateRange(*pb) + return &st, nil +} + type DateValue struct { // Manually specified date-time value. - DateValue string `json:"date_value,omitempty"` + // Wire name: 'date_value' + DateValue string // Dynamic date-time value based on current date-time. - DynamicDateValue DateValueDynamicDate `json:"dynamic_date_value,omitempty"` + // Wire name: 'dynamic_date_value' + DynamicDateValue DateValueDynamicDate // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision DatePrecision `json:"precision,omitempty"` + // Wire name: 'precision' + Precision DatePrecision - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DateValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DateValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &dateValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := dateValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DateValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DateValue) MarshalJSON() ([]byte, error) { + pb, err := dateValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DateValueDynamicDate string +type dateValueDynamicDatePb string const DateValueDynamicDateNow DateValueDynamicDate = `NOW` @@ -1511,51 +2753,304 @@ func (f *DateValueDynamicDate) Type() string { return "DateValueDynamicDate" } +func dateValueDynamicDateToPb(st *DateValueDynamicDate) (*dateValueDynamicDatePb, error) { + if st == nil { + return nil, nil + } + pb := dateValueDynamicDatePb(*st) + return &pb, nil +} + +func dateValueDynamicDateFromPb(pb *dateValueDynamicDatePb) (*DateValueDynamicDate, error) { + if pb == nil { + return nil, nil + } + st := DateValueDynamicDate(*pb) + return &st, nil +} + // Delete an alert type DeleteAlertsLegacyRequest struct { - AlertId string `json:"-" url:"-"` + + // Wire name: 'alert_id' + AlertId string `tf:"-"` +} + +func (st *DeleteAlertsLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAlertsLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAlertsLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAlertsLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteAlertsLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Remove a dashboard type DeleteDashboardRequest struct { - DashboardId string `json:"-" url:"-"` + + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *DeleteDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Remove widget type DeleteDashboardWidgetRequest struct { // Widget ID returned by :method:dashboardwidgets/create - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteDashboardWidgetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDashboardWidgetRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDashboardWidgetRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDashboardWidgetRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDashboardWidgetRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a query type DeleteQueriesLegacyRequest struct { - QueryId string `json:"-" url:"-"` + + // Wire name: 'query_id' + QueryId string `tf:"-"` +} + +func (st *DeleteQueriesLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteQueriesLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteQueriesLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteQueriesLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteQueriesLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Remove visualization type DeleteQueryVisualizationsLegacyRequest struct { // Widget ID returned by :method:queryvizualisations/create - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteQueryVisualizationsLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteQueryVisualizationsLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteQueryVisualizationsLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteQueryVisualizationsLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteQueryVisualizationsLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Remove a visualization type DeleteVisualizationRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteVisualizationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteVisualizationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteVisualizationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteVisualizationRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteVisualizationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a warehouse type DeleteWarehouseRequest struct { // Required. Id of the SQL warehouse. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *DeleteWarehouseRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWarehouseRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWarehouseRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWarehouseRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteWarehouseRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteWarehouseResponse struct { } +func (st *DeleteWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Disposition string +type dispositionPb string const DispositionExternalLinks Disposition = `EXTERNAL_LINKS` @@ -1582,28 +3077,67 @@ func (f *Disposition) Type() string { return "Disposition" } +func dispositionToPb(st *Disposition) (*dispositionPb, error) { + if st == nil { + return nil, nil + } + pb := dispositionPb(*st) + return &pb, nil +} + +func dispositionFromPb(pb *dispositionPb) (*Disposition, error) { + if pb == nil { + return nil, nil + } + st := Disposition(*pb) + return &st, nil +} + type EditAlert struct { - AlertId string `json:"-" url:"-"` + + // Wire name: 'alert_id' + AlertId string `tf:"-"` // Name of the alert. - Name string `json:"name"` + // Wire name: 'name' + Name string // Alert configuration options. - Options AlertOptions `json:"options"` + // Wire name: 'options' + Options AlertOptions // Query ID. - QueryId string `json:"query_id"` + // Wire name: 'query_id' + QueryId string // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm int `json:"rearm,omitempty"` + // Wire name: 'rearm' + Rearm int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditAlert) MarshalJSON() ([]byte, error) { + pb, err := editAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EditWarehouseRequest struct { @@ -1613,35 +3147,44 @@ type EditWarehouseRequest struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins int `json:"auto_stop_mins,omitempty"` + // Wire name: 'auto_stop_mins' + AutoStopMins int // Channel Details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize string `json:"cluster_size,omitempty"` + // Wire name: 'cluster_size' + ClusterSize string // warehouse creator name - CreatorName string `json:"creator_name,omitempty"` + // Wire name: 'creator_name' + CreatorName string // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton bool `json:"enable_photon,omitempty"` + // Wire name: 'enable_photon' + EnablePhoton bool // Configures whether the warehouse should use serverless compute. - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + // Wire name: 'enable_serverless_compute' + EnableServerlessCompute bool // Required. Id of the warehouse to configure. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters int `json:"max_num_clusters,omitempty"` + // Wire name: 'max_num_clusters' + MaxNumClusters int // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -1651,39 +3194,62 @@ type EditWarehouseRequest struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters int `json:"min_num_clusters,omitempty"` + // Wire name: 'min_num_clusters' + MinNumClusters int // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + // Wire name: 'spot_instance_policy' + SpotInstancePolicy SpotInstancePolicy // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags *EndpointTags `json:"tags,omitempty"` + // Wire name: 'tags' + Tags *EndpointTags // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType EditWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + // Wire name: 'warehouse_type' + WarehouseType EditWarehouseRequestWarehouseType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EditWarehouseRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EditWarehouseRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editWarehouseRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editWarehouseRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EditWarehouseRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EditWarehouseRequest) MarshalJSON() ([]byte, error) { + pb, err := editWarehouseRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type EditWarehouseRequestWarehouseType string +type editWarehouseRequestWarehouseTypePb string const EditWarehouseRequestWarehouseTypeClassic EditWarehouseRequestWarehouseType = `CLASSIC` @@ -1712,53 +3278,161 @@ func (f *EditWarehouseRequestWarehouseType) Type() string { return "EditWarehouseRequestWarehouseType" } +func editWarehouseRequestWarehouseTypeToPb(st *EditWarehouseRequestWarehouseType) (*editWarehouseRequestWarehouseTypePb, error) { + if st == nil { + return nil, nil + } + pb := editWarehouseRequestWarehouseTypePb(*st) + return &pb, nil +} + +func editWarehouseRequestWarehouseTypeFromPb(pb *editWarehouseRequestWarehouseTypePb) (*EditWarehouseRequestWarehouseType, error) { + if pb == nil { + return nil, nil + } + st := EditWarehouseRequestWarehouseType(*pb) + return &st, nil +} + type EditWarehouseResponse struct { } +func (st *EditWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &editWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := editWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EditWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := editWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Represents an empty message, similar to google.protobuf.Empty, which is not // available in the firm right now. type Empty struct { } +func (st *Empty) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &emptyPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := emptyFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Empty) MarshalJSON() ([]byte, error) { + pb, err := emptyToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type EndpointConfPair struct { - Key string `json:"key,omitempty"` - Value string `json:"value,omitempty"` + // Wire name: 'key' + Key string + + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointConfPair) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointConfPair) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointConfPairPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointConfPairFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointConfPair) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointConfPair) MarshalJSON() ([]byte, error) { + pb, err := endpointConfPairToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointHealth struct { // Details about errors that are causing current degraded/failed status. - Details string `json:"details,omitempty"` + // Wire name: 'details' + Details string // The reason for failure to bring up clusters for this warehouse. This is // available when status is 'FAILED' and sometimes when it is DEGRADED. - FailureReason *TerminationReason `json:"failure_reason,omitempty"` + // Wire name: 'failure_reason' + FailureReason *TerminationReason // Deprecated. split into summary and details for security - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Health status of the warehouse. - Status Status `json:"status,omitempty"` + // Wire name: 'status' + Status Status // A short summary of the health status in case of degraded/failed // warehouses. - Summary string `json:"summary,omitempty"` + // Wire name: 'summary' + Summary string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointHealth) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointHealth) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointHealthPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointHealthFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointHealth) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointHealth) MarshalJSON() ([]byte, error) { + pb, err := endpointHealthToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointInfo struct { @@ -1768,40 +3442,51 @@ type EndpointInfo struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins int `json:"auto_stop_mins,omitempty"` + // Wire name: 'auto_stop_mins' + AutoStopMins int // Channel Details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize string `json:"cluster_size,omitempty"` + // Wire name: 'cluster_size' + ClusterSize string // warehouse creator name - CreatorName string `json:"creator_name,omitempty"` + // Wire name: 'creator_name' + CreatorName string // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton bool `json:"enable_photon,omitempty"` + // Wire name: 'enable_photon' + EnablePhoton bool // Configures whether the warehouse should use serverless compute - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + // Wire name: 'enable_serverless_compute' + EnableServerlessCompute bool // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health *EndpointHealth `json:"health,omitempty"` + // Wire name: 'health' + Health *EndpointHealth // unique identifier for warehouse - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // the jdbc connection string for this warehouse - JdbcUrl string `json:"jdbc_url,omitempty"` + // Wire name: 'jdbc_url' + JdbcUrl string // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters int `json:"max_num_clusters,omitempty"` + // Wire name: 'max_num_clusters' + MaxNumClusters int // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -1811,47 +3496,74 @@ type EndpointInfo struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters int `json:"min_num_clusters,omitempty"` + // Wire name: 'min_num_clusters' + MinNumClusters int // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Deprecated. current number of active sessions for the warehouse - NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + // Wire name: 'num_active_sessions' + NumActiveSessions int64 // current number of clusters running for the service - NumClusters int `json:"num_clusters,omitempty"` + // Wire name: 'num_clusters' + NumClusters int // ODBC parameters for the SQL warehouse - OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + // Wire name: 'odbc_params' + OdbcParams *OdbcParams // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + // Wire name: 'spot_instance_policy' + SpotInstancePolicy SpotInstancePolicy // State of the warehouse - State State `json:"state,omitempty"` + // Wire name: 'state' + State State // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags *EndpointTags `json:"tags,omitempty"` + // Wire name: 'tags' + Tags *EndpointTags // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType EndpointInfoWarehouseType `json:"warehouse_type,omitempty"` + // Wire name: 'warehouse_type' + WarehouseType EndpointInfoWarehouseType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointInfo) MarshalJSON() ([]byte, error) { + pb, err := endpointInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type EndpointInfoWarehouseType string +type endpointInfoWarehouseTypePb string const EndpointInfoWarehouseTypeClassic EndpointInfoWarehouseType = `CLASSIC` @@ -1880,43 +3592,126 @@ func (f *EndpointInfoWarehouseType) Type() string { return "EndpointInfoWarehouseType" } +func endpointInfoWarehouseTypeToPb(st *EndpointInfoWarehouseType) (*endpointInfoWarehouseTypePb, error) { + if st == nil { + return nil, nil + } + pb := endpointInfoWarehouseTypePb(*st) + return &pb, nil +} + +func endpointInfoWarehouseTypeFromPb(pb *endpointInfoWarehouseTypePb) (*EndpointInfoWarehouseType, error) { + if pb == nil { + return nil, nil + } + st := EndpointInfoWarehouseType(*pb) + return &st, nil +} + type EndpointTagPair struct { - Key string `json:"key,omitempty"` - Value string `json:"value,omitempty"` + // Wire name: 'key' + Key string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'value' + Value string + + ForceSendFields []string `tf:"-"` } -func (s *EndpointTagPair) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointTagPair) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointTagPairPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointTagPairFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointTagPair) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointTagPair) MarshalJSON() ([]byte, error) { + pb, err := endpointTagPairToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointTags struct { - CustomTags []EndpointTagPair `json:"custom_tags,omitempty"` + + // Wire name: 'custom_tags' + CustomTags []EndpointTagPair +} + +func (st *EndpointTags) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointTagsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointTagsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st EndpointTags) MarshalJSON() ([]byte, error) { + pb, err := endpointTagsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EnumValue struct { // List of valid query parameter values, newline delimited. - EnumOptions string `json:"enum_options,omitempty"` + // Wire name: 'enum_options' + EnumOptions string // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` + // Wire name: 'multi_values_options' + MultiValuesOptions *MultiValuesOptions // List of selected query parameter values. - Values []string `json:"values,omitempty"` + // Wire name: 'values' + Values []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EnumValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EnumValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &enumValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := enumValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EnumValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EnumValue) MarshalJSON() ([]byte, error) { + pb, err := enumValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExecuteStatementRequest struct { @@ -1926,14 +3721,17 @@ type ExecuteStatementRequest struct { // byte limit, then `truncated` in the response is set to `true`. When using // `EXTERNAL_LINKS` disposition, a default `byte_limit` of 100 GiB is // applied if `byte_limit` is not explcitly set. - ByteLimit int64 `json:"byte_limit,omitempty"` + // Wire name: 'byte_limit' + ByteLimit int64 // Sets default catalog for statement execution, similar to [`USE CATALOG`] // in SQL. // // [`USE CATALOG`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-catalog.html - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string - Disposition Disposition `json:"disposition,omitempty"` + // Wire name: 'disposition' + Disposition Disposition // Statement execution supports three result formats: `JSON_ARRAY` // (default), `ARROW_STREAM`, and `CSV`. // @@ -1970,7 +3768,8 @@ type ExecuteStatementRequest struct { // // [Apache Arrow streaming format]: https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format // [RFC 4180]: https://www.rfc-editor.org/rfc/rfc4180 - Format Format `json:"format,omitempty"` + // Wire name: 'format' + Format Format // When `wait_timeout > 0s`, the call will block up to the specified time. // If the statement execution doesn't finish within this time, // `on_wait_timeout` determines whether the execution should continue or be @@ -1979,7 +3778,8 @@ type ExecuteStatementRequest struct { // polling with :method:statementexecution/getStatement. When set to // `CANCEL`, the statement execution is canceled and the call returns with a // `CANCELED` state. - OnWaitTimeout ExecuteStatementRequestOnWaitTimeout `json:"on_wait_timeout,omitempty"` + // Wire name: 'on_wait_timeout' + OnWaitTimeout ExecuteStatementRequestOnWaitTimeout // A list of parameters to pass into a SQL statement containing parameter // markers. A parameter consists of a name, a value, and optionally a type. // To represent a NULL value, the `value` field may be omitted or set to @@ -2010,19 +3810,23 @@ type ExecuteStatementRequest struct { // // [Parameter markers]: https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html // [`cast` function]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Parameters []StatementParameterListItem `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []StatementParameterListItem // Applies the given row limit to the statement's result set, but unlike the // `LIMIT` clause in SQL, it also sets the `truncated` field in the response // to indicate whether the result was trimmed due to the limit or not. - RowLimit int64 `json:"row_limit,omitempty"` + // Wire name: 'row_limit' + RowLimit int64 // Sets default schema for statement execution, similar to [`USE SCHEMA`] in // SQL. // // [`USE SCHEMA`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-schema.html - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string // The SQL statement to execute. The statement can optionally be // parameterized, see `parameters`. - Statement string `json:"statement"` + // Wire name: 'statement' + Statement string // The time in seconds the call will wait for the statement's result set as // `Ns`, where `N` can be set to 0 or to a value between 5 and 50. // @@ -2037,22 +3841,41 @@ type ExecuteStatementRequest struct { // manifest and result data (or a `FAILED` state in case of an execution // error). If the statement takes longer to execute, `on_wait_timeout` // determines what should happen after the timeout is reached. - WaitTimeout string `json:"wait_timeout,omitempty"` + // Wire name: 'wait_timeout' + WaitTimeout string // Warehouse upon which to execute a statement. See also [What are SQL // warehouses?] // // [What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html - WarehouseId string `json:"warehouse_id"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExecuteStatementRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExecuteStatementRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &executeStatementRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := executeStatementRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExecuteStatementRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExecuteStatementRequest) MarshalJSON() ([]byte, error) { + pb, err := executeStatementRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // When `wait_timeout > 0s`, the call will block up to the specified time. If @@ -2063,6 +3886,7 @@ func (s ExecuteStatementRequest) MarshalJSON() ([]byte, error) { // :method:statementexecution/getStatement. When set to `CANCEL`, the statement // execution is canceled and the call returns with a `CANCELED` state. type ExecuteStatementRequestOnWaitTimeout string +type executeStatementRequestOnWaitTimeoutPb string const ExecuteStatementRequestOnWaitTimeoutCancel ExecuteStatementRequestOnWaitTimeout = `CANCEL` @@ -2089,97 +3913,184 @@ func (f *ExecuteStatementRequestOnWaitTimeout) Type() string { return "ExecuteStatementRequestOnWaitTimeout" } +func executeStatementRequestOnWaitTimeoutToPb(st *ExecuteStatementRequestOnWaitTimeout) (*executeStatementRequestOnWaitTimeoutPb, error) { + if st == nil { + return nil, nil + } + pb := executeStatementRequestOnWaitTimeoutPb(*st) + return &pb, nil +} + +func executeStatementRequestOnWaitTimeoutFromPb(pb *executeStatementRequestOnWaitTimeoutPb) (*ExecuteStatementRequestOnWaitTimeout, error) { + if pb == nil { + return nil, nil + } + st := ExecuteStatementRequestOnWaitTimeout(*pb) + return &st, nil +} + type ExternalLink struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount int64 `json:"byte_count,omitempty"` + // Wire name: 'byte_count' + ByteCount int64 // The position within the sequence of result set chunks. - ChunkIndex int `json:"chunk_index,omitempty"` + // Wire name: 'chunk_index' + ChunkIndex int // Indicates the date-time that the given external link will expire and // becomes invalid, after which point a new `external_link` must be // requested. - Expiration string `json:"expiration,omitempty"` + // Wire name: 'expiration' + Expiration string - ExternalLink string `json:"external_link,omitempty"` + // Wire name: 'external_link' + ExternalLink string // HTTP headers that must be included with a GET request to the // `external_link`. Each header is provided as a key-value pair. Headers are // typically used to pass a decryption key to the external service. The // values of these headers should be considered sensitive and the client // should not expose these values in a log. - HttpHeaders map[string]string `json:"http_headers,omitempty"` + // Wire name: 'http_headers' + HttpHeaders map[string]string // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex int `json:"next_chunk_index,omitempty"` + // Wire name: 'next_chunk_index' + NextChunkIndex int // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + // Wire name: 'next_chunk_internal_link' + NextChunkInternalLink string // The number of rows within the result chunk. - RowCount int64 `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int64 // The starting row offset within the result set. - RowOffset int64 `json:"row_offset,omitempty"` + // Wire name: 'row_offset' + RowOffset int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalLink) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalLink) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalLinkPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalLinkFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalLink) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalLink) MarshalJSON() ([]byte, error) { + pb, err := externalLinkToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExternalQuerySource struct { // The canonical identifier for this SQL alert - AlertId string `json:"alert_id,omitempty"` + // Wire name: 'alert_id' + AlertId string // The canonical identifier for this Lakeview dashboard - DashboardId string `json:"dashboard_id,omitempty"` + // Wire name: 'dashboard_id' + DashboardId string // The canonical identifier for this Genie space - GenieSpaceId string `json:"genie_space_id,omitempty"` + // Wire name: 'genie_space_id' + GenieSpaceId string - JobInfo *ExternalQuerySourceJobInfo `json:"job_info,omitempty"` + // Wire name: 'job_info' + JobInfo *ExternalQuerySourceJobInfo // The canonical identifier for this legacy dashboard - LegacyDashboardId string `json:"legacy_dashboard_id,omitempty"` + // Wire name: 'legacy_dashboard_id' + LegacyDashboardId string // The canonical identifier for this notebook - NotebookId string `json:"notebook_id,omitempty"` + // Wire name: 'notebook_id' + NotebookId string // The canonical identifier for this SQL query - SqlQueryId string `json:"sql_query_id,omitempty"` + // Wire name: 'sql_query_id' + SqlQueryId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalQuerySource) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalQuerySource) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalQuerySourcePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalQuerySourceFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalQuerySource) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalQuerySource) MarshalJSON() ([]byte, error) { + pb, err := externalQuerySourceToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ExternalQuerySourceJobInfo struct { // The canonical identifier for this job. - JobId string `json:"job_id,omitempty"` + // Wire name: 'job_id' + JobId string // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - JobRunId string `json:"job_run_id,omitempty"` + // Wire name: 'job_run_id' + JobRunId string // The canonical identifier of the task run. - JobTaskRunId string `json:"job_task_run_id,omitempty"` + // Wire name: 'job_task_run_id' + JobTaskRunId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExternalQuerySourceJobInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExternalQuerySourceJobInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &externalQuerySourceJobInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := externalQuerySourceJobInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExternalQuerySourceJobInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExternalQuerySourceJobInfo) MarshalJSON() ([]byte, error) { + pb, err := externalQuerySourceJobInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Format string +type formatPb string const FormatArrowStream Format = `ARROW_STREAM` @@ -2208,98 +4119,482 @@ func (f *Format) Type() string { return "Format" } +func formatToPb(st *Format) (*formatPb, error) { + if st == nil { + return nil, nil + } + pb := formatPb(*st) + return &pb, nil +} + +func formatFromPb(pb *formatPb) (*Format, error) { + if pb == nil { + return nil, nil + } + st := Format(*pb) + return &st, nil +} + // Get an alert type GetAlertRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetAlertRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAlertRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAlertRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAlertRequest) MarshalJSON() ([]byte, error) { + pb, err := getAlertRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an alert type GetAlertV2Request struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetAlertV2Request) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAlertV2RequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAlertV2RequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAlertV2Request) MarshalJSON() ([]byte, error) { + pb, err := getAlertV2RequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an alert type GetAlertsLegacyRequest struct { - AlertId string `json:"-" url:"-"` + + // Wire name: 'alert_id' + AlertId string `tf:"-"` +} + +func (st *GetAlertsLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAlertsLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAlertsLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAlertsLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := getAlertsLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Retrieve a definition type GetDashboardRequest struct { - DashboardId string `json:"-" url:"-"` + + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *GetDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := getDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get object ACL type GetDbsqlPermissionRequest struct { // Object ID. An ACL is returned for the object with this UUID. - ObjectId string `json:"-" url:"-"` + // Wire name: 'objectId' + ObjectId string `tf:"-"` // The type of object permissions to check. - ObjectType ObjectTypePlural `json:"-" url:"-"` + // Wire name: 'objectType' + ObjectType ObjectTypePlural `tf:"-"` +} + +func (st *GetDbsqlPermissionRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getDbsqlPermissionRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getDbsqlPermissionRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetDbsqlPermissionRequest) MarshalJSON() ([]byte, error) { + pb, err := getDbsqlPermissionRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a query definition. type GetQueriesLegacyRequest struct { - QueryId string `json:"-" url:"-"` + + // Wire name: 'query_id' + QueryId string `tf:"-"` +} + +func (st *GetQueriesLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQueriesLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQueriesLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQueriesLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := getQueriesLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a query type GetQueryRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := getQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetResponse struct { - AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AccessControl // An object's type and UUID, separated by a forward slash (/) character. - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'object_id' + ObjectId string // A singular noun object type. - ObjectType ObjectType `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType ObjectType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetResponse) MarshalJSON() ([]byte, error) { + pb, err := getResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get status, manifest, and result first chunk type GetStatementRequest struct { // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId string `json:"-" url:"-"` + // Wire name: 'statement_id' + StatementId string `tf:"-"` +} + +func (st *GetStatementRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStatementRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStatementRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStatementRequest) MarshalJSON() ([]byte, error) { + pb, err := getStatementRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get result chunk by index type GetStatementResultChunkNRequest struct { - ChunkIndex int `json:"-" url:"-"` + + // Wire name: 'chunk_index' + ChunkIndex int `tf:"-"` // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId string `json:"-" url:"-"` + // Wire name: 'statement_id' + StatementId string `tf:"-"` +} + +func (st *GetStatementResultChunkNRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStatementResultChunkNRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStatementResultChunkNRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStatementResultChunkNRequest) MarshalJSON() ([]byte, error) { + pb, err := getStatementResultChunkNRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get SQL warehouse permission levels type GetWarehousePermissionLevelsRequest struct { // The SQL warehouse for which to get or manage permissions. - WarehouseId string `json:"-" url:"-"` + // Wire name: 'warehouse_id' + WarehouseId string `tf:"-"` +} + +func (st *GetWarehousePermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWarehousePermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWarehousePermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWarehousePermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getWarehousePermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetWarehousePermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []WarehousePermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []WarehousePermissionsDescription +} + +func (st *GetWarehousePermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWarehousePermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWarehousePermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWarehousePermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getWarehousePermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get SQL warehouse permissions type GetWarehousePermissionsRequest struct { // The SQL warehouse for which to get or manage permissions. - WarehouseId string `json:"-" url:"-"` + // Wire name: 'warehouse_id' + WarehouseId string `tf:"-"` +} + +func (st *GetWarehousePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWarehousePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWarehousePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWarehousePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getWarehousePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get warehouse info type GetWarehouseRequest struct { // Required. Id of the SQL warehouse. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *GetWarehouseRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWarehouseRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWarehouseRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWarehouseRequest) MarshalJSON() ([]byte, error) { + pb, err := getWarehouseRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetWarehouseResponse struct { @@ -2309,40 +4604,51 @@ type GetWarehouseResponse struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins int `json:"auto_stop_mins,omitempty"` + // Wire name: 'auto_stop_mins' + AutoStopMins int // Channel Details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize string `json:"cluster_size,omitempty"` + // Wire name: 'cluster_size' + ClusterSize string // warehouse creator name - CreatorName string `json:"creator_name,omitempty"` + // Wire name: 'creator_name' + CreatorName string // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton bool `json:"enable_photon,omitempty"` + // Wire name: 'enable_photon' + EnablePhoton bool // Configures whether the warehouse should use serverless compute - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + // Wire name: 'enable_serverless_compute' + EnableServerlessCompute bool // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health *EndpointHealth `json:"health,omitempty"` + // Wire name: 'health' + Health *EndpointHealth // unique identifier for warehouse - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // the jdbc connection string for this warehouse - JdbcUrl string `json:"jdbc_url,omitempty"` + // Wire name: 'jdbc_url' + JdbcUrl string // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters int `json:"max_num_clusters,omitempty"` + // Wire name: 'max_num_clusters' + MaxNumClusters int // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -2352,47 +4658,74 @@ type GetWarehouseResponse struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters int `json:"min_num_clusters,omitempty"` + // Wire name: 'min_num_clusters' + MinNumClusters int // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Deprecated. current number of active sessions for the warehouse - NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + // Wire name: 'num_active_sessions' + NumActiveSessions int64 // current number of clusters running for the service - NumClusters int `json:"num_clusters,omitempty"` + // Wire name: 'num_clusters' + NumClusters int // ODBC parameters for the SQL warehouse - OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + // Wire name: 'odbc_params' + OdbcParams *OdbcParams // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + // Wire name: 'spot_instance_policy' + SpotInstancePolicy SpotInstancePolicy // State of the warehouse - State State `json:"state,omitempty"` + // Wire name: 'state' + State State // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags *EndpointTags `json:"tags,omitempty"` + // Wire name: 'tags' + Tags *EndpointTags // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType GetWarehouseResponseWarehouseType `json:"warehouse_type,omitempty"` + // Wire name: 'warehouse_type' + WarehouseType GetWarehouseResponseWarehouseType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetWarehouseResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetWarehouseResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := getWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type GetWarehouseResponseWarehouseType string +type getWarehouseResponseWarehouseTypePb string const GetWarehouseResponseWarehouseTypeClassic GetWarehouseResponseWarehouseType = `CLASSIC` @@ -2421,46 +4754,89 @@ func (f *GetWarehouseResponseWarehouseType) Type() string { return "GetWarehouseResponseWarehouseType" } +func getWarehouseResponseWarehouseTypeToPb(st *GetWarehouseResponseWarehouseType) (*getWarehouseResponseWarehouseTypePb, error) { + if st == nil { + return nil, nil + } + pb := getWarehouseResponseWarehouseTypePb(*st) + return &pb, nil +} + +func getWarehouseResponseWarehouseTypeFromPb(pb *getWarehouseResponseWarehouseTypePb) (*GetWarehouseResponseWarehouseType, error) { + if pb == nil { + return nil, nil + } + st := GetWarehouseResponseWarehouseType(*pb) + return &st, nil +} + type GetWorkspaceWarehouseConfigResponse struct { // Optional: Channel selection details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Deprecated: Use sql_configuration_parameters - ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + // Wire name: 'config_param' + ConfigParam *RepeatedEndpointConfPairs // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + // Wire name: 'data_access_config' + DataAccessConfig []EndpointConfPair // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + // Wire name: 'enabled_warehouse_types' + EnabledWarehouseTypes []WarehouseTypePair // Deprecated: Use sql_configuration_parameters - GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + // Wire name: 'global_param' + GlobalParam *RepeatedEndpointConfPairs // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount string `json:"google_service_account,omitempty"` + // Wire name: 'google_service_account' + GoogleServiceAccount string // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Security policy for warehouses - SecurityPolicy GetWorkspaceWarehouseConfigResponseSecurityPolicy `json:"security_policy,omitempty"` + // Wire name: 'security_policy' + SecurityPolicy GetWorkspaceWarehouseConfigResponseSecurityPolicy // SQL configuration parameters - SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + // Wire name: 'sql_configuration_parameters' + SqlConfigurationParameters *RepeatedEndpointConfPairs - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetWorkspaceWarehouseConfigResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetWorkspaceWarehouseConfigResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceWarehouseConfigResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceWarehouseConfigResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceWarehouseConfigResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Security policy for warehouses type GetWorkspaceWarehouseConfigResponseSecurityPolicy string +type getWorkspaceWarehouseConfigResponseSecurityPolicyPb string const GetWorkspaceWarehouseConfigResponseSecurityPolicyDataAccessControl GetWorkspaceWarehouseConfigResponseSecurityPolicy = `DATA_ACCESS_CONTROL` @@ -2489,49 +4865,94 @@ func (f *GetWorkspaceWarehouseConfigResponseSecurityPolicy) Type() string { return "GetWorkspaceWarehouseConfigResponseSecurityPolicy" } +func getWorkspaceWarehouseConfigResponseSecurityPolicyToPb(st *GetWorkspaceWarehouseConfigResponseSecurityPolicy) (*getWorkspaceWarehouseConfigResponseSecurityPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := getWorkspaceWarehouseConfigResponseSecurityPolicyPb(*st) + return &pb, nil +} + +func getWorkspaceWarehouseConfigResponseSecurityPolicyFromPb(pb *getWorkspaceWarehouseConfigResponseSecurityPolicyPb) (*GetWorkspaceWarehouseConfigResponseSecurityPolicy, error) { + if pb == nil { + return nil, nil + } + st := GetWorkspaceWarehouseConfigResponseSecurityPolicy(*pb) + return &st, nil +} + type LegacyAlert struct { // Timestamp when the alert was created. - CreatedAt string `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt string // Alert ID. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Timestamp when the alert was last triggered. - LastTriggeredAt string `json:"last_triggered_at,omitempty"` + // Wire name: 'last_triggered_at' + LastTriggeredAt string // Name of the alert. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Alert configuration options. - Options *AlertOptions `json:"options,omitempty"` + // Wire name: 'options' + Options *AlertOptions // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string - Query *AlertQuery `json:"query,omitempty"` + // Wire name: 'query' + Query *AlertQuery // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm int `json:"rearm,omitempty"` + // Wire name: 'rearm' + Rearm int // State of the alert. Possible values are: `unknown` (yet to be evaluated), // `triggered` (evaluated and fulfilled trigger conditions), or `ok` // (evaluated and did not fulfill trigger conditions). - State LegacyAlertState `json:"state,omitempty"` + // Wire name: 'state' + State LegacyAlertState // Timestamp when the alert was last updated. - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string - User *User `json:"user,omitempty"` + // Wire name: 'user' + User *User - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LegacyAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LegacyAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &legacyAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := legacyAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LegacyAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LegacyAlert) MarshalJSON() ([]byte, error) { + pb, err := legacyAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // State of the alert. Possible values are: `unknown` (yet to be evaluated), // `triggered` (evaluated and fulfilled trigger conditions), or `ok` (evaluated // and did not fulfill trigger conditions). type LegacyAlertState string +type legacyAlertStatePb string const LegacyAlertStateOk LegacyAlertState = `ok` @@ -2560,85 +4981,142 @@ func (f *LegacyAlertState) Type() string { return "LegacyAlertState" } +func legacyAlertStateToPb(st *LegacyAlertState) (*legacyAlertStatePb, error) { + if st == nil { + return nil, nil + } + pb := legacyAlertStatePb(*st) + return &pb, nil +} + +func legacyAlertStateFromPb(pb *legacyAlertStatePb) (*LegacyAlertState, error) { + if pb == nil { + return nil, nil + } + st := LegacyAlertState(*pb) + return &st, nil +} + type LegacyQuery struct { // Describes whether the authenticated user is allowed to edit the // definition of this query. - CanEdit bool `json:"can_edit,omitempty"` + // Wire name: 'can_edit' + CanEdit bool // The timestamp when this query was created. - CreatedAt string `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt string // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId string `json:"data_source_id,omitempty"` + // Wire name: 'data_source_id' + DataSourceId string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Query ID. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived bool `json:"is_archived,omitempty"` + // Wire name: 'is_archived' + IsArchived bool // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft bool `json:"is_draft,omitempty"` + // Wire name: 'is_draft' + IsDraft bool // Whether this query object appears in the current user's favorites list. // This flag determines whether the star icon for favorites is selected. - IsFavorite bool `json:"is_favorite,omitempty"` + // Wire name: 'is_favorite' + IsFavorite bool // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe bool `json:"is_safe,omitempty"` + // Wire name: 'is_safe' + IsSafe bool - LastModifiedBy *User `json:"last_modified_by,omitempty"` + // Wire name: 'last_modified_by' + LastModifiedBy *User // The ID of the user who last saved changes to this query. - LastModifiedById int `json:"last_modified_by_id,omitempty"` + // Wire name: 'last_modified_by_id' + LastModifiedById int // If there is a cached result for this query and user, this field includes // the query result ID. If this query uses parameters, this field is always // null. - LatestQueryDataId string `json:"latest_query_data_id,omitempty"` + // Wire name: 'latest_query_data_id' + LatestQueryDataId string // The title of this query that appears in list views, widget headings, and // on the query page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - Options *QueryOptions `json:"options,omitempty"` + // Wire name: 'options' + Options *QueryOptions // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + // Wire name: 'permission_tier' + PermissionTier PermissionLevel // The text of the query to be run. - Query string `json:"query,omitempty"` + // Wire name: 'query' + Query string // A SHA-256 hash of the query text along with the authenticated user ID. - QueryHash string `json:"query_hash,omitempty"` + // Wire name: 'query_hash' + QueryHash string // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + // Wire name: 'run_as_role' + RunAsRole RunAsRole - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // The timestamp at which this query was last updated. - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string - User *User `json:"user,omitempty"` + // Wire name: 'user' + User *User // The ID of the user who owns the query. - UserId int `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId int - Visualizations []LegacyVisualization `json:"visualizations,omitempty"` + // Wire name: 'visualizations' + Visualizations []LegacyVisualization - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LegacyQuery) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LegacyQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &legacyQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := legacyQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LegacyQuery) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LegacyQuery) MarshalJSON() ([]byte, error) { + pb, err := legacyQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The visualization description API changes frequently and is unsupported. You @@ -2647,38 +5125,65 @@ func (s LegacyQuery) MarshalJSON() ([]byte, error) { // same endpoint. Databricks does not recommend constructing ad-hoc // visualizations entirely in JSON. type LegacyVisualization struct { - CreatedAt string `json:"created_at,omitempty"` + + // Wire name: 'created_at' + CreatedAt string // A short description of this visualization. This is not displayed in the // UI. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The UUID for this visualization. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The name of the visualization that appears on dashboards and the query // screen. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options any `json:"options,omitempty"` + // Wire name: 'options' + Options any - Query *LegacyQuery `json:"query,omitempty"` + // Wire name: 'query' + Query *LegacyQuery // The type of visualization: chart, table, pivot table, and so on. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *LegacyVisualization) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *LegacyVisualization) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &legacyVisualizationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := legacyVisualizationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s LegacyVisualization) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st LegacyVisualization) MarshalJSON() ([]byte, error) { + pb, err := legacyVisualizationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type LifecycleState string +type lifecycleStatePb string const LifecycleStateActive LifecycleState = `ACTIVE` @@ -2705,149 +5210,298 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } +func lifecycleStateToPb(st *LifecycleState) (*lifecycleStatePb, error) { + if st == nil { + return nil, nil + } + pb := lifecycleStatePb(*st) + return &pb, nil +} + +func lifecycleStateFromPb(pb *lifecycleStatePb) (*LifecycleState, error) { + if pb == nil { + return nil, nil + } + st := LifecycleState(*pb) + return &st, nil +} + // List alerts type ListAlertsRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'page_token' + PageToken string `tf:"-"` + + ForceSendFields []string `tf:"-"` } -func (s *ListAlertsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAlertsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAlertsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAlertsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAlertsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAlertsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAlertsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAlertsResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Results []ListAlertsResponseAlert `json:"results,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'results' + Results []ListAlertsResponseAlert - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAlertsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAlertsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAlertsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAlertsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAlertsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAlertsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAlertsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAlertsResponseAlert struct { // Trigger conditions of the alert. - Condition *AlertCondition `json:"condition,omitempty"` + // Wire name: 'condition' + Condition *AlertCondition // The timestamp indicating when the alert was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody string `json:"custom_body,omitempty"` + // Wire name: 'custom_body' + CustomBody string // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // The display name of the alert. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying the alert. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // The workspace state of the alert. Used for tracking trashed status. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk bool `json:"notify_on_ok,omitempty"` + // Wire name: 'notify_on_ok' + NotifyOnOk bool // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // UUID of the query attached to the alert. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + // Wire name: 'seconds_to_retrigger' + SecondsToRetrigger int // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State AlertState `json:"state,omitempty"` + // Wire name: 'state' + State AlertState // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime string `json:"trigger_time,omitempty"` + // Wire name: 'trigger_time' + TriggerTime string // The timestamp indicating when the alert was updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAlertsResponseAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAlertsResponseAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAlertsResponseAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAlertsResponseAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAlertsResponseAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAlertsResponseAlert) MarshalJSON() ([]byte, error) { + pb, err := listAlertsResponseAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List alerts type ListAlertsV2Request struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAlertsV2Request) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAlertsV2Request) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAlertsV2RequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAlertsV2RequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAlertsV2Request) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAlertsV2Request) MarshalJSON() ([]byte, error) { + pb, err := listAlertsV2RequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAlertsV2Response struct { - NextPageToken string `json:"next_page_token,omitempty"` - Results []AlertV2 `json:"results,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'results' + Results []AlertV2 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListAlertsV2Response) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListAlertsV2Response) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAlertsV2ResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAlertsV2ResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListAlertsV2Response) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListAlertsV2Response) MarshalJSON() ([]byte, error) { + pb, err := listAlertsV2ResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get dashboard objects type ListDashboardsRequest struct { // Name of dashboard attribute to order by. - Order ListOrder `json:"-" url:"order,omitempty"` + // Wire name: 'order' + Order ListOrder `tf:"-"` // Page number to retrieve. - Page int `json:"-" url:"page,omitempty"` + // Wire name: 'page' + Page int `tf:"-"` // Number of dashboards to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Full text search term. - Q string `json:"-" url:"q,omitempty"` + // Wire name: 'q' + Q string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListDashboardsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListDashboardsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listDashboardsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listDashboardsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListDashboardsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListDashboardsRequest) MarshalJSON() ([]byte, error) { + pb, err := listDashboardsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListOrder string +type listOrderPb string const ListOrderCreatedAt ListOrder = `created_at` @@ -2874,6 +5528,22 @@ func (f *ListOrder) Type() string { return "ListOrder" } +func listOrderToPb(st *ListOrder) (*listOrderPb, error) { + if st == nil { + return nil, nil + } + pb := listOrderPb(*st) + return &pb, nil +} + +func listOrderFromPb(pb *listOrderPb) (*ListOrder, error) { + if pb == nil { + return nil, nil + } + st := ListOrder(*pb) + return &st, nil +} + // Get a list of queries type ListQueriesLegacyRequest struct { // Name of query attribute to order by. Default sort order is ascending. @@ -2890,265 +5560,546 @@ type ListQueriesLegacyRequest struct { // - `executed_at`: The timestamp when the query was last run. // // - `created_by`: The user name of the user that created the query. - Order string `json:"-" url:"order,omitempty"` + // Wire name: 'order' + Order string `tf:"-"` // Page number to retrieve. - Page int `json:"-" url:"page,omitempty"` + // Wire name: 'page' + Page int `tf:"-"` // Number of queries to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` // Full text search term - Q string `json:"-" url:"q,omitempty"` + // Wire name: 'q' + Q string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueriesLegacyRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueriesLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueriesLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueriesLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueriesLegacyRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueriesLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := listQueriesLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List queries type ListQueriesRequest struct { - PageSize int `json:"-" url:"page_size,omitempty"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_size' + PageSize int `tf:"-"` + + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueriesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueriesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueriesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueriesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueriesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueriesRequest) MarshalJSON() ([]byte, error) { + pb, err := listQueriesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListQueriesResponse struct { // Whether there is another page of results. - HasNextPage bool `json:"has_next_page,omitempty"` + // Wire name: 'has_next_page' + HasNextPage bool // A token that can be used to get the next page of results. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - Res []QueryInfo `json:"res,omitempty"` + // Wire name: 'res' + Res []QueryInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueriesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueriesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueriesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueriesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueriesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueriesResponse) MarshalJSON() ([]byte, error) { + pb, err := listQueriesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List Queries type ListQueryHistoryRequest struct { // A filter to limit query history results. This field is optional. - FilterBy *QueryFilter `json:"-" url:"filter_by,omitempty"` + // Wire name: 'filter_by' + FilterBy *QueryFilter `tf:"-"` // Whether to include the query metrics with each query. Only use this for a // small subset of queries (max_results). Defaults to false. - IncludeMetrics bool `json:"-" url:"include_metrics,omitempty"` + // Wire name: 'include_metrics' + IncludeMetrics bool `tf:"-"` // Limit the number of results returned in one page. Must be less than 1000 // and the default is 100. - MaxResults int `json:"-" url:"max_results,omitempty"` + // Wire name: 'max_results' + MaxResults int `tf:"-"` // A token that can be used to get the next page of results. The token can // contains characters that need to be encoded before using it in a URL. For // example, the character '+' needs to be replaced by %2B. This field is // optional. - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueryHistoryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueryHistoryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueryHistoryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueryHistoryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueryHistoryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueryHistoryRequest) MarshalJSON() ([]byte, error) { + pb, err := listQueryHistoryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListQueryObjectsResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Results []ListQueryObjectsResponseQuery `json:"results,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'results' + Results []ListQueryObjectsResponseQuery - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueryObjectsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueryObjectsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueryObjectsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueryObjectsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueryObjectsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueryObjectsResponse) MarshalJSON() ([]byte, error) { + pb, err := listQueryObjectsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListQueryObjectsResponseQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + // Wire name: 'apply_auto_limit' + ApplyAutoLimit bool // Name of the catalog where this query will be executed. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // Timestamp when this query was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying the query. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Username of the user who last saved changes to this query. - LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + // Wire name: 'last_modifier_user_name' + LastModifierUserName string // Indicates whether the query is trashed. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // Username of the user that owns the query. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // List of query parameter definitions. - Parameters []QueryParameter `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []QueryParameter // Text of the query to be run. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Sets the "Run as" role for the object. - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + // Wire name: 'run_as_mode' + RunAsMode RunAsMode // Name of the schema where this query will be executed. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // Timestamp when this query was last updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // ID of the SQL warehouse attached to the query. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListQueryObjectsResponseQuery) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListQueryObjectsResponseQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listQueryObjectsResponseQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listQueryObjectsResponseQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListQueryObjectsResponseQuery) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListQueryObjectsResponseQuery) MarshalJSON() ([]byte, error) { + pb, err := listQueryObjectsResponseQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListResponse struct { // The total number of dashboards. - Count int `json:"count,omitempty"` + // Wire name: 'count' + Count int // The current page being displayed. - Page int `json:"page,omitempty"` + // Wire name: 'page' + Page int // The number of dashboards per page. - PageSize int `json:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int // List of dashboards returned. - Results []Dashboard `json:"results,omitempty"` + // Wire name: 'results' + Results []Dashboard - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListResponse) MarshalJSON() ([]byte, error) { + pb, err := listResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List visualizations on a query type ListVisualizationsForQueryRequest struct { - Id string `json:"-" url:"-"` - PageSize int `json:"-" url:"page_size,omitempty"` + // Wire name: 'id' + Id string `tf:"-"` + + // Wire name: 'page_size' + PageSize int `tf:"-"` - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListVisualizationsForQueryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListVisualizationsForQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listVisualizationsForQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listVisualizationsForQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListVisualizationsForQueryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListVisualizationsForQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := listVisualizationsForQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListVisualizationsForQueryResponse struct { - NextPageToken string `json:"next_page_token,omitempty"` - Results []Visualization `json:"results,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string + + // Wire name: 'results' + Results []Visualization - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListVisualizationsForQueryResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListVisualizationsForQueryResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listVisualizationsForQueryResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listVisualizationsForQueryResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListVisualizationsForQueryResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListVisualizationsForQueryResponse) MarshalJSON() ([]byte, error) { + pb, err := listVisualizationsForQueryResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List warehouses type ListWarehousesRequest struct { // Service Principal which will be used to fetch the list of warehouses. If // not specified, the user from the session header is used. - RunAsUserId int `json:"-" url:"run_as_user_id,omitempty"` + // Wire name: 'run_as_user_id' + RunAsUserId int `tf:"-"` + + ForceSendFields []string `tf:"-"` +} + +func (st *ListWarehousesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listWarehousesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listWarehousesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - ForceSendFields []string `json:"-" url:"-"` +func (st ListWarehousesRequest) MarshalJSON() ([]byte, error) { + pb, err := listWarehousesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } -func (s *ListWarehousesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +type ListWarehousesResponse struct { + // A list of warehouses and their configurations. + // Wire name: 'warehouses' + Warehouses []EndpointInfo } -func (s ListWarehousesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st *ListWarehousesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listWarehousesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listWarehousesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type ListWarehousesResponse struct { - // A list of warehouses and their configurations. - Warehouses []EndpointInfo `json:"warehouses,omitempty"` +func (st ListWarehousesResponse) MarshalJSON() ([]byte, error) { + pb, err := listWarehousesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MultiValuesOptions struct { // Character that prefixes each selected parameter value. - Prefix string `json:"prefix,omitempty"` + // Wire name: 'prefix' + Prefix string // Character that separates each selected parameter value. Defaults to a // comma. - Separator string `json:"separator,omitempty"` + // Wire name: 'separator' + Separator string // Character that suffixes each selected parameter value. - Suffix string `json:"suffix,omitempty"` + // Wire name: 'suffix' + Suffix string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MultiValuesOptions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MultiValuesOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &multiValuesOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := multiValuesOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MultiValuesOptions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MultiValuesOptions) MarshalJSON() ([]byte, error) { + pb, err := multiValuesOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type NumericValue struct { - Value float64 `json:"value,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'value' + Value float64 + + ForceSendFields []string `tf:"-"` } -func (s *NumericValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *NumericValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &numericValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := numericValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s NumericValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st NumericValue) MarshalJSON() ([]byte, error) { + pb, err := numericValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A singular noun object type. type ObjectType string +type objectTypePb string const ObjectTypeAlert ObjectType = `alert` @@ -3179,8 +6130,25 @@ func (f *ObjectType) Type() string { return "ObjectType" } +func objectTypeToPb(st *ObjectType) (*objectTypePb, error) { + if st == nil { + return nil, nil + } + pb := objectTypePb(*st) + return &pb, nil +} + +func objectTypeFromPb(pb *objectTypePb) (*ObjectType, error) { + if pb == nil { + return nil, nil + } + st := ObjectType(*pb) + return &st, nil +} + // Always a plural of the object type. type ObjectTypePlural string +type objectTypePluralPb string const ObjectTypePluralAlerts ObjectTypePlural = `alerts` @@ -3211,28 +6179,67 @@ func (f *ObjectTypePlural) Type() string { return "ObjectTypePlural" } +func objectTypePluralToPb(st *ObjectTypePlural) (*objectTypePluralPb, error) { + if st == nil { + return nil, nil + } + pb := objectTypePluralPb(*st) + return &pb, nil +} + +func objectTypePluralFromPb(pb *objectTypePluralPb) (*ObjectTypePlural, error) { + if pb == nil { + return nil, nil + } + st := ObjectTypePlural(*pb) + return &st, nil +} + type OdbcParams struct { - Hostname string `json:"hostname,omitempty"` - Path string `json:"path,omitempty"` + // Wire name: 'hostname' + Hostname string + + // Wire name: 'path' + Path string - Port int `json:"port,omitempty"` + // Wire name: 'port' + Port int - Protocol string `json:"protocol,omitempty"` + // Wire name: 'protocol' + Protocol string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *OdbcParams) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *OdbcParams) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &odbcParamsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := odbcParamsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s OdbcParams) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st OdbcParams) MarshalJSON() ([]byte, error) { + pb, err := odbcParamsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The singular form of the type of object which can be owned. type OwnableObjectType string +type ownableObjectTypePb string const OwnableObjectTypeAlert OwnableObjectType = `alert` @@ -3261,39 +6268,80 @@ func (f *OwnableObjectType) Type() string { return "OwnableObjectType" } +func ownableObjectTypeToPb(st *OwnableObjectType) (*ownableObjectTypePb, error) { + if st == nil { + return nil, nil + } + pb := ownableObjectTypePb(*st) + return &pb, nil +} + +func ownableObjectTypeFromPb(pb *ownableObjectTypePb) (*OwnableObjectType, error) { + if pb == nil { + return nil, nil + } + st := OwnableObjectType(*pb) + return &st, nil +} + type Parameter struct { // List of valid parameter values, newline delimited. Only applies for // dropdown list parameters. - EnumOptions string `json:"enumOptions,omitempty"` + // Wire name: 'enumOptions' + EnumOptions string // If specified, allows multiple values to be selected for this parameter. // Only applies to dropdown list and query-based dropdown list parameters. - MultiValuesOptions *MultiValuesOptions `json:"multiValuesOptions,omitempty"` + // Wire name: 'multiValuesOptions' + MultiValuesOptions *MultiValuesOptions // The literal parameter marker that appears between double curly braces in // the query text. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // The UUID of the query that provides the parameter values. Only applies // for query-based dropdown list parameters. - QueryId string `json:"queryId,omitempty"` + // Wire name: 'queryId' + QueryId string // The text displayed in a parameter picking widget. - Title string `json:"title,omitempty"` + // Wire name: 'title' + Title string // Parameters can have several different types. - Type ParameterType `json:"type,omitempty"` + // Wire name: 'type' + Type ParameterType // The default value for this parameter. - Value any `json:"value,omitempty"` + // Wire name: 'value' + Value any - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Parameter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Parameter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := ¶meterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := parameterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Parameter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Parameter) MarshalJSON() ([]byte, error) { + pb, err := parameterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Parameters can have several different types. type ParameterType string +type parameterTypePb string const ParameterTypeDatetime ParameterType = `datetime` @@ -3326,9 +6374,26 @@ func (f *ParameterType) Type() string { return "ParameterType" } +func parameterTypeToPb(st *ParameterType) (*parameterTypePb, error) { + if st == nil { + return nil, nil + } + pb := parameterTypePb(*st) + return &pb, nil +} + +func parameterTypeFromPb(pb *parameterTypePb) (*ParameterType, error) { + if pb == nil { + return nil, nil + } + st := ParameterType(*pb) + return &st, nil +} + // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * `CAN_EDIT`: // Can edit the query * `CAN_MANAGE`: Can manage the query type PermissionLevel string +type permissionLevelPb string // Can edit the query const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT` @@ -3363,8 +6428,25 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } +func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := permissionLevelPb(*st) + return &pb, nil +} + +func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := PermissionLevel(*pb) + return &st, nil +} + // Possible Reasons for which we have not saved plans in the database type PlansState string +type plansStatePb string const PlansStateEmpty PlansState = `EMPTY` @@ -3399,72 +6481,142 @@ func (f *PlansState) Type() string { return "PlansState" } +func plansStateToPb(st *PlansState) (*plansStatePb, error) { + if st == nil { + return nil, nil + } + pb := plansStatePb(*st) + return &pb, nil +} + +func plansStateFromPb(pb *plansStatePb) (*PlansState, error) { + if pb == nil { + return nil, nil + } + st := PlansState(*pb) + return &st, nil +} + type Query struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + // Wire name: 'apply_auto_limit' + ApplyAutoLimit bool // Name of the catalog where this query will be executed. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // Timestamp when this query was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying the query. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Username of the user who last saved changes to this query. - LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + // Wire name: 'last_modifier_user_name' + LastModifierUserName string // Indicates whether the query is trashed. - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + // Wire name: 'lifecycle_state' + LifecycleState LifecycleState // Username of the user that owns the query. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // List of query parameter definitions. - Parameters []QueryParameter `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []QueryParameter // Workspace path of the workspace folder containing the object. - ParentPath string `json:"parent_path,omitempty"` + // Wire name: 'parent_path' + ParentPath string // Text of the query to be run. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Sets the "Run as" role for the object. - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + // Wire name: 'run_as_mode' + RunAsMode RunAsMode // Name of the schema where this query will be executed. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // Timestamp when this query was last updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string // ID of the SQL warehouse attached to the query. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Query) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Query) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Query) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Query) MarshalJSON() ([]byte, error) { + pb, err := queryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryBackedValue struct { // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` + // Wire name: 'multi_values_options' + MultiValuesOptions *MultiValuesOptions // UUID of the query that provides the parameter values. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // List of selected query parameter values. - Values []string `json:"values,omitempty"` + // Wire name: 'values' + Values []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryBackedValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryBackedValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryBackedValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryBackedValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryBackedValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryBackedValue) MarshalJSON() ([]byte, error) { + pb, err := queryBackedValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryEditContent struct { @@ -3472,269 +6624,471 @@ type QueryEditContent struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId string `json:"data_source_id,omitempty"` + // Wire name: 'data_source_id' + DataSourceId string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The title of this query that appears in list views, widget headings, and // on the query page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options any `json:"options,omitempty"` + // Wire name: 'options' + Options any // The text of the query to be run. - Query string `json:"query,omitempty"` + // Wire name: 'query' + Query string - QueryId string `json:"-" url:"-"` + // Wire name: 'query_id' + QueryId string `tf:"-"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + // Wire name: 'run_as_role' + RunAsRole RunAsRole - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryEditContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryEditContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryEditContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryEditContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryEditContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryEditContent) MarshalJSON() ([]byte, error) { + pb, err := queryEditContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryFilter struct { // A range filter for query submitted time. The time range must be <= 30 // days. - QueryStartTimeRange *TimeRange `json:"query_start_time_range,omitempty" url:"query_start_time_range,omitempty"` + // Wire name: 'query_start_time_range' + QueryStartTimeRange *TimeRange // A list of statement IDs. - StatementIds []string `json:"statement_ids,omitempty" url:"statement_ids,omitempty"` + // Wire name: 'statement_ids' + StatementIds []string - Statuses []QueryStatus `json:"statuses,omitempty" url:"statuses,omitempty"` + // Wire name: 'statuses' + Statuses []QueryStatus // A list of user IDs who ran the queries. - UserIds []int64 `json:"user_ids,omitempty" url:"user_ids,omitempty"` + // Wire name: 'user_ids' + UserIds []int64 // A list of warehouse IDs. - WarehouseIds []string `json:"warehouse_ids,omitempty" url:"warehouse_ids,omitempty"` + // Wire name: 'warehouse_ids' + WarehouseIds []string +} + +func (st *QueryFilter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryFilterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryFilterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st QueryFilter) MarshalJSON() ([]byte, error) { + pb, err := queryFilterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryInfo struct { // SQL Warehouse channel information at the time of query execution - ChannelUsed *ChannelInfo `json:"channel_used,omitempty"` + // Wire name: 'channel_used' + ChannelUsed *ChannelInfo // Client application that ran the statement. For example: Databricks SQL // Editor, Tableau, and Power BI. This field is derived from information // provided by client applications. While values are expected to remain // static over time, this cannot be guaranteed. - ClientApplication string `json:"client_application,omitempty"` + // Wire name: 'client_application' + ClientApplication string // Total execution time of the statement ( excluding result fetch time ). - Duration int64 `json:"duration,omitempty"` + // Wire name: 'duration' + Duration int64 // Alias for `warehouse_id`. - EndpointId string `json:"endpoint_id,omitempty"` + // Wire name: 'endpoint_id' + EndpointId string // Message describing why the query could not complete. - ErrorMessage string `json:"error_message,omitempty"` + // Wire name: 'error_message' + ErrorMessage string // The ID of the user whose credentials were used to run the query. - ExecutedAsUserId int64 `json:"executed_as_user_id,omitempty"` + // Wire name: 'executed_as_user_id' + ExecutedAsUserId int64 // The email address or username of the user whose credentials were used to // run the query. - ExecutedAsUserName string `json:"executed_as_user_name,omitempty"` + // Wire name: 'executed_as_user_name' + ExecutedAsUserName string // The time execution of the query ended. - ExecutionEndTimeMs int64 `json:"execution_end_time_ms,omitempty"` + // Wire name: 'execution_end_time_ms' + ExecutionEndTimeMs int64 // Whether more updates for the query are expected. - IsFinal bool `json:"is_final,omitempty"` + // Wire name: 'is_final' + IsFinal bool // A key that can be used to look up query details. - LookupKey string `json:"lookup_key,omitempty"` + // Wire name: 'lookup_key' + LookupKey string // Metrics about query execution. - Metrics *QueryMetrics `json:"metrics,omitempty"` + // Wire name: 'metrics' + Metrics *QueryMetrics // Whether plans exist for the execution, or the reason why they are missing - PlansState PlansState `json:"plans_state,omitempty"` + // Wire name: 'plans_state' + PlansState PlansState // The time the query ended. - QueryEndTimeMs int64 `json:"query_end_time_ms,omitempty"` + // Wire name: 'query_end_time_ms' + QueryEndTimeMs int64 // The query ID. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // A struct that contains key-value pairs representing Databricks entities // that were involved in the execution of this statement, such as jobs, // notebooks, or dashboards. This field only records Databricks entities. - QuerySource *ExternalQuerySource `json:"query_source,omitempty"` + // Wire name: 'query_source' + QuerySource *ExternalQuerySource // The time the query started. - QueryStartTimeMs int64 `json:"query_start_time_ms,omitempty"` + // Wire name: 'query_start_time_ms' + QueryStartTimeMs int64 // The text of the query. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // The number of results returned by the query. - RowsProduced int64 `json:"rows_produced,omitempty"` + // Wire name: 'rows_produced' + RowsProduced int64 // URL to the Spark UI query plan. - SparkUiUrl string `json:"spark_ui_url,omitempty"` + // Wire name: 'spark_ui_url' + SparkUiUrl string // Type of statement for this query - StatementType QueryStatementType `json:"statement_type,omitempty"` + // Wire name: 'statement_type' + StatementType QueryStatementType // Query status with one the following values: // // - `QUEUED`: Query has been received and queued. - `RUNNING`: Query has // started. - `CANCELED`: Query has been cancelled by the user. - `FAILED`: // Query has failed. - `FINISHED`: Query has completed. - Status QueryStatus `json:"status,omitempty"` + // Wire name: 'status' + Status QueryStatus // The ID of the user who ran the query. - UserId int64 `json:"user_id,omitempty"` + // Wire name: 'user_id' + UserId int64 // The email address or username of the user who ran the query. - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string // Warehouse ID. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryInfo) MarshalJSON() ([]byte, error) { + pb, err := queryInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryList struct { // The total number of queries. - Count int `json:"count,omitempty"` + // Wire name: 'count' + Count int // The page number that is currently displayed. - Page int `json:"page,omitempty"` + // Wire name: 'page' + Page int // The number of queries per page. - PageSize int `json:"page_size,omitempty"` + // Wire name: 'page_size' + PageSize int // List of queries returned. - Results []LegacyQuery `json:"results,omitempty"` + // Wire name: 'results' + Results []LegacyQuery - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryList) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryList) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryListPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryListFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryList) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryList) MarshalJSON() ([]byte, error) { + pb, err := queryListToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // A query metric that encapsulates a set of measurements for a single query. // Metrics come from the driver and are stored in the history service database. type QueryMetrics struct { // Time spent loading metadata and optimizing the query, in milliseconds. - CompilationTimeMs int64 `json:"compilation_time_ms,omitempty"` + // Wire name: 'compilation_time_ms' + CompilationTimeMs int64 // Time spent executing the query, in milliseconds. - ExecutionTimeMs int64 `json:"execution_time_ms,omitempty"` + // Wire name: 'execution_time_ms' + ExecutionTimeMs int64 // Total amount of data sent over the network between executor nodes during // shuffle, in bytes. - NetworkSentBytes int64 `json:"network_sent_bytes,omitempty"` + // Wire name: 'network_sent_bytes' + NetworkSentBytes int64 // Timestamp of when the query was enqueued waiting while the warehouse was // at max load. This field is optional and will not appear if the query // skipped the overloading queue. - OverloadingQueueStartTimestamp int64 `json:"overloading_queue_start_timestamp,omitempty"` + // Wire name: 'overloading_queue_start_timestamp' + OverloadingQueueStartTimestamp int64 // Total execution time for all individual Photon query engine tasks in the // query, in milliseconds. - PhotonTotalTimeMs int64 `json:"photon_total_time_ms,omitempty"` + // Wire name: 'photon_total_time_ms' + PhotonTotalTimeMs int64 // Timestamp of when the query was enqueued waiting for a cluster to be // provisioned for the warehouse. This field is optional and will not appear // if the query skipped the provisioning queue. - ProvisioningQueueStartTimestamp int64 `json:"provisioning_queue_start_timestamp,omitempty"` + // Wire name: 'provisioning_queue_start_timestamp' + ProvisioningQueueStartTimestamp int64 // Total number of bytes in all tables not read due to pruning - PrunedBytes int64 `json:"pruned_bytes,omitempty"` + // Wire name: 'pruned_bytes' + PrunedBytes int64 // Total number of files from all tables not read due to pruning - PrunedFilesCount int64 `json:"pruned_files_count,omitempty"` + // Wire name: 'pruned_files_count' + PrunedFilesCount int64 // Timestamp of when the underlying compute started compilation of the // query. - QueryCompilationStartTimestamp int64 `json:"query_compilation_start_timestamp,omitempty"` + // Wire name: 'query_compilation_start_timestamp' + QueryCompilationStartTimestamp int64 // Total size of data read by the query, in bytes. - ReadBytes int64 `json:"read_bytes,omitempty"` + // Wire name: 'read_bytes' + ReadBytes int64 // Size of persistent data read from the cache, in bytes. - ReadCacheBytes int64 `json:"read_cache_bytes,omitempty"` + // Wire name: 'read_cache_bytes' + ReadCacheBytes int64 // Number of files read after pruning - ReadFilesCount int64 `json:"read_files_count,omitempty"` + // Wire name: 'read_files_count' + ReadFilesCount int64 // Number of partitions read after pruning. - ReadPartitionsCount int64 `json:"read_partitions_count,omitempty"` + // Wire name: 'read_partitions_count' + ReadPartitionsCount int64 // Size of persistent data read from cloud object storage on your cloud // tenant, in bytes. - ReadRemoteBytes int64 `json:"read_remote_bytes,omitempty"` + // Wire name: 'read_remote_bytes' + ReadRemoteBytes int64 // Time spent fetching the query results after the execution finished, in // milliseconds. - ResultFetchTimeMs int64 `json:"result_fetch_time_ms,omitempty"` + // Wire name: 'result_fetch_time_ms' + ResultFetchTimeMs int64 // `true` if the query result was fetched from cache, `false` otherwise. - ResultFromCache bool `json:"result_from_cache,omitempty"` + // Wire name: 'result_from_cache' + ResultFromCache bool // Total number of rows returned by the query. - RowsProducedCount int64 `json:"rows_produced_count,omitempty"` + // Wire name: 'rows_produced_count' + RowsProducedCount int64 // Total number of rows read by the query. - RowsReadCount int64 `json:"rows_read_count,omitempty"` + // Wire name: 'rows_read_count' + RowsReadCount int64 // Size of data temporarily written to disk while executing the query, in // bytes. - SpillToDiskBytes int64 `json:"spill_to_disk_bytes,omitempty"` + // Wire name: 'spill_to_disk_bytes' + SpillToDiskBytes int64 // Sum of execution time for all of the query’s tasks, in milliseconds. - TaskTotalTimeMs int64 `json:"task_total_time_ms,omitempty"` + // Wire name: 'task_total_time_ms' + TaskTotalTimeMs int64 // Total execution time of the query from the client’s point of view, in // milliseconds. - TotalTimeMs int64 `json:"total_time_ms,omitempty"` + // Wire name: 'total_time_ms' + TotalTimeMs int64 // Size pf persistent data written to cloud object storage in your cloud // tenant, in bytes. - WriteRemoteBytes int64 `json:"write_remote_bytes,omitempty"` + // Wire name: 'write_remote_bytes' + WriteRemoteBytes int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryMetrics) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryMetrics) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryMetricsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryMetricsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryMetrics) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryMetrics) MarshalJSON() ([]byte, error) { + pb, err := queryMetricsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryOptions struct { // The name of the catalog to execute this query in. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // The timestamp when this query was moved to trash. Only present when the // `is_archived` property is `true`. Trashed items are deleted after thirty // days. - MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` + // Wire name: 'moved_to_trash_at' + MovedToTrashAt string - Parameters []Parameter `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []Parameter // The name of the schema to execute this query in. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryOptions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryOptions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryOptions) MarshalJSON() ([]byte, error) { + pb, err := queryOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryParameter struct { // Date-range query parameter value. Can only specify one of // `dynamic_date_range_value` or `date_range_value`. - DateRangeValue *DateRangeValue `json:"date_range_value,omitempty"` + // Wire name: 'date_range_value' + DateRangeValue *DateRangeValue // Date query parameter value. Can only specify one of `dynamic_date_value` // or `date_value`. - DateValue *DateValue `json:"date_value,omitempty"` + // Wire name: 'date_value' + DateValue *DateValue // Dropdown query parameter value. - EnumValue *EnumValue `json:"enum_value,omitempty"` + // Wire name: 'enum_value' + EnumValue *EnumValue // Literal parameter marker that appears between double curly braces in the // query text. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Numeric query parameter value. - NumericValue *NumericValue `json:"numeric_value,omitempty"` + // Wire name: 'numeric_value' + NumericValue *NumericValue // Query-based dropdown query parameter value. - QueryBackedValue *QueryBackedValue `json:"query_backed_value,omitempty"` + // Wire name: 'query_backed_value' + QueryBackedValue *QueryBackedValue // Text query parameter value. - TextValue *TextValue `json:"text_value,omitempty"` + // Wire name: 'text_value' + TextValue *TextValue // Text displayed in the user-facing parameter widget in the UI. - Title string `json:"title,omitempty"` + // Wire name: 'title' + Title string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryParameter) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryParameter) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryParameterPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryParameterFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryParameter) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryParameter) MarshalJSON() ([]byte, error) { + pb, err := queryParameterToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryPostContent struct { @@ -3742,40 +7096,66 @@ type QueryPostContent struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId string `json:"data_source_id,omitempty"` + // Wire name: 'data_source_id' + DataSourceId string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // The title of this query that appears in list views, widget headings, and // on the query page. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options any `json:"options,omitempty"` + // Wire name: 'options' + Options any // The identifier of the workspace folder containing the object. - Parent string `json:"parent,omitempty"` + // Wire name: 'parent' + Parent string // The text of the query to be run. - Query string `json:"query,omitempty"` + // Wire name: 'query' + Query string // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + // Wire name: 'run_as_role' + RunAsRole RunAsRole - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryPostContent) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryPostContent) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryPostContentPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryPostContentFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryPostContent) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryPostContent) MarshalJSON() ([]byte, error) { + pb, err := queryPostContentToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryStatementType string +type queryStatementTypePb string const QueryStatementTypeAlter QueryStatementType = `ALTER` @@ -3842,8 +7222,25 @@ func (f *QueryStatementType) Type() string { return "QueryStatementType" } +func queryStatementTypeToPb(st *QueryStatementType) (*queryStatementTypePb, error) { + if st == nil { + return nil, nil + } + pb := queryStatementTypePb(*st) + return &pb, nil +} + +func queryStatementTypeFromPb(pb *queryStatementTypePb) (*QueryStatementType, error) { + if pb == nil { + return nil, nil + } + st := QueryStatementType(*pb) + return &st, nil +} + // Statuses which are also used by OperationStatus in runtime type QueryStatus string +type queryStatusPb string const QueryStatusCanceled QueryStatus = `CANCELED` @@ -3882,111 +7279,303 @@ func (f *QueryStatus) Type() string { return "QueryStatus" } +func queryStatusToPb(st *QueryStatus) (*queryStatusPb, error) { + if st == nil { + return nil, nil + } + pb := queryStatusPb(*st) + return &pb, nil +} + +func queryStatusFromPb(pb *queryStatusPb) (*QueryStatus, error) { + if pb == nil { + return nil, nil + } + st := QueryStatus(*pb) + return &st, nil +} + type RepeatedEndpointConfPairs struct { // Deprecated: Use configuration_pairs - ConfigPair []EndpointConfPair `json:"config_pair,omitempty"` + // Wire name: 'config_pair' + ConfigPair []EndpointConfPair + + // Wire name: 'configuration_pairs' + ConfigurationPairs []EndpointConfPair +} + +func (st *RepeatedEndpointConfPairs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repeatedEndpointConfPairsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repeatedEndpointConfPairsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - ConfigurationPairs []EndpointConfPair `json:"configuration_pairs,omitempty"` +func (st RepeatedEndpointConfPairs) MarshalJSON() ([]byte, error) { + pb, err := repeatedEndpointConfPairsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Restore a dashboard type RestoreDashboardRequest struct { - DashboardId string `json:"-" url:"-"` + + // Wire name: 'dashboard_id' + DashboardId string `tf:"-"` +} + +func (st *RestoreDashboardRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreDashboardRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreDashboardRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreDashboardRequest) MarshalJSON() ([]byte, error) { + pb, err := restoreDashboardRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Restore a query type RestoreQueriesLegacyRequest struct { - QueryId string `json:"-" url:"-"` + + // Wire name: 'query_id' + QueryId string `tf:"-"` +} + +func (st *RestoreQueriesLegacyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreQueriesLegacyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreQueriesLegacyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreQueriesLegacyRequest) MarshalJSON() ([]byte, error) { + pb, err := restoreQueriesLegacyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RestoreResponse struct { } +func (st *RestoreResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &restoreResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := restoreResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RestoreResponse) MarshalJSON() ([]byte, error) { + pb, err := restoreResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type ResultData struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount int64 `json:"byte_count,omitempty"` + // Wire name: 'byte_count' + ByteCount int64 // The position within the sequence of result set chunks. - ChunkIndex int `json:"chunk_index,omitempty"` + // Wire name: 'chunk_index' + ChunkIndex int // The `JSON_ARRAY` format is an array of arrays of values, where each // non-null value is formatted as a string. Null values are encoded as JSON // `null`. - DataArray [][]string `json:"data_array,omitempty"` + // Wire name: 'data_array' + DataArray [][]string - ExternalLinks []ExternalLink `json:"external_links,omitempty"` + // Wire name: 'external_links' + ExternalLinks []ExternalLink // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex int `json:"next_chunk_index,omitempty"` + // Wire name: 'next_chunk_index' + NextChunkIndex int // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + // Wire name: 'next_chunk_internal_link' + NextChunkInternalLink string // The number of rows within the result chunk. - RowCount int64 `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int64 // The starting row offset within the result set. - RowOffset int64 `json:"row_offset,omitempty"` + // Wire name: 'row_offset' + RowOffset int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResultData) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResultData) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultDataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultDataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResultData) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResultData) MarshalJSON() ([]byte, error) { + pb, err := resultDataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The result manifest provides schema and metadata for the result set. type ResultManifest struct { // Array of result set chunk metadata. - Chunks []BaseChunkInfo `json:"chunks,omitempty"` + // Wire name: 'chunks' + Chunks []BaseChunkInfo - Format Format `json:"format,omitempty"` + // Wire name: 'format' + Format Format // The schema is an ordered list of column descriptions. - Schema *ResultSchema `json:"schema,omitempty"` + // Wire name: 'schema' + Schema *ResultSchema // The total number of bytes in the result set. This field is not available // when using `INLINE` disposition. - TotalByteCount int64 `json:"total_byte_count,omitempty"` + // Wire name: 'total_byte_count' + TotalByteCount int64 // The total number of chunks that the result set has been divided into. - TotalChunkCount int `json:"total_chunk_count,omitempty"` + // Wire name: 'total_chunk_count' + TotalChunkCount int // The total number of rows in the result set. - TotalRowCount int64 `json:"total_row_count,omitempty"` + // Wire name: 'total_row_count' + TotalRowCount int64 // Indicates whether the result is truncated due to `row_limit` or // `byte_limit`. - Truncated bool `json:"truncated,omitempty"` + // Wire name: 'truncated' + Truncated bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResultManifest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResultManifest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultManifestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultManifestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResultManifest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResultManifest) MarshalJSON() ([]byte, error) { + pb, err := resultManifestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The schema is an ordered list of column descriptions. type ResultSchema struct { - ColumnCount int `json:"column_count,omitempty"` - Columns []ColumnInfo `json:"columns,omitempty"` + // Wire name: 'column_count' + ColumnCount int - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'columns' + Columns []ColumnInfo + + ForceSendFields []string `tf:"-"` } -func (s *ResultSchema) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResultSchema) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultSchemaPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultSchemaFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResultSchema) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResultSchema) MarshalJSON() ([]byte, error) { + pb, err := resultSchemaToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RunAsMode string +type runAsModePb string const RunAsModeOwner RunAsMode = `OWNER` @@ -4013,10 +7602,27 @@ func (f *RunAsMode) Type() string { return "RunAsMode" } +func runAsModeToPb(st *RunAsMode) (*runAsModePb, error) { + if st == nil { + return nil, nil + } + pb := runAsModePb(*st) + return &pb, nil +} + +func runAsModeFromPb(pb *runAsModePb) (*RunAsMode, error) { + if pb == nil { + return nil, nil + } + st := RunAsMode(*pb) + return &st, nil +} + // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as owner" // behavior) type RunAsRole string +type runAsRolePb string const RunAsRoleOwner RunAsRole = `owner` @@ -4043,7 +7649,24 @@ func (f *RunAsRole) Type() string { return "RunAsRole" } +func runAsRoleToPb(st *RunAsRole) (*runAsRolePb, error) { + if st == nil { + return nil, nil + } + pb := runAsRolePb(*st) + return &pb, nil +} + +func runAsRoleFromPb(pb *runAsRolePb) (*RunAsRole, error) { + if pb == nil { + return nil, nil + } + st := RunAsRole(*pb) + return &st, nil +} + type SchedulePauseStatus string +type schedulePauseStatusPb string const SchedulePauseStatusPaused SchedulePauseStatus = `PAUSED` @@ -4070,23 +7693,60 @@ func (f *SchedulePauseStatus) Type() string { return "SchedulePauseStatus" } +func schedulePauseStatusToPb(st *SchedulePauseStatus) (*schedulePauseStatusPb, error) { + if st == nil { + return nil, nil + } + pb := schedulePauseStatusPb(*st) + return &pb, nil +} + +func schedulePauseStatusFromPb(pb *schedulePauseStatusPb) (*SchedulePauseStatus, error) { + if pb == nil { + return nil, nil + } + st := SchedulePauseStatus(*pb) + return &st, nil +} + type ServiceError struct { - ErrorCode ServiceErrorCode `json:"error_code,omitempty"` + + // Wire name: 'error_code' + ErrorCode ServiceErrorCode // A brief summary of the error condition. - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ServiceError) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ServiceError) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &serviceErrorPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := serviceErrorFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ServiceError) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ServiceError) MarshalJSON() ([]byte, error) { + pb, err := serviceErrorToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ServiceErrorCode string +type serviceErrorCodePb string const ServiceErrorCodeAborted ServiceErrorCode = `ABORTED` @@ -4137,74 +7797,167 @@ func (f *ServiceErrorCode) Type() string { return "ServiceErrorCode" } +func serviceErrorCodeToPb(st *ServiceErrorCode) (*serviceErrorCodePb, error) { + if st == nil { + return nil, nil + } + pb := serviceErrorCodePb(*st) + return &pb, nil +} + +func serviceErrorCodeFromPb(pb *serviceErrorCodePb) (*ServiceErrorCode, error) { + if pb == nil { + return nil, nil + } + st := ServiceErrorCode(*pb) + return &st, nil +} + // Set object ACL type SetRequest struct { - AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AccessControl // Object ID. The ACL for the object with this UUID is overwritten by this // request's POST content. - ObjectId string `json:"-" url:"-"` + // Wire name: 'objectId' + ObjectId string `tf:"-"` // The type of object permission to set. - ObjectType ObjectTypePlural `json:"-" url:"-"` + // Wire name: 'objectType' + ObjectType ObjectTypePlural `tf:"-"` +} + +func (st *SetRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetRequest) MarshalJSON() ([]byte, error) { + pb, err := setRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetResponse struct { - AccessControlList []AccessControl `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []AccessControl // An object's type and UUID, separated by a forward slash (/) character. - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'object_id' + ObjectId string // A singular noun object type. - ObjectType ObjectType `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType ObjectType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SetResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SetResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SetResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SetResponse) MarshalJSON() ([]byte, error) { + pb, err := setResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SetWorkspaceWarehouseConfigRequest struct { // Optional: Channel selection details - Channel *Channel `json:"channel,omitempty"` + // Wire name: 'channel' + Channel *Channel // Deprecated: Use sql_configuration_parameters - ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + // Wire name: 'config_param' + ConfigParam *RepeatedEndpointConfPairs // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + // Wire name: 'data_access_config' + DataAccessConfig []EndpointConfPair // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + // Wire name: 'enabled_warehouse_types' + EnabledWarehouseTypes []WarehouseTypePair // Deprecated: Use sql_configuration_parameters - GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + // Wire name: 'global_param' + GlobalParam *RepeatedEndpointConfPairs // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount string `json:"google_service_account,omitempty"` + // Wire name: 'google_service_account' + GoogleServiceAccount string // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + // Wire name: 'instance_profile_arn' + InstanceProfileArn string // Security policy for warehouses - SecurityPolicy SetWorkspaceWarehouseConfigRequestSecurityPolicy `json:"security_policy,omitempty"` + // Wire name: 'security_policy' + SecurityPolicy SetWorkspaceWarehouseConfigRequestSecurityPolicy // SQL configuration parameters - SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + // Wire name: 'sql_configuration_parameters' + SqlConfigurationParameters *RepeatedEndpointConfPairs - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SetWorkspaceWarehouseConfigRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SetWorkspaceWarehouseConfigRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setWorkspaceWarehouseConfigRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setWorkspaceWarehouseConfigRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SetWorkspaceWarehouseConfigRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SetWorkspaceWarehouseConfigRequest) MarshalJSON() ([]byte, error) { + pb, err := setWorkspaceWarehouseConfigRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Security policy for warehouses type SetWorkspaceWarehouseConfigRequestSecurityPolicy string +type setWorkspaceWarehouseConfigRequestSecurityPolicyPb string const SetWorkspaceWarehouseConfigRequestSecurityPolicyDataAccessControl SetWorkspaceWarehouseConfigRequestSecurityPolicy = `DATA_ACCESS_CONTROL` @@ -4233,11 +7986,53 @@ func (f *SetWorkspaceWarehouseConfigRequestSecurityPolicy) Type() string { return "SetWorkspaceWarehouseConfigRequestSecurityPolicy" } +func setWorkspaceWarehouseConfigRequestSecurityPolicyToPb(st *SetWorkspaceWarehouseConfigRequestSecurityPolicy) (*setWorkspaceWarehouseConfigRequestSecurityPolicyPb, error) { + if st == nil { + return nil, nil + } + pb := setWorkspaceWarehouseConfigRequestSecurityPolicyPb(*st) + return &pb, nil +} + +func setWorkspaceWarehouseConfigRequestSecurityPolicyFromPb(pb *setWorkspaceWarehouseConfigRequestSecurityPolicyPb) (*SetWorkspaceWarehouseConfigRequestSecurityPolicy, error) { + if pb == nil { + return nil, nil + } + st := SetWorkspaceWarehouseConfigRequestSecurityPolicy(*pb) + return &st, nil +} + type SetWorkspaceWarehouseConfigResponse struct { } +func (st *SetWorkspaceWarehouseConfigResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &setWorkspaceWarehouseConfigResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := setWorkspaceWarehouseConfigResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { + pb, err := setWorkspaceWarehouseConfigResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Configurations whether the warehouse should use spot instances. type SpotInstancePolicy string +type spotInstancePolicyPb string const SpotInstancePolicyCostOptimized SpotInstancePolicy = `COST_OPTIMIZED` @@ -4266,17 +8061,85 @@ func (f *SpotInstancePolicy) Type() string { return "SpotInstancePolicy" } +func spotInstancePolicyToPb(st *SpotInstancePolicy) (*spotInstancePolicyPb, error) { + if st == nil { + return nil, nil + } + pb := spotInstancePolicyPb(*st) + return &pb, nil +} + +func spotInstancePolicyFromPb(pb *spotInstancePolicyPb) (*SpotInstancePolicy, error) { + if pb == nil { + return nil, nil + } + st := SpotInstancePolicy(*pb) + return &st, nil +} + // Start a warehouse type StartRequest struct { // Required. Id of the SQL warehouse. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *StartRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StartRequest) MarshalJSON() ([]byte, error) { + pb, err := startRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StartWarehouseResponse struct { } +func (st *StartWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &startWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := startWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StartWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := startWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // State of the warehouse type State string +type statePb string const StateDeleted State = `DELETED` @@ -4311,9 +8174,26 @@ func (f *State) Type() string { return "State" } +func stateToPb(st *State) (*statePb, error) { + if st == nil { + return nil, nil + } + pb := statePb(*st) + return &pb, nil +} + +func stateFromPb(pb *statePb) (*State, error) { + if pb == nil { + return nil, nil + } + st := State(*pb) + return &st, nil +} + type StatementParameterListItem struct { // The name of a parameter marker to be substituted in the statement. - Name string `json:"name"` + // Wire name: 'name' + Name string // 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. @@ -4321,43 +8201,83 @@ type StatementParameterListItem struct { // reference. // // [Data types]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string // The value to substitute, represented as a string. If omitted, the value // is interpreted as NULL. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StatementParameterListItem) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StatementParameterListItem) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &statementParameterListItemPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := statementParameterListItemFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StatementParameterListItem) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StatementParameterListItem) MarshalJSON() ([]byte, error) { + pb, err := statementParameterListItemToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StatementResponse struct { // The result manifest provides schema and metadata for the result set. - Manifest *ResultManifest `json:"manifest,omitempty"` + // Wire name: 'manifest' + Manifest *ResultManifest - Result *ResultData `json:"result,omitempty"` + // Wire name: 'result' + Result *ResultData // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId string `json:"statement_id,omitempty"` + // Wire name: 'statement_id' + StatementId string // The status response includes execution state and if relevant, error // information. - Status *StatementStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *StatementStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *StatementResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *StatementResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &statementResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := statementResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s StatementResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st StatementResponse) MarshalJSON() ([]byte, error) { + pb, err := statementResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Statement execution state: - `PENDING`: waiting for warehouse - `RUNNING`: @@ -4367,6 +8287,7 @@ func (s StatementResponse) MarshalJSON() ([]byte, error) { // cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`: execution // successful, and statement closed; result no longer available for fetch type StatementState string +type statementStatePb string // user canceled; can come from explicit cancel call, or timeout with // `on_wait_timeout=CANCEL` @@ -4409,10 +8330,28 @@ func (f *StatementState) Type() string { return "StatementState" } +func statementStateToPb(st *StatementState) (*statementStatePb, error) { + if st == nil { + return nil, nil + } + pb := statementStatePb(*st) + return &pb, nil +} + +func statementStateFromPb(pb *statementStatePb) (*StatementState, error) { + if pb == nil { + return nil, nil + } + st := StatementState(*pb) + return &st, nil +} + // The status response includes execution state and if relevant, error // information. type StatementStatus struct { - Error *ServiceError `json:"error,omitempty"` + + // Wire name: 'error' + Error *ServiceError // Statement execution state: - `PENDING`: waiting for warehouse - // `RUNNING`: running - `SUCCEEDED`: execution was successful, result data // available for fetch - `FAILED`: execution failed; reason for failure @@ -4420,11 +8359,38 @@ type StatementStatus struct { // come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` // - `CLOSED`: execution successful, and statement closed; result no longer // available for fetch - State StatementState `json:"state,omitempty"` + // Wire name: 'state' + State StatementState +} + +func (st *StatementStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &statementStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := statementStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StatementStatus) MarshalJSON() ([]byte, error) { + pb, err := statementStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Health status of the warehouse. type Status string +type statusPb string const StatusDegraded Status = `DEGRADED` @@ -4455,20 +8421,115 @@ func (f *Status) Type() string { return "Status" } +func statusToPb(st *Status) (*statusPb, error) { + if st == nil { + return nil, nil + } + pb := statusPb(*st) + return &pb, nil +} + +func statusFromPb(pb *statusPb) (*Status, error) { + if pb == nil { + return nil, nil + } + st := Status(*pb) + return &st, nil +} + // Stop a warehouse type StopRequest struct { // Required. Id of the SQL warehouse. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *StopRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stopRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stopRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StopRequest) MarshalJSON() ([]byte, error) { + pb, err := stopRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type StopWarehouseResponse struct { } +func (st *StopWarehouseResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &stopWarehouseResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := stopWarehouseResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st StopWarehouseResponse) MarshalJSON() ([]byte, error) { + pb, err := stopWarehouseResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type Success struct { - Message SuccessMessage `json:"message,omitempty"` + + // Wire name: 'message' + Message SuccessMessage +} + +func (st *Success) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &successPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := successFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Success) MarshalJSON() ([]byte, error) { + pb, err := successToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SuccessMessage string +type successMessagePb string const SuccessMessageSuccess SuccessMessage = `Success` @@ -4493,18 +8554,63 @@ func (f *SuccessMessage) Type() string { return "SuccessMessage" } +func successMessageToPb(st *SuccessMessage) (*successMessagePb, error) { + if st == nil { + return nil, nil + } + pb := successMessagePb(*st) + return &pb, nil +} + +func successMessageFromPb(pb *successMessagePb) (*SuccessMessage, error) { + if pb == nil { + return nil, nil + } + st := SuccessMessage(*pb) + return &st, nil +} + type TerminationReason struct { // status code indicating why the cluster was terminated - Code TerminationReasonCode `json:"code,omitempty"` + // Wire name: 'code' + Code TerminationReasonCode // list of parameters that provide additional information about why the // cluster was terminated - Parameters map[string]string `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters map[string]string // type of the termination - Type TerminationReasonType `json:"type,omitempty"` + // Wire name: 'type' + Type TerminationReasonType +} + +func (st *TerminationReason) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &terminationReasonPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := terminationReasonFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TerminationReason) MarshalJSON() ([]byte, error) { + pb, err := terminationReasonToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // status code indicating why the cluster was terminated type TerminationReasonCode string +type terminationReasonCodePb string const TerminationReasonCodeAbuseDetected TerminationReasonCode = `ABUSE_DETECTED` @@ -4685,8 +8791,25 @@ func (f *TerminationReasonCode) Type() string { return "TerminationReasonCode" } +func terminationReasonCodeToPb(st *TerminationReasonCode) (*terminationReasonCodePb, error) { + if st == nil { + return nil, nil + } + pb := terminationReasonCodePb(*st) + return &pb, nil +} + +func terminationReasonCodeFromPb(pb *terminationReasonCodePb) (*TerminationReasonCode, error) { + if pb == nil { + return nil, nil + } + st := TerminationReasonCode(*pb) + return &st, nil +} + // type of the termination type TerminationReasonType string +type terminationReasonTypePb string const TerminationReasonTypeClientError TerminationReasonType = `CLIENT_ERROR` @@ -4717,95 +8840,272 @@ func (f *TerminationReasonType) Type() string { return "TerminationReasonType" } +func terminationReasonTypeToPb(st *TerminationReasonType) (*terminationReasonTypePb, error) { + if st == nil { + return nil, nil + } + pb := terminationReasonTypePb(*st) + return &pb, nil +} + +func terminationReasonTypeFromPb(pb *terminationReasonTypePb) (*TerminationReasonType, error) { + if pb == nil { + return nil, nil + } + st := TerminationReasonType(*pb) + return &st, nil +} + type TextValue struct { - Value string `json:"value,omitempty"` - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'value' + Value string + + ForceSendFields []string `tf:"-"` } -func (s *TextValue) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TextValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &textValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := textValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TextValue) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TextValue) MarshalJSON() ([]byte, error) { + pb, err := textValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TimeRange struct { // The end time in milliseconds. - EndTimeMs int64 `json:"end_time_ms,omitempty" url:"end_time_ms,omitempty"` + // Wire name: 'end_time_ms' + EndTimeMs int64 // The start time in milliseconds. - StartTimeMs int64 `json:"start_time_ms,omitempty" url:"start_time_ms,omitempty"` + // Wire name: 'start_time_ms' + StartTimeMs int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TimeRange) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TimeRange) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &timeRangePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := timeRangeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TimeRange) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TimeRange) MarshalJSON() ([]byte, error) { + pb, err := timeRangeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type TransferOwnershipObjectId struct { // Email address for the new owner, who must exist in the workspace. - NewOwner string `json:"new_owner,omitempty"` + // Wire name: 'new_owner' + NewOwner string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TransferOwnershipObjectId) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TransferOwnershipObjectId) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &transferOwnershipObjectIdPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := transferOwnershipObjectIdFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TransferOwnershipObjectId) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TransferOwnershipObjectId) MarshalJSON() ([]byte, error) { + pb, err := transferOwnershipObjectIdToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Transfer object ownership type TransferOwnershipRequest struct { // Email address for the new owner, who must exist in the workspace. - NewOwner string `json:"new_owner,omitempty"` + // Wire name: 'new_owner' + NewOwner string // The ID of the object on which to change ownership. - ObjectId TransferOwnershipObjectId `json:"-" url:"-"` + // Wire name: 'objectId' + ObjectId TransferOwnershipObjectId `tf:"-"` // The type of object on which to change ownership. - ObjectType OwnableObjectType `json:"-" url:"-"` + // Wire name: 'objectType' + ObjectType OwnableObjectType `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *TransferOwnershipRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *TransferOwnershipRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &transferOwnershipRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := transferOwnershipRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s TransferOwnershipRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st TransferOwnershipRequest) MarshalJSON() ([]byte, error) { + pb, err := transferOwnershipRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an alert type TrashAlertRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *TrashAlertRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trashAlertRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trashAlertRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrashAlertRequest) MarshalJSON() ([]byte, error) { + pb, err := trashAlertRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an alert type TrashAlertV2Request struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *TrashAlertV2Request) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trashAlertV2RequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trashAlertV2RequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrashAlertV2Request) MarshalJSON() ([]byte, error) { + pb, err := trashAlertV2RequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete a query type TrashQueryRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` +} + +func (st *TrashQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &trashQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := trashQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st TrashQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := trashQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateAlertRequest struct { - Alert *UpdateAlertRequestAlert `json:"alert,omitempty"` + + // Wire name: 'alert' + Alert *UpdateAlertRequestAlert // If true, automatically resolve alert display name conflicts. Otherwise, // fail the request if the alert's display name conflicts with an existing // alert's display name. - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + // Wire name: 'auto_resolve_display_name' + AutoResolveDisplayName bool - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -4817,63 +9117,109 @@ type UpdateAlertRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - UpdateMask string `json:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateAlertRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateAlertRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAlertRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAlertRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateAlertRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateAlertRequest) MarshalJSON() ([]byte, error) { + pb, err := updateAlertRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateAlertRequestAlert struct { // Trigger conditions of the alert. - Condition *AlertCondition `json:"condition,omitempty"` + // Wire name: 'condition' + Condition *AlertCondition // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody string `json:"custom_body,omitempty"` + // Wire name: 'custom_body' + CustomBody string // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject string `json:"custom_subject,omitempty"` + // Wire name: 'custom_subject' + CustomSubject string // The display name of the alert. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk bool `json:"notify_on_ok,omitempty"` + // Wire name: 'notify_on_ok' + NotifyOnOk bool // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // UUID of the query attached to the alert. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + // Wire name: 'seconds_to_retrigger' + SecondsToRetrigger int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateAlertRequestAlert) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateAlertRequestAlert) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAlertRequestAlertPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAlertRequestAlertFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateAlertRequestAlert) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateAlertRequestAlert) MarshalJSON() ([]byte, error) { + pb, err := updateAlertRequestAlertToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Update an alert type UpdateAlertV2Request struct { - Alert AlertV2 `json:"alert"` + + // Wire name: 'alert' + Alert AlertV2 // UUID identifying the alert. - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -4885,18 +9231,47 @@ type UpdateAlertV2Request struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - UpdateMask string `json:"-" url:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string `tf:"-"` +} + +func (st *UpdateAlertV2Request) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateAlertV2RequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateAlertV2RequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateAlertV2Request) MarshalJSON() ([]byte, error) { + pb, err := updateAlertV2RequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateQueryRequest struct { // If true, automatically resolve alert display name conflicts. Otherwise, // fail the request if the alert's display name conflicts with an existing // alert's display name. - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + // Wire name: 'auto_resolve_display_name' + AutoResolveDisplayName bool - Id string `json:"-" url:"-"` + // Wire name: 'id' + Id string `tf:"-"` - Query *UpdateQueryRequestQuery `json:"query,omitempty"` + // Wire name: 'query' + Query *UpdateQueryRequestQuery // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -4908,61 +9283,134 @@ type UpdateQueryRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - UpdateMask string `json:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateQueryRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateQueryRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateQueryRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateQueryRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateQueryRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateQueryRequest) MarshalJSON() ([]byte, error) { + pb, err := updateQueryRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateQueryRequestQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + // Wire name: 'apply_auto_limit' + ApplyAutoLimit bool // Name of the catalog where this query will be executed. - Catalog string `json:"catalog,omitempty"` + // Wire name: 'catalog' + Catalog string // General description that conveys additional information about this query // such as usage notes. - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // Username of the user that owns the query. - OwnerUserName string `json:"owner_user_name,omitempty"` + // Wire name: 'owner_user_name' + OwnerUserName string // List of query parameter definitions. - Parameters []QueryParameter `json:"parameters,omitempty"` + // Wire name: 'parameters' + Parameters []QueryParameter // Text of the query to be run. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // Sets the "Run as" role for the object. - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + // Wire name: 'run_as_mode' + RunAsMode RunAsMode // Name of the schema where this query will be executed. - Schema string `json:"schema,omitempty"` + // Wire name: 'schema' + Schema string - Tags []string `json:"tags,omitempty"` + // Wire name: 'tags' + Tags []string // ID of the SQL warehouse attached to the query. - WarehouseId string `json:"warehouse_id,omitempty"` + // Wire name: 'warehouse_id' + WarehouseId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateQueryRequestQuery) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateQueryRequestQuery) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateQueryRequestQueryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateQueryRequestQueryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateQueryRequestQuery) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateQueryRequestQuery) MarshalJSON() ([]byte, error) { + pb, err := updateQueryRequestQueryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateResponse struct { } +func (st *UpdateResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateResponse) MarshalJSON() ([]byte, error) { + pb, err := updateResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateVisualizationRequest struct { - Id string `json:"-" url:"-"` + + // Wire name: 'id' + Id string `tf:"-"` // The field mask must be a single string, with multiple fields separated by // commas (no spaces). The field path is relative to the resource object, // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). @@ -4974,151 +9422,310 @@ type UpdateVisualizationRequest struct { // always explicitly list the fields being updated and avoid using `*` // wildcards, as it can lead to unintended results if the API changes in the // future. - UpdateMask string `json:"update_mask"` + // Wire name: 'update_mask' + UpdateMask string + + // Wire name: 'visualization' + Visualization *UpdateVisualizationRequestVisualization +} + +func (st *UpdateVisualizationRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateVisualizationRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateVisualizationRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} - Visualization *UpdateVisualizationRequestVisualization `json:"visualization,omitempty"` +func (st UpdateVisualizationRequest) MarshalJSON() ([]byte, error) { + pb, err := updateVisualizationRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateVisualizationRequestVisualization struct { // The display name of the visualization. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions string `json:"serialized_options,omitempty"` + // Wire name: 'serialized_options' + SerializedOptions string // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + // Wire name: 'serialized_query_plan' + SerializedQueryPlan string // The type of visualization: counter, table, funnel, and so on. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateVisualizationRequestVisualization) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateVisualizationRequestVisualization) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateVisualizationRequestVisualizationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateVisualizationRequestVisualizationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateVisualizationRequestVisualization) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateVisualizationRequestVisualization) MarshalJSON() ([]byte, error) { + pb, err := updateVisualizationRequestVisualizationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type User struct { - Email string `json:"email,omitempty"` - Id int `json:"id,omitempty"` + // Wire name: 'email' + Email string + + // Wire name: 'id' + Id int - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *User) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *User) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &userPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := userFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s User) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st User) MarshalJSON() ([]byte, error) { + pb, err := userToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Visualization struct { // The timestamp indicating when the visualization was created. - CreateTime string `json:"create_time,omitempty"` + // Wire name: 'create_time' + CreateTime string // The display name of the visualization. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // UUID identifying the visualization. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // UUID of the query that the visualization is attached to. - QueryId string `json:"query_id,omitempty"` + // Wire name: 'query_id' + QueryId string // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions string `json:"serialized_options,omitempty"` + // Wire name: 'serialized_options' + SerializedOptions string // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` + // Wire name: 'serialized_query_plan' + SerializedQueryPlan string // The type of visualization: counter, table, funnel, and so on. - Type string `json:"type,omitempty"` + // Wire name: 'type' + Type string // The timestamp indicating when the visualization was updated. - UpdateTime string `json:"update_time,omitempty"` + // Wire name: 'update_time' + UpdateTime string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Visualization) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Visualization) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &visualizationPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := visualizationFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Visualization) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Visualization) MarshalJSON() ([]byte, error) { + pb, err := visualizationToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehouseAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WarehousePermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehouseAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehouseAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehouseAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehouseAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehouseAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehouseAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := warehouseAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehouseAccessControlResponse struct { // All permissions. - AllPermissions []WarehousePermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []WarehousePermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehouseAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehouseAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehouseAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehouseAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehouseAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehouseAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := warehouseAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehousePermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WarehousePermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehousePermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehousePermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehousePermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehousePermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehousePermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehousePermission) MarshalJSON() ([]byte, error) { + pb, err := warehousePermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type WarehousePermissionLevel string +type warehousePermissionLevelPb string const WarehousePermissionLevelCanManage WarehousePermissionLevel = `CAN_MANAGE` @@ -5151,66 +9758,171 @@ func (f *WarehousePermissionLevel) Type() string { return "WarehousePermissionLevel" } +func warehousePermissionLevelToPb(st *WarehousePermissionLevel) (*warehousePermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := warehousePermissionLevelPb(*st) + return &pb, nil +} + +func warehousePermissionLevelFromPb(pb *warehousePermissionLevelPb) (*WarehousePermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := WarehousePermissionLevel(*pb) + return &st, nil +} + type WarehousePermissions struct { - AccessControlList []WarehouseAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []WarehouseAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehousePermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehousePermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehousePermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehousePermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehousePermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehousePermissions) MarshalJSON() ([]byte, error) { + pb, err := warehousePermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehousePermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WarehousePermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehousePermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehousePermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehousePermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehousePermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehousePermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehousePermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := warehousePermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehousePermissionsRequest struct { - AccessControlList []WarehouseAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []WarehouseAccessControlRequest // The SQL warehouse for which to get or manage permissions. - WarehouseId string `json:"-" url:"-"` + // Wire name: 'warehouse_id' + WarehouseId string `tf:"-"` +} + +func (st *WarehousePermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehousePermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehousePermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WarehousePermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := warehousePermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WarehouseTypePair struct { // If set to false the specific warehouse type will not be be allowed as a // value for warehouse_type in CreateWarehouse and EditWarehouse - Enabled bool `json:"enabled,omitempty"` + // Wire name: 'enabled' + Enabled bool // Warehouse type: `PRO` or `CLASSIC`. - WarehouseType WarehouseTypePairWarehouseType `json:"warehouse_type,omitempty"` + // Wire name: 'warehouse_type' + WarehouseType WarehouseTypePairWarehouseType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WarehouseTypePair) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WarehouseTypePair) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &warehouseTypePairPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := warehouseTypePairFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WarehouseTypePair) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WarehouseTypePair) MarshalJSON() ([]byte, error) { + pb, err := warehouseTypePairToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Warehouse type: `PRO` or `CLASSIC`. type WarehouseTypePairWarehouseType string +type warehouseTypePairWarehouseTypePb string const WarehouseTypePairWarehouseTypeClassic WarehouseTypePairWarehouseType = `CLASSIC` @@ -5239,82 +9951,219 @@ func (f *WarehouseTypePairWarehouseType) Type() string { return "WarehouseTypePairWarehouseType" } +func warehouseTypePairWarehouseTypeToPb(st *WarehouseTypePairWarehouseType) (*warehouseTypePairWarehouseTypePb, error) { + if st == nil { + return nil, nil + } + pb := warehouseTypePairWarehouseTypePb(*st) + return &pb, nil +} + +func warehouseTypePairWarehouseTypeFromPb(pb *warehouseTypePairWarehouseTypePb) (*WarehouseTypePairWarehouseType, error) { + if pb == nil { + return nil, nil + } + st := WarehouseTypePairWarehouseType(*pb) + return &st, nil +} + type Widget struct { // The unique ID for this widget. - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string - Options *WidgetOptions `json:"options,omitempty"` + // Wire name: 'options' + Options *WidgetOptions // The visualization description API changes frequently and is unsupported. // You can duplicate a visualization by copying description objects received // _from the API_ and then using them to create a new one with a POST // request to the same endpoint. Databricks does not recommend constructing // ad-hoc visualizations entirely in JSON. - Visualization *LegacyVisualization `json:"visualization,omitempty"` + // Wire name: 'visualization' + Visualization *LegacyVisualization // Unused field. - Width int `json:"width,omitempty"` + // Wire name: 'width' + Width int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Widget) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Widget) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &widgetPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := widgetFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Widget) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Widget) MarshalJSON() ([]byte, error) { + pb, err := widgetToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WidgetOptions struct { // Timestamp when this object was created - CreatedAt string `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt string // Custom description of the widget - Description string `json:"description,omitempty"` + // Wire name: 'description' + Description string // Whether this widget is hidden on the dashboard. - IsHidden bool `json:"isHidden,omitempty"` + // Wire name: 'isHidden' + IsHidden bool // How parameters used by the visualization in this widget relate to other // widgets on the dashboard. Databricks does not recommend modifying this // definition in JSON. - ParameterMappings any `json:"parameterMappings,omitempty"` + // Wire name: 'parameterMappings' + ParameterMappings any // Coordinates of this widget on a dashboard. This portion of the API // changes frequently and is unsupported. - Position *WidgetPosition `json:"position,omitempty"` + // Wire name: 'position' + Position *WidgetPosition // Custom title of the widget - Title string `json:"title,omitempty"` + // Wire name: 'title' + Title string // Timestamp of the last time this object was updated. - UpdatedAt string `json:"updated_at,omitempty"` + // Wire name: 'updated_at' + UpdatedAt string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WidgetOptions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WidgetOptions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &widgetOptionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := widgetOptionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WidgetOptions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WidgetOptions) MarshalJSON() ([]byte, error) { + pb, err := widgetOptionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Coordinates of this widget on a dashboard. This portion of the API changes // frequently and is unsupported. type WidgetPosition struct { // reserved for internal use - AutoHeight bool `json:"autoHeight,omitempty"` + // Wire name: 'autoHeight' + AutoHeight bool // column in the dashboard grid. Values start with 0 - Col int `json:"col,omitempty"` + // Wire name: 'col' + Col int // row in the dashboard grid. Values start with 0 - Row int `json:"row,omitempty"` + // Wire name: 'row' + Row int // width of the widget measured in dashboard grid cells - SizeX int `json:"sizeX,omitempty"` + // Wire name: 'sizeX' + SizeX int // height of the widget measured in dashboard grid cells - SizeY int `json:"sizeY,omitempty"` + // Wire name: 'sizeY' + SizeY int + + ForceSendFields []string `tf:"-"` +} + +func (st *WidgetPosition) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &widgetPositionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := widgetPositionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WidgetPosition) MarshalJSON() ([]byte, error) { + pb, err := widgetPositionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} - ForceSendFields []string `json:"-" url:"-"` +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil } -func (s *WidgetPosition) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil } -func (s WidgetPosition) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/service/vectorsearch/impl.go b/service/vectorsearch/impl.go index a11abb569..46f13a977 100755 --- a/service/vectorsearch/impl.go +++ b/service/vectorsearch/impl.go @@ -18,34 +18,96 @@ type vectorSearchEndpointsImpl struct { } func (a *vectorSearchEndpointsImpl) CreateEndpoint(ctx context.Context, request CreateEndpoint) (*EndpointInfo, error) { - var endpointInfo EndpointInfo + + requestPb, pbErr := createEndpointToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var endpointInfoPb endpointInfoPb path := "/api/2.0/vector-search/endpoints" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &endpointInfo) - return &endpointInfo, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &endpointInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := endpointInfoFromPb(&endpointInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchEndpointsImpl) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error { - var deleteEndpointResponse DeleteEndpointResponse - path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", request.EndpointName) + + requestPb, pbErr := deleteEndpointRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteEndpointResponsePb deleteEndpointResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", requestPb.EndpointName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteEndpointResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteEndpointResponsePb, + ) + if err != nil { + return err + } + return err } func (a *vectorSearchEndpointsImpl) GetEndpoint(ctx context.Context, request GetEndpointRequest) (*EndpointInfo, error) { - var endpointInfo EndpointInfo - path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", request.EndpointName) + + requestPb, pbErr := getEndpointRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var endpointInfoPb endpointInfoPb + path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", requestPb.EndpointName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &endpointInfo) - return &endpointInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &endpointInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := endpointInfoFromPb(&endpointInfoPb) + if err != nil { + return nil, err + } + + return resp, err } // List all endpoints. @@ -84,35 +146,101 @@ func (a *vectorSearchEndpointsImpl) ListEndpointsAll(ctx context.Context, reques } func (a *vectorSearchEndpointsImpl) internalListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointResponse, error) { - var listEndpointResponse ListEndpointResponse + + requestPb, pbErr := listEndpointsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listEndpointResponsePb listEndpointResponsePb path := "/api/2.0/vector-search/endpoints" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listEndpointResponse) - return &listEndpointResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listEndpointResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listEndpointResponseFromPb(&listEndpointResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchEndpointsImpl) UpdateEndpointBudgetPolicy(ctx context.Context, request PatchEndpointBudgetPolicyRequest) (*PatchEndpointBudgetPolicyResponse, error) { - var patchEndpointBudgetPolicyResponse PatchEndpointBudgetPolicyResponse - path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v/budget-policy", request.EndpointName) + + requestPb, pbErr := patchEndpointBudgetPolicyRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var patchEndpointBudgetPolicyResponsePb patchEndpointBudgetPolicyResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v/budget-policy", requestPb.EndpointName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchEndpointBudgetPolicyResponse) - return &patchEndpointBudgetPolicyResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &patchEndpointBudgetPolicyResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := patchEndpointBudgetPolicyResponseFromPb(&patchEndpointBudgetPolicyResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchEndpointsImpl) UpdateEndpointCustomTags(ctx context.Context, request UpdateEndpointCustomTagsRequest) (*UpdateEndpointCustomTagsResponse, error) { - var updateEndpointCustomTagsResponse UpdateEndpointCustomTagsResponse - path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v/tags", request.EndpointName) + + requestPb, pbErr := updateEndpointCustomTagsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var updateEndpointCustomTagsResponsePb updateEndpointCustomTagsResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v/tags", requestPb.EndpointName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateEndpointCustomTagsResponse) - return &updateEndpointCustomTagsResponse, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateEndpointCustomTagsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := updateEndpointCustomTagsResponseFromPb(&updateEndpointCustomTagsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just VectorSearchIndexes API methods @@ -121,44 +249,128 @@ type vectorSearchIndexesImpl struct { } func (a *vectorSearchIndexesImpl) CreateIndex(ctx context.Context, request CreateVectorIndexRequest) (*VectorIndex, error) { - var vectorIndex VectorIndex + + requestPb, pbErr := createVectorIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var vectorIndexPb vectorIndexPb path := "/api/2.0/vector-search/indexes" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &vectorIndex) - return &vectorIndex, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &vectorIndexPb, + ) + if err != nil { + return nil, err + } + resp, err := vectorIndexFromPb(&vectorIndexPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) DeleteDataVectorIndex(ctx context.Context, request DeleteDataVectorIndexRequest) (*DeleteDataVectorIndexResponse, error) { - var deleteDataVectorIndexResponse DeleteDataVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/delete-data", request.IndexName) + + requestPb, pbErr := deleteDataVectorIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var deleteDataVectorIndexResponsePb deleteDataVectorIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/delete-data", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDataVectorIndexResponse) - return &deleteDataVectorIndexResponse, err + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteDataVectorIndexResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := deleteDataVectorIndexResponseFromPb(&deleteDataVectorIndexResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) DeleteIndex(ctx context.Context, request DeleteIndexRequest) error { - var deleteIndexResponse DeleteIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", request.IndexName) + + requestPb, pbErr := deleteIndexRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteIndexResponsePb deleteIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteIndexResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteIndexResponsePb, + ) + if err != nil { + return err + } + return err } func (a *vectorSearchIndexesImpl) GetIndex(ctx context.Context, request GetIndexRequest) (*VectorIndex, error) { - var vectorIndex VectorIndex - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", request.IndexName) + + requestPb, pbErr := getIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var vectorIndexPb vectorIndexPb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &vectorIndex) - return &vectorIndex, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &vectorIndexPb, + ) + if err != nil { + return nil, err + } + resp, err := vectorIndexFromPb(&vectorIndexPb) + if err != nil { + return nil, err + } + + return resp, err } // List indexes. @@ -197,65 +409,193 @@ func (a *vectorSearchIndexesImpl) ListIndexesAll(ctx context.Context, request Li } func (a *vectorSearchIndexesImpl) internalListIndexes(ctx context.Context, request ListIndexesRequest) (*ListVectorIndexesResponse, error) { - var listVectorIndexesResponse ListVectorIndexesResponse + + requestPb, pbErr := listIndexesRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listVectorIndexesResponsePb listVectorIndexesResponsePb path := "/api/2.0/vector-search/indexes" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVectorIndexesResponse) - return &listVectorIndexesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listVectorIndexesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listVectorIndexesResponseFromPb(&listVectorIndexesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error) { - var queryVectorIndexResponse QueryVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query", request.IndexName) + + requestPb, pbErr := queryVectorIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryVectorIndexResponsePb queryVectorIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryVectorIndexResponse) - return &queryVectorIndexResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &queryVectorIndexResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := queryVectorIndexResponseFromPb(&queryVectorIndexResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) { - var queryVectorIndexResponse QueryVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query-next-page", request.IndexName) + + requestPb, pbErr := queryVectorIndexNextPageRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var queryVectorIndexResponsePb queryVectorIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query-next-page", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryVectorIndexResponse) - return &queryVectorIndexResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &queryVectorIndexResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := queryVectorIndexResponseFromPb(&queryVectorIndexResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) ScanIndex(ctx context.Context, request ScanVectorIndexRequest) (*ScanVectorIndexResponse, error) { - var scanVectorIndexResponse ScanVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/scan", request.IndexName) + + requestPb, pbErr := scanVectorIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var scanVectorIndexResponsePb scanVectorIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/scan", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &scanVectorIndexResponse) - return &scanVectorIndexResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &scanVectorIndexResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := scanVectorIndexResponseFromPb(&scanVectorIndexResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *vectorSearchIndexesImpl) SyncIndex(ctx context.Context, request SyncIndexRequest) error { - var syncIndexResponse SyncIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/sync", request.IndexName) + + requestPb, pbErr := syncIndexRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var syncIndexResponsePb syncIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/sync", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &syncIndexResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + nil, + &syncIndexResponsePb, + ) + if err != nil { + return err + } + return err } func (a *vectorSearchIndexesImpl) UpsertDataVectorIndex(ctx context.Context, request UpsertDataVectorIndexRequest) (*UpsertDataVectorIndexResponse, error) { - var upsertDataVectorIndexResponse UpsertDataVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/upsert-data", request.IndexName) + + requestPb, pbErr := upsertDataVectorIndexRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var upsertDataVectorIndexResponsePb upsertDataVectorIndexResponsePb + path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/upsert-data", requestPb.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &upsertDataVectorIndexResponse) - return &upsertDataVectorIndexResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &upsertDataVectorIndexResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := upsertDataVectorIndexResponseFromPb(&upsertDataVectorIndexResponsePb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/vectorsearch/internal.go b/service/vectorsearch/internal.go new file mode 100755 index 000000000..10492d1a2 --- /dev/null +++ b/service/vectorsearch/internal.go @@ -0,0 +1,1891 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package vectorsearch + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &columnInfoPb{} + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type columnInfoPb struct { + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func columnInfoFromPb(pb *columnInfoPb) (*ColumnInfo, error) { + if pb == nil { + return nil, nil + } + st := &ColumnInfo{} + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *columnInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st columnInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createEndpointToPb(st *CreateEndpoint) (*createEndpointPb, error) { + if st == nil { + return nil, nil + } + pb := &createEndpointPb{} + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.EndpointType = st.EndpointType + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createEndpointPb struct { + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + + EndpointType EndpointType `json:"endpoint_type"` + + Name string `json:"name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createEndpointFromPb(pb *createEndpointPb) (*CreateEndpoint, error) { + if pb == nil { + return nil, nil + } + st := &CreateEndpoint{} + st.BudgetPolicyId = pb.BudgetPolicyId + st.EndpointType = pb.EndpointType + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createEndpointPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createEndpointPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createVectorIndexRequestToPb(st *CreateVectorIndexRequest) (*createVectorIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createVectorIndexRequestPb{} + pb.DeltaSyncIndexSpec = st.DeltaSyncIndexSpec + + pb.DirectAccessIndexSpec = st.DirectAccessIndexSpec + + pb.EndpointName = st.EndpointName + + pb.IndexType = st.IndexType + + pb.Name = st.Name + + pb.PrimaryKey = st.PrimaryKey + + return pb, nil +} + +type createVectorIndexRequestPb struct { + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest `json:"delta_sync_index_spec,omitempty"` + + DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + + EndpointName string `json:"endpoint_name"` + + IndexType VectorIndexType `json:"index_type"` + + Name string `json:"name"` + + PrimaryKey string `json:"primary_key"` +} + +func createVectorIndexRequestFromPb(pb *createVectorIndexRequestPb) (*CreateVectorIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateVectorIndexRequest{} + st.DeltaSyncIndexSpec = pb.DeltaSyncIndexSpec + st.DirectAccessIndexSpec = pb.DirectAccessIndexSpec + st.EndpointName = pb.EndpointName + st.IndexType = pb.IndexType + st.Name = pb.Name + st.PrimaryKey = pb.PrimaryKey + + return st, nil +} + +func customTagToPb(st *CustomTag) (*customTagPb, error) { + if st == nil { + return nil, nil + } + pb := &customTagPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type customTagPb struct { + Key string `json:"key"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func customTagFromPb(pb *customTagPb) (*CustomTag, error) { + if pb == nil { + return nil, nil + } + st := &CustomTag{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *customTagPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st customTagPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDataResultToPb(st *DeleteDataResult) (*deleteDataResultPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDataResultPb{} + pb.FailedPrimaryKeys = st.FailedPrimaryKeys + + pb.SuccessRowCount = st.SuccessRowCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deleteDataResultPb struct { + FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` + + SuccessRowCount int64 `json:"success_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteDataResultFromPb(pb *deleteDataResultPb) (*DeleteDataResult, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDataResult{} + st.FailedPrimaryKeys = pb.FailedPrimaryKeys + st.SuccessRowCount = pb.SuccessRowCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deleteDataResultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deleteDataResultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteDataVectorIndexRequestToPb(st *DeleteDataVectorIndexRequest) (*deleteDataVectorIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDataVectorIndexRequestPb{} + pb.IndexName = st.IndexName + + pb.PrimaryKeys = st.PrimaryKeys + + return pb, nil +} + +type deleteDataVectorIndexRequestPb struct { + IndexName string `json:"-" url:"-"` + + PrimaryKeys []string `json:"-" url:"primary_keys"` +} + +func deleteDataVectorIndexRequestFromPb(pb *deleteDataVectorIndexRequestPb) (*DeleteDataVectorIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDataVectorIndexRequest{} + st.IndexName = pb.IndexName + st.PrimaryKeys = pb.PrimaryKeys + + return st, nil +} + +func deleteDataVectorIndexResponseToPb(st *DeleteDataVectorIndexResponse) (*deleteDataVectorIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteDataVectorIndexResponsePb{} + pb.Result = st.Result + + pb.Status = st.Status + + return pb, nil +} + +type deleteDataVectorIndexResponsePb struct { + Result *DeleteDataResult `json:"result,omitempty"` + + Status DeleteDataStatus `json:"status,omitempty"` +} + +func deleteDataVectorIndexResponseFromPb(pb *deleteDataVectorIndexResponsePb) (*DeleteDataVectorIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteDataVectorIndexResponse{} + st.Result = pb.Result + st.Status = pb.Status + + return st, nil +} + +func deleteEndpointRequestToPb(st *DeleteEndpointRequest) (*deleteEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteEndpointRequestPb{} + pb.EndpointName = st.EndpointName + + return pb, nil +} + +type deleteEndpointRequestPb struct { + EndpointName string `json:"-" url:"-"` +} + +func deleteEndpointRequestFromPb(pb *deleteEndpointRequestPb) (*DeleteEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteEndpointRequest{} + st.EndpointName = pb.EndpointName + + return st, nil +} + +func deleteEndpointResponseToPb(st *DeleteEndpointResponse) (*deleteEndpointResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteEndpointResponsePb{} + + return pb, nil +} + +type deleteEndpointResponsePb struct { +} + +func deleteEndpointResponseFromPb(pb *deleteEndpointResponsePb) (*DeleteEndpointResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteEndpointResponse{} + + return st, nil +} + +func deleteIndexRequestToPb(st *DeleteIndexRequest) (*deleteIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteIndexRequestPb{} + pb.IndexName = st.IndexName + + return pb, nil +} + +type deleteIndexRequestPb struct { + IndexName string `json:"-" url:"-"` +} + +func deleteIndexRequestFromPb(pb *deleteIndexRequestPb) (*DeleteIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteIndexRequest{} + st.IndexName = pb.IndexName + + return st, nil +} + +func deleteIndexResponseToPb(st *DeleteIndexResponse) (*deleteIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteIndexResponsePb{} + + return pb, nil +} + +type deleteIndexResponsePb struct { +} + +func deleteIndexResponseFromPb(pb *deleteIndexResponsePb) (*DeleteIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteIndexResponse{} + + return st, nil +} + +func deltaSyncVectorIndexSpecRequestToPb(st *DeltaSyncVectorIndexSpecRequest) (*deltaSyncVectorIndexSpecRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSyncVectorIndexSpecRequestPb{} + pb.ColumnsToSync = st.ColumnsToSync + + pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns + + pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns + + pb.EmbeddingWritebackTable = st.EmbeddingWritebackTable + + pb.PipelineType = st.PipelineType + + pb.SourceTable = st.SourceTable + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deltaSyncVectorIndexSpecRequestPb struct { + ColumnsToSync []string `json:"columns_to_sync,omitempty"` + + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + + EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + + PipelineType PipelineType `json:"pipeline_type,omitempty"` + + SourceTable string `json:"source_table,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deltaSyncVectorIndexSpecRequestFromPb(pb *deltaSyncVectorIndexSpecRequestPb) (*DeltaSyncVectorIndexSpecRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSyncVectorIndexSpecRequest{} + st.ColumnsToSync = pb.ColumnsToSync + st.EmbeddingSourceColumns = pb.EmbeddingSourceColumns + st.EmbeddingVectorColumns = pb.EmbeddingVectorColumns + st.EmbeddingWritebackTable = pb.EmbeddingWritebackTable + st.PipelineType = pb.PipelineType + st.SourceTable = pb.SourceTable + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deltaSyncVectorIndexSpecRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deltaSyncVectorIndexSpecRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deltaSyncVectorIndexSpecResponseToPb(st *DeltaSyncVectorIndexSpecResponse) (*deltaSyncVectorIndexSpecResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deltaSyncVectorIndexSpecResponsePb{} + pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns + + pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns + + pb.EmbeddingWritebackTable = st.EmbeddingWritebackTable + + pb.PipelineId = st.PipelineId + + pb.PipelineType = st.PipelineType + + pb.SourceTable = st.SourceTable + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deltaSyncVectorIndexSpecResponsePb struct { + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + + EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + + PipelineId string `json:"pipeline_id,omitempty"` + + PipelineType PipelineType `json:"pipeline_type,omitempty"` + + SourceTable string `json:"source_table,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deltaSyncVectorIndexSpecResponseFromPb(pb *deltaSyncVectorIndexSpecResponsePb) (*DeltaSyncVectorIndexSpecResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeltaSyncVectorIndexSpecResponse{} + st.EmbeddingSourceColumns = pb.EmbeddingSourceColumns + st.EmbeddingVectorColumns = pb.EmbeddingVectorColumns + st.EmbeddingWritebackTable = pb.EmbeddingWritebackTable + st.PipelineId = pb.PipelineId + st.PipelineType = pb.PipelineType + st.SourceTable = pb.SourceTable + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deltaSyncVectorIndexSpecResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deltaSyncVectorIndexSpecResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func directAccessVectorIndexSpecToPb(st *DirectAccessVectorIndexSpec) (*directAccessVectorIndexSpecPb, error) { + if st == nil { + return nil, nil + } + pb := &directAccessVectorIndexSpecPb{} + pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns + + pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns + + pb.SchemaJson = st.SchemaJson + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type directAccessVectorIndexSpecPb struct { + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + + SchemaJson string `json:"schema_json,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func directAccessVectorIndexSpecFromPb(pb *directAccessVectorIndexSpecPb) (*DirectAccessVectorIndexSpec, error) { + if pb == nil { + return nil, nil + } + st := &DirectAccessVectorIndexSpec{} + st.EmbeddingSourceColumns = pb.EmbeddingSourceColumns + st.EmbeddingVectorColumns = pb.EmbeddingVectorColumns + st.SchemaJson = pb.SchemaJson + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *directAccessVectorIndexSpecPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st directAccessVectorIndexSpecPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func embeddingSourceColumnToPb(st *EmbeddingSourceColumn) (*embeddingSourceColumnPb, error) { + if st == nil { + return nil, nil + } + pb := &embeddingSourceColumnPb{} + pb.EmbeddingModelEndpointName = st.EmbeddingModelEndpointName + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type embeddingSourceColumnPb struct { + EmbeddingModelEndpointName string `json:"embedding_model_endpoint_name,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func embeddingSourceColumnFromPb(pb *embeddingSourceColumnPb) (*EmbeddingSourceColumn, error) { + if pb == nil { + return nil, nil + } + st := &EmbeddingSourceColumn{} + st.EmbeddingModelEndpointName = pb.EmbeddingModelEndpointName + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *embeddingSourceColumnPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st embeddingSourceColumnPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func embeddingVectorColumnToPb(st *EmbeddingVectorColumn) (*embeddingVectorColumnPb, error) { + if st == nil { + return nil, nil + } + pb := &embeddingVectorColumnPb{} + pb.EmbeddingDimension = st.EmbeddingDimension + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type embeddingVectorColumnPb struct { + EmbeddingDimension int `json:"embedding_dimension,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func embeddingVectorColumnFromPb(pb *embeddingVectorColumnPb) (*EmbeddingVectorColumn, error) { + if pb == nil { + return nil, nil + } + st := &EmbeddingVectorColumn{} + st.EmbeddingDimension = pb.EmbeddingDimension + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *embeddingVectorColumnPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st embeddingVectorColumnPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointInfoPb{} + pb.CreationTimestamp = st.CreationTimestamp + + pb.Creator = st.Creator + + pb.CustomTags = st.CustomTags + + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.EndpointStatus = st.EndpointStatus + + pb.EndpointType = st.EndpointType + + pb.Id = st.Id + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.LastUpdatedUser = st.LastUpdatedUser + + pb.Name = st.Name + + pb.NumIndexes = st.NumIndexes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointInfoPb struct { + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + + Creator string `json:"creator,omitempty"` + + CustomTags []CustomTag `json:"custom_tags,omitempty"` + + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"` + + EndpointType EndpointType `json:"endpoint_type,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + LastUpdatedUser string `json:"last_updated_user,omitempty"` + + Name string `json:"name,omitempty"` + + NumIndexes int `json:"num_indexes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointInfoFromPb(pb *endpointInfoPb) (*EndpointInfo, error) { + if pb == nil { + return nil, nil + } + st := &EndpointInfo{} + st.CreationTimestamp = pb.CreationTimestamp + st.Creator = pb.Creator + st.CustomTags = pb.CustomTags + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + st.EndpointStatus = pb.EndpointStatus + st.EndpointType = pb.EndpointType + st.Id = pb.Id + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + st.LastUpdatedUser = pb.LastUpdatedUser + st.Name = pb.Name + st.NumIndexes = pb.NumIndexes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func endpointStatusToPb(st *EndpointStatus) (*endpointStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &endpointStatusPb{} + pb.Message = st.Message + + pb.State = st.State + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type endpointStatusPb struct { + Message string `json:"message,omitempty"` + + State EndpointStatusState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func endpointStatusFromPb(pb *endpointStatusPb) (*EndpointStatus, error) { + if pb == nil { + return nil, nil + } + st := &EndpointStatus{} + st.Message = pb.Message + st.State = pb.State + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *endpointStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st endpointStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getEndpointRequestToPb(st *GetEndpointRequest) (*getEndpointRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getEndpointRequestPb{} + pb.EndpointName = st.EndpointName + + return pb, nil +} + +type getEndpointRequestPb struct { + EndpointName string `json:"-" url:"-"` +} + +func getEndpointRequestFromPb(pb *getEndpointRequestPb) (*GetEndpointRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetEndpointRequest{} + st.EndpointName = pb.EndpointName + + return st, nil +} + +func getIndexRequestToPb(st *GetIndexRequest) (*getIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getIndexRequestPb{} + pb.IndexName = st.IndexName + + return pb, nil +} + +type getIndexRequestPb struct { + IndexName string `json:"-" url:"-"` +} + +func getIndexRequestFromPb(pb *getIndexRequestPb) (*GetIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetIndexRequest{} + st.IndexName = pb.IndexName + + return st, nil +} + +func listEndpointResponseToPb(st *ListEndpointResponse) (*listEndpointResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listEndpointResponsePb{} + pb.Endpoints = st.Endpoints + + pb.NextPageToken = st.NextPageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listEndpointResponsePb struct { + Endpoints []EndpointInfo `json:"endpoints,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listEndpointResponseFromPb(pb *listEndpointResponsePb) (*ListEndpointResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListEndpointResponse{} + st.Endpoints = pb.Endpoints + st.NextPageToken = pb.NextPageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listEndpointResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listEndpointResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listEndpointsRequestToPb(st *ListEndpointsRequest) (*listEndpointsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listEndpointsRequestPb{} + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listEndpointsRequestPb struct { + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listEndpointsRequestFromPb(pb *listEndpointsRequestPb) (*ListEndpointsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListEndpointsRequest{} + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listEndpointsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listEndpointsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listIndexesRequestToPb(st *ListIndexesRequest) (*listIndexesRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listIndexesRequestPb{} + pb.EndpointName = st.EndpointName + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listIndexesRequestPb struct { + EndpointName string `json:"-" url:"endpoint_name"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listIndexesRequestFromPb(pb *listIndexesRequestPb) (*ListIndexesRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListIndexesRequest{} + st.EndpointName = pb.EndpointName + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listIndexesRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listIndexesRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listValueToPb(st *ListValue) (*listValuePb, error) { + if st == nil { + return nil, nil + } + pb := &listValuePb{} + pb.Values = st.Values + + return pb, nil +} + +type listValuePb struct { + Values []Value `json:"values,omitempty"` +} + +func listValueFromPb(pb *listValuePb) (*ListValue, error) { + if pb == nil { + return nil, nil + } + st := &ListValue{} + st.Values = pb.Values + + return st, nil +} + +func listVectorIndexesResponseToPb(st *ListVectorIndexesResponse) (*listVectorIndexesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listVectorIndexesResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.VectorIndexes = st.VectorIndexes + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listVectorIndexesResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + VectorIndexes []MiniVectorIndex `json:"vector_indexes,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listVectorIndexesResponseFromPb(pb *listVectorIndexesResponsePb) (*ListVectorIndexesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListVectorIndexesResponse{} + st.NextPageToken = pb.NextPageToken + st.VectorIndexes = pb.VectorIndexes + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listVectorIndexesResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listVectorIndexesResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func mapStringValueEntryToPb(st *MapStringValueEntry) (*mapStringValueEntryPb, error) { + if st == nil { + return nil, nil + } + pb := &mapStringValueEntryPb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type mapStringValueEntryPb struct { + Key string `json:"key,omitempty"` + + Value *Value `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func mapStringValueEntryFromPb(pb *mapStringValueEntryPb) (*MapStringValueEntry, error) { + if pb == nil { + return nil, nil + } + st := &MapStringValueEntry{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *mapStringValueEntryPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st mapStringValueEntryPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func miniVectorIndexToPb(st *MiniVectorIndex) (*miniVectorIndexPb, error) { + if st == nil { + return nil, nil + } + pb := &miniVectorIndexPb{} + pb.Creator = st.Creator + + pb.EndpointName = st.EndpointName + + pb.IndexType = st.IndexType + + pb.Name = st.Name + + pb.PrimaryKey = st.PrimaryKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type miniVectorIndexPb struct { + Creator string `json:"creator,omitempty"` + + EndpointName string `json:"endpoint_name,omitempty"` + + IndexType VectorIndexType `json:"index_type,omitempty"` + + Name string `json:"name,omitempty"` + + PrimaryKey string `json:"primary_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func miniVectorIndexFromPb(pb *miniVectorIndexPb) (*MiniVectorIndex, error) { + if pb == nil { + return nil, nil + } + st := &MiniVectorIndex{} + st.Creator = pb.Creator + st.EndpointName = pb.EndpointName + st.IndexType = pb.IndexType + st.Name = pb.Name + st.PrimaryKey = pb.PrimaryKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *miniVectorIndexPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st miniVectorIndexPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func patchEndpointBudgetPolicyRequestToPb(st *PatchEndpointBudgetPolicyRequest) (*patchEndpointBudgetPolicyRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &patchEndpointBudgetPolicyRequestPb{} + pb.BudgetPolicyId = st.BudgetPolicyId + + pb.EndpointName = st.EndpointName + + return pb, nil +} + +type patchEndpointBudgetPolicyRequestPb struct { + BudgetPolicyId string `json:"budget_policy_id"` + + EndpointName string `json:"-" url:"-"` +} + +func patchEndpointBudgetPolicyRequestFromPb(pb *patchEndpointBudgetPolicyRequestPb) (*PatchEndpointBudgetPolicyRequest, error) { + if pb == nil { + return nil, nil + } + st := &PatchEndpointBudgetPolicyRequest{} + st.BudgetPolicyId = pb.BudgetPolicyId + st.EndpointName = pb.EndpointName + + return st, nil +} + +func patchEndpointBudgetPolicyResponseToPb(st *PatchEndpointBudgetPolicyResponse) (*patchEndpointBudgetPolicyResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &patchEndpointBudgetPolicyResponsePb{} + pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type patchEndpointBudgetPolicyResponsePb struct { + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func patchEndpointBudgetPolicyResponseFromPb(pb *patchEndpointBudgetPolicyResponsePb) (*PatchEndpointBudgetPolicyResponse, error) { + if pb == nil { + return nil, nil + } + st := &PatchEndpointBudgetPolicyResponse{} + st.EffectiveBudgetPolicyId = pb.EffectiveBudgetPolicyId + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *patchEndpointBudgetPolicyResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st patchEndpointBudgetPolicyResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryVectorIndexNextPageRequestToPb(st *QueryVectorIndexNextPageRequest) (*queryVectorIndexNextPageRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &queryVectorIndexNextPageRequestPb{} + pb.EndpointName = st.EndpointName + + pb.IndexName = st.IndexName + + pb.PageToken = st.PageToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryVectorIndexNextPageRequestPb struct { + EndpointName string `json:"endpoint_name,omitempty"` + + IndexName string `json:"-" url:"-"` + + PageToken string `json:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryVectorIndexNextPageRequestFromPb(pb *queryVectorIndexNextPageRequestPb) (*QueryVectorIndexNextPageRequest, error) { + if pb == nil { + return nil, nil + } + st := &QueryVectorIndexNextPageRequest{} + st.EndpointName = pb.EndpointName + st.IndexName = pb.IndexName + st.PageToken = pb.PageToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryVectorIndexNextPageRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryVectorIndexNextPageRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryVectorIndexRequestToPb(st *QueryVectorIndexRequest) (*queryVectorIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &queryVectorIndexRequestPb{} + pb.Columns = st.Columns + + pb.ColumnsToRerank = st.ColumnsToRerank + + pb.FiltersJson = st.FiltersJson + + pb.IndexName = st.IndexName + + pb.NumResults = st.NumResults + + pb.QueryText = st.QueryText + + pb.QueryType = st.QueryType + + pb.QueryVector = st.QueryVector + + pb.ScoreThreshold = st.ScoreThreshold + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryVectorIndexRequestPb struct { + Columns []string `json:"columns"` + + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` + + FiltersJson string `json:"filters_json,omitempty"` + + IndexName string `json:"-" url:"-"` + + NumResults int `json:"num_results,omitempty"` + + QueryText string `json:"query_text,omitempty"` + + QueryType string `json:"query_type,omitempty"` + + QueryVector []float64 `json:"query_vector,omitempty"` + + ScoreThreshold float64 `json:"score_threshold,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryVectorIndexRequestFromPb(pb *queryVectorIndexRequestPb) (*QueryVectorIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &QueryVectorIndexRequest{} + st.Columns = pb.Columns + st.ColumnsToRerank = pb.ColumnsToRerank + st.FiltersJson = pb.FiltersJson + st.IndexName = pb.IndexName + st.NumResults = pb.NumResults + st.QueryText = pb.QueryText + st.QueryType = pb.QueryType + st.QueryVector = pb.QueryVector + st.ScoreThreshold = pb.ScoreThreshold + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryVectorIndexRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryVectorIndexRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func queryVectorIndexResponseToPb(st *QueryVectorIndexResponse) (*queryVectorIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &queryVectorIndexResponsePb{} + pb.Manifest = st.Manifest + + pb.NextPageToken = st.NextPageToken + + pb.Result = st.Result + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type queryVectorIndexResponsePb struct { + Manifest *ResultManifest `json:"manifest,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + Result *ResultData `json:"result,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func queryVectorIndexResponseFromPb(pb *queryVectorIndexResponsePb) (*QueryVectorIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &QueryVectorIndexResponse{} + st.Manifest = pb.Manifest + st.NextPageToken = pb.NextPageToken + st.Result = pb.Result + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *queryVectorIndexResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st queryVectorIndexResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resultDataToPb(st *ResultData) (*resultDataPb, error) { + if st == nil { + return nil, nil + } + pb := &resultDataPb{} + pb.DataArray = st.DataArray + + pb.RowCount = st.RowCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultDataPb struct { + DataArray [][]string `json:"data_array,omitempty"` + + RowCount int `json:"row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultDataFromPb(pb *resultDataPb) (*ResultData, error) { + if pb == nil { + return nil, nil + } + st := &ResultData{} + st.DataArray = pb.DataArray + st.RowCount = pb.RowCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultDataPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultDataPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { + if st == nil { + return nil, nil + } + pb := &resultManifestPb{} + pb.ColumnCount = st.ColumnCount + + pb.Columns = st.Columns + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type resultManifestPb struct { + ColumnCount int `json:"column_count,omitempty"` + + Columns []ColumnInfo `json:"columns,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func resultManifestFromPb(pb *resultManifestPb) (*ResultManifest, error) { + if pb == nil { + return nil, nil + } + st := &ResultManifest{} + st.ColumnCount = pb.ColumnCount + st.Columns = pb.Columns + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *resultManifestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st resultManifestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func scanVectorIndexRequestToPb(st *ScanVectorIndexRequest) (*scanVectorIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &scanVectorIndexRequestPb{} + pb.IndexName = st.IndexName + + pb.LastPrimaryKey = st.LastPrimaryKey + + pb.NumResults = st.NumResults + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type scanVectorIndexRequestPb struct { + IndexName string `json:"-" url:"-"` + + LastPrimaryKey string `json:"last_primary_key,omitempty"` + + NumResults int `json:"num_results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func scanVectorIndexRequestFromPb(pb *scanVectorIndexRequestPb) (*ScanVectorIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &ScanVectorIndexRequest{} + st.IndexName = pb.IndexName + st.LastPrimaryKey = pb.LastPrimaryKey + st.NumResults = pb.NumResults + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *scanVectorIndexRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st scanVectorIndexRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func scanVectorIndexResponseToPb(st *ScanVectorIndexResponse) (*scanVectorIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &scanVectorIndexResponsePb{} + pb.Data = st.Data + + pb.LastPrimaryKey = st.LastPrimaryKey + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type scanVectorIndexResponsePb struct { + Data []Struct `json:"data,omitempty"` + + LastPrimaryKey string `json:"last_primary_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func scanVectorIndexResponseFromPb(pb *scanVectorIndexResponsePb) (*ScanVectorIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &ScanVectorIndexResponse{} + st.Data = pb.Data + st.LastPrimaryKey = pb.LastPrimaryKey + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *scanVectorIndexResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st scanVectorIndexResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func structToPb(st *Struct) (*structPb, error) { + if st == nil { + return nil, nil + } + pb := &structPb{} + pb.Fields = st.Fields + + return pb, nil +} + +type structPb struct { + Fields []MapStringValueEntry `json:"fields,omitempty"` +} + +func structFromPb(pb *structPb) (*Struct, error) { + if pb == nil { + return nil, nil + } + st := &Struct{} + st.Fields = pb.Fields + + return st, nil +} + +func syncIndexRequestToPb(st *SyncIndexRequest) (*syncIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &syncIndexRequestPb{} + pb.IndexName = st.IndexName + + return pb, nil +} + +type syncIndexRequestPb struct { + IndexName string `json:"-" url:"-"` +} + +func syncIndexRequestFromPb(pb *syncIndexRequestPb) (*SyncIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &SyncIndexRequest{} + st.IndexName = pb.IndexName + + return st, nil +} + +func syncIndexResponseToPb(st *SyncIndexResponse) (*syncIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &syncIndexResponsePb{} + + return pb, nil +} + +type syncIndexResponsePb struct { +} + +func syncIndexResponseFromPb(pb *syncIndexResponsePb) (*SyncIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &SyncIndexResponse{} + + return st, nil +} + +func updateEndpointCustomTagsRequestToPb(st *UpdateEndpointCustomTagsRequest) (*updateEndpointCustomTagsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateEndpointCustomTagsRequestPb{} + pb.CustomTags = st.CustomTags + + pb.EndpointName = st.EndpointName + + return pb, nil +} + +type updateEndpointCustomTagsRequestPb struct { + CustomTags []CustomTag `json:"custom_tags"` + + EndpointName string `json:"-" url:"-"` +} + +func updateEndpointCustomTagsRequestFromPb(pb *updateEndpointCustomTagsRequestPb) (*UpdateEndpointCustomTagsRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEndpointCustomTagsRequest{} + st.CustomTags = pb.CustomTags + st.EndpointName = pb.EndpointName + + return st, nil +} + +func updateEndpointCustomTagsResponseToPb(st *UpdateEndpointCustomTagsResponse) (*updateEndpointCustomTagsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateEndpointCustomTagsResponsePb{} + pb.CustomTags = st.CustomTags + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateEndpointCustomTagsResponsePb struct { + CustomTags []CustomTag `json:"custom_tags,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateEndpointCustomTagsResponseFromPb(pb *updateEndpointCustomTagsResponsePb) (*UpdateEndpointCustomTagsResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateEndpointCustomTagsResponse{} + st.CustomTags = pb.CustomTags + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateEndpointCustomTagsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateEndpointCustomTagsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func upsertDataResultToPb(st *UpsertDataResult) (*upsertDataResultPb, error) { + if st == nil { + return nil, nil + } + pb := &upsertDataResultPb{} + pb.FailedPrimaryKeys = st.FailedPrimaryKeys + + pb.SuccessRowCount = st.SuccessRowCount + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type upsertDataResultPb struct { + FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` + + SuccessRowCount int64 `json:"success_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func upsertDataResultFromPb(pb *upsertDataResultPb) (*UpsertDataResult, error) { + if pb == nil { + return nil, nil + } + st := &UpsertDataResult{} + st.FailedPrimaryKeys = pb.FailedPrimaryKeys + st.SuccessRowCount = pb.SuccessRowCount + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *upsertDataResultPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st upsertDataResultPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func upsertDataVectorIndexRequestToPb(st *UpsertDataVectorIndexRequest) (*upsertDataVectorIndexRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &upsertDataVectorIndexRequestPb{} + pb.IndexName = st.IndexName + + pb.InputsJson = st.InputsJson + + return pb, nil +} + +type upsertDataVectorIndexRequestPb struct { + IndexName string `json:"-" url:"-"` + + InputsJson string `json:"inputs_json"` +} + +func upsertDataVectorIndexRequestFromPb(pb *upsertDataVectorIndexRequestPb) (*UpsertDataVectorIndexRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpsertDataVectorIndexRequest{} + st.IndexName = pb.IndexName + st.InputsJson = pb.InputsJson + + return st, nil +} + +func upsertDataVectorIndexResponseToPb(st *UpsertDataVectorIndexResponse) (*upsertDataVectorIndexResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &upsertDataVectorIndexResponsePb{} + pb.Result = st.Result + + pb.Status = st.Status + + return pb, nil +} + +type upsertDataVectorIndexResponsePb struct { + Result *UpsertDataResult `json:"result,omitempty"` + + Status UpsertDataStatus `json:"status,omitempty"` +} + +func upsertDataVectorIndexResponseFromPb(pb *upsertDataVectorIndexResponsePb) (*UpsertDataVectorIndexResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpsertDataVectorIndexResponse{} + st.Result = pb.Result + st.Status = pb.Status + + return st, nil +} + +func valueToPb(st *Value) (*valuePb, error) { + if st == nil { + return nil, nil + } + pb := &valuePb{} + pb.BoolValue = st.BoolValue + + pb.ListValue = st.ListValue + + pb.NumberValue = st.NumberValue + + pb.StringValue = st.StringValue + + pb.StructValue = st.StructValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type valuePb struct { + BoolValue bool `json:"bool_value,omitempty"` + + ListValue *ListValue `json:"list_value,omitempty"` + + NumberValue float64 `json:"number_value,omitempty"` + + StringValue string `json:"string_value,omitempty"` + + StructValue *Struct `json:"struct_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func valueFromPb(pb *valuePb) (*Value, error) { + if pb == nil { + return nil, nil + } + st := &Value{} + st.BoolValue = pb.BoolValue + st.ListValue = pb.ListValue + st.NumberValue = pb.NumberValue + st.StringValue = pb.StringValue + st.StructValue = pb.StructValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *valuePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st valuePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func vectorIndexToPb(st *VectorIndex) (*vectorIndexPb, error) { + if st == nil { + return nil, nil + } + pb := &vectorIndexPb{} + pb.Creator = st.Creator + + pb.DeltaSyncIndexSpec = st.DeltaSyncIndexSpec + + pb.DirectAccessIndexSpec = st.DirectAccessIndexSpec + + pb.EndpointName = st.EndpointName + + pb.IndexType = st.IndexType + + pb.Name = st.Name + + pb.PrimaryKey = st.PrimaryKey + + pb.Status = st.Status + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type vectorIndexPb struct { + Creator string `json:"creator,omitempty"` + + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse `json:"delta_sync_index_spec,omitempty"` + + DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + + EndpointName string `json:"endpoint_name,omitempty"` + + IndexType VectorIndexType `json:"index_type,omitempty"` + + Name string `json:"name,omitempty"` + + PrimaryKey string `json:"primary_key,omitempty"` + + Status *VectorIndexStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func vectorIndexFromPb(pb *vectorIndexPb) (*VectorIndex, error) { + if pb == nil { + return nil, nil + } + st := &VectorIndex{} + st.Creator = pb.Creator + st.DeltaSyncIndexSpec = pb.DeltaSyncIndexSpec + st.DirectAccessIndexSpec = pb.DirectAccessIndexSpec + st.EndpointName = pb.EndpointName + st.IndexType = pb.IndexType + st.Name = pb.Name + st.PrimaryKey = pb.PrimaryKey + st.Status = pb.Status + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *vectorIndexPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st vectorIndexPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func vectorIndexStatusToPb(st *VectorIndexStatus) (*vectorIndexStatusPb, error) { + if st == nil { + return nil, nil + } + pb := &vectorIndexStatusPb{} + pb.IndexUrl = st.IndexUrl + + pb.IndexedRowCount = st.IndexedRowCount + + pb.Message = st.Message + + pb.Ready = st.Ready + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type vectorIndexStatusPb struct { + IndexUrl string `json:"index_url,omitempty"` + + IndexedRowCount int64 `json:"indexed_row_count,omitempty"` + + Message string `json:"message,omitempty"` + + Ready bool `json:"ready,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func vectorIndexStatusFromPb(pb *vectorIndexStatusPb) (*VectorIndexStatus, error) { + if pb == nil { + return nil, nil + } + st := &VectorIndexStatus{} + st.IndexUrl = pb.IndexUrl + st.IndexedRowCount = pb.IndexedRowCount + st.Message = pb.Message + st.Ready = pb.Ready + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *vectorIndexStatusPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st vectorIndexStatusPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 868b235e8..3c709cdb4 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -3,102 +3,211 @@ package vectorsearch import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type ColumnInfo struct { // Name of the column. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ColumnInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ColumnInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &columnInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := columnInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ColumnInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ColumnInfo) MarshalJSON() ([]byte, error) { + pb, err := columnInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateEndpoint struct { // The budget policy id to be applied - BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // Type of endpoint - EndpointType EndpointType `json:"endpoint_type"` + // Wire name: 'endpoint_type' + EndpointType EndpointType // Name of the vector search endpoint - Name string `json:"name"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateEndpoint) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateEndpoint) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createEndpointPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createEndpointFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateEndpoint) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateEndpoint) MarshalJSON() ([]byte, error) { + pb, err := createEndpointToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateVectorIndexRequest struct { // Specification for Delta Sync Index. Required if `index_type` is // `DELTA_SYNC`. - DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest `json:"delta_sync_index_spec,omitempty"` + // Wire name: 'delta_sync_index_spec' + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest // Specification for Direct Vector Access Index. Required if `index_type` is // `DIRECT_ACCESS`. - DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + // Wire name: 'direct_access_index_spec' + DirectAccessIndexSpec *DirectAccessVectorIndexSpec // Name of the endpoint to be used for serving the index - EndpointName string `json:"endpoint_name"` + // Wire name: 'endpoint_name' + EndpointName string // There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that // automatically syncs with a source Delta Table, automatically and // incrementally updating the index as the underlying data in the Delta // Table changes. - `DIRECT_ACCESS`: An index that supports direct read and // write of vectors and metadata through our REST and SDK APIs. With this // model, the user manages index updates. - IndexType VectorIndexType `json:"index_type"` + // Wire name: 'index_type' + IndexType VectorIndexType // Name of the index - Name string `json:"name"` + // Wire name: 'name' + Name string // Primary key of the index - PrimaryKey string `json:"primary_key"` + // Wire name: 'primary_key' + PrimaryKey string +} + +func (st *CreateVectorIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createVectorIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createVectorIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateVectorIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := createVectorIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CustomTag struct { // Key field for a vector search endpoint tag. - Key string `json:"key"` + // Wire name: 'key' + Key string // [Optional] Value field for a vector search endpoint tag. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CustomTag) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CustomTag) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &customTagPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := customTagFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CustomTag) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CustomTag) MarshalJSON() ([]byte, error) { + pb, err := customTagToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDataResult struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` + // Wire name: 'failed_primary_keys' + FailedPrimaryKeys []string // Count of successfully processed rows. - SuccessRowCount int64 `json:"success_row_count,omitempty"` + // Wire name: 'success_row_count' + SuccessRowCount int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeleteDataResult) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeleteDataResult) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDataResultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDataResultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeleteDataResult) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeleteDataResult) MarshalJSON() ([]byte, error) { + pb, err := deleteDataResultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDataStatus string +type deleteDataStatusPb string const DeleteDataStatusFailure DeleteDataStatus = `FAILURE` @@ -127,53 +236,229 @@ func (f *DeleteDataStatus) Type() string { return "DeleteDataStatus" } +func deleteDataStatusToPb(st *DeleteDataStatus) (*deleteDataStatusPb, error) { + if st == nil { + return nil, nil + } + pb := deleteDataStatusPb(*st) + return &pb, nil +} + +func deleteDataStatusFromPb(pb *deleteDataStatusPb) (*DeleteDataStatus, error) { + if pb == nil { + return nil, nil + } + st := DeleteDataStatus(*pb) + return &st, nil +} + // Delete data from index type DeleteDataVectorIndexRequest struct { // Name of the vector index where data is to be deleted. Must be a Direct // Vector Access Index. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` // List of primary keys for the data to be deleted. - PrimaryKeys []string `json:"-" url:"primary_keys"` + // Wire name: 'primary_keys' + PrimaryKeys []string `tf:"-"` +} + +func (st *DeleteDataVectorIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDataVectorIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDataVectorIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDataVectorIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteDataVectorIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteDataVectorIndexResponse struct { // Result of the upsert or delete operation. - Result *DeleteDataResult `json:"result,omitempty"` + // Wire name: 'result' + Result *DeleteDataResult // Status of the delete operation. - Status DeleteDataStatus `json:"status,omitempty"` + // Wire name: 'status' + Status DeleteDataStatus +} + +func (st *DeleteDataVectorIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteDataVectorIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteDataVectorIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteDataVectorIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteDataVectorIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Delete an endpoint type DeleteEndpointRequest struct { // Name of the vector search endpoint - EndpointName string `json:"-" url:"-"` + // Wire name: 'endpoint_name' + EndpointName string `tf:"-"` +} + +func (st *DeleteEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteEndpointResponse struct { } +func (st *DeleteEndpointResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteEndpointResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteEndpointResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteEndpointResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteEndpointResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete an index type DeleteIndexRequest struct { // Name of the index - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` +} + +func (st *DeleteIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteIndexResponse struct { } +func (st *DeleteIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeltaSyncVectorIndexSpecRequest struct { // [Optional] Select the columns to sync with the vector index. If you leave // this field blank, all columns from the source table are synced with the // index. The primary key column and embedding source column or embedding // vector column are always synced. - ColumnsToSync []string `json:"columns_to_sync,omitempty"` + // Wire name: 'columns_to_sync' + ColumnsToSync []string // The columns that contain the embedding source. - EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + // Wire name: 'embedding_source_columns' + EmbeddingSourceColumns []EmbeddingSourceColumn // The columns that contain the embedding vectors. - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + // Wire name: 'embedding_vector_columns' + EmbeddingVectorColumns []EmbeddingVectorColumn // [Optional] Name of the Delta table to sync the vector index contents and // computed embeddings to. - EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + // Wire name: 'embedding_writeback_table' + EmbeddingWritebackTable string // Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the // triggered execution mode, the system stops processing after successfully // refreshing the source table in the pipeline once, ensuring the table is @@ -181,31 +466,54 @@ type DeltaSyncVectorIndexSpecRequest struct { // `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline // processes new data as it arrives in the source table to keep vector index // fresh. - PipelineType PipelineType `json:"pipeline_type,omitempty"` + // Wire name: 'pipeline_type' + PipelineType PipelineType // The name of the source table. - SourceTable string `json:"source_table,omitempty"` + // Wire name: 'source_table' + SourceTable string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeltaSyncVectorIndexSpecRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeltaSyncVectorIndexSpecRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSyncVectorIndexSpecRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSyncVectorIndexSpecRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeltaSyncVectorIndexSpecRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeltaSyncVectorIndexSpecRequest) MarshalJSON() ([]byte, error) { + pb, err := deltaSyncVectorIndexSpecRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeltaSyncVectorIndexSpecResponse struct { // The columns that contain the embedding source. - EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + // Wire name: 'embedding_source_columns' + EmbeddingSourceColumns []EmbeddingSourceColumn // The columns that contain the embedding vectors. - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + // Wire name: 'embedding_vector_columns' + EmbeddingVectorColumns []EmbeddingVectorColumn // [Optional] Name of the Delta table to sync the vector index contents and // computed embeddings to. - EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + // Wire name: 'embedding_writeback_table' + EmbeddingWritebackTable string // The ID of the pipeline that is used to sync the index. - PipelineId string `json:"pipeline_id,omitempty"` + // Wire name: 'pipeline_id' + PipelineId string // Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the // triggered execution mode, the system stops processing after successfully // refreshing the source table in the pipeline once, ensuring the table is @@ -213,133 +521,258 @@ type DeltaSyncVectorIndexSpecResponse struct { // `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline // processes new data as it arrives in the source table to keep vector index // fresh. - PipelineType PipelineType `json:"pipeline_type,omitempty"` + // Wire name: 'pipeline_type' + PipelineType PipelineType // The name of the source table. - SourceTable string `json:"source_table,omitempty"` + // Wire name: 'source_table' + SourceTable string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DeltaSyncVectorIndexSpecResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DeltaSyncVectorIndexSpecResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deltaSyncVectorIndexSpecResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deltaSyncVectorIndexSpecResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DeltaSyncVectorIndexSpecResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DeltaSyncVectorIndexSpecResponse) MarshalJSON() ([]byte, error) { + pb, err := deltaSyncVectorIndexSpecResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DirectAccessVectorIndexSpec struct { // The columns that contain the embedding source. The format should be // array[double]. - EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + // Wire name: 'embedding_source_columns' + EmbeddingSourceColumns []EmbeddingSourceColumn // The columns that contain the embedding vectors. The format should be // array[double]. - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + // Wire name: 'embedding_vector_columns' + EmbeddingVectorColumns []EmbeddingVectorColumn // The schema of the index in JSON format. Supported types are `integer`, // `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`. // Supported types for vector column: `array`, `array`,`. - SchemaJson string `json:"schema_json,omitempty"` + // Wire name: 'schema_json' + SchemaJson string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *DirectAccessVectorIndexSpec) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *DirectAccessVectorIndexSpec) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &directAccessVectorIndexSpecPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := directAccessVectorIndexSpecFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s DirectAccessVectorIndexSpec) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st DirectAccessVectorIndexSpec) MarshalJSON() ([]byte, error) { + pb, err := directAccessVectorIndexSpecToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EmbeddingSourceColumn struct { // Name of the embedding model endpoint - EmbeddingModelEndpointName string `json:"embedding_model_endpoint_name,omitempty"` + // Wire name: 'embedding_model_endpoint_name' + EmbeddingModelEndpointName string // Name of the column - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EmbeddingSourceColumn) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EmbeddingSourceColumn) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &embeddingSourceColumnPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := embeddingSourceColumnFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EmbeddingSourceColumn) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EmbeddingSourceColumn) MarshalJSON() ([]byte, error) { + pb, err := embeddingSourceColumnToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EmbeddingVectorColumn struct { // Dimension of the embedding vector - EmbeddingDimension int `json:"embedding_dimension,omitempty"` + // Wire name: 'embedding_dimension' + EmbeddingDimension int // Name of the column - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EmbeddingVectorColumn) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EmbeddingVectorColumn) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &embeddingVectorColumnPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := embeddingVectorColumnFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EmbeddingVectorColumn) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EmbeddingVectorColumn) MarshalJSON() ([]byte, error) { + pb, err := embeddingVectorColumnToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type EndpointInfo struct { // Timestamp of endpoint creation - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + // Wire name: 'creation_timestamp' + CreationTimestamp int64 // Creator of the endpoint - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // The custom tags assigned to the endpoint - CustomTags []CustomTag `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags []CustomTag // The budget policy id applied to the endpoint - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string // Current status of the endpoint - EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"` + // Wire name: 'endpoint_status' + EndpointStatus *EndpointStatus // Type of endpoint - EndpointType EndpointType `json:"endpoint_type,omitempty"` + // Wire name: 'endpoint_type' + EndpointType EndpointType // Unique identifier of the endpoint - Id string `json:"id,omitempty"` + // Wire name: 'id' + Id string // Timestamp of last update to the endpoint - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 // User who last updated the endpoint - LastUpdatedUser string `json:"last_updated_user,omitempty"` + // Wire name: 'last_updated_user' + LastUpdatedUser string // Name of the vector search endpoint - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Number of indexes on the endpoint - NumIndexes int `json:"num_indexes,omitempty"` + // Wire name: 'num_indexes' + NumIndexes int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointInfo) MarshalJSON() ([]byte, error) { + pb, err := endpointInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Status information of an endpoint type EndpointStatus struct { // Additional status message - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Current state of the endpoint - State EndpointStatusState `json:"state,omitempty"` + // Wire name: 'state' + State EndpointStatusState - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *EndpointStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *EndpointStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &endpointStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := endpointStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s EndpointStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st EndpointStatus) MarshalJSON() ([]byte, error) { + pb, err := endpointStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Current state of the endpoint type EndpointStatusState string +type endpointStatusStatePb string const EndpointStatusStateOffline EndpointStatusState = `OFFLINE` @@ -368,8 +801,25 @@ func (f *EndpointStatusState) Type() string { return "EndpointStatusState" } +func endpointStatusStateToPb(st *EndpointStatusState) (*endpointStatusStatePb, error) { + if st == nil { + return nil, nil + } + pb := endpointStatusStatePb(*st) + return &pb, nil +} + +func endpointStatusStateFromPb(pb *endpointStatusStatePb) (*EndpointStatusState, error) { + if pb == nil { + return nil, nil + } + st := EndpointStatusState(*pb) + return &st, nil +} + // Type of endpoint. type EndpointType string +type endpointTypePb string const EndpointTypeStandard EndpointType = `STANDARD` @@ -394,159 +844,414 @@ func (f *EndpointType) Type() string { return "EndpointType" } +func endpointTypeToPb(st *EndpointType) (*endpointTypePb, error) { + if st == nil { + return nil, nil + } + pb := endpointTypePb(*st) + return &pb, nil +} + +func endpointTypeFromPb(pb *endpointTypePb) (*EndpointType, error) { + if pb == nil { + return nil, nil + } + st := EndpointType(*pb) + return &st, nil +} + // Get an endpoint type GetEndpointRequest struct { // Name of the endpoint - EndpointName string `json:"-" url:"-"` + // Wire name: 'endpoint_name' + EndpointName string `tf:"-"` +} + +func (st *GetEndpointRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getEndpointRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getEndpointRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetEndpointRequest) MarshalJSON() ([]byte, error) { + pb, err := getEndpointRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get an index type GetIndexRequest struct { // Name of the index - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` +} + +func (st *GetIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := getIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListEndpointResponse struct { // An array of Endpoint objects - Endpoints []EndpointInfo `json:"endpoints,omitempty"` + // Wire name: 'endpoints' + Endpoints []EndpointInfo // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListEndpointResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListEndpointResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listEndpointResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listEndpointResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListEndpointResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListEndpointResponse) MarshalJSON() ([]byte, error) { + pb, err := listEndpointResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List all endpoints type ListEndpointsRequest struct { // Token for pagination - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListEndpointsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListEndpointsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listEndpointsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listEndpointsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListEndpointsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListEndpointsRequest) MarshalJSON() ([]byte, error) { + pb, err := listEndpointsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List indexes type ListIndexesRequest struct { // Name of the endpoint - EndpointName string `json:"-" url:"endpoint_name"` + // Wire name: 'endpoint_name' + EndpointName string `tf:"-"` // Token for pagination - PageToken string `json:"-" url:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListIndexesRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListIndexesRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listIndexesRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listIndexesRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListIndexesRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListIndexesRequest) MarshalJSON() ([]byte, error) { + pb, err := listIndexesRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListValue struct { // Repeated field of dynamically typed values. - Values []Value `json:"values,omitempty"` + // Wire name: 'values' + Values []Value +} + +func (st *ListValue) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listValuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listValueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListValue) MarshalJSON() ([]byte, error) { + pb, err := listValueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListVectorIndexesResponse struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string - VectorIndexes []MiniVectorIndex `json:"vector_indexes,omitempty"` + // Wire name: 'vector_indexes' + VectorIndexes []MiniVectorIndex - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListVectorIndexesResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListVectorIndexesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listVectorIndexesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listVectorIndexesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListVectorIndexesResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListVectorIndexesResponse) MarshalJSON() ([]byte, error) { + pb, err := listVectorIndexesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Key-value pair. type MapStringValueEntry struct { // Column name. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // Column value, nullable. - Value *Value `json:"value,omitempty"` + // Wire name: 'value' + Value *Value - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MapStringValueEntry) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MapStringValueEntry) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mapStringValueEntryPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mapStringValueEntryFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MapStringValueEntry) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MapStringValueEntry) MarshalJSON() ([]byte, error) { + pb, err := mapStringValueEntryToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MiniVectorIndex struct { // The user who created the index. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string // Name of the endpoint associated with the index - EndpointName string `json:"endpoint_name,omitempty"` + // Wire name: 'endpoint_name' + EndpointName string // There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that // automatically syncs with a source Delta Table, automatically and // incrementally updating the index as the underlying data in the Delta // Table changes. - `DIRECT_ACCESS`: An index that supports direct read and // write of vectors and metadata through our REST and SDK APIs. With this // model, the user manages index updates. - IndexType VectorIndexType `json:"index_type,omitempty"` + // Wire name: 'index_type' + IndexType VectorIndexType // Name of the index - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Primary key of the index - PrimaryKey string `json:"primary_key,omitempty"` + // Wire name: 'primary_key' + PrimaryKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *MiniVectorIndex) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *MiniVectorIndex) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &miniVectorIndexPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := miniVectorIndexFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s MiniVectorIndex) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st MiniVectorIndex) MarshalJSON() ([]byte, error) { + pb, err := miniVectorIndexToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PatchEndpointBudgetPolicyRequest struct { // The budget policy id to be applied - BudgetPolicyId string `json:"budget_policy_id"` + // Wire name: 'budget_policy_id' + BudgetPolicyId string // Name of the vector search endpoint - EndpointName string `json:"-" url:"-"` + // Wire name: 'endpoint_name' + EndpointName string `tf:"-"` +} + +func (st *PatchEndpointBudgetPolicyRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchEndpointBudgetPolicyRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchEndpointBudgetPolicyRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PatchEndpointBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + pb, err := patchEndpointBudgetPolicyRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PatchEndpointBudgetPolicyResponse struct { // The budget policy applied to the vector search endpoint. - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Wire name: 'effective_budget_policy_id' + EffectiveBudgetPolicyId string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PatchEndpointBudgetPolicyResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PatchEndpointBudgetPolicyResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &patchEndpointBudgetPolicyResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := patchEndpointBudgetPolicyResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PatchEndpointBudgetPolicyResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PatchEndpointBudgetPolicyResponse) MarshalJSON() ([]byte, error) { + pb, err := patchEndpointBudgetPolicyResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the triggered @@ -556,6 +1261,7 @@ func (s PatchEndpointBudgetPolicyResponse) MarshalJSON() ([]byte, error) { // continuous execution, the pipeline processes new data as it arrives in the // source table to keep vector index fresh. type PipelineType string +type pipelineTypePb string // If the pipeline uses continuous execution, the pipeline processes new data as // it arrives in the source table to keep vector index fresh. @@ -588,32 +1294,70 @@ func (f *PipelineType) Type() string { return "PipelineType" } +func pipelineTypeToPb(st *PipelineType) (*pipelineTypePb, error) { + if st == nil { + return nil, nil + } + pb := pipelineTypePb(*st) + return &pb, nil +} + +func pipelineTypeFromPb(pb *pipelineTypePb) (*PipelineType, error) { + if pb == nil { + return nil, nil + } + st := PipelineType(*pb) + return &st, nil +} + // Request payload for getting next page of results. type QueryVectorIndexNextPageRequest struct { // Name of the endpoint. - EndpointName string `json:"endpoint_name,omitempty"` + // Wire name: 'endpoint_name' + EndpointName string // Name of the vector index to query. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` // Page token returned from previous `QueryVectorIndex` or // `QueryVectorIndexNextPage` API. - PageToken string `json:"page_token,omitempty"` + // Wire name: 'page_token' + PageToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryVectorIndexNextPageRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryVectorIndexNextPageRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryVectorIndexNextPageRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryVectorIndexNextPageRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryVectorIndexNextPageRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryVectorIndexNextPageRequest) MarshalJSON() ([]byte, error) { + pb, err := queryVectorIndexNextPageRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryVectorIndexRequest struct { // List of column names to include in the response. - Columns []string `json:"columns"` + // Wire name: 'columns' + Columns []string // Column names used to retrieve data to send to the reranker. - ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` + // Wire name: 'columns_to_rerank' + ColumnsToRerank []string // JSON string representing query filters. // // Example filters: @@ -622,183 +1366,447 @@ type QueryVectorIndexRequest struct { // id greater than 5. - `{"id <=": 5}`: Filter for id less than equal to 5. // - `{"id >=": 5}`: Filter for id greater than equal to 5. - `{"id": 5}`: // Filter for id equal to 5. - FiltersJson string `json:"filters_json,omitempty"` + // Wire name: 'filters_json' + FiltersJson string // Name of the vector index to query. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` // Number of results to return. Defaults to 10. - NumResults int `json:"num_results,omitempty"` + // Wire name: 'num_results' + NumResults int // Query text. Required for Delta Sync Index using model endpoint. - QueryText string `json:"query_text,omitempty"` + // Wire name: 'query_text' + QueryText string // The query type to use. Choices are `ANN` and `HYBRID`. Defaults to `ANN`. - QueryType string `json:"query_type,omitempty"` + // Wire name: 'query_type' + QueryType string // Query vector. Required for Direct Vector Access Index and Delta Sync // Index using self-managed vectors. - QueryVector []float64 `json:"query_vector,omitempty"` + // Wire name: 'query_vector' + QueryVector []float64 // Threshold for the approximate nearest neighbor search. Defaults to 0.0. - ScoreThreshold float64 `json:"score_threshold,omitempty"` + // Wire name: 'score_threshold' + ScoreThreshold float64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryVectorIndexRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryVectorIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryVectorIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryVectorIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryVectorIndexRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryVectorIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := queryVectorIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type QueryVectorIndexResponse struct { // Metadata about the result set. - Manifest *ResultManifest `json:"manifest,omitempty"` + // Wire name: 'manifest' + Manifest *ResultManifest // [Optional] Token that can be used in `QueryVectorIndexNextPage` API to // get next page of results. If more than 1000 results satisfy the query, // they are returned in groups of 1000. Empty value means no more results. // The maximum number of results that can be returned is 10,000. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // Data returned in the query result. - Result *ResultData `json:"result,omitempty"` + // Wire name: 'result' + Result *ResultData - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *QueryVectorIndexResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *QueryVectorIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &queryVectorIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := queryVectorIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := queryVectorIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Data returned in the query result. type ResultData struct { // Data rows returned in the query. - DataArray [][]string `json:"data_array,omitempty"` + // Wire name: 'data_array' + DataArray [][]string // Number of rows in the result set. - RowCount int `json:"row_count,omitempty"` + // Wire name: 'row_count' + RowCount int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResultData) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResultData) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultDataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultDataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResultData) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResultData) MarshalJSON() ([]byte, error) { + pb, err := resultDataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Metadata about the result set. type ResultManifest struct { // Number of columns in the result set. - ColumnCount int `json:"column_count,omitempty"` + // Wire name: 'column_count' + ColumnCount int // Information about each column in the result set. - Columns []ColumnInfo `json:"columns,omitempty"` + // Wire name: 'columns' + Columns []ColumnInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ResultManifest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ResultManifest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &resultManifestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := resultManifestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ResultManifest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ResultManifest) MarshalJSON() ([]byte, error) { + pb, err := resultManifestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ScanVectorIndexRequest struct { // Name of the vector index to scan. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` // Primary key of the last entry returned in the previous scan. - LastPrimaryKey string `json:"last_primary_key,omitempty"` + // Wire name: 'last_primary_key' + LastPrimaryKey string // Number of results to return. Defaults to 10. - NumResults int `json:"num_results,omitempty"` + // Wire name: 'num_results' + NumResults int - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ScanVectorIndexRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ScanVectorIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &scanVectorIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := scanVectorIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ScanVectorIndexRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ScanVectorIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := scanVectorIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Response to a scan vector index request. type ScanVectorIndexResponse struct { // List of data entries - Data []Struct `json:"data,omitempty"` + // Wire name: 'data' + Data []Struct // Primary key of the last entry. - LastPrimaryKey string `json:"last_primary_key,omitempty"` + // Wire name: 'last_primary_key' + LastPrimaryKey string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ScanVectorIndexResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ScanVectorIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &scanVectorIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := scanVectorIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ScanVectorIndexResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ScanVectorIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := scanVectorIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Struct struct { // Data entry, corresponding to a row in a vector index. - Fields []MapStringValueEntry `json:"fields,omitempty"` + // Wire name: 'fields' + Fields []MapStringValueEntry +} + +func (st *Struct) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &structPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := structFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Struct) MarshalJSON() ([]byte, error) { + pb, err := structToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Synchronize an index type SyncIndexRequest struct { // Name of the vector index to synchronize. Must be a Delta Sync Index. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` +} + +func (st *SyncIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &syncIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := syncIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SyncIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := syncIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SyncIndexResponse struct { } +func (st *SyncIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &syncIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := syncIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SyncIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := syncIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateEndpointCustomTagsRequest struct { // The new custom tags for the vector search endpoint - CustomTags []CustomTag `json:"custom_tags"` + // Wire name: 'custom_tags' + CustomTags []CustomTag // Name of the vector search endpoint - EndpointName string `json:"-" url:"-"` + // Wire name: 'endpoint_name' + EndpointName string `tf:"-"` +} + +func (st *UpdateEndpointCustomTagsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEndpointCustomTagsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEndpointCustomTagsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateEndpointCustomTagsRequest) MarshalJSON() ([]byte, error) { + pb, err := updateEndpointCustomTagsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateEndpointCustomTagsResponse struct { // All the custom tags that are applied to the vector search endpoint. - CustomTags []CustomTag `json:"custom_tags,omitempty"` + // Wire name: 'custom_tags' + CustomTags []CustomTag // The name of the vector search endpoint whose custom tags were updated. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateEndpointCustomTagsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateEndpointCustomTagsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateEndpointCustomTagsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateEndpointCustomTagsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateEndpointCustomTagsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateEndpointCustomTagsResponse) MarshalJSON() ([]byte, error) { + pb, err := updateEndpointCustomTagsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpsertDataResult struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` + // Wire name: 'failed_primary_keys' + FailedPrimaryKeys []string // Count of successfully processed rows. - SuccessRowCount int64 `json:"success_row_count,omitempty"` + // Wire name: 'success_row_count' + SuccessRowCount int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpsertDataResult) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpsertDataResult) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &upsertDataResultPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := upsertDataResultFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpsertDataResult) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpsertDataResult) MarshalJSON() ([]byte, error) { + pb, err := upsertDataResultToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpsertDataStatus string +type upsertDataStatusPb string const UpsertDataStatusFailure UpsertDataStatus = `FAILURE` @@ -827,96 +1835,235 @@ func (f *UpsertDataStatus) Type() string { return "UpsertDataStatus" } +func upsertDataStatusToPb(st *UpsertDataStatus) (*upsertDataStatusPb, error) { + if st == nil { + return nil, nil + } + pb := upsertDataStatusPb(*st) + return &pb, nil +} + +func upsertDataStatusFromPb(pb *upsertDataStatusPb) (*UpsertDataStatus, error) { + if pb == nil { + return nil, nil + } + st := UpsertDataStatus(*pb) + return &st, nil +} + type UpsertDataVectorIndexRequest struct { // Name of the vector index where data is to be upserted. Must be a Direct // Vector Access Index. - IndexName string `json:"-" url:"-"` + // Wire name: 'index_name' + IndexName string `tf:"-"` // JSON string representing the data to be upserted. - InputsJson string `json:"inputs_json"` + // Wire name: 'inputs_json' + InputsJson string +} + +func (st *UpsertDataVectorIndexRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &upsertDataVectorIndexRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := upsertDataVectorIndexRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpsertDataVectorIndexRequest) MarshalJSON() ([]byte, error) { + pb, err := upsertDataVectorIndexRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpsertDataVectorIndexResponse struct { // Result of the upsert or delete operation. - Result *UpsertDataResult `json:"result,omitempty"` + // Wire name: 'result' + Result *UpsertDataResult // Status of the upsert operation. - Status UpsertDataStatus `json:"status,omitempty"` + // Wire name: 'status' + Status UpsertDataStatus +} + +func (st *UpsertDataVectorIndexResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &upsertDataVectorIndexResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := upsertDataVectorIndexResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpsertDataVectorIndexResponse) MarshalJSON() ([]byte, error) { + pb, err := upsertDataVectorIndexResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Value struct { - BoolValue bool `json:"bool_value,omitempty"` - ListValue *ListValue `json:"list_value,omitempty"` + // Wire name: 'bool_value' + BoolValue bool - NumberValue float64 `json:"number_value,omitempty"` + // Wire name: 'list_value' + ListValue *ListValue - StringValue string `json:"string_value,omitempty"` + // Wire name: 'number_value' + NumberValue float64 - StructValue *Struct `json:"struct_value,omitempty"` + // Wire name: 'string_value' + StringValue string - ForceSendFields []string `json:"-" url:"-"` + // Wire name: 'struct_value' + StructValue *Struct + + ForceSendFields []string `tf:"-"` } -func (s *Value) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Value) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &valuePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := valueFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Value) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Value) MarshalJSON() ([]byte, error) { + pb, err := valueToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type VectorIndex struct { // The user who created the index. - Creator string `json:"creator,omitempty"` + // Wire name: 'creator' + Creator string - DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse `json:"delta_sync_index_spec,omitempty"` + // Wire name: 'delta_sync_index_spec' + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse - DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + // Wire name: 'direct_access_index_spec' + DirectAccessIndexSpec *DirectAccessVectorIndexSpec // Name of the endpoint associated with the index - EndpointName string `json:"endpoint_name,omitempty"` + // Wire name: 'endpoint_name' + EndpointName string // There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that // automatically syncs with a source Delta Table, automatically and // incrementally updating the index as the underlying data in the Delta // Table changes. - `DIRECT_ACCESS`: An index that supports direct read and // write of vectors and metadata through our REST and SDK APIs. With this // model, the user manages index updates. - IndexType VectorIndexType `json:"index_type,omitempty"` + // Wire name: 'index_type' + IndexType VectorIndexType // Name of the index - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string // Primary key of the index - PrimaryKey string `json:"primary_key,omitempty"` + // Wire name: 'primary_key' + PrimaryKey string - Status *VectorIndexStatus `json:"status,omitempty"` + // Wire name: 'status' + Status *VectorIndexStatus - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *VectorIndex) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *VectorIndex) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &vectorIndexPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := vectorIndexFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s VectorIndex) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st VectorIndex) MarshalJSON() ([]byte, error) { + pb, err := vectorIndexToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type VectorIndexStatus struct { // Index API Url to be used to perform operations on the index - IndexUrl string `json:"index_url,omitempty"` + // Wire name: 'index_url' + IndexUrl string // Number of rows indexed - IndexedRowCount int64 `json:"indexed_row_count,omitempty"` + // Wire name: 'indexed_row_count' + IndexedRowCount int64 // Message associated with the index status - Message string `json:"message,omitempty"` + // Wire name: 'message' + Message string // Whether the index is ready for search - Ready bool `json:"ready,omitempty"` + // Wire name: 'ready' + Ready bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *VectorIndexStatus) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *VectorIndexStatus) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &vectorIndexStatusPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := vectorIndexStatusFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s VectorIndexStatus) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st VectorIndexStatus) MarshalJSON() ([]byte, error) { + pb, err := vectorIndexStatusToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that @@ -926,6 +2073,7 @@ func (s VectorIndexStatus) MarshalJSON() ([]byte, error) { // vectors and metadata through our REST and SDK APIs. With this model, the user // manages index updates. type VectorIndexType string +type vectorIndexTypePb string // An index that automatically syncs with a source Delta Table, automatically // and incrementally updating the index as the underlying data in the Delta @@ -956,3 +2104,73 @@ func (f *VectorIndexType) Set(v string) error { func (f *VectorIndexType) Type() string { return "VectorIndexType" } + +func vectorIndexTypeToPb(st *VectorIndexType) (*vectorIndexTypePb, error) { + if st == nil { + return nil, nil + } + pb := vectorIndexTypePb(*st) + return &pb, nil +} + +func vectorIndexTypeFromPb(pb *vectorIndexTypePb) (*VectorIndexType, error) { + if pb == nil { + return nil, nil + } + st := VectorIndexType(*pb) + return &st, nil +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/workspace/impl.go b/service/workspace/impl.go index 5ec0fd77e..4c5d64a83 100755 --- a/service/workspace/impl.go +++ b/service/workspace/impl.go @@ -18,34 +18,96 @@ type gitCredentialsImpl struct { } func (a *gitCredentialsImpl) Create(ctx context.Context, request CreateCredentialsRequest) (*CreateCredentialsResponse, error) { - var createCredentialsResponse CreateCredentialsResponse + + requestPb, pbErr := createCredentialsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createCredentialsResponsePb createCredentialsResponsePb path := "/api/2.0/git-credentials" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCredentialsResponse) - return &createCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createCredentialsResponseFromPb(&createCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *gitCredentialsImpl) Delete(ctx context.Context, request DeleteCredentialsRequest) error { - var deleteCredentialsResponse DeleteCredentialsResponse - path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + + requestPb, pbErr := deleteCredentialsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteCredentialsResponsePb deleteCredentialsResponsePb + path := fmt.Sprintf("/api/2.0/git-credentials/%v", requestPb.CredentialId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialsResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteCredentialsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *gitCredentialsImpl) Get(ctx context.Context, request GetCredentialsRequest) (*GetCredentialsResponse, error) { - var getCredentialsResponse GetCredentialsResponse - path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + + requestPb, pbErr := getCredentialsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getCredentialsResponsePb getCredentialsResponsePb + path := fmt.Sprintf("/api/2.0/git-credentials/%v", requestPb.CredentialId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCredentialsResponse) - return &getCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getCredentialsResponseFromPb(&getCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Get Git credentials. @@ -81,23 +143,58 @@ func (a *gitCredentialsImpl) ListAll(ctx context.Context) ([]CredentialInfo, err } func (a *gitCredentialsImpl) internalList(ctx context.Context) (*ListCredentialsResponse, error) { - var listCredentialsResponse ListCredentialsResponse + + var listCredentialsResponsePb listCredentialsResponsePb path := "/api/2.0/git-credentials" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listCredentialsResponse) - return &listCredentialsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listCredentialsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listCredentialsResponseFromPb(&listCredentialsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *gitCredentialsImpl) Update(ctx context.Context, request UpdateCredentialsRequest) error { - var updateCredentialsResponse UpdateCredentialsResponse - path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + + requestPb, pbErr := updateCredentialsRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateCredentialsResponsePb updateCredentialsResponsePb + path := fmt.Sprintf("/api/2.0/git-credentials/%v", requestPb.CredentialId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCredentialsResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateCredentialsResponsePb, + ) + if err != nil { + return err + } + return err } @@ -107,54 +204,160 @@ type reposImpl struct { } func (a *reposImpl) Create(ctx context.Context, request CreateRepoRequest) (*CreateRepoResponse, error) { - var createRepoResponse CreateRepoResponse + + requestPb, pbErr := createRepoRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var createRepoResponsePb createRepoResponsePb path := "/api/2.0/repos" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createRepoResponse) - return &createRepoResponse, err + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createRepoResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := createRepoResponseFromPb(&createRepoResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *reposImpl) Delete(ctx context.Context, request DeleteRepoRequest) error { - var deleteRepoResponse DeleteRepoResponse - path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + + requestPb, pbErr := deleteRepoRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteRepoResponsePb deleteRepoResponsePb + path := fmt.Sprintf("/api/2.0/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteRepoResponse) + err := a.client.Do( + ctx, + http.MethodDelete, + path, + headers, + queryParams, + (*requestPb), + &deleteRepoResponsePb, + ) + if err != nil { + return err + } + return err } func (a *reposImpl) Get(ctx context.Context, request GetRepoRequest) (*GetRepoResponse, error) { - var getRepoResponse GetRepoResponse - path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + + requestPb, pbErr := getRepoRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getRepoResponsePb getRepoResponsePb + path := fmt.Sprintf("/api/2.0/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRepoResponse) - return &getRepoResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getRepoResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getRepoResponseFromPb(&getRepoResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *reposImpl) GetPermissionLevels(ctx context.Context, request GetRepoPermissionLevelsRequest) (*GetRepoPermissionLevelsResponse, error) { - var getRepoPermissionLevelsResponse GetRepoPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/repos/%v/permissionLevels", request.RepoId) + + requestPb, pbErr := getRepoPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getRepoPermissionLevelsResponsePb getRepoPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/repos/%v/permissionLevels", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRepoPermissionLevelsResponse) - return &getRepoPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getRepoPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getRepoPermissionLevelsResponseFromPb(&getRepoPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *reposImpl) GetPermissions(ctx context.Context, request GetRepoPermissionsRequest) (*RepoPermissions, error) { - var repoPermissions RepoPermissions - path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + + requestPb, pbErr := getRepoPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var repoPermissionsPb repoPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &repoPermissions) - return &repoPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &repoPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := repoPermissionsFromPb(&repoPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // Get repos. @@ -195,46 +398,130 @@ func (a *reposImpl) ListAll(ctx context.Context, request ListReposRequest) ([]Re } func (a *reposImpl) internalList(ctx context.Context, request ListReposRequest) (*ListReposResponse, error) { - var listReposResponse ListReposResponse + + requestPb, pbErr := listReposRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listReposResponsePb listReposResponsePb path := "/api/2.0/repos" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listReposResponse) - return &listReposResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listReposResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listReposResponseFromPb(&listReposResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *reposImpl) SetPermissions(ctx context.Context, request RepoPermissionsRequest) (*RepoPermissions, error) { - var repoPermissions RepoPermissions - path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + + requestPb, pbErr := repoPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var repoPermissionsPb repoPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &repoPermissions) - return &repoPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &repoPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := repoPermissionsFromPb(&repoPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *reposImpl) Update(ctx context.Context, request UpdateRepoRequest) error { - var updateRepoResponse UpdateRepoResponse - path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + + requestPb, pbErr := updateRepoRequestToPb(&request) + if pbErr != nil { + return pbErr + } + + var updateRepoResponsePb updateRepoResponsePb + path := fmt.Sprintf("/api/2.0/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateRepoResponse) + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &updateRepoResponsePb, + ) + if err != nil { + return err + } + return err } func (a *reposImpl) UpdatePermissions(ctx context.Context, request RepoPermissionsRequest) (*RepoPermissions, error) { - var repoPermissions RepoPermissions - path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + + requestPb, pbErr := repoPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var repoPermissionsPb repoPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/repos/%v", requestPb.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &repoPermissions) - return &repoPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &repoPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := repoPermissionsFromPb(&repoPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } // unexported type that holds implementations of just Secrets API methods @@ -243,67 +530,183 @@ type secretsImpl struct { } func (a *secretsImpl) CreateScope(ctx context.Context, request CreateScope) error { - var createScopeResponse CreateScopeResponse + + requestPb, pbErr := createScopeToPb(&request) + if pbErr != nil { + return pbErr + } + + var createScopeResponsePb createScopeResponsePb path := "/api/2.0/secrets/scopes/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createScopeResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &createScopeResponsePb, + ) + if err != nil { + return err + } + return err } func (a *secretsImpl) DeleteAcl(ctx context.Context, request DeleteAcl) error { - var deleteAclResponse DeleteAclResponse + + requestPb, pbErr := deleteAclToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteAclResponsePb deleteAclResponsePb path := "/api/2.0/secrets/acls/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteAclResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteAclResponsePb, + ) + if err != nil { + return err + } + return err } func (a *secretsImpl) DeleteScope(ctx context.Context, request DeleteScope) error { - var deleteScopeResponse DeleteScopeResponse + + requestPb, pbErr := deleteScopeToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteScopeResponsePb deleteScopeResponsePb path := "/api/2.0/secrets/scopes/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteScopeResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteScopeResponsePb, + ) + if err != nil { + return err + } + return err } func (a *secretsImpl) DeleteSecret(ctx context.Context, request DeleteSecret) error { - var deleteSecretResponse DeleteSecretResponse + + requestPb, pbErr := deleteSecretToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteSecretResponsePb deleteSecretResponsePb path := "/api/2.0/secrets/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteSecretResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteSecretResponsePb, + ) + if err != nil { + return err + } + return err } func (a *secretsImpl) GetAcl(ctx context.Context, request GetAclRequest) (*AclItem, error) { - var aclItem AclItem + + requestPb, pbErr := getAclRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var aclItemPb aclItemPb path := "/api/2.0/secrets/acls/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aclItem) - return &aclItem, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &aclItemPb, + ) + if err != nil { + return nil, err + } + resp, err := aclItemFromPb(&aclItemPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *secretsImpl) GetSecret(ctx context.Context, request GetSecretRequest) (*GetSecretResponse, error) { - var getSecretResponse GetSecretResponse + + requestPb, pbErr := getSecretRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getSecretResponsePb getSecretResponsePb path := "/api/2.0/secrets/get" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getSecretResponse) - return &getSecretResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getSecretResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getSecretResponseFromPb(&getSecretResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // Lists ACLs. @@ -346,13 +749,35 @@ func (a *secretsImpl) ListAclsAll(ctx context.Context, request ListAclsRequest) } func (a *secretsImpl) internalListAcls(ctx context.Context, request ListAclsRequest) (*ListAclsResponse, error) { - var listAclsResponse ListAclsResponse + + requestPb, pbErr := listAclsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listAclsResponsePb listAclsResponsePb path := "/api/2.0/secrets/acls/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAclsResponse) - return &listAclsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listAclsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listAclsResponseFromPb(&listAclsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List all scopes. @@ -392,13 +817,30 @@ func (a *secretsImpl) ListScopesAll(ctx context.Context) ([]SecretScope, error) } func (a *secretsImpl) internalListScopes(ctx context.Context) (*ListScopesResponse, error) { - var listScopesResponse ListScopesResponse + + var listScopesResponsePb listScopesResponsePb path := "/api/2.0/secrets/scopes/list" headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listScopesResponse) - return &listScopesResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + nil, + nil, + &listScopesResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listScopesResponseFromPb(&listScopesResponsePb) + if err != nil { + return nil, err + } + + return resp, err } // List secret keys. @@ -445,34 +887,92 @@ func (a *secretsImpl) ListSecretsAll(ctx context.Context, request ListSecretsReq } func (a *secretsImpl) internalListSecrets(ctx context.Context, request ListSecretsRequest) (*ListSecretsResponse, error) { - var listSecretsResponse ListSecretsResponse + + requestPb, pbErr := listSecretsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listSecretsResponsePb listSecretsResponsePb path := "/api/2.0/secrets/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSecretsResponse) - return &listSecretsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listSecretsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listSecretsResponseFromPb(&listSecretsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *secretsImpl) PutAcl(ctx context.Context, request PutAcl) error { - var putAclResponse PutAclResponse + + requestPb, pbErr := putAclToPb(&request) + if pbErr != nil { + return pbErr + } + + var putAclResponsePb putAclResponsePb path := "/api/2.0/secrets/acls/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putAclResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &putAclResponsePb, + ) + if err != nil { + return err + } + return err } func (a *secretsImpl) PutSecret(ctx context.Context, request PutSecret) error { - var putSecretResponse PutSecretResponse + + requestPb, pbErr := putSecretToPb(&request) + if pbErr != nil { + return pbErr + } + + var putSecretResponsePb putSecretResponsePb path := "/api/2.0/secrets/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putSecretResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &putSecretResponsePb, + ) + if err != nil { + return err + } + return err } @@ -482,64 +982,188 @@ type workspaceImpl struct { } func (a *workspaceImpl) Delete(ctx context.Context, request Delete) error { - var deleteResponse DeleteResponse + + requestPb, pbErr := deleteToPb(&request) + if pbErr != nil { + return pbErr + } + + var deleteResponsePb deleteResponsePb path := "/api/2.0/workspace/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &deleteResponsePb, + ) + if err != nil { + return err + } + return err } func (a *workspaceImpl) Export(ctx context.Context, request ExportRequest) (*ExportResponse, error) { - var exportResponse ExportResponse + + requestPb, pbErr := exportRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var exportResponsePb exportResponsePb path := "/api/2.0/workspace/export" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportResponse) - return &exportResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &exportResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := exportResponseFromPb(&exportResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) GetPermissionLevels(ctx context.Context, request GetWorkspaceObjectPermissionLevelsRequest) (*GetWorkspaceObjectPermissionLevelsResponse, error) { - var getWorkspaceObjectPermissionLevelsResponse GetWorkspaceObjectPermissionLevelsResponse - path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", request.WorkspaceObjectType, request.WorkspaceObjectId) + + requestPb, pbErr := getWorkspaceObjectPermissionLevelsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var getWorkspaceObjectPermissionLevelsResponsePb getWorkspaceObjectPermissionLevelsResponsePb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", requestPb.WorkspaceObjectType, requestPb.WorkspaceObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWorkspaceObjectPermissionLevelsResponse) - return &getWorkspaceObjectPermissionLevelsResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &getWorkspaceObjectPermissionLevelsResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := getWorkspaceObjectPermissionLevelsResponseFromPb(&getWorkspaceObjectPermissionLevelsResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) GetPermissions(ctx context.Context, request GetWorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { - var workspaceObjectPermissions WorkspaceObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + + requestPb, pbErr := getWorkspaceObjectPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceObjectPermissionsPb workspaceObjectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.WorkspaceObjectType, requestPb.WorkspaceObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceObjectPermissions) - return &workspaceObjectPermissions, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &workspaceObjectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceObjectPermissionsFromPb(&workspaceObjectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*ObjectInfo, error) { - var objectInfo ObjectInfo + + requestPb, pbErr := getStatusRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var objectInfoPb objectInfoPb path := "/api/2.0/workspace/get-status" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &objectInfo) - return &objectInfo, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &objectInfoPb, + ) + if err != nil { + return nil, err + } + resp, err := objectInfoFromPb(&objectInfoPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) Import(ctx context.Context, request Import) error { - var importResponse ImportResponse + + requestPb, pbErr := importToPb(&request) + if pbErr != nil { + return pbErr + } + + var importResponsePb importResponsePb path := "/api/2.0/workspace/import" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &importResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &importResponsePb, + ) + if err != nil { + return err + } + return err } @@ -577,44 +1201,128 @@ func (a *workspaceImpl) ListAll(ctx context.Context, request ListWorkspaceReques } func (a *workspaceImpl) internalList(ctx context.Context, request ListWorkspaceRequest) (*ListResponse, error) { - var listResponse ListResponse + + requestPb, pbErr := listWorkspaceRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var listResponsePb listResponsePb path := "/api/2.0/workspace/list" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listResponse) - return &listResponse, err + err := a.client.Do( + ctx, + http.MethodGet, + path, + headers, + queryParams, + (*requestPb), + &listResponsePb, + ) + if err != nil { + return nil, err + } + resp, err := listResponseFromPb(&listResponsePb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) Mkdirs(ctx context.Context, request Mkdirs) error { - var mkdirsResponse MkdirsResponse + + requestPb, pbErr := mkdirsToPb(&request) + if pbErr != nil { + return pbErr + } + + var mkdirsResponsePb mkdirsResponsePb path := "/api/2.0/workspace/mkdirs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkdirsResponse) + err := a.client.Do( + ctx, + http.MethodPost, + path, + headers, + queryParams, + (*requestPb), + &mkdirsResponsePb, + ) + if err != nil { + return err + } + return err } func (a *workspaceImpl) SetPermissions(ctx context.Context, request WorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { - var workspaceObjectPermissions WorkspaceObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + + requestPb, pbErr := workspaceObjectPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceObjectPermissionsPb workspaceObjectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.WorkspaceObjectType, requestPb.WorkspaceObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &workspaceObjectPermissions) - return &workspaceObjectPermissions, err + err := a.client.Do( + ctx, + http.MethodPut, + path, + headers, + queryParams, + (*requestPb), + &workspaceObjectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceObjectPermissionsFromPb(&workspaceObjectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } func (a *workspaceImpl) UpdatePermissions(ctx context.Context, request WorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { - var workspaceObjectPermissions WorkspaceObjectPermissions - path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + + requestPb, pbErr := workspaceObjectPermissionsRequestToPb(&request) + if pbErr != nil { + return nil, pbErr + } + + var workspaceObjectPermissionsPb workspaceObjectPermissionsPb + path := fmt.Sprintf("/api/2.0/permissions/%v/%v", requestPb.WorkspaceObjectType, requestPb.WorkspaceObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &workspaceObjectPermissions) - return &workspaceObjectPermissions, err + err := a.client.Do( + ctx, + http.MethodPatch, + path, + headers, + queryParams, + (*requestPb), + &workspaceObjectPermissionsPb, + ) + if err != nil { + return nil, err + } + resp, err := workspaceObjectPermissionsFromPb(&workspaceObjectPermissionsPb) + if err != nil { + return nil, err + } + + return resp, err } diff --git a/service/workspace/internal.go b/service/workspace/internal.go new file mode 100755 index 000000000..b4e88d406 --- /dev/null +++ b/service/workspace/internal.go @@ -0,0 +1,2695 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package workspace + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +func aclItemToPb(st *AclItem) (*aclItemPb, error) { + if st == nil { + return nil, nil + } + pb := &aclItemPb{} + pb.Permission = st.Permission + + pb.Principal = st.Principal + + return pb, nil +} + +type aclItemPb struct { + Permission AclPermission `json:"permission"` + + Principal string `json:"principal"` +} + +func aclItemFromPb(pb *aclItemPb) (*AclItem, error) { + if pb == nil { + return nil, nil + } + st := &AclItem{} + st.Permission = pb.Permission + st.Principal = pb.Principal + + return st, nil +} + +func azureKeyVaultSecretScopeMetadataToPb(st *AzureKeyVaultSecretScopeMetadata) (*azureKeyVaultSecretScopeMetadataPb, error) { + if st == nil { + return nil, nil + } + pb := &azureKeyVaultSecretScopeMetadataPb{} + pb.DnsName = st.DnsName + + pb.ResourceId = st.ResourceId + + return pb, nil +} + +type azureKeyVaultSecretScopeMetadataPb struct { + DnsName string `json:"dns_name"` + + ResourceId string `json:"resource_id"` +} + +func azureKeyVaultSecretScopeMetadataFromPb(pb *azureKeyVaultSecretScopeMetadataPb) (*AzureKeyVaultSecretScopeMetadata, error) { + if pb == nil { + return nil, nil + } + st := &AzureKeyVaultSecretScopeMetadata{} + st.DnsName = pb.DnsName + st.ResourceId = pb.ResourceId + + return st, nil +} + +func createCredentialsRequestToPb(st *CreateCredentialsRequest) (*createCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialsRequestPb{} + pb.GitProvider = st.GitProvider + + pb.GitUsername = st.GitUsername + + pb.PersonalAccessToken = st.PersonalAccessToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCredentialsRequestPb struct { + GitProvider string `json:"git_provider"` + + GitUsername string `json:"git_username,omitempty"` + + PersonalAccessToken string `json:"personal_access_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCredentialsRequestFromPb(pb *createCredentialsRequestPb) (*CreateCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialsRequest{} + st.GitProvider = pb.GitProvider + st.GitUsername = pb.GitUsername + st.PersonalAccessToken = pb.PersonalAccessToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCredentialsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCredentialsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createCredentialsResponseToPb(st *CreateCredentialsResponse) (*createCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createCredentialsResponsePb{} + pb.CredentialId = st.CredentialId + + pb.GitProvider = st.GitProvider + + pb.GitUsername = st.GitUsername + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createCredentialsResponsePb struct { + CredentialId int64 `json:"credential_id"` + + GitProvider string `json:"git_provider"` + + GitUsername string `json:"git_username,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createCredentialsResponseFromPb(pb *createCredentialsResponsePb) (*CreateCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateCredentialsResponse{} + st.CredentialId = pb.CredentialId + st.GitProvider = pb.GitProvider + st.GitUsername = pb.GitUsername + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createCredentialsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createCredentialsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createRepoRequestToPb(st *CreateRepoRequest) (*createRepoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &createRepoRequestPb{} + pb.Path = st.Path + + pb.Provider = st.Provider + + pb.SparseCheckout = st.SparseCheckout + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRepoRequestPb struct { + Path string `json:"path,omitempty"` + + Provider string `json:"provider"` + + SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + + Url string `json:"url"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRepoRequestFromPb(pb *createRepoRequestPb) (*CreateRepoRequest, error) { + if pb == nil { + return nil, nil + } + st := &CreateRepoRequest{} + st.Path = pb.Path + st.Provider = pb.Provider + st.SparseCheckout = pb.SparseCheckout + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRepoRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRepoRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createRepoResponseToPb(st *CreateRepoResponse) (*createRepoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createRepoResponsePb{} + pb.Branch = st.Branch + + pb.HeadCommitId = st.HeadCommitId + + pb.Id = st.Id + + pb.Path = st.Path + + pb.Provider = st.Provider + + pb.SparseCheckout = st.SparseCheckout + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createRepoResponsePb struct { + Branch string `json:"branch,omitempty"` + + HeadCommitId string `json:"head_commit_id,omitempty"` + + Id int64 `json:"id,omitempty"` + + Path string `json:"path,omitempty"` + + Provider string `json:"provider,omitempty"` + + SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createRepoResponseFromPb(pb *createRepoResponsePb) (*CreateRepoResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateRepoResponse{} + st.Branch = pb.Branch + st.HeadCommitId = pb.HeadCommitId + st.Id = pb.Id + st.Path = pb.Path + st.Provider = pb.Provider + st.SparseCheckout = pb.SparseCheckout + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createRepoResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createRepoResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createScopeToPb(st *CreateScope) (*createScopePb, error) { + if st == nil { + return nil, nil + } + pb := &createScopePb{} + pb.BackendAzureKeyvault = st.BackendAzureKeyvault + + pb.InitialManagePrincipal = st.InitialManagePrincipal + + pb.Scope = st.Scope + + pb.ScopeBackendType = st.ScopeBackendType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type createScopePb struct { + BackendAzureKeyvault *AzureKeyVaultSecretScopeMetadata `json:"backend_azure_keyvault,omitempty"` + + InitialManagePrincipal string `json:"initial_manage_principal,omitempty"` + + Scope string `json:"scope"` + + ScopeBackendType ScopeBackendType `json:"scope_backend_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func createScopeFromPb(pb *createScopePb) (*CreateScope, error) { + if pb == nil { + return nil, nil + } + st := &CreateScope{} + st.BackendAzureKeyvault = pb.BackendAzureKeyvault + st.InitialManagePrincipal = pb.InitialManagePrincipal + st.Scope = pb.Scope + st.ScopeBackendType = pb.ScopeBackendType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *createScopePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st createScopePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func createScopeResponseToPb(st *CreateScopeResponse) (*createScopeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &createScopeResponsePb{} + + return pb, nil +} + +type createScopeResponsePb struct { +} + +func createScopeResponseFromPb(pb *createScopeResponsePb) (*CreateScopeResponse, error) { + if pb == nil { + return nil, nil + } + st := &CreateScopeResponse{} + + return st, nil +} + +func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &credentialInfoPb{} + pb.CredentialId = st.CredentialId + + pb.GitProvider = st.GitProvider + + pb.GitUsername = st.GitUsername + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type credentialInfoPb struct { + CredentialId int64 `json:"credential_id"` + + GitProvider string `json:"git_provider,omitempty"` + + GitUsername string `json:"git_username,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func credentialInfoFromPb(pb *credentialInfoPb) (*CredentialInfo, error) { + if pb == nil { + return nil, nil + } + st := &CredentialInfo{} + st.CredentialId = pb.CredentialId + st.GitProvider = pb.GitProvider + st.GitUsername = pb.GitUsername + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *credentialInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st credentialInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteToPb(st *Delete) (*deletePb, error) { + if st == nil { + return nil, nil + } + pb := &deletePb{} + pb.Path = st.Path + + pb.Recursive = st.Recursive + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type deletePb struct { + Path string `json:"path"` + + Recursive bool `json:"recursive,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func deleteFromPb(pb *deletePb) (*Delete, error) { + if pb == nil { + return nil, nil + } + st := &Delete{} + st.Path = pb.Path + st.Recursive = pb.Recursive + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *deletePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st deletePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func deleteAclToPb(st *DeleteAcl) (*deleteAclPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAclPb{} + pb.Principal = st.Principal + + pb.Scope = st.Scope + + return pb, nil +} + +type deleteAclPb struct { + Principal string `json:"principal"` + + Scope string `json:"scope"` +} + +func deleteAclFromPb(pb *deleteAclPb) (*DeleteAcl, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAcl{} + st.Principal = pb.Principal + st.Scope = pb.Scope + + return st, nil +} + +func deleteAclResponseToPb(st *DeleteAclResponse) (*deleteAclResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteAclResponsePb{} + + return pb, nil +} + +type deleteAclResponsePb struct { +} + +func deleteAclResponseFromPb(pb *deleteAclResponsePb) (*DeleteAclResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteAclResponse{} + + return st, nil +} + +func deleteCredentialsRequestToPb(st *DeleteCredentialsRequest) (*deleteCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCredentialsRequestPb{} + pb.CredentialId = st.CredentialId + + return pb, nil +} + +type deleteCredentialsRequestPb struct { + CredentialId int64 `json:"-" url:"-"` +} + +func deleteCredentialsRequestFromPb(pb *deleteCredentialsRequestPb) (*DeleteCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCredentialsRequest{} + st.CredentialId = pb.CredentialId + + return st, nil +} + +func deleteCredentialsResponseToPb(st *DeleteCredentialsResponse) (*deleteCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteCredentialsResponsePb{} + + return pb, nil +} + +type deleteCredentialsResponsePb struct { +} + +func deleteCredentialsResponseFromPb(pb *deleteCredentialsResponsePb) (*DeleteCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteCredentialsResponse{} + + return st, nil +} + +func deleteRepoRequestToPb(st *DeleteRepoRequest) (*deleteRepoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRepoRequestPb{} + pb.RepoId = st.RepoId + + return pb, nil +} + +type deleteRepoRequestPb struct { + RepoId int64 `json:"-" url:"-"` +} + +func deleteRepoRequestFromPb(pb *deleteRepoRequestPb) (*DeleteRepoRequest, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRepoRequest{} + st.RepoId = pb.RepoId + + return st, nil +} + +func deleteRepoResponseToPb(st *DeleteRepoResponse) (*deleteRepoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteRepoResponsePb{} + + return pb, nil +} + +type deleteRepoResponsePb struct { +} + +func deleteRepoResponseFromPb(pb *deleteRepoResponsePb) (*DeleteRepoResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteRepoResponse{} + + return st, nil +} + +func deleteResponseToPb(st *DeleteResponse) (*deleteResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteResponsePb{} + + return pb, nil +} + +type deleteResponsePb struct { +} + +func deleteResponseFromPb(pb *deleteResponsePb) (*DeleteResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteResponse{} + + return st, nil +} + +func deleteScopeToPb(st *DeleteScope) (*deleteScopePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteScopePb{} + pb.Scope = st.Scope + + return pb, nil +} + +type deleteScopePb struct { + Scope string `json:"scope"` +} + +func deleteScopeFromPb(pb *deleteScopePb) (*DeleteScope, error) { + if pb == nil { + return nil, nil + } + st := &DeleteScope{} + st.Scope = pb.Scope + + return st, nil +} + +func deleteScopeResponseToPb(st *DeleteScopeResponse) (*deleteScopeResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteScopeResponsePb{} + + return pb, nil +} + +type deleteScopeResponsePb struct { +} + +func deleteScopeResponseFromPb(pb *deleteScopeResponsePb) (*DeleteScopeResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteScopeResponse{} + + return st, nil +} + +func deleteSecretToPb(st *DeleteSecret) (*deleteSecretPb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSecretPb{} + pb.Key = st.Key + + pb.Scope = st.Scope + + return pb, nil +} + +type deleteSecretPb struct { + Key string `json:"key"` + + Scope string `json:"scope"` +} + +func deleteSecretFromPb(pb *deleteSecretPb) (*DeleteSecret, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSecret{} + st.Key = pb.Key + st.Scope = pb.Scope + + return st, nil +} + +func deleteSecretResponseToPb(st *DeleteSecretResponse) (*deleteSecretResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &deleteSecretResponsePb{} + + return pb, nil +} + +type deleteSecretResponsePb struct { +} + +func deleteSecretResponseFromPb(pb *deleteSecretResponsePb) (*DeleteSecretResponse, error) { + if pb == nil { + return nil, nil + } + st := &DeleteSecretResponse{} + + return st, nil +} + +func exportRequestToPb(st *ExportRequest) (*exportRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &exportRequestPb{} + pb.Format = st.Format + + pb.Path = st.Path + + return pb, nil +} + +type exportRequestPb struct { + Format ExportFormat `json:"-" url:"format,omitempty"` + + Path string `json:"-" url:"path"` +} + +func exportRequestFromPb(pb *exportRequestPb) (*ExportRequest, error) { + if pb == nil { + return nil, nil + } + st := &ExportRequest{} + st.Format = pb.Format + st.Path = pb.Path + + return st, nil +} + +func exportResponseToPb(st *ExportResponse) (*exportResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &exportResponsePb{} + pb.Content = st.Content + + pb.FileType = st.FileType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type exportResponsePb struct { + Content string `json:"content,omitempty"` + + FileType string `json:"file_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func exportResponseFromPb(pb *exportResponsePb) (*ExportResponse, error) { + if pb == nil { + return nil, nil + } + st := &ExportResponse{} + st.Content = pb.Content + st.FileType = pb.FileType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *exportResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st exportResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getAclRequestToPb(st *GetAclRequest) (*getAclRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getAclRequestPb{} + pb.Principal = st.Principal + + pb.Scope = st.Scope + + return pb, nil +} + +type getAclRequestPb struct { + Principal string `json:"-" url:"principal"` + + Scope string `json:"-" url:"scope"` +} + +func getAclRequestFromPb(pb *getAclRequestPb) (*GetAclRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetAclRequest{} + st.Principal = pb.Principal + st.Scope = pb.Scope + + return st, nil +} + +func getCredentialsRequestToPb(st *GetCredentialsRequest) (*getCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsRequestPb{} + pb.CredentialId = st.CredentialId + + return pb, nil +} + +type getCredentialsRequestPb struct { + CredentialId int64 `json:"-" url:"-"` +} + +func getCredentialsRequestFromPb(pb *getCredentialsRequestPb) (*GetCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsRequest{} + st.CredentialId = pb.CredentialId + + return st, nil +} + +func getCredentialsResponseToPb(st *GetCredentialsResponse) (*getCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getCredentialsResponsePb{} + pb.CredentialId = st.CredentialId + + pb.GitProvider = st.GitProvider + + pb.GitUsername = st.GitUsername + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getCredentialsResponsePb struct { + CredentialId int64 `json:"credential_id"` + + GitProvider string `json:"git_provider,omitempty"` + + GitUsername string `json:"git_username,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getCredentialsResponseFromPb(pb *getCredentialsResponsePb) (*GetCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetCredentialsResponse{} + st.CredentialId = pb.CredentialId + st.GitProvider = pb.GitProvider + st.GitUsername = pb.GitUsername + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getCredentialsResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getCredentialsResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getRepoPermissionLevelsRequestToPb(st *GetRepoPermissionLevelsRequest) (*getRepoPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRepoPermissionLevelsRequestPb{} + pb.RepoId = st.RepoId + + return pb, nil +} + +type getRepoPermissionLevelsRequestPb struct { + RepoId string `json:"-" url:"-"` +} + +func getRepoPermissionLevelsRequestFromPb(pb *getRepoPermissionLevelsRequestPb) (*GetRepoPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRepoPermissionLevelsRequest{} + st.RepoId = pb.RepoId + + return st, nil +} + +func getRepoPermissionLevelsResponseToPb(st *GetRepoPermissionLevelsResponse) (*getRepoPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getRepoPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getRepoPermissionLevelsResponsePb struct { + PermissionLevels []RepoPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getRepoPermissionLevelsResponseFromPb(pb *getRepoPermissionLevelsResponsePb) (*GetRepoPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetRepoPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getRepoPermissionsRequestToPb(st *GetRepoPermissionsRequest) (*getRepoPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRepoPermissionsRequestPb{} + pb.RepoId = st.RepoId + + return pb, nil +} + +type getRepoPermissionsRequestPb struct { + RepoId string `json:"-" url:"-"` +} + +func getRepoPermissionsRequestFromPb(pb *getRepoPermissionsRequestPb) (*GetRepoPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRepoPermissionsRequest{} + st.RepoId = pb.RepoId + + return st, nil +} + +func getRepoRequestToPb(st *GetRepoRequest) (*getRepoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getRepoRequestPb{} + pb.RepoId = st.RepoId + + return pb, nil +} + +type getRepoRequestPb struct { + RepoId int64 `json:"-" url:"-"` +} + +func getRepoRequestFromPb(pb *getRepoRequestPb) (*GetRepoRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetRepoRequest{} + st.RepoId = pb.RepoId + + return st, nil +} + +func getRepoResponseToPb(st *GetRepoResponse) (*getRepoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getRepoResponsePb{} + pb.Branch = st.Branch + + pb.HeadCommitId = st.HeadCommitId + + pb.Id = st.Id + + pb.Path = st.Path + + pb.Provider = st.Provider + + pb.SparseCheckout = st.SparseCheckout + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getRepoResponsePb struct { + Branch string `json:"branch,omitempty"` + + HeadCommitId string `json:"head_commit_id,omitempty"` + + Id int64 `json:"id,omitempty"` + + Path string `json:"path,omitempty"` + + Provider string `json:"provider,omitempty"` + + SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getRepoResponseFromPb(pb *getRepoResponsePb) (*GetRepoResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetRepoResponse{} + st.Branch = pb.Branch + st.HeadCommitId = pb.HeadCommitId + st.Id = pb.Id + st.Path = pb.Path + st.Provider = pb.Provider + st.SparseCheckout = pb.SparseCheckout + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getRepoResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getRepoResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getSecretRequestToPb(st *GetSecretRequest) (*getSecretRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getSecretRequestPb{} + pb.Key = st.Key + + pb.Scope = st.Scope + + return pb, nil +} + +type getSecretRequestPb struct { + Key string `json:"-" url:"key"` + + Scope string `json:"-" url:"scope"` +} + +func getSecretRequestFromPb(pb *getSecretRequestPb) (*GetSecretRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetSecretRequest{} + st.Key = pb.Key + st.Scope = pb.Scope + + return st, nil +} + +func getSecretResponseToPb(st *GetSecretResponse) (*getSecretResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getSecretResponsePb{} + pb.Key = st.Key + + pb.Value = st.Value + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type getSecretResponsePb struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func getSecretResponseFromPb(pb *getSecretResponsePb) (*GetSecretResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetSecretResponse{} + st.Key = pb.Key + st.Value = pb.Value + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *getSecretResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st getSecretResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func getStatusRequestToPb(st *GetStatusRequest) (*getStatusRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getStatusRequestPb{} + pb.Path = st.Path + + return pb, nil +} + +type getStatusRequestPb struct { + Path string `json:"-" url:"path"` +} + +func getStatusRequestFromPb(pb *getStatusRequestPb) (*GetStatusRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetStatusRequest{} + st.Path = pb.Path + + return st, nil +} + +func getWorkspaceObjectPermissionLevelsRequestToPb(st *GetWorkspaceObjectPermissionLevelsRequest) (*getWorkspaceObjectPermissionLevelsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceObjectPermissionLevelsRequestPb{} + pb.WorkspaceObjectId = st.WorkspaceObjectId + + pb.WorkspaceObjectType = st.WorkspaceObjectType + + return pb, nil +} + +type getWorkspaceObjectPermissionLevelsRequestPb struct { + WorkspaceObjectId string `json:"-" url:"-"` + + WorkspaceObjectType string `json:"-" url:"-"` +} + +func getWorkspaceObjectPermissionLevelsRequestFromPb(pb *getWorkspaceObjectPermissionLevelsRequestPb) (*GetWorkspaceObjectPermissionLevelsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceObjectPermissionLevelsRequest{} + st.WorkspaceObjectId = pb.WorkspaceObjectId + st.WorkspaceObjectType = pb.WorkspaceObjectType + + return st, nil +} + +func getWorkspaceObjectPermissionLevelsResponseToPb(st *GetWorkspaceObjectPermissionLevelsResponse) (*getWorkspaceObjectPermissionLevelsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceObjectPermissionLevelsResponsePb{} + pb.PermissionLevels = st.PermissionLevels + + return pb, nil +} + +type getWorkspaceObjectPermissionLevelsResponsePb struct { + PermissionLevels []WorkspaceObjectPermissionsDescription `json:"permission_levels,omitempty"` +} + +func getWorkspaceObjectPermissionLevelsResponseFromPb(pb *getWorkspaceObjectPermissionLevelsResponsePb) (*GetWorkspaceObjectPermissionLevelsResponse, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceObjectPermissionLevelsResponse{} + st.PermissionLevels = pb.PermissionLevels + + return st, nil +} + +func getWorkspaceObjectPermissionsRequestToPb(st *GetWorkspaceObjectPermissionsRequest) (*getWorkspaceObjectPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &getWorkspaceObjectPermissionsRequestPb{} + pb.WorkspaceObjectId = st.WorkspaceObjectId + + pb.WorkspaceObjectType = st.WorkspaceObjectType + + return pb, nil +} + +type getWorkspaceObjectPermissionsRequestPb struct { + WorkspaceObjectId string `json:"-" url:"-"` + + WorkspaceObjectType string `json:"-" url:"-"` +} + +func getWorkspaceObjectPermissionsRequestFromPb(pb *getWorkspaceObjectPermissionsRequestPb) (*GetWorkspaceObjectPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &GetWorkspaceObjectPermissionsRequest{} + st.WorkspaceObjectId = pb.WorkspaceObjectId + st.WorkspaceObjectType = pb.WorkspaceObjectType + + return st, nil +} + +func importToPb(st *Import) (*importPb, error) { + if st == nil { + return nil, nil + } + pb := &importPb{} + pb.Content = st.Content + + pb.Format = st.Format + + pb.Language = st.Language + + pb.Overwrite = st.Overwrite + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type importPb struct { + Content string `json:"content,omitempty"` + + Format ImportFormat `json:"format,omitempty"` + + Language Language `json:"language,omitempty"` + + Overwrite bool `json:"overwrite,omitempty"` + + Path string `json:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func importFromPb(pb *importPb) (*Import, error) { + if pb == nil { + return nil, nil + } + st := &Import{} + st.Content = pb.Content + st.Format = pb.Format + st.Language = pb.Language + st.Overwrite = pb.Overwrite + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *importPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st importPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func importResponseToPb(st *ImportResponse) (*importResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &importResponsePb{} + + return pb, nil +} + +type importResponsePb struct { +} + +func importResponseFromPb(pb *importResponsePb) (*ImportResponse, error) { + if pb == nil { + return nil, nil + } + st := &ImportResponse{} + + return st, nil +} + +func listAclsRequestToPb(st *ListAclsRequest) (*listAclsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listAclsRequestPb{} + pb.Scope = st.Scope + + return pb, nil +} + +type listAclsRequestPb struct { + Scope string `json:"-" url:"scope"` +} + +func listAclsRequestFromPb(pb *listAclsRequestPb) (*ListAclsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListAclsRequest{} + st.Scope = pb.Scope + + return st, nil +} + +func listAclsResponseToPb(st *ListAclsResponse) (*listAclsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listAclsResponsePb{} + pb.Items = st.Items + + return pb, nil +} + +type listAclsResponsePb struct { + Items []AclItem `json:"items,omitempty"` +} + +func listAclsResponseFromPb(pb *listAclsResponsePb) (*ListAclsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListAclsResponse{} + st.Items = pb.Items + + return st, nil +} + +func listCredentialsResponseToPb(st *ListCredentialsResponse) (*listCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listCredentialsResponsePb{} + pb.Credentials = st.Credentials + + return pb, nil +} + +type listCredentialsResponsePb struct { + Credentials []CredentialInfo `json:"credentials,omitempty"` +} + +func listCredentialsResponseFromPb(pb *listCredentialsResponsePb) (*ListCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListCredentialsResponse{} + st.Credentials = pb.Credentials + + return st, nil +} + +func listReposRequestToPb(st *ListReposRequest) (*listReposRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listReposRequestPb{} + pb.NextPageToken = st.NextPageToken + + pb.PathPrefix = st.PathPrefix + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listReposRequestPb struct { + NextPageToken string `json:"-" url:"next_page_token,omitempty"` + + PathPrefix string `json:"-" url:"path_prefix,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listReposRequestFromPb(pb *listReposRequestPb) (*ListReposRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListReposRequest{} + st.NextPageToken = pb.NextPageToken + st.PathPrefix = pb.PathPrefix + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listReposRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listReposRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listReposResponseToPb(st *ListReposResponse) (*listReposResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listReposResponsePb{} + pb.NextPageToken = st.NextPageToken + + pb.Repos = st.Repos + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listReposResponsePb struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Repos []RepoInfo `json:"repos,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listReposResponseFromPb(pb *listReposResponsePb) (*ListReposResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListReposResponse{} + st.NextPageToken = pb.NextPageToken + st.Repos = pb.Repos + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listReposResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listReposResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func listResponseToPb(st *ListResponse) (*listResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listResponsePb{} + pb.Objects = st.Objects + + return pb, nil +} + +type listResponsePb struct { + Objects []ObjectInfo `json:"objects,omitempty"` +} + +func listResponseFromPb(pb *listResponsePb) (*ListResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListResponse{} + st.Objects = pb.Objects + + return st, nil +} + +func listScopesResponseToPb(st *ListScopesResponse) (*listScopesResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listScopesResponsePb{} + pb.Scopes = st.Scopes + + return pb, nil +} + +type listScopesResponsePb struct { + Scopes []SecretScope `json:"scopes,omitempty"` +} + +func listScopesResponseFromPb(pb *listScopesResponsePb) (*ListScopesResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListScopesResponse{} + st.Scopes = pb.Scopes + + return st, nil +} + +func listSecretsRequestToPb(st *ListSecretsRequest) (*listSecretsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listSecretsRequestPb{} + pb.Scope = st.Scope + + return pb, nil +} + +type listSecretsRequestPb struct { + Scope string `json:"-" url:"scope"` +} + +func listSecretsRequestFromPb(pb *listSecretsRequestPb) (*ListSecretsRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListSecretsRequest{} + st.Scope = pb.Scope + + return st, nil +} + +func listSecretsResponseToPb(st *ListSecretsResponse) (*listSecretsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &listSecretsResponsePb{} + pb.Secrets = st.Secrets + + return pb, nil +} + +type listSecretsResponsePb struct { + Secrets []SecretMetadata `json:"secrets,omitempty"` +} + +func listSecretsResponseFromPb(pb *listSecretsResponsePb) (*ListSecretsResponse, error) { + if pb == nil { + return nil, nil + } + st := &ListSecretsResponse{} + st.Secrets = pb.Secrets + + return st, nil +} + +func listWorkspaceRequestToPb(st *ListWorkspaceRequest) (*listWorkspaceRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &listWorkspaceRequestPb{} + pb.NotebooksModifiedAfter = st.NotebooksModifiedAfter + + pb.Path = st.Path + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type listWorkspaceRequestPb struct { + NotebooksModifiedAfter int64 `json:"-" url:"notebooks_modified_after,omitempty"` + + Path string `json:"-" url:"path"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func listWorkspaceRequestFromPb(pb *listWorkspaceRequestPb) (*ListWorkspaceRequest, error) { + if pb == nil { + return nil, nil + } + st := &ListWorkspaceRequest{} + st.NotebooksModifiedAfter = pb.NotebooksModifiedAfter + st.Path = pb.Path + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *listWorkspaceRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st listWorkspaceRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func mkdirsToPb(st *Mkdirs) (*mkdirsPb, error) { + if st == nil { + return nil, nil + } + pb := &mkdirsPb{} + pb.Path = st.Path + + return pb, nil +} + +type mkdirsPb struct { + Path string `json:"path"` +} + +func mkdirsFromPb(pb *mkdirsPb) (*Mkdirs, error) { + if pb == nil { + return nil, nil + } + st := &Mkdirs{} + st.Path = pb.Path + + return st, nil +} + +func mkdirsResponseToPb(st *MkdirsResponse) (*mkdirsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &mkdirsResponsePb{} + + return pb, nil +} + +type mkdirsResponsePb struct { +} + +func mkdirsResponseFromPb(pb *mkdirsResponsePb) (*MkdirsResponse, error) { + if pb == nil { + return nil, nil + } + st := &MkdirsResponse{} + + return st, nil +} + +func objectInfoToPb(st *ObjectInfo) (*objectInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &objectInfoPb{} + pb.CreatedAt = st.CreatedAt + + pb.Language = st.Language + + pb.ModifiedAt = st.ModifiedAt + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.Path = st.Path + + pb.ResourceId = st.ResourceId + + pb.Size = st.Size + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type objectInfoPb struct { + CreatedAt int64 `json:"created_at,omitempty"` + + Language Language `json:"language,omitempty"` + + ModifiedAt int64 `json:"modified_at,omitempty"` + + ObjectId int64 `json:"object_id,omitempty"` + + ObjectType ObjectType `json:"object_type,omitempty"` + + Path string `json:"path,omitempty"` + + ResourceId string `json:"resource_id,omitempty"` + + Size int64 `json:"size,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func objectInfoFromPb(pb *objectInfoPb) (*ObjectInfo, error) { + if pb == nil { + return nil, nil + } + st := &ObjectInfo{} + st.CreatedAt = pb.CreatedAt + st.Language = pb.Language + st.ModifiedAt = pb.ModifiedAt + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + st.Path = pb.Path + st.ResourceId = pb.ResourceId + st.Size = pb.Size + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *objectInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st objectInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func putAclToPb(st *PutAcl) (*putAclPb, error) { + if st == nil { + return nil, nil + } + pb := &putAclPb{} + pb.Permission = st.Permission + + pb.Principal = st.Principal + + pb.Scope = st.Scope + + return pb, nil +} + +type putAclPb struct { + Permission AclPermission `json:"permission"` + + Principal string `json:"principal"` + + Scope string `json:"scope"` +} + +func putAclFromPb(pb *putAclPb) (*PutAcl, error) { + if pb == nil { + return nil, nil + } + st := &PutAcl{} + st.Permission = pb.Permission + st.Principal = pb.Principal + st.Scope = pb.Scope + + return st, nil +} + +func putAclResponseToPb(st *PutAclResponse) (*putAclResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &putAclResponsePb{} + + return pb, nil +} + +type putAclResponsePb struct { +} + +func putAclResponseFromPb(pb *putAclResponsePb) (*PutAclResponse, error) { + if pb == nil { + return nil, nil + } + st := &PutAclResponse{} + + return st, nil +} + +func putSecretToPb(st *PutSecret) (*putSecretPb, error) { + if st == nil { + return nil, nil + } + pb := &putSecretPb{} + pb.BytesValue = st.BytesValue + + pb.Key = st.Key + + pb.Scope = st.Scope + + pb.StringValue = st.StringValue + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type putSecretPb struct { + BytesValue string `json:"bytes_value,omitempty"` + + Key string `json:"key"` + + Scope string `json:"scope"` + + StringValue string `json:"string_value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func putSecretFromPb(pb *putSecretPb) (*PutSecret, error) { + if pb == nil { + return nil, nil + } + st := &PutSecret{} + st.BytesValue = pb.BytesValue + st.Key = pb.Key + st.Scope = pb.Scope + st.StringValue = pb.StringValue + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *putSecretPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st putSecretPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func putSecretResponseToPb(st *PutSecretResponse) (*putSecretResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &putSecretResponsePb{} + + return pb, nil +} + +type putSecretResponsePb struct { +} + +func putSecretResponseFromPb(pb *putSecretResponsePb) (*PutSecretResponse, error) { + if pb == nil { + return nil, nil + } + st := &PutSecretResponse{} + + return st, nil +} + +func repoAccessControlRequestToPb(st *RepoAccessControlRequest) (*repoAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &repoAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoAccessControlRequestFromPb(pb *repoAccessControlRequestPb) (*RepoAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &RepoAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoAccessControlResponseToPb(st *RepoAccessControlResponse) (*repoAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &repoAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoAccessControlResponsePb struct { + AllPermissions []RepoPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoAccessControlResponseFromPb(pb *repoAccessControlResponsePb) (*RepoAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &RepoAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoInfoToPb(st *RepoInfo) (*repoInfoPb, error) { + if st == nil { + return nil, nil + } + pb := &repoInfoPb{} + pb.Branch = st.Branch + + pb.HeadCommitId = st.HeadCommitId + + pb.Id = st.Id + + pb.Path = st.Path + + pb.Provider = st.Provider + + pb.SparseCheckout = st.SparseCheckout + + pb.Url = st.Url + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoInfoPb struct { + Branch string `json:"branch,omitempty"` + + HeadCommitId string `json:"head_commit_id,omitempty"` + + Id int64 `json:"id,omitempty"` + + Path string `json:"path,omitempty"` + + Provider string `json:"provider,omitempty"` + + SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoInfoFromPb(pb *repoInfoPb) (*RepoInfo, error) { + if pb == nil { + return nil, nil + } + st := &RepoInfo{} + st.Branch = pb.Branch + st.HeadCommitId = pb.HeadCommitId + st.Id = pb.Id + st.Path = pb.Path + st.Provider = pb.Provider + st.SparseCheckout = pb.SparseCheckout + st.Url = pb.Url + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoInfoPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoInfoPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoPermissionToPb(st *RepoPermission) (*repoPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &repoPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoPermissionFromPb(pb *repoPermissionPb) (*RepoPermission, error) { + if pb == nil { + return nil, nil + } + st := &RepoPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoPermissionsToPb(st *RepoPermissions) (*repoPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &repoPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoPermissionsPb struct { + AccessControlList []RepoAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoPermissionsFromPb(pb *repoPermissionsPb) (*RepoPermissions, error) { + if pb == nil { + return nil, nil + } + st := &RepoPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoPermissionsDescriptionToPb(st *RepoPermissionsDescription) (*repoPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &repoPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type repoPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func repoPermissionsDescriptionFromPb(pb *repoPermissionsDescriptionPb) (*RepoPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &RepoPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *repoPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st repoPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func repoPermissionsRequestToPb(st *RepoPermissionsRequest) (*repoPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &repoPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.RepoId = st.RepoId + + return pb, nil +} + +type repoPermissionsRequestPb struct { + AccessControlList []RepoAccessControlRequest `json:"access_control_list,omitempty"` + + RepoId string `json:"-" url:"-"` +} + +func repoPermissionsRequestFromPb(pb *repoPermissionsRequestPb) (*RepoPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &RepoPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.RepoId = pb.RepoId + + return st, nil +} + +func secretMetadataToPb(st *SecretMetadata) (*secretMetadataPb, error) { + if st == nil { + return nil, nil + } + pb := &secretMetadataPb{} + pb.Key = st.Key + + pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type secretMetadataPb struct { + Key string `json:"key,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func secretMetadataFromPb(pb *secretMetadataPb) (*SecretMetadata, error) { + if pb == nil { + return nil, nil + } + st := &SecretMetadata{} + st.Key = pb.Key + st.LastUpdatedTimestamp = pb.LastUpdatedTimestamp + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *secretMetadataPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st secretMetadataPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func secretScopeToPb(st *SecretScope) (*secretScopePb, error) { + if st == nil { + return nil, nil + } + pb := &secretScopePb{} + pb.BackendType = st.BackendType + + pb.KeyvaultMetadata = st.KeyvaultMetadata + + pb.Name = st.Name + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type secretScopePb struct { + BackendType ScopeBackendType `json:"backend_type,omitempty"` + + KeyvaultMetadata *AzureKeyVaultSecretScopeMetadata `json:"keyvault_metadata,omitempty"` + + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func secretScopeFromPb(pb *secretScopePb) (*SecretScope, error) { + if pb == nil { + return nil, nil + } + st := &SecretScope{} + st.BackendType = pb.BackendType + st.KeyvaultMetadata = pb.KeyvaultMetadata + st.Name = pb.Name + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *secretScopePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st secretScopePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func sparseCheckoutToPb(st *SparseCheckout) (*sparseCheckoutPb, error) { + if st == nil { + return nil, nil + } + pb := &sparseCheckoutPb{} + pb.Patterns = st.Patterns + + return pb, nil +} + +type sparseCheckoutPb struct { + Patterns []string `json:"patterns,omitempty"` +} + +func sparseCheckoutFromPb(pb *sparseCheckoutPb) (*SparseCheckout, error) { + if pb == nil { + return nil, nil + } + st := &SparseCheckout{} + st.Patterns = pb.Patterns + + return st, nil +} + +func sparseCheckoutUpdateToPb(st *SparseCheckoutUpdate) (*sparseCheckoutUpdatePb, error) { + if st == nil { + return nil, nil + } + pb := &sparseCheckoutUpdatePb{} + pb.Patterns = st.Patterns + + return pb, nil +} + +type sparseCheckoutUpdatePb struct { + Patterns []string `json:"patterns,omitempty"` +} + +func sparseCheckoutUpdateFromPb(pb *sparseCheckoutUpdatePb) (*SparseCheckoutUpdate, error) { + if pb == nil { + return nil, nil + } + st := &SparseCheckoutUpdate{} + st.Patterns = pb.Patterns + + return st, nil +} + +func updateCredentialsRequestToPb(st *UpdateCredentialsRequest) (*updateCredentialsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateCredentialsRequestPb{} + pb.CredentialId = st.CredentialId + + pb.GitProvider = st.GitProvider + + pb.GitUsername = st.GitUsername + + pb.PersonalAccessToken = st.PersonalAccessToken + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateCredentialsRequestPb struct { + CredentialId int64 `json:"-" url:"-"` + + GitProvider string `json:"git_provider"` + + GitUsername string `json:"git_username,omitempty"` + + PersonalAccessToken string `json:"personal_access_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateCredentialsRequestFromPb(pb *updateCredentialsRequestPb) (*UpdateCredentialsRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCredentialsRequest{} + st.CredentialId = pb.CredentialId + st.GitProvider = pb.GitProvider + st.GitUsername = pb.GitUsername + st.PersonalAccessToken = pb.PersonalAccessToken + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateCredentialsRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateCredentialsRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateCredentialsResponseToPb(st *UpdateCredentialsResponse) (*updateCredentialsResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateCredentialsResponsePb{} + + return pb, nil +} + +type updateCredentialsResponsePb struct { +} + +func updateCredentialsResponseFromPb(pb *updateCredentialsResponsePb) (*UpdateCredentialsResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateCredentialsResponse{} + + return st, nil +} + +func updateRepoRequestToPb(st *UpdateRepoRequest) (*updateRepoRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &updateRepoRequestPb{} + pb.Branch = st.Branch + + pb.RepoId = st.RepoId + + pb.SparseCheckout = st.SparseCheckout + + pb.Tag = st.Tag + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type updateRepoRequestPb struct { + Branch string `json:"branch,omitempty"` + + RepoId int64 `json:"-" url:"-"` + + SparseCheckout *SparseCheckoutUpdate `json:"sparse_checkout,omitempty"` + + Tag string `json:"tag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func updateRepoRequestFromPb(pb *updateRepoRequestPb) (*UpdateRepoRequest, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRepoRequest{} + st.Branch = pb.Branch + st.RepoId = pb.RepoId + st.SparseCheckout = pb.SparseCheckout + st.Tag = pb.Tag + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *updateRepoRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st updateRepoRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func updateRepoResponseToPb(st *UpdateRepoResponse) (*updateRepoResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &updateRepoResponsePb{} + + return pb, nil +} + +type updateRepoResponsePb struct { +} + +func updateRepoResponseFromPb(pb *updateRepoResponsePb) (*UpdateRepoResponse, error) { + if pb == nil { + return nil, nil + } + st := &UpdateRepoResponse{} + + return st, nil +} + +func workspaceObjectAccessControlRequestToPb(st *WorkspaceObjectAccessControlRequest) (*workspaceObjectAccessControlRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectAccessControlRequestPb{} + pb.GroupName = st.GroupName + + pb.PermissionLevel = st.PermissionLevel + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceObjectAccessControlRequestPb struct { + GroupName string `json:"group_name,omitempty"` + + PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceObjectAccessControlRequestFromPb(pb *workspaceObjectAccessControlRequestPb) (*WorkspaceObjectAccessControlRequest, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectAccessControlRequest{} + st.GroupName = pb.GroupName + st.PermissionLevel = pb.PermissionLevel + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceObjectAccessControlRequestPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceObjectAccessControlRequestPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceObjectAccessControlResponseToPb(st *WorkspaceObjectAccessControlResponse) (*workspaceObjectAccessControlResponsePb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectAccessControlResponsePb{} + pb.AllPermissions = st.AllPermissions + + pb.DisplayName = st.DisplayName + + pb.GroupName = st.GroupName + + pb.ServicePrincipalName = st.ServicePrincipalName + + pb.UserName = st.UserName + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceObjectAccessControlResponsePb struct { + AllPermissions []WorkspaceObjectPermission `json:"all_permissions,omitempty"` + + DisplayName string `json:"display_name,omitempty"` + + GroupName string `json:"group_name,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + + UserName string `json:"user_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceObjectAccessControlResponseFromPb(pb *workspaceObjectAccessControlResponsePb) (*WorkspaceObjectAccessControlResponse, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectAccessControlResponse{} + st.AllPermissions = pb.AllPermissions + st.DisplayName = pb.DisplayName + st.GroupName = pb.GroupName + st.ServicePrincipalName = pb.ServicePrincipalName + st.UserName = pb.UserName + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceObjectAccessControlResponsePb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceObjectAccessControlResponsePb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceObjectPermissionToPb(st *WorkspaceObjectPermission) (*workspaceObjectPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectPermissionPb{} + pb.Inherited = st.Inherited + + pb.InheritedFromObject = st.InheritedFromObject + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceObjectPermissionPb struct { + Inherited bool `json:"inherited,omitempty"` + + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + + PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceObjectPermissionFromPb(pb *workspaceObjectPermissionPb) (*WorkspaceObjectPermission, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectPermission{} + st.Inherited = pb.Inherited + st.InheritedFromObject = pb.InheritedFromObject + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceObjectPermissionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceObjectPermissionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceObjectPermissionsToPb(st *WorkspaceObjectPermissions) (*workspaceObjectPermissionsPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectPermissionsPb{} + pb.AccessControlList = st.AccessControlList + + pb.ObjectId = st.ObjectId + + pb.ObjectType = st.ObjectType + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceObjectPermissionsPb struct { + AccessControlList []WorkspaceObjectAccessControlResponse `json:"access_control_list,omitempty"` + + ObjectId string `json:"object_id,omitempty"` + + ObjectType string `json:"object_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceObjectPermissionsFromPb(pb *workspaceObjectPermissionsPb) (*WorkspaceObjectPermissions, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectPermissions{} + st.AccessControlList = pb.AccessControlList + st.ObjectId = pb.ObjectId + st.ObjectType = pb.ObjectType + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceObjectPermissionsPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceObjectPermissionsPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceObjectPermissionsDescriptionToPb(st *WorkspaceObjectPermissionsDescription) (*workspaceObjectPermissionsDescriptionPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectPermissionsDescriptionPb{} + pb.Description = st.Description + + pb.PermissionLevel = st.PermissionLevel + + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} + +type workspaceObjectPermissionsDescriptionPb struct { + Description string `json:"description,omitempty"` + + PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func workspaceObjectPermissionsDescriptionFromPb(pb *workspaceObjectPermissionsDescriptionPb) (*WorkspaceObjectPermissionsDescription, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectPermissionsDescription{} + st.Description = pb.Description + st.PermissionLevel = pb.PermissionLevel + + st.ForceSendFields = pb.ForceSendFields + return st, nil +} + +func (st *workspaceObjectPermissionsDescriptionPb) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, st) +} + +func (st workspaceObjectPermissionsDescriptionPb) MarshalJSON() ([]byte, error) { + return marshal.Marshal(st) +} + +func workspaceObjectPermissionsRequestToPb(st *WorkspaceObjectPermissionsRequest) (*workspaceObjectPermissionsRequestPb, error) { + if st == nil { + return nil, nil + } + pb := &workspaceObjectPermissionsRequestPb{} + pb.AccessControlList = st.AccessControlList + + pb.WorkspaceObjectId = st.WorkspaceObjectId + + pb.WorkspaceObjectType = st.WorkspaceObjectType + + return pb, nil +} + +type workspaceObjectPermissionsRequestPb struct { + AccessControlList []WorkspaceObjectAccessControlRequest `json:"access_control_list,omitempty"` + + WorkspaceObjectId string `json:"-" url:"-"` + + WorkspaceObjectType string `json:"-" url:"-"` +} + +func workspaceObjectPermissionsRequestFromPb(pb *workspaceObjectPermissionsRequestPb) (*WorkspaceObjectPermissionsRequest, error) { + if pb == nil { + return nil, nil + } + st := &WorkspaceObjectPermissionsRequest{} + st.AccessControlList = pb.AccessControlList + st.WorkspaceObjectId = pb.WorkspaceObjectId + st.WorkspaceObjectType = pb.WorkspaceObjectType + + return st, nil +} diff --git a/service/workspace/model.go b/service/workspace/model.go index 82e7bad67..1e3283d46 100755 --- a/service/workspace/model.go +++ b/service/workspace/model.go @@ -3,19 +3,48 @@ package workspace import ( + "encoding/json" "fmt" - - "github.com/databricks/databricks-sdk-go/marshal" + "strings" + "time" ) type AclItem struct { // The permission level applied to the principal. - Permission AclPermission `json:"permission"` + // Wire name: 'permission' + Permission AclPermission // The principal in which the permission is applied. - Principal string `json:"principal"` + // Wire name: 'principal' + Principal string +} + +func (st *AclItem) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &aclItemPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := aclItemFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AclItem) MarshalJSON() ([]byte, error) { + pb, err := aclItemToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type AclPermission string +type aclPermissionPb string const AclPermissionManage AclPermission = `MANAGE` @@ -44,12 +73,55 @@ func (f *AclPermission) Type() string { return "AclPermission" } +func aclPermissionToPb(st *AclPermission) (*aclPermissionPb, error) { + if st == nil { + return nil, nil + } + pb := aclPermissionPb(*st) + return &pb, nil +} + +func aclPermissionFromPb(pb *aclPermissionPb) (*AclPermission, error) { + if pb == nil { + return nil, nil + } + st := AclPermission(*pb) + return &st, nil +} + type AzureKeyVaultSecretScopeMetadata struct { // The DNS of the KeyVault - DnsName string `json:"dns_name"` + // Wire name: 'dns_name' + DnsName string // The resource id of the azure KeyVault that user wants to associate the // scope with. - ResourceId string `json:"resource_id"` + // Wire name: 'resource_id' + ResourceId string +} + +func (st *AzureKeyVaultSecretScopeMetadata) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &azureKeyVaultSecretScopeMetadataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := azureKeyVaultSecretScopeMetadataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st AzureKeyVaultSecretScopeMetadata) MarshalJSON() ([]byte, error) { + pb, err := azureKeyVaultSecretScopeMetadataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialsRequest struct { @@ -57,7 +129,8 @@ type CreateCredentialsRequest struct { // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider string `json:"git_provider"` + // Wire name: 'git_provider' + GitProvider string // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -65,217 +138,669 @@ type CreateCredentialsRequest struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername string `json:"git_username,omitempty"` + // Wire name: 'git_username' + GitUsername string // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken string `json:"personal_access_token,omitempty"` + // Wire name: 'personal_access_token' + PersonalAccessToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCredentialsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCredentialsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := createCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateCredentialsResponse struct { // ID of the credential object in the workspace. - CredentialId int64 `json:"credential_id"` + // Wire name: 'credential_id' + CredentialId int64 // The Git provider associated with the credential. - GitProvider string `json:"git_provider"` + // Wire name: 'git_provider' + GitProvider string // The username or email provided with your Git provider account and // associated with the credential. - GitUsername string `json:"git_username,omitempty"` + // Wire name: 'git_username' + GitUsername string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateCredentialsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateCredentialsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := createCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRepoRequest struct { // Desired path for the repo in the workspace. Almost any path in the // workspace can be chosen. If repo is created in `/Repos`, path must be in // the format `/Repos/{folder}/{repo-name}`. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // Git provider. This field is case-insensitive. The available Git providers // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - Provider string `json:"provider"` + // Wire name: 'provider' + Provider string // If specified, the repo will be created with sparse checkout enabled. You // cannot enable/disable sparse checkout after the repo is created. - SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + // Wire name: 'sparse_checkout' + SparseCheckout *SparseCheckout // URL of the Git repository to be linked. - Url string `json:"url"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRepoRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRepoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRepoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRepoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRepoRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRepoRequest) MarshalJSON() ([]byte, error) { + pb, err := createRepoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateRepoResponse struct { // Branch that the Git folder (repo) is checked out to. - Branch string `json:"branch,omitempty"` + // Wire name: 'branch' + Branch string // SHA-1 hash representing the commit ID of the current HEAD of the Git // folder (repo). - HeadCommitId string `json:"head_commit_id,omitempty"` + // Wire name: 'head_commit_id' + HeadCommitId string // ID of the Git folder (repo) object in the workspace. - Id int64 `json:"id,omitempty"` + // Wire name: 'id' + Id int64 // Path of the Git folder (repo) in the workspace. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // Git provider of the linked Git repository. - Provider string `json:"provider,omitempty"` + // Wire name: 'provider' + Provider string // Sparse checkout settings for the Git folder (repo). - SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + // Wire name: 'sparse_checkout' + SparseCheckout *SparseCheckout // URL of the linked Git repository. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateRepoResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateRepoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createRepoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createRepoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateRepoResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateRepoResponse) MarshalJSON() ([]byte, error) { + pb, err := createRepoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateScope struct { // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - BackendAzureKeyvault *AzureKeyVaultSecretScopeMetadata `json:"backend_azure_keyvault,omitempty"` + // Wire name: 'backend_azure_keyvault' + BackendAzureKeyvault *AzureKeyVaultSecretScopeMetadata // The principal that is initially granted `MANAGE` permission to the // created scope. - InitialManagePrincipal string `json:"initial_manage_principal,omitempty"` + // Wire name: 'initial_manage_principal' + InitialManagePrincipal string // Scope name requested by the user. Scope names are unique. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string // The backend type the scope will be created with. If not specified, will // default to `DATABRICKS` - ScopeBackendType ScopeBackendType `json:"scope_backend_type,omitempty"` + // Wire name: 'scope_backend_type' + ScopeBackendType ScopeBackendType - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CreateScope) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CreateScope) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createScopePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createScopeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CreateScope) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CreateScope) MarshalJSON() ([]byte, error) { + pb, err := createScopeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type CreateScopeResponse struct { } +func (st *CreateScopeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &createScopeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := createScopeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st CreateScopeResponse) MarshalJSON() ([]byte, error) { + pb, err := createScopeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type CredentialInfo struct { // ID of the credential object in the workspace. - CredentialId int64 `json:"credential_id"` + // Wire name: 'credential_id' + CredentialId int64 // The Git provider associated with the credential. - GitProvider string `json:"git_provider,omitempty"` + // Wire name: 'git_provider' + GitProvider string // The username or email provided with your Git provider account and // associated with the credential. - GitUsername string `json:"git_username,omitempty"` + // Wire name: 'git_username' + GitUsername string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *CredentialInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *CredentialInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &credentialInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := credentialInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s CredentialInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st CredentialInfo) MarshalJSON() ([]byte, error) { + pb, err := credentialInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Delete struct { // The absolute path of the notebook or directory. - Path string `json:"path"` + // Wire name: 'path' + Path string // The flag that specifies whether to delete the object recursively. It is // `false` by default. Please note this deleting directory is not atomic. If // it fails in the middle, some of objects under this directory may be // deleted and cannot be undone. - Recursive bool `json:"recursive,omitempty"` + // Wire name: 'recursive' + Recursive bool - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Delete) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Delete) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deletePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Delete) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Delete) MarshalJSON() ([]byte, error) { + pb, err := deleteToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteAcl struct { // The principal to remove an existing ACL from. - Principal string `json:"principal"` + // Wire name: 'principal' + Principal string // The name of the scope to remove permissions from. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string +} + +func (st *DeleteAcl) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAclPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAclFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAcl) MarshalJSON() ([]byte, error) { + pb, err := deleteAclToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteAclResponse struct { } +func (st *DeleteAclResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteAclResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteAclResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteAclResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteAclResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a credential type DeleteCredentialsRequest struct { // The ID for the corresponding credential to access. - CredentialId int64 `json:"-" url:"-"` + // Wire name: 'credential_id' + CredentialId int64 `tf:"-"` +} + +func (st *DeleteCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteCredentialsResponse struct { } +func (st *DeleteCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // Delete a repo type DeleteRepoRequest struct { // The ID for the corresponding repo to delete. - RepoId int64 `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId int64 `tf:"-"` +} + +func (st *DeleteRepoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRepoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRepoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRepoRequest) MarshalJSON() ([]byte, error) { + pb, err := deleteRepoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteRepoResponse struct { } +func (st *DeleteRepoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteRepoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteRepoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteRepoResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteRepoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteResponse struct { } +func (st *DeleteResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteScope struct { // Name of the scope to delete. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string +} + +func (st *DeleteScope) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteScopePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteScopeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteScope) MarshalJSON() ([]byte, error) { + pb, err := deleteScopeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteScopeResponse struct { } +func (st *DeleteScopeResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteScopeResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteScopeResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteScopeResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteScopeResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type DeleteSecret struct { // Name of the secret to delete. - Key string `json:"key"` + // Wire name: 'key' + Key string // The name of the scope that contains the secret to delete. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string +} + +func (st *DeleteSecret) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSecretPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSecretFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteSecret) MarshalJSON() ([]byte, error) { + pb, err := deleteSecretToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type DeleteSecretResponse struct { } +func (st *DeleteSecretResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &deleteSecretResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := deleteSecretResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st DeleteSecretResponse) MarshalJSON() ([]byte, error) { + pb, err := deleteSecretResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The format for workspace import and export. type ExportFormat string +type exportFormatPb string const ExportFormatAuto ExportFormat = `AUTO` @@ -312,6 +837,22 @@ func (f *ExportFormat) Type() string { return "ExportFormat" } +func exportFormatToPb(st *ExportFormat) (*exportFormatPb, error) { + if st == nil { + return nil, nil + } + pb := exportFormatPb(*st) + return &pb, nil +} + +func exportFormatFromPb(pb *exportFormatPb) (*ExportFormat, error) { + if pb == nil { + return nil, nil + } + st := ExportFormat(*pb) + return &st, nil +} + // Export a workspace object type ExportRequest struct { // This specifies the format of the exported file. By default, this is @@ -328,10 +869,37 @@ type ExportRequest struct { // Markdown format. - `AUTO`: The object or directory is exported depending // on the objects type. Directory exports will include notebooks and // workspace files. - Format ExportFormat `json:"-" url:"format,omitempty"` + // Wire name: 'format' + Format ExportFormat `tf:"-"` // The absolute path of the object or directory. Exporting a directory is // only supported for the `DBC`, `SOURCE`, and `AUTO` format. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` +} + +func (st *ExportRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ExportRequest) MarshalJSON() ([]byte, error) { + pb, err := exportRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The request field `direct_download` determines whether a JSON response or @@ -339,155 +907,527 @@ type ExportRequest struct { type ExportResponse struct { // The base64-encoded content. If the limit (10MB) is exceeded, exception // with error code **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string // The file type of the exported file. - FileType string `json:"file_type,omitempty"` + // Wire name: 'file_type' + FileType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ExportResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ExportResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &exportResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := exportResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ExportResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ExportResponse) MarshalJSON() ([]byte, error) { + pb, err := exportResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get secret ACL details type GetAclRequest struct { // The principal to fetch ACL information for. - Principal string `json:"-" url:"principal"` + // Wire name: 'principal' + Principal string `tf:"-"` // The name of the scope to fetch ACL information from. - Scope string `json:"-" url:"scope"` + // Wire name: 'scope' + Scope string `tf:"-"` +} + +func (st *GetAclRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getAclRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getAclRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetAclRequest) MarshalJSON() ([]byte, error) { + pb, err := getAclRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a credential entry type GetCredentialsRequest struct { // The ID for the corresponding credential to access. - CredentialId int64 `json:"-" url:"-"` + // Wire name: 'credential_id' + CredentialId int64 `tf:"-"` +} + +func (st *GetCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetCredentialsResponse struct { // ID of the credential object in the workspace. - CredentialId int64 `json:"credential_id"` + // Wire name: 'credential_id' + CredentialId int64 // The Git provider associated with the credential. - GitProvider string `json:"git_provider,omitempty"` + // Wire name: 'git_provider' + GitProvider string // The username or email provided with your Git provider account and // associated with the credential. - GitUsername string `json:"git_username,omitempty"` + // Wire name: 'git_username' + GitUsername string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetCredentialsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetCredentialsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := getCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get repo permission levels type GetRepoPermissionLevelsRequest struct { // The repo for which to get or manage permissions. - RepoId string `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId string `tf:"-"` +} + +func (st *GetRepoPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRepoPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRepoPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRepoPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getRepoPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetRepoPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []RepoPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []RepoPermissionsDescription +} + +func (st *GetRepoPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRepoPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRepoPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRepoPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getRepoPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get repo permissions type GetRepoPermissionsRequest struct { // The repo for which to get or manage permissions. - RepoId string `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId string `tf:"-"` +} + +func (st *GetRepoPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRepoPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRepoPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRepoPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getRepoPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a repo type GetRepoRequest struct { // ID of the Git folder (repo) object in the workspace. - RepoId int64 `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId int64 `tf:"-"` +} + +func (st *GetRepoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRepoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRepoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetRepoRequest) MarshalJSON() ([]byte, error) { + pb, err := getRepoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetRepoResponse struct { // Branch that the local version of the repo is checked out to. - Branch string `json:"branch,omitempty"` + // Wire name: 'branch' + Branch string // SHA-1 hash representing the commit ID of the current HEAD of the repo. - HeadCommitId string `json:"head_commit_id,omitempty"` + // Wire name: 'head_commit_id' + HeadCommitId string // ID of the Git folder (repo) object in the workspace. - Id int64 `json:"id,omitempty"` + // Wire name: 'id' + Id int64 // Path of the Git folder (repo) in the workspace. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // Git provider of the linked Git repository. - Provider string `json:"provider,omitempty"` + // Wire name: 'provider' + Provider string // Sparse checkout settings for the Git folder (repo). - SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + // Wire name: 'sparse_checkout' + SparseCheckout *SparseCheckout // URL of the linked Git repository. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetRepoResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetRepoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getRepoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getRepoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetRepoResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetRepoResponse) MarshalJSON() ([]byte, error) { + pb, err := getRepoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get a secret type GetSecretRequest struct { // The key to fetch secret for. - Key string `json:"-" url:"key"` + // Wire name: 'key' + Key string `tf:"-"` // The name of the scope to fetch secret information from. - Scope string `json:"-" url:"scope"` + // Wire name: 'scope' + Scope string `tf:"-"` +} + +func (st *GetSecretRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSecretRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSecretRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetSecretRequest) MarshalJSON() ([]byte, error) { + pb, err := getSecretRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetSecretResponse struct { // A unique name to identify the secret. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The value of the secret in its byte representation. - Value string `json:"value,omitempty"` + // Wire name: 'value' + Value string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *GetSecretResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *GetSecretResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getSecretResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getSecretResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s GetSecretResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st GetSecretResponse) MarshalJSON() ([]byte, error) { + pb, err := getSecretResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get status type GetStatusRequest struct { // The absolute path of the notebook or directory. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` +} + +func (st *GetStatusRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getStatusRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getStatusRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetStatusRequest) MarshalJSON() ([]byte, error) { + pb, err := getStatusRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get workspace object permission levels type GetWorkspaceObjectPermissionLevelsRequest struct { // The workspace object for which to get or manage permissions. - WorkspaceObjectId string `json:"-" url:"-"` + // Wire name: 'workspace_object_id' + WorkspaceObjectId string `tf:"-"` // The workspace object type for which to get or manage permissions. - WorkspaceObjectType string `json:"-" url:"-"` + // Wire name: 'workspace_object_type' + WorkspaceObjectType string `tf:"-"` +} + +func (st *GetWorkspaceObjectPermissionLevelsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceObjectPermissionLevelsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceObjectPermissionLevelsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceObjectPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceObjectPermissionLevelsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type GetWorkspaceObjectPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels []WorkspaceObjectPermissionsDescription `json:"permission_levels,omitempty"` + // Wire name: 'permission_levels' + PermissionLevels []WorkspaceObjectPermissionsDescription +} + +func (st *GetWorkspaceObjectPermissionLevelsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceObjectPermissionLevelsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceObjectPermissionLevelsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceObjectPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceObjectPermissionLevelsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get workspace object permissions type GetWorkspaceObjectPermissionsRequest struct { // The workspace object for which to get or manage permissions. - WorkspaceObjectId string `json:"-" url:"-"` + // Wire name: 'workspace_object_id' + WorkspaceObjectId string `tf:"-"` // The workspace object type for which to get or manage permissions. - WorkspaceObjectType string `json:"-" url:"-"` + // Wire name: 'workspace_object_type' + WorkspaceObjectType string `tf:"-"` +} + +func (st *GetWorkspaceObjectPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &getWorkspaceObjectPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := getWorkspaceObjectPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st GetWorkspaceObjectPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := getWorkspaceObjectPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Import struct { @@ -496,7 +1436,8 @@ type Import struct { // If the limit (10MB) is exceeded, exception with error code // **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. This parameter might be absent, // and instead a posted file is used. - Content string `json:"content,omitempty"` + // Wire name: 'content' + Content string // This specifies the format of the file to be imported. // // The value is case sensitive. @@ -510,31 +1451,53 @@ type Import struct { // notebook is imported in Databricks archive format. Required for // directories. - `R_MARKDOWN`: The notebook is imported from R Markdown // format. - Format ImportFormat `json:"format,omitempty"` + // Wire name: 'format' + Format ImportFormat // The language of the object. This value is set only if the object type is // `NOTEBOOK`. - Language Language `json:"language,omitempty"` + // Wire name: 'language' + Language Language // The flag that specifies whether to overwrite existing object. It is // `false` by default. For `DBC` format, `overwrite` is not supported since // it may contain a directory. - Overwrite bool `json:"overwrite,omitempty"` + // Wire name: 'overwrite' + Overwrite bool // The absolute path of the object or directory. Importing a directory is // only supported for the `DBC` and `SOURCE` formats. - Path string `json:"path"` + // Wire name: 'path' + Path string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *Import) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *Import) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &importPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := importFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s Import) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st Import) MarshalJSON() ([]byte, error) { + pb, err := importToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The format for workspace import and export. type ImportFormat string +type importFormatPb string const ImportFormatAuto ImportFormat = `AUTO` @@ -571,11 +1534,53 @@ func (f *ImportFormat) Type() string { return "ImportFormat" } +func importFormatToPb(st *ImportFormat) (*importFormatPb, error) { + if st == nil { + return nil, nil + } + pb := importFormatPb(*st) + return &pb, nil +} + +func importFormatFromPb(pb *importFormatPb) (*ImportFormat, error) { + if pb == nil { + return nil, nil + } + st := ImportFormat(*pb) + return &st, nil +} + type ImportResponse struct { } +func (st *ImportResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &importResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := importResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ImportResponse) MarshalJSON() ([]byte, error) { + pb, err := importResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The language of notebook. type Language string +type languagePb string const LanguagePython Language = `PYTHON` @@ -606,20 +1611,114 @@ func (f *Language) Type() string { return "Language" } +func languageToPb(st *Language) (*languagePb, error) { + if st == nil { + return nil, nil + } + pb := languagePb(*st) + return &pb, nil +} + +func languageFromPb(pb *languagePb) (*Language, error) { + if pb == nil { + return nil, nil + } + st := Language(*pb) + return &st, nil +} + // Lists ACLs type ListAclsRequest struct { // The name of the scope to fetch ACL information from. - Scope string `json:"-" url:"scope"` + // Wire name: 'scope' + Scope string `tf:"-"` +} + +func (st *ListAclsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAclsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAclsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAclsRequest) MarshalJSON() ([]byte, error) { + pb, err := listAclsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListAclsResponse struct { // The associated ACLs rule applied to principals in the given scope. - Items []AclItem `json:"items,omitempty"` + // Wire name: 'items' + Items []AclItem +} + +func (st *ListAclsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listAclsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listAclsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListAclsResponse) MarshalJSON() ([]byte, error) { + pb, err := listAclsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +type ListCredentialsResponse struct { + // List of credentials. + // Wire name: 'credentials' + Credentials []CredentialInfo +} + +func (st *ListCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -type ListCredentialsResponse struct { - // List of credentials. - Credentials []CredentialInfo `json:"credentials,omitempty"` +func (st ListCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := listCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Get repos @@ -627,129 +1726,367 @@ type ListReposRequest struct { // Token used to get the next page of results. If not specified, returns the // first page of results as well as a next page token if there are more // results. - NextPageToken string `json:"-" url:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string `tf:"-"` // Filters repos that have paths starting with the given path prefix. If not // provided or when provided an effectively empty prefix (`/` or // `/Workspace`) Git folders (repos) from `/Workspace/Repos` will be served. - PathPrefix string `json:"-" url:"path_prefix,omitempty"` + // Wire name: 'path_prefix' + PathPrefix string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListReposRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListReposRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listReposRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listReposRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListReposRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListReposRequest) MarshalJSON() ([]byte, error) { + pb, err := listReposRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListReposResponse struct { // Token that can be specified as a query parameter to the `GET /repos` // endpoint to retrieve the next page of results. - NextPageToken string `json:"next_page_token,omitempty"` + // Wire name: 'next_page_token' + NextPageToken string // List of Git folders (repos). - Repos []RepoInfo `json:"repos,omitempty"` + // Wire name: 'repos' + Repos []RepoInfo - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListReposResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListReposResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listReposResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listReposResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListReposResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListReposResponse) MarshalJSON() ([]byte, error) { + pb, err := listReposResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListResponse struct { // List of objects. - Objects []ObjectInfo `json:"objects,omitempty"` + // Wire name: 'objects' + Objects []ObjectInfo +} + +func (st *ListResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListResponse) MarshalJSON() ([]byte, error) { + pb, err := listResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListScopesResponse struct { // The available secret scopes. - Scopes []SecretScope `json:"scopes,omitempty"` + // Wire name: 'scopes' + Scopes []SecretScope +} + +func (st *ListScopesResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listScopesResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listScopesResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListScopesResponse) MarshalJSON() ([]byte, error) { + pb, err := listScopesResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List secret keys type ListSecretsRequest struct { // The name of the scope to list secrets within. - Scope string `json:"-" url:"scope"` + // Wire name: 'scope' + Scope string `tf:"-"` +} + +func (st *ListSecretsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSecretsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSecretsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListSecretsRequest) MarshalJSON() ([]byte, error) { + pb, err := listSecretsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ListSecretsResponse struct { // Metadata information of all secrets contained within the given scope. - Secrets []SecretMetadata `json:"secrets,omitempty"` + // Wire name: 'secrets' + Secrets []SecretMetadata +} + +func (st *ListSecretsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listSecretsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listSecretsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st ListSecretsResponse) MarshalJSON() ([]byte, error) { + pb, err := listSecretsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // List contents type ListWorkspaceRequest struct { // UTC timestamp in milliseconds - NotebooksModifiedAfter int64 `json:"-" url:"notebooks_modified_after,omitempty"` + // Wire name: 'notebooks_modified_after' + NotebooksModifiedAfter int64 `tf:"-"` // The absolute path of the notebook or directory. - Path string `json:"-" url:"path"` + // Wire name: 'path' + Path string `tf:"-"` - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ListWorkspaceRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ListWorkspaceRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &listWorkspaceRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := listWorkspaceRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ListWorkspaceRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ListWorkspaceRequest) MarshalJSON() ([]byte, error) { + pb, err := listWorkspaceRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type Mkdirs struct { // The absolute path of the directory. If the parent directories do not // exist, it will also create them. If the directory already exists, this // command will do nothing and succeed. - Path string `json:"path"` + // Wire name: 'path' + Path string +} + +func (st *Mkdirs) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mkdirsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mkdirsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st Mkdirs) MarshalJSON() ([]byte, error) { + pb, err := mkdirsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type MkdirsResponse struct { } +func (st *MkdirsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &mkdirsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := mkdirsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st MkdirsResponse) MarshalJSON() ([]byte, error) { + pb, err := mkdirsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + // The information of the object in workspace. It will be returned by “list“ // and “get-status“. type ObjectInfo struct { // Only applicable to files. The creation UTC timestamp. - CreatedAt int64 `json:"created_at,omitempty"` + // Wire name: 'created_at' + CreatedAt int64 // The language of the object. This value is set only if the object type is // ``NOTEBOOK``. - Language Language `json:"language,omitempty"` + // Wire name: 'language' + Language Language // Only applicable to files, the last modified UTC timestamp. - ModifiedAt int64 `json:"modified_at,omitempty"` + // Wire name: 'modified_at' + ModifiedAt int64 // Unique identifier for the object. - ObjectId int64 `json:"object_id,omitempty"` + // Wire name: 'object_id' + ObjectId int64 // The type of the object in workspace. // // - `NOTEBOOK`: document that contains runnable code, visualizations, and // explanatory text. - `DIRECTORY`: directory - `LIBRARY`: library - `FILE`: // file - `REPO`: repository - `DASHBOARD`: Lakeview dashboard - ObjectType ObjectType `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType ObjectType // The absolute path of the object. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // A unique identifier for the object that is consistent across all // Databricks APIs. - ResourceId string `json:"resource_id,omitempty"` + // Wire name: 'resource_id' + ResourceId string // Only applicable to files. The file size in bytes can be returned. - Size int64 `json:"size,omitempty"` + // Wire name: 'size' + Size int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *ObjectInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *ObjectInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &objectInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := objectInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s ObjectInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st ObjectInfo) MarshalJSON() ([]byte, error) { + pb, err := objectInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // The type of the object in workspace. type ObjectType string +type objectTypePb string const ObjectTypeDashboard ObjectType = `DASHBOARD` @@ -784,134 +2121,338 @@ func (f *ObjectType) Type() string { return "ObjectType" } +func objectTypeToPb(st *ObjectType) (*objectTypePb, error) { + if st == nil { + return nil, nil + } + pb := objectTypePb(*st) + return &pb, nil +} + +func objectTypeFromPb(pb *objectTypePb) (*ObjectType, error) { + if pb == nil { + return nil, nil + } + st := ObjectType(*pb) + return &st, nil +} + type PutAcl struct { // The permission level applied to the principal. - Permission AclPermission `json:"permission"` + // Wire name: 'permission' + Permission AclPermission // The principal in which the permission is applied. - Principal string `json:"principal"` + // Wire name: 'principal' + Principal string // The name of the scope to apply permissions to. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string +} + +func (st *PutAcl) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putAclPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putAclFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutAcl) MarshalJSON() ([]byte, error) { + pb, err := putAclToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutAclResponse struct { } +func (st *PutAclResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putAclResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putAclResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutAclResponse) MarshalJSON() ([]byte, error) { + pb, err := putAclResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type PutSecret struct { // If specified, value will be stored as bytes. - BytesValue string `json:"bytes_value,omitempty"` + // Wire name: 'bytes_value' + BytesValue string // A unique name to identify the secret. - Key string `json:"key"` + // Wire name: 'key' + Key string // The name of the scope to which the secret will be associated with. - Scope string `json:"scope"` + // Wire name: 'scope' + Scope string // If specified, note that the value will be stored in UTF-8 (MB4) form. - StringValue string `json:"string_value,omitempty"` + // Wire name: 'string_value' + StringValue string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *PutSecret) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *PutSecret) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putSecretPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putSecretFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s PutSecret) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st PutSecret) MarshalJSON() ([]byte, error) { + pb, err := putSecretToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type PutSecretResponse struct { } +func (st *PutSecretResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &putSecretResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := putSecretResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st PutSecretResponse) MarshalJSON() ([]byte, error) { + pb, err := putSecretResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type RepoAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RepoPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := repoAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepoAccessControlResponse struct { // All permissions. - AllPermissions []RepoPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []RepoPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := repoAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Git folder (repo) information. type RepoInfo struct { // Name of the current git branch of the git folder (repo). - Branch string `json:"branch,omitempty"` + // Wire name: 'branch' + Branch string // Current git commit id of the git folder (repo). - HeadCommitId string `json:"head_commit_id,omitempty"` + // Wire name: 'head_commit_id' + HeadCommitId string // Id of the git folder (repo) in the Workspace. - Id int64 `json:"id,omitempty"` + // Wire name: 'id' + Id int64 // Root path of the git folder (repo) in the Workspace. - Path string `json:"path,omitempty"` + // Wire name: 'path' + Path string // Git provider of the remote git repository, e.g. `gitHub`. - Provider string `json:"provider,omitempty"` + // Wire name: 'provider' + Provider string // Sparse checkout config for the git folder (repo). - SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` + // Wire name: 'sparse_checkout' + SparseCheckout *SparseCheckout // URL of the remote git repository. - Url string `json:"url,omitempty"` + // Wire name: 'url' + Url string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoInfo) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoInfoPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoInfoFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoInfo) MarshalJSON() ([]byte, error) { + pb, err := repoInfoToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepoPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RepoPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoPermission) MarshalJSON() ([]byte, error) { + pb, err := repoPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type RepoPermissionLevel string +type repoPermissionLevelPb string const RepoPermissionLevelCanEdit RepoPermissionLevel = `CAN_EDIT` @@ -942,47 +2483,133 @@ func (f *RepoPermissionLevel) Type() string { return "RepoPermissionLevel" } +func repoPermissionLevelToPb(st *RepoPermissionLevel) (*repoPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := repoPermissionLevelPb(*st) + return &pb, nil +} + +func repoPermissionLevelFromPb(pb *repoPermissionLevelPb) (*RepoPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := RepoPermissionLevel(*pb) + return &st, nil +} + type RepoPermissions struct { - AccessControlList []RepoAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []RepoAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoPermissions) MarshalJSON() ([]byte, error) { + pb, err := repoPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepoPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel RepoPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *RepoPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *RepoPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s RepoPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st RepoPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := repoPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type RepoPermissionsRequest struct { - AccessControlList []RepoAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []RepoAccessControlRequest // The repo for which to get or manage permissions. - RepoId string `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId string `tf:"-"` +} + +func (st *RepoPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &repoPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := repoPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st RepoPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := repoPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type ScopeBackendType string +type scopeBackendTypePb string const ScopeBackendTypeAzureKeyvault ScopeBackendType = `AZURE_KEYVAULT` @@ -1009,40 +2636,95 @@ func (f *ScopeBackendType) Type() string { return "ScopeBackendType" } +func scopeBackendTypeToPb(st *ScopeBackendType) (*scopeBackendTypePb, error) { + if st == nil { + return nil, nil + } + pb := scopeBackendTypePb(*st) + return &pb, nil +} + +func scopeBackendTypeFromPb(pb *scopeBackendTypePb) (*ScopeBackendType, error) { + if pb == nil { + return nil, nil + } + st := ScopeBackendType(*pb) + return &st, nil +} + type SecretMetadata struct { // A unique name to identify the secret. - Key string `json:"key,omitempty"` + // Wire name: 'key' + Key string // The last updated timestamp (in milliseconds) for the secret. - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + // Wire name: 'last_updated_timestamp' + LastUpdatedTimestamp int64 - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SecretMetadata) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SecretMetadata) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &secretMetadataPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := secretMetadataFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SecretMetadata) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SecretMetadata) MarshalJSON() ([]byte, error) { + pb, err := secretMetadataToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type SecretScope struct { // The type of secret scope backend. - BackendType ScopeBackendType `json:"backend_type,omitempty"` + // Wire name: 'backend_type' + BackendType ScopeBackendType // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - KeyvaultMetadata *AzureKeyVaultSecretScopeMetadata `json:"keyvault_metadata,omitempty"` + // Wire name: 'keyvault_metadata' + KeyvaultMetadata *AzureKeyVaultSecretScopeMetadata // A unique name to identify the secret scope. - Name string `json:"name,omitempty"` + // Wire name: 'name' + Name string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *SecretScope) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *SecretScope) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &secretScopePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := secretScopeFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s SecretScope) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st SecretScope) MarshalJSON() ([]byte, error) { + pb, err := secretScopeToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Sparse checkout configuration, it contains options like cone patterns. @@ -1051,7 +2733,33 @@ type SparseCheckout struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns []string `json:"patterns,omitempty"` + // Wire name: 'patterns' + Patterns []string +} + +func (st *SparseCheckout) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparseCheckoutPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparseCheckoutFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SparseCheckout) MarshalJSON() ([]byte, error) { + pb, err := sparseCheckoutToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Sparse checkout configuration, it contains options like cone patterns. @@ -1060,17 +2768,45 @@ type SparseCheckoutUpdate struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns []string `json:"patterns,omitempty"` + // Wire name: 'patterns' + Patterns []string +} + +func (st *SparseCheckoutUpdate) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &sparseCheckoutUpdatePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := sparseCheckoutUpdateFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st SparseCheckoutUpdate) MarshalJSON() ([]byte, error) { + pb, err := sparseCheckoutUpdateToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCredentialsRequest struct { // The ID for the corresponding credential to access. - CredentialId int64 `json:"-" url:"-"` + // Wire name: 'credential_id' + CredentialId int64 `tf:"-"` // Git provider. This field is case-insensitive. The available Git providers // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider string `json:"git_provider"` + // Wire name: 'git_provider' + GitProvider string // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -1078,120 +2814,275 @@ type UpdateCredentialsRequest struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername string `json:"git_username,omitempty"` + // Wire name: 'git_username' + GitUsername string // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken string `json:"personal_access_token,omitempty"` + // Wire name: 'personal_access_token' + PersonalAccessToken string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateCredentialsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateCredentialsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCredentialsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCredentialsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateCredentialsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateCredentialsRequest) MarshalJSON() ([]byte, error) { + pb, err := updateCredentialsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateCredentialsResponse struct { } +func (st *UpdateCredentialsResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateCredentialsResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateCredentialsResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateCredentialsResponse) MarshalJSON() ([]byte, error) { + pb, err := updateCredentialsResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type UpdateRepoRequest struct { // Branch that the local version of the repo is checked out to. - Branch string `json:"branch,omitempty"` + // Wire name: 'branch' + Branch string // ID of the Git folder (repo) object in the workspace. - RepoId int64 `json:"-" url:"-"` + // Wire name: 'repo_id' + RepoId int64 `tf:"-"` // If specified, update the sparse checkout settings. The update will fail // if sparse checkout is not enabled for the repo. - SparseCheckout *SparseCheckoutUpdate `json:"sparse_checkout,omitempty"` + // Wire name: 'sparse_checkout' + SparseCheckout *SparseCheckoutUpdate // Tag that the local version of the repo is checked out to. Updating the // repo to a tag puts the repo in a detached HEAD state. Before committing // new changes, you must update the repo to a branch instead of the detached // HEAD. - Tag string `json:"tag,omitempty"` + // Wire name: 'tag' + Tag string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *UpdateRepoRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *UpdateRepoRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRepoRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRepoRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s UpdateRepoRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st UpdateRepoRequest) MarshalJSON() ([]byte, error) { + pb, err := updateRepoRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type UpdateRepoResponse struct { } +func (st *UpdateRepoResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &updateRepoResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := updateRepoResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st UpdateRepoResponse) MarshalJSON() ([]byte, error) { + pb, err := updateRepoResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + type WorkspaceObjectAccessControlRequest struct { // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Permission level - PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WorkspaceObjectPermissionLevel // application ID of a service principal - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceObjectAccessControlRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceObjectAccessControlRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectAccessControlRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectAccessControlRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceObjectAccessControlRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceObjectAccessControlRequest) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectAccessControlRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WorkspaceObjectAccessControlResponse struct { // All permissions. - AllPermissions []WorkspaceObjectPermission `json:"all_permissions,omitempty"` + // Wire name: 'all_permissions' + AllPermissions []WorkspaceObjectPermission // Display name of the user or service principal. - DisplayName string `json:"display_name,omitempty"` + // Wire name: 'display_name' + DisplayName string // name of the group - GroupName string `json:"group_name,omitempty"` + // Wire name: 'group_name' + GroupName string // Name of the service principal. - ServicePrincipalName string `json:"service_principal_name,omitempty"` + // Wire name: 'service_principal_name' + ServicePrincipalName string // name of the user - UserName string `json:"user_name,omitempty"` + // Wire name: 'user_name' + UserName string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceObjectAccessControlResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceObjectAccessControlResponse) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectAccessControlResponsePb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectAccessControlResponseFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceObjectAccessControlResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceObjectAccessControlResponse) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectAccessControlResponseToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WorkspaceObjectPermission struct { - Inherited bool `json:"inherited,omitempty"` - InheritedFromObject []string `json:"inherited_from_object,omitempty"` + // Wire name: 'inherited' + Inherited bool + + // Wire name: 'inherited_from_object' + InheritedFromObject []string // Permission level - PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WorkspaceObjectPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceObjectPermission) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceObjectPermission) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectPermissionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectPermissionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceObjectPermission) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceObjectPermission) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectPermissionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } // Permission level type WorkspaceObjectPermissionLevel string +type workspaceObjectPermissionLevelPb string const WorkspaceObjectPermissionLevelCanEdit WorkspaceObjectPermissionLevel = `CAN_EDIT` @@ -1222,44 +3113,184 @@ func (f *WorkspaceObjectPermissionLevel) Type() string { return "WorkspaceObjectPermissionLevel" } +func workspaceObjectPermissionLevelToPb(st *WorkspaceObjectPermissionLevel) (*workspaceObjectPermissionLevelPb, error) { + if st == nil { + return nil, nil + } + pb := workspaceObjectPermissionLevelPb(*st) + return &pb, nil +} + +func workspaceObjectPermissionLevelFromPb(pb *workspaceObjectPermissionLevelPb) (*WorkspaceObjectPermissionLevel, error) { + if pb == nil { + return nil, nil + } + st := WorkspaceObjectPermissionLevel(*pb) + return &st, nil +} + type WorkspaceObjectPermissions struct { - AccessControlList []WorkspaceObjectAccessControlResponse `json:"access_control_list,omitempty"` - ObjectId string `json:"object_id,omitempty"` + // Wire name: 'access_control_list' + AccessControlList []WorkspaceObjectAccessControlResponse + + // Wire name: 'object_id' + ObjectId string - ObjectType string `json:"object_type,omitempty"` + // Wire name: 'object_type' + ObjectType string - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceObjectPermissions) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceObjectPermissions) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectPermissionsPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectPermissionsFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceObjectPermissions) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceObjectPermissions) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectPermissionsToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WorkspaceObjectPermissionsDescription struct { - Description string `json:"description,omitempty"` + + // Wire name: 'description' + Description string // Permission level - PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + // Wire name: 'permission_level' + PermissionLevel WorkspaceObjectPermissionLevel - ForceSendFields []string `json:"-" url:"-"` + ForceSendFields []string `tf:"-"` } -func (s *WorkspaceObjectPermissionsDescription) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +func (st *WorkspaceObjectPermissionsDescription) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectPermissionsDescriptionPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectPermissionsDescriptionFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil } -func (s WorkspaceObjectPermissionsDescription) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +func (st WorkspaceObjectPermissionsDescription) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectPermissionsDescriptionToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) } type WorkspaceObjectPermissionsRequest struct { - AccessControlList []WorkspaceObjectAccessControlRequest `json:"access_control_list,omitempty"` + + // Wire name: 'access_control_list' + AccessControlList []WorkspaceObjectAccessControlRequest // The workspace object for which to get or manage permissions. - WorkspaceObjectId string `json:"-" url:"-"` + // Wire name: 'workspace_object_id' + WorkspaceObjectId string `tf:"-"` // The workspace object type for which to get or manage permissions. - WorkspaceObjectType string `json:"-" url:"-"` + // Wire name: 'workspace_object_type' + WorkspaceObjectType string `tf:"-"` +} + +func (st *WorkspaceObjectPermissionsRequest) UnmarshalJSON(b []byte) error { + if st == nil { + return fmt.Errorf("json.Unmarshal on nil pointer") + } + pb := &workspaceObjectPermissionsRequestPb{} + err := json.Unmarshal(b, pb) + if err != nil { + return err + } + tmp, err := workspaceObjectPermissionsRequestFromPb(pb) + if err != nil { + return err + } + *st = *tmp + return nil +} + +func (st WorkspaceObjectPermissionsRequest) MarshalJSON() ([]byte, error) { + pb, err := workspaceObjectPermissionsRequestToPb(&st) + if err != nil { + return nil, err + } + return json.Marshal(pb) +} + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil } diff --git a/workspace_client.go b/workspace_client.go index 655f94feb..e3011fc04 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -20,6 +20,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/marketplace" "github.com/databricks/databricks-sdk-go/service/ml" "github.com/databricks/databricks-sdk-go/service/pipelines" + "github.com/databricks/databricks-sdk-go/service/qualitymonitor" "github.com/databricks/databricks-sdk-go/service/serving" "github.com/databricks/databricks-sdk-go/service/settings" "github.com/databricks/databricks-sdk-go/service/sharing" @@ -657,6 +658,9 @@ type WorkspaceClient struct { // **USE_CATALOG**). QualityMonitors catalog.QualityMonitorsInterface + // Manage data quality of UC objects (currently support `schema`) + QualityMonitorsV2 qualitymonitor.QualityMonitorsV2Interface + // The queries API can be used to perform CRUD operations on queries. A // query is a Databricks SQL object that includes the target SQL warehouse, // query text, name, description, tags, and parameters. Queries can be @@ -1251,6 +1255,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { ProviderProviders: marketplace.NewProviderProviders(databricksClient), Providers: sharing.NewProviders(databricksClient), QualityMonitors: catalog.NewQualityMonitors(databricksClient), + QualityMonitorsV2: qualitymonitor.NewQualityMonitorsV2(databricksClient), Queries: sql.NewQueries(databricksClient), QueriesLegacy: sql.NewQueriesLegacy(databricksClient), QueryExecution: dashboards.NewQueryExecution(databricksClient), From 61ffa29b7aae58419598fe415a5525dccbd362f1 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Thu, 22 May 2025 08:25:27 +0000 Subject: [PATCH 2/3] Clenaup --- .gitattributes | 1 + service/apps/model.go | 187 ------- service/billing/model.go | 187 ------- service/catalog/internal.go | 54 ++ service/catalog/model.go | 833 ------------------------------- service/cleanrooms/model.go | 119 ----- service/compute/internal.go | 18 + service/compute/model.go | 594 ---------------------- service/dashboards/model.go | 85 ---- service/iam/model.go | 204 -------- service/jobs/model.go | 544 -------------------- service/marketplace/model.go | 289 ----------- service/ml/model.go | 306 ------------ service/pipelines/model.go | 255 ---------- service/pkg.go | 6 +- service/provisioning/internal.go | 18 + service/provisioning/model.go | 170 ------- service/qualitymonitor/model.go | 17 - service/serving/model.go | 306 ------------ service/settings/internal.go | 18 + service/settings/model.go | 407 --------------- service/sharing/model.go | 204 -------- service/sql/model.go | 748 --------------------------- service/vectorsearch/model.go | 102 ---- service/workspace/model.go | 136 ----- 25 files changed, 112 insertions(+), 5696 deletions(-) diff --git a/.gitattributes b/.gitattributes index 2aa42223b..423b89025 100644 --- a/.gitattributes +++ b/.gitattributes @@ -97,6 +97,7 @@ experimental/mocks/service/provisioning/mock_private_access_interface.go linguis experimental/mocks/service/provisioning/mock_storage_interface.go linguist-generated=true experimental/mocks/service/provisioning/mock_vpc_endpoints_interface.go linguist-generated=true experimental/mocks/service/provisioning/mock_workspaces_interface.go linguist-generated=true +experimental/mocks/service/qualitymonitor/mock_quality_monitors_v2_interface.go linguist-generated=true experimental/mocks/service/serving/mock_serving_endpoints_data_plane_interface.go linguist-generated=true experimental/mocks/service/serving/mock_serving_endpoints_interface.go linguist-generated=true experimental/mocks/service/settings/mock_account_ip_access_lists_interface.go linguist-generated=true diff --git a/service/apps/model.go b/service/apps/model.go index 0a571d8c5..f635ade9c 100755 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -295,7 +295,6 @@ func (st AppDeploymentArtifacts) MarshalJSON() ([]byte, error) { } type AppDeploymentMode string -type appDeploymentModePb string const AppDeploymentModeAutoSync AppDeploymentMode = `AUTO_SYNC` @@ -322,24 +321,7 @@ func (f *AppDeploymentMode) Type() string { return "AppDeploymentMode" } -func appDeploymentModeToPb(st *AppDeploymentMode) (*appDeploymentModePb, error) { - if st == nil { - return nil, nil - } - pb := appDeploymentModePb(*st) - return &pb, nil -} - -func appDeploymentModeFromPb(pb *appDeploymentModePb) (*AppDeploymentMode, error) { - if pb == nil { - return nil, nil - } - st := AppDeploymentMode(*pb) - return &st, nil -} - type AppDeploymentState string -type appDeploymentStatePb string const AppDeploymentStateCancelled AppDeploymentState = `CANCELLED` @@ -370,22 +352,6 @@ func (f *AppDeploymentState) Type() string { return "AppDeploymentState" } -func appDeploymentStateToPb(st *AppDeploymentState) (*appDeploymentStatePb, error) { - if st == nil { - return nil, nil - } - pb := appDeploymentStatePb(*st) - return &pb, nil -} - -func appDeploymentStateFromPb(pb *appDeploymentStatePb) (*AppDeploymentState, error) { - if pb == nil { - return nil, nil - } - st := AppDeploymentState(*pb) - return &st, nil -} - type AppDeploymentStatus struct { // Message corresponding with the deployment state. // Wire name: 'message' @@ -463,7 +429,6 @@ func (st AppPermission) MarshalJSON() ([]byte, error) { // Permission level type AppPermissionLevel string -type appPermissionLevelPb string const AppPermissionLevelCanManage AppPermissionLevel = `CAN_MANAGE` @@ -490,22 +455,6 @@ func (f *AppPermissionLevel) Type() string { return "AppPermissionLevel" } -func appPermissionLevelToPb(st *AppPermissionLevel) (*appPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := appPermissionLevelPb(*st) - return &pb, nil -} - -func appPermissionLevelFromPb(pb *appPermissionLevelPb) (*AppPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := AppPermissionLevel(*pb) - return &st, nil -} - type AppPermissions struct { // Wire name: 'access_control_list' @@ -702,7 +651,6 @@ func (st AppResourceJob) MarshalJSON() ([]byte, error) { } type AppResourceJobJobPermission string -type appResourceJobJobPermissionPb string const AppResourceJobJobPermissionCanManage AppResourceJobJobPermission = `CAN_MANAGE` @@ -733,22 +681,6 @@ func (f *AppResourceJobJobPermission) Type() string { return "AppResourceJobJobPermission" } -func appResourceJobJobPermissionToPb(st *AppResourceJobJobPermission) (*appResourceJobJobPermissionPb, error) { - if st == nil { - return nil, nil - } - pb := appResourceJobJobPermissionPb(*st) - return &pb, nil -} - -func appResourceJobJobPermissionFromPb(pb *appResourceJobJobPermissionPb) (*AppResourceJobJobPermission, error) { - if pb == nil { - return nil, nil - } - st := AppResourceJobJobPermission(*pb) - return &st, nil -} - type AppResourceSecret struct { // Key of the secret to grant permission on. // Wire name: 'key' @@ -790,7 +722,6 @@ func (st AppResourceSecret) MarshalJSON() ([]byte, error) { // Permission to grant on the secret scope. Supported permissions are: "READ", // "WRITE", "MANAGE". type AppResourceSecretSecretPermission string -type appResourceSecretSecretPermissionPb string const AppResourceSecretSecretPermissionManage AppResourceSecretSecretPermission = `MANAGE` @@ -819,22 +750,6 @@ func (f *AppResourceSecretSecretPermission) Type() string { return "AppResourceSecretSecretPermission" } -func appResourceSecretSecretPermissionToPb(st *AppResourceSecretSecretPermission) (*appResourceSecretSecretPermissionPb, error) { - if st == nil { - return nil, nil - } - pb := appResourceSecretSecretPermissionPb(*st) - return &pb, nil -} - -func appResourceSecretSecretPermissionFromPb(pb *appResourceSecretSecretPermissionPb) (*AppResourceSecretSecretPermission, error) { - if pb == nil { - return nil, nil - } - st := AppResourceSecretSecretPermission(*pb) - return &st, nil -} - type AppResourceServingEndpoint struct { // Name of the serving endpoint to grant permission on. // Wire name: 'name' @@ -871,7 +786,6 @@ func (st AppResourceServingEndpoint) MarshalJSON() ([]byte, error) { } type AppResourceServingEndpointServingEndpointPermission string -type appResourceServingEndpointServingEndpointPermissionPb string const AppResourceServingEndpointServingEndpointPermissionCanManage AppResourceServingEndpointServingEndpointPermission = `CAN_MANAGE` @@ -900,22 +814,6 @@ func (f *AppResourceServingEndpointServingEndpointPermission) Type() string { return "AppResourceServingEndpointServingEndpointPermission" } -func appResourceServingEndpointServingEndpointPermissionToPb(st *AppResourceServingEndpointServingEndpointPermission) (*appResourceServingEndpointServingEndpointPermissionPb, error) { - if st == nil { - return nil, nil - } - pb := appResourceServingEndpointServingEndpointPermissionPb(*st) - return &pb, nil -} - -func appResourceServingEndpointServingEndpointPermissionFromPb(pb *appResourceServingEndpointServingEndpointPermissionPb) (*AppResourceServingEndpointServingEndpointPermission, error) { - if pb == nil { - return nil, nil - } - st := AppResourceServingEndpointServingEndpointPermission(*pb) - return &st, nil -} - type AppResourceSqlWarehouse struct { // Id of the SQL warehouse to grant permission on. // Wire name: 'id' @@ -952,7 +850,6 @@ func (st AppResourceSqlWarehouse) MarshalJSON() ([]byte, error) { } type AppResourceSqlWarehouseSqlWarehousePermission string -type appResourceSqlWarehouseSqlWarehousePermissionPb string const AppResourceSqlWarehouseSqlWarehousePermissionCanManage AppResourceSqlWarehouseSqlWarehousePermission = `CAN_MANAGE` @@ -981,22 +878,6 @@ func (f *AppResourceSqlWarehouseSqlWarehousePermission) Type() string { return "AppResourceSqlWarehouseSqlWarehousePermission" } -func appResourceSqlWarehouseSqlWarehousePermissionToPb(st *AppResourceSqlWarehouseSqlWarehousePermission) (*appResourceSqlWarehouseSqlWarehousePermissionPb, error) { - if st == nil { - return nil, nil - } - pb := appResourceSqlWarehouseSqlWarehousePermissionPb(*st) - return &pb, nil -} - -func appResourceSqlWarehouseSqlWarehousePermissionFromPb(pb *appResourceSqlWarehouseSqlWarehousePermissionPb) (*AppResourceSqlWarehouseSqlWarehousePermission, error) { - if pb == nil { - return nil, nil - } - st := AppResourceSqlWarehouseSqlWarehousePermission(*pb) - return &st, nil -} - type AppResourceUcSecurable struct { // Wire name: 'permission' @@ -1035,7 +916,6 @@ func (st AppResourceUcSecurable) MarshalJSON() ([]byte, error) { } type AppResourceUcSecurableUcSecurablePermission string -type appResourceUcSecurableUcSecurablePermissionPb string const AppResourceUcSecurableUcSecurablePermissionReadVolume AppResourceUcSecurableUcSecurablePermission = `READ_VOLUME` @@ -1062,24 +942,7 @@ func (f *AppResourceUcSecurableUcSecurablePermission) Type() string { return "AppResourceUcSecurableUcSecurablePermission" } -func appResourceUcSecurableUcSecurablePermissionToPb(st *AppResourceUcSecurableUcSecurablePermission) (*appResourceUcSecurableUcSecurablePermissionPb, error) { - if st == nil { - return nil, nil - } - pb := appResourceUcSecurableUcSecurablePermissionPb(*st) - return &pb, nil -} - -func appResourceUcSecurableUcSecurablePermissionFromPb(pb *appResourceUcSecurableUcSecurablePermissionPb) (*AppResourceUcSecurableUcSecurablePermission, error) { - if pb == nil { - return nil, nil - } - st := AppResourceUcSecurableUcSecurablePermission(*pb) - return &st, nil -} - type AppResourceUcSecurableUcSecurableType string -type appResourceUcSecurableUcSecurableTypePb string const AppResourceUcSecurableUcSecurableTypeVolume AppResourceUcSecurableUcSecurableType = `VOLUME` @@ -1104,24 +967,7 @@ func (f *AppResourceUcSecurableUcSecurableType) Type() string { return "AppResourceUcSecurableUcSecurableType" } -func appResourceUcSecurableUcSecurableTypeToPb(st *AppResourceUcSecurableUcSecurableType) (*appResourceUcSecurableUcSecurableTypePb, error) { - if st == nil { - return nil, nil - } - pb := appResourceUcSecurableUcSecurableTypePb(*st) - return &pb, nil -} - -func appResourceUcSecurableUcSecurableTypeFromPb(pb *appResourceUcSecurableUcSecurableTypePb) (*AppResourceUcSecurableUcSecurableType, error) { - if pb == nil { - return nil, nil - } - st := AppResourceUcSecurableUcSecurableType(*pb) - return &st, nil -} - type ApplicationState string -type applicationStatePb string const ApplicationStateCrashed ApplicationState = `CRASHED` @@ -1152,22 +998,6 @@ func (f *ApplicationState) Type() string { return "ApplicationState" } -func applicationStateToPb(st *ApplicationState) (*applicationStatePb, error) { - if st == nil { - return nil, nil - } - pb := applicationStatePb(*st) - return &pb, nil -} - -func applicationStateFromPb(pb *applicationStatePb) (*ApplicationState, error) { - if pb == nil { - return nil, nil - } - st := ApplicationState(*pb) - return &st, nil -} - type ApplicationStatus struct { // Application status message // Wire name: 'message' @@ -1205,7 +1035,6 @@ func (st ApplicationStatus) MarshalJSON() ([]byte, error) { } type ComputeState string -type computeStatePb string const ComputeStateActive ComputeState = `ACTIVE` @@ -1242,22 +1071,6 @@ func (f *ComputeState) Type() string { return "ComputeState" } -func computeStateToPb(st *ComputeState) (*computeStatePb, error) { - if st == nil { - return nil, nil - } - pb := computeStatePb(*st) - return &pb, nil -} - -func computeStateFromPb(pb *computeStatePb) (*ComputeState, error) { - if pb == nil { - return nil, nil - } - st := ComputeState(*pb) - return &st, nil -} - type ComputeStatus struct { // Compute status message // Wire name: 'message' diff --git a/service/billing/model.go b/service/billing/model.go index 64fda77f6..b6a030c56 100644 --- a/service/billing/model.go +++ b/service/billing/model.go @@ -52,7 +52,6 @@ func (st ActionConfiguration) MarshalJSON() ([]byte, error) { } type ActionConfigurationType string -type actionConfigurationTypePb string const ActionConfigurationTypeEmailNotification ActionConfigurationType = `EMAIL_NOTIFICATION` @@ -77,22 +76,6 @@ func (f *ActionConfigurationType) Type() string { return "ActionConfigurationType" } -func actionConfigurationTypeToPb(st *ActionConfigurationType) (*actionConfigurationTypePb, error) { - if st == nil { - return nil, nil - } - pb := actionConfigurationTypePb(*st) - return &pb, nil -} - -func actionConfigurationTypeFromPb(pb *actionConfigurationTypePb) (*ActionConfigurationType, error) { - if pb == nil { - return nil, nil - } - st := ActionConfigurationType(*pb) - return &st, nil -} - type AlertConfiguration struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. @@ -146,7 +129,6 @@ func (st AlertConfiguration) MarshalJSON() ([]byte, error) { } type AlertConfigurationQuantityType string -type alertConfigurationQuantityTypePb string const AlertConfigurationQuantityTypeListPriceDollarsUsd AlertConfigurationQuantityType = `LIST_PRICE_DOLLARS_USD` @@ -171,24 +153,7 @@ func (f *AlertConfigurationQuantityType) Type() string { return "AlertConfigurationQuantityType" } -func alertConfigurationQuantityTypeToPb(st *AlertConfigurationQuantityType) (*alertConfigurationQuantityTypePb, error) { - if st == nil { - return nil, nil - } - pb := alertConfigurationQuantityTypePb(*st) - return &pb, nil -} - -func alertConfigurationQuantityTypeFromPb(pb *alertConfigurationQuantityTypePb) (*AlertConfigurationQuantityType, error) { - if pb == nil { - return nil, nil - } - st := AlertConfigurationQuantityType(*pb) - return &st, nil -} - type AlertConfigurationTimePeriod string -type alertConfigurationTimePeriodPb string const AlertConfigurationTimePeriodMonth AlertConfigurationTimePeriod = `MONTH` @@ -213,24 +178,7 @@ func (f *AlertConfigurationTimePeriod) Type() string { return "AlertConfigurationTimePeriod" } -func alertConfigurationTimePeriodToPb(st *AlertConfigurationTimePeriod) (*alertConfigurationTimePeriodPb, error) { - if st == nil { - return nil, nil - } - pb := alertConfigurationTimePeriodPb(*st) - return &pb, nil -} - -func alertConfigurationTimePeriodFromPb(pb *alertConfigurationTimePeriodPb) (*AlertConfigurationTimePeriod, error) { - if pb == nil { - return nil, nil - } - st := AlertConfigurationTimePeriod(*pb) - return &st, nil -} - type AlertConfigurationTriggerType string -type alertConfigurationTriggerTypePb string const AlertConfigurationTriggerTypeCumulativeSpendingExceeded AlertConfigurationTriggerType = `CUMULATIVE_SPENDING_EXCEEDED` @@ -255,22 +203,6 @@ func (f *AlertConfigurationTriggerType) Type() string { return "AlertConfigurationTriggerType" } -func alertConfigurationTriggerTypeToPb(st *AlertConfigurationTriggerType) (*alertConfigurationTriggerTypePb, error) { - if st == nil { - return nil, nil - } - pb := alertConfigurationTriggerTypePb(*st) - return &pb, nil -} - -func alertConfigurationTriggerTypeFromPb(pb *alertConfigurationTriggerTypePb) (*AlertConfigurationTriggerType, error) { - if pb == nil { - return nil, nil - } - st := AlertConfigurationTriggerType(*pb) - return &st, nil -} - type BudgetConfiguration struct { // Databricks account ID. // Wire name: 'account_id' @@ -397,7 +329,6 @@ func (st BudgetConfigurationFilterClause) MarshalJSON() ([]byte, error) { } type BudgetConfigurationFilterOperator string -type budgetConfigurationFilterOperatorPb string const BudgetConfigurationFilterOperatorIn BudgetConfigurationFilterOperator = `IN` @@ -422,22 +353,6 @@ func (f *BudgetConfigurationFilterOperator) Type() string { return "BudgetConfigurationFilterOperator" } -func budgetConfigurationFilterOperatorToPb(st *BudgetConfigurationFilterOperator) (*budgetConfigurationFilterOperatorPb, error) { - if st == nil { - return nil, nil - } - pb := budgetConfigurationFilterOperatorPb(*st) - return &pb, nil -} - -func budgetConfigurationFilterOperatorFromPb(pb *budgetConfigurationFilterOperatorPb) (*BudgetConfigurationFilterOperator, error) { - if pb == nil { - return nil, nil - } - st := BudgetConfigurationFilterOperator(*pb) - return &st, nil -} - type BudgetConfigurationFilterTagClause struct { // Wire name: 'key' @@ -1101,7 +1016,6 @@ func (st DeleteResponse) MarshalJSON() ([]byte, error) { // `NOT_FOUND`: The log delivery status as the configuration has been disabled // since the release of this feature or there are no workspaces in the account. type DeliveryStatus string -type deliveryStatusPb string // There were no log delivery attempts since the config was created. const DeliveryStatusCreated DeliveryStatus = `CREATED` @@ -1142,22 +1056,6 @@ func (f *DeliveryStatus) Type() string { return "DeliveryStatus" } -func deliveryStatusToPb(st *DeliveryStatus) (*deliveryStatusPb, error) { - if st == nil { - return nil, nil - } - pb := deliveryStatusPb(*st) - return &pb, nil -} - -func deliveryStatusFromPb(pb *deliveryStatusPb) (*DeliveryStatus, error) { - if pb == nil { - return nil, nil - } - st := DeliveryStatus(*pb) - return &st, nil -} - // Return billable usage logs type DownloadRequest struct { // Format: `YYYY-MM`. Last month to return billable usage logs for. This @@ -1722,7 +1620,6 @@ func (st ListLogDeliveryRequest) MarshalJSON() ([]byte, error) { // of a configuration is not supported, so disable a log delivery configuration // that is no longer needed. type LogDeliveryConfigStatus string -type logDeliveryConfigStatusPb string const LogDeliveryConfigStatusDisabled LogDeliveryConfigStatus = `DISABLED` @@ -1749,22 +1646,6 @@ func (f *LogDeliveryConfigStatus) Type() string { return "LogDeliveryConfigStatus" } -func logDeliveryConfigStatusToPb(st *LogDeliveryConfigStatus) (*logDeliveryConfigStatusPb, error) { - if st == nil { - return nil, nil - } - pb := logDeliveryConfigStatusPb(*st) - return &pb, nil -} - -func logDeliveryConfigStatusFromPb(pb *logDeliveryConfigStatusPb) (*LogDeliveryConfigStatus, error) { - if pb == nil { - return nil, nil - } - st := LogDeliveryConfigStatus(*pb) - return &st, nil -} - type LogDeliveryConfiguration struct { // The Databricks account ID that hosts the log delivery configuration. // Wire name: 'account_id' @@ -1957,7 +1838,6 @@ func (st LogDeliveryStatus) MarshalJSON() ([]byte, error) { // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html type LogType string -type logTypePb string const LogTypeAuditLogs LogType = `AUDIT_LOGS` @@ -1984,22 +1864,6 @@ func (f *LogType) Type() string { return "LogType" } -func logTypeToPb(st *LogType) (*logTypePb, error) { - if st == nil { - return nil, nil - } - pb := logTypePb(*st) - return &pb, nil -} - -func logTypeFromPb(pb *logTypePb) (*LogType, error) { - if pb == nil { - return nil, nil - } - st := LogType(*pb) - return &st, nil -} - // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV @@ -2011,7 +1875,6 @@ func logTypeFromPb(pb *logTypePb) (*LogType, error) { // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html type OutputFormat string -type outputFormatPb string const OutputFormatCsv OutputFormat = `CSV` @@ -2038,22 +1901,6 @@ func (f *OutputFormat) Type() string { return "OutputFormat" } -func outputFormatToPb(st *OutputFormat) (*outputFormatPb, error) { - if st == nil { - return nil, nil - } - pb := outputFormatPb(*st) - return &pb, nil -} - -func outputFormatFromPb(pb *outputFormatPb) (*OutputFormat, error) { - if pb == nil { - return nil, nil - } - st := OutputFormat(*pb) - return &st, nil -} - type PatchStatusResponse struct { } @@ -2119,7 +1966,6 @@ func (st SortSpec) MarshalJSON() ([]byte, error) { } type SortSpecField string -type sortSpecFieldPb string const SortSpecFieldPolicyName SortSpecField = `POLICY_NAME` @@ -2144,22 +1990,6 @@ func (f *SortSpecField) Type() string { return "SortSpecField" } -func sortSpecFieldToPb(st *SortSpecField) (*sortSpecFieldPb, error) { - if st == nil { - return nil, nil - } - pb := sortSpecFieldPb(*st) - return &pb, nil -} - -func sortSpecFieldFromPb(pb *sortSpecFieldPb) (*SortSpecField, error) { - if pb == nil { - return nil, nil - } - st := SortSpecField(*pb) - return &st, nil -} - type UpdateBudgetConfigurationBudget struct { // Databricks account ID. // Wire name: 'account_id' @@ -2354,7 +2184,6 @@ func (st UpdateLogDeliveryConfigurationStatusRequest) MarshalJSON() ([]byte, err } type UsageDashboardType string -type usageDashboardTypePb string const UsageDashboardTypeUsageDashboardTypeGlobal UsageDashboardType = `USAGE_DASHBOARD_TYPE_GLOBAL` @@ -2381,22 +2210,6 @@ func (f *UsageDashboardType) Type() string { return "UsageDashboardType" } -func usageDashboardTypeToPb(st *UsageDashboardType) (*usageDashboardTypePb, error) { - if st == nil { - return nil, nil - } - pb := usageDashboardTypePb(*st) - return &pb, nil -} - -func usageDashboardTypeFromPb(pb *usageDashboardTypePb) (*UsageDashboardType, error) { - if pb == nil { - return nil, nil - } - st := UsageDashboardType(*pb) - return &st, nil -} - type WrappedCreateLogDeliveryConfiguration struct { // Wire name: 'log_delivery_configuration' diff --git a/service/catalog/internal.go b/service/catalog/internal.go index a2043c0e5..9d4c84e84 100755 --- a/service/catalog/internal.go +++ b/service/catalog/internal.go @@ -9217,6 +9217,24 @@ func (st privilegeAssignmentPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } +type propertiesKvPairsPb PropertiesKvPairs + +func propertiesKvPairsToPb(st *PropertiesKvPairs) (*propertiesKvPairsPb, error) { + if st == nil { + return nil, nil + } + stPb := propertiesKvPairsPb(*st) + return &stPb, nil +} + +func propertiesKvPairsFromPb(stPb *propertiesKvPairsPb) (*PropertiesKvPairs, error) { + if stPb == nil { + return nil, nil + } + st := PropertiesKvPairs(*stPb) + return &st, nil +} + func provisioningInfoToPb(st *ProvisioningInfo) (*provisioningInfoPb, error) { if st == nil { return nil, nil @@ -9782,6 +9800,42 @@ func (st schemaInfoPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } +type securableOptionsMapPb SecurableOptionsMap + +func securableOptionsMapToPb(st *SecurableOptionsMap) (*securableOptionsMapPb, error) { + if st == nil { + return nil, nil + } + stPb := securableOptionsMapPb(*st) + return &stPb, nil +} + +func securableOptionsMapFromPb(stPb *securableOptionsMapPb) (*SecurableOptionsMap, error) { + if stPb == nil { + return nil, nil + } + st := SecurableOptionsMap(*stPb) + return &st, nil +} + +type securablePropertiesMapPb SecurablePropertiesMap + +func securablePropertiesMapToPb(st *SecurablePropertiesMap) (*securablePropertiesMapPb, error) { + if st == nil { + return nil, nil + } + stPb := securablePropertiesMapPb(*st) + return &stPb, nil +} + +func securablePropertiesMapFromPb(stPb *securablePropertiesMapPb) (*SecurablePropertiesMap, error) { + if stPb == nil { + return nil, nil + } + st := SecurablePropertiesMap(*stPb) + return &st, nil +} + func setArtifactAllowlistToPb(st *SetArtifactAllowlist) (*setArtifactAllowlistPb, error) { if st == nil { return nil, nil diff --git a/service/catalog/model.go b/service/catalog/model.go index 42e2567a4..c4c03aab0 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -390,7 +390,6 @@ func (st ArtifactMatcher) MarshalJSON() ([]byte, error) { // The artifact type type ArtifactType string -type artifactTypePb string const ArtifactTypeInitScript ArtifactType = `INIT_SCRIPT` @@ -419,22 +418,6 @@ func (f *ArtifactType) Type() string { return "ArtifactType" } -func artifactTypeToPb(st *ArtifactType) (*artifactTypePb, error) { - if st == nil { - return nil, nil - } - pb := artifactTypePb(*st) - return &pb, nil -} - -func artifactTypeFromPb(pb *artifactTypePb) (*ArtifactType, error) { - if pb == nil { - return nil, nil - } - st := ArtifactType(*pb) - return &st, nil -} - type AssignResponse struct { } @@ -1133,7 +1116,6 @@ func (st CatalogInfo) MarshalJSON() ([]byte, error) { } type CatalogIsolationMode string -type catalogIsolationModePb string const CatalogIsolationModeIsolated CatalogIsolationMode = `ISOLATED` @@ -1160,25 +1142,8 @@ func (f *CatalogIsolationMode) Type() string { return "CatalogIsolationMode" } -func catalogIsolationModeToPb(st *CatalogIsolationMode) (*catalogIsolationModePb, error) { - if st == nil { - return nil, nil - } - pb := catalogIsolationModePb(*st) - return &pb, nil -} - -func catalogIsolationModeFromPb(pb *catalogIsolationModePb) (*CatalogIsolationMode, error) { - if pb == nil { - return nil, nil - } - st := CatalogIsolationMode(*pb) - return &st, nil -} - // The type of the catalog. type CatalogType string -type catalogTypePb string const CatalogTypeDeltasharingCatalog CatalogType = `DELTASHARING_CATALOG` @@ -1215,22 +1180,6 @@ func (f *CatalogType) Type() string { return "CatalogType" } -func catalogTypeToPb(st *CatalogType) (*catalogTypePb, error) { - if st == nil { - return nil, nil - } - pb := catalogTypePb(*st) - return &pb, nil -} - -func catalogTypeFromPb(pb *catalogTypePb) (*CatalogType, error) { - if pb == nil { - return nil, nil - } - st := CatalogType(*pb) - return &st, nil -} - type CloudflareApiToken struct { // The Cloudflare access key id of the token. // Wire name: 'access_key_id' @@ -1374,7 +1323,6 @@ func (st ColumnMask) MarshalJSON() ([]byte, error) { } type ColumnTypeName string -type columnTypeNamePb string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -1445,22 +1393,6 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } -func columnTypeNameToPb(st *ColumnTypeName) (*columnTypeNamePb, error) { - if st == nil { - return nil, nil - } - pb := columnTypeNamePb(*st) - return &pb, nil -} - -func columnTypeNameFromPb(pb *columnTypeNamePb) (*ColumnTypeName, error) { - if pb == nil { - return nil, nil - } - st := ColumnTypeName(*pb) - return &st, nil -} - type ConnectionInfo struct { // User-provided free-form text description. // Wire name: 'comment' @@ -1548,7 +1480,6 @@ func (st ConnectionInfo) MarshalJSON() ([]byte, error) { // The type of connection. type ConnectionType string -type connectionTypePb string const ConnectionTypeBigquery ConnectionType = `BIGQUERY` @@ -1597,22 +1528,6 @@ func (f *ConnectionType) Type() string { return "ConnectionType" } -func connectionTypeToPb(st *ConnectionType) (*connectionTypePb, error) { - if st == nil { - return nil, nil - } - pb := connectionTypePb(*st) - return &pb, nil -} - -func connectionTypeFromPb(pb *connectionTypePb) (*ConnectionType, error) { - if pb == nil { - return nil, nil - } - st := ConnectionType(*pb) - return &st, nil -} - // Detailed status of an online table. Shown if the online table is in the // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. type ContinuousUpdateStatus struct { @@ -2085,7 +2000,6 @@ func (st CreateFunction) MarshalJSON() ([]byte, error) { // Function parameter style. **S** is the value for SQL. type CreateFunctionParameterStyle string -type createFunctionParameterStylePb string const CreateFunctionParameterStyleS CreateFunctionParameterStyle = `S` @@ -2110,22 +2024,6 @@ func (f *CreateFunctionParameterStyle) Type() string { return "CreateFunctionParameterStyle" } -func createFunctionParameterStyleToPb(st *CreateFunctionParameterStyle) (*createFunctionParameterStylePb, error) { - if st == nil { - return nil, nil - } - pb := createFunctionParameterStylePb(*st) - return &pb, nil -} - -func createFunctionParameterStyleFromPb(pb *createFunctionParameterStylePb) (*CreateFunctionParameterStyle, error) { - if pb == nil { - return nil, nil - } - st := CreateFunctionParameterStyle(*pb) - return &st, nil -} - type CreateFunctionRequest struct { // Partial __FunctionInfo__ specifying the function to be created. // Wire name: 'function_info' @@ -2162,7 +2060,6 @@ func (st CreateFunctionRequest) MarshalJSON() ([]byte, error) { // __return_params__ of the function cannot be used (as **TABLE** return type is // not supported), and the __sql_data_access__ field must be **NO_SQL**. type CreateFunctionRoutineBody string -type createFunctionRoutineBodyPb string const CreateFunctionRoutineBodyExternal CreateFunctionRoutineBody = `EXTERNAL` @@ -2189,25 +2086,8 @@ func (f *CreateFunctionRoutineBody) Type() string { return "CreateFunctionRoutineBody" } -func createFunctionRoutineBodyToPb(st *CreateFunctionRoutineBody) (*createFunctionRoutineBodyPb, error) { - if st == nil { - return nil, nil - } - pb := createFunctionRoutineBodyPb(*st) - return &pb, nil -} - -func createFunctionRoutineBodyFromPb(pb *createFunctionRoutineBodyPb) (*CreateFunctionRoutineBody, error) { - if pb == nil { - return nil, nil - } - st := CreateFunctionRoutineBody(*pb) - return &st, nil -} - // The security type of the function. type CreateFunctionSecurityType string -type createFunctionSecurityTypePb string const CreateFunctionSecurityTypeDefiner CreateFunctionSecurityType = `DEFINER` @@ -2232,25 +2112,8 @@ func (f *CreateFunctionSecurityType) Type() string { return "CreateFunctionSecurityType" } -func createFunctionSecurityTypeToPb(st *CreateFunctionSecurityType) (*createFunctionSecurityTypePb, error) { - if st == nil { - return nil, nil - } - pb := createFunctionSecurityTypePb(*st) - return &pb, nil -} - -func createFunctionSecurityTypeFromPb(pb *createFunctionSecurityTypePb) (*CreateFunctionSecurityType, error) { - if pb == nil { - return nil, nil - } - st := CreateFunctionSecurityType(*pb) - return &st, nil -} - // Function SQL data access. type CreateFunctionSqlDataAccess string -type createFunctionSqlDataAccessPb string const CreateFunctionSqlDataAccessContainsSql CreateFunctionSqlDataAccess = `CONTAINS_SQL` @@ -2279,22 +2142,6 @@ func (f *CreateFunctionSqlDataAccess) Type() string { return "CreateFunctionSqlDataAccess" } -func createFunctionSqlDataAccessToPb(st *CreateFunctionSqlDataAccess) (*createFunctionSqlDataAccessPb, error) { - if st == nil { - return nil, nil - } - pb := createFunctionSqlDataAccessPb(*st) - return &pb, nil -} - -func createFunctionSqlDataAccessFromPb(pb *createFunctionSqlDataAccessPb) (*CreateFunctionSqlDataAccess, error) { - if pb == nil { - return nil, nil - } - st := CreateFunctionSqlDataAccess(*pb) - return &st, nil -} - type CreateMetastore struct { // The user-specified name of the metastore. // Wire name: 'name' @@ -2879,7 +2726,6 @@ func (st CredentialInfo) MarshalJSON() ([]byte, error) { } type CredentialPurpose string -type credentialPurposePb string const CredentialPurposeService CredentialPurpose = `SERVICE` @@ -2906,25 +2752,8 @@ func (f *CredentialPurpose) Type() string { return "CredentialPurpose" } -func credentialPurposeToPb(st *CredentialPurpose) (*credentialPurposePb, error) { - if st == nil { - return nil, nil - } - pb := credentialPurposePb(*st) - return &pb, nil -} - -func credentialPurposeFromPb(pb *credentialPurposePb) (*CredentialPurpose, error) { - if pb == nil { - return nil, nil - } - st := CredentialPurpose(*pb) - return &st, nil -} - // The type of credential. type CredentialType string -type credentialTypePb string const CredentialTypeBearerToken CredentialType = `BEARER_TOKEN` @@ -2951,22 +2780,6 @@ func (f *CredentialType) Type() string { return "CredentialType" } -func credentialTypeToPb(st *CredentialType) (*credentialTypePb, error) { - if st == nil { - return nil, nil - } - pb := credentialTypePb(*st) - return &pb, nil -} - -func credentialTypeFromPb(pb *credentialTypePb) (*CredentialType, error) { - if pb == nil { - return nil, nil - } - st := CredentialType(*pb) - return &st, nil -} - type CredentialValidationResult struct { // Error message would exist when the result does not equal to **PASS**. // Wire name: 'message' @@ -3005,7 +2818,6 @@ func (st CredentialValidationResult) MarshalJSON() ([]byte, error) { // Data source format type DataSourceFormat string -type dataSourceFormatPb string const DataSourceFormatAvro DataSourceFormat = `AVRO` @@ -3074,22 +2886,6 @@ func (f *DataSourceFormat) Type() string { return "DataSourceFormat" } -func dataSourceFormatToPb(st *DataSourceFormat) (*dataSourceFormatPb, error) { - if st == nil { - return nil, nil - } - pb := dataSourceFormatPb(*st) - return &pb, nil -} - -func dataSourceFormatFromPb(pb *dataSourceFormatPb) (*DataSourceFormat, error) { - if pb == nil { - return nil, nil - } - st := DataSourceFormat(*pb) - return &st, nil -} - type DatabaseCatalog struct { // Wire name: 'create_database_if_not_exists' @@ -3321,7 +3117,6 @@ func (st DatabaseInstanceRef) MarshalJSON() ([]byte, error) { } type DatabaseInstanceState string -type databaseInstanceStatePb string const DatabaseInstanceStateAvailable DatabaseInstanceState = `AVAILABLE` @@ -3356,22 +3151,6 @@ func (f *DatabaseInstanceState) Type() string { return "DatabaseInstanceState" } -func databaseInstanceStateToPb(st *DatabaseInstanceState) (*databaseInstanceStatePb, error) { - if st == nil { - return nil, nil - } - pb := databaseInstanceStatePb(*st) - return &pb, nil -} - -func databaseInstanceStateFromPb(pb *databaseInstanceStatePb) (*DatabaseInstanceState, error) { - if pb == nil { - return nil, nil - } - st := DatabaseInstanceState(*pb) - return &st, nil -} - // Next field marker: 13 type DatabaseTable struct { // Name of the target database instance. This is required when creating @@ -4800,7 +4579,6 @@ func (st EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { // The type of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. type EffectivePredictiveOptimizationFlagInheritedFromType string -type effectivePredictiveOptimizationFlagInheritedFromTypePb string const EffectivePredictiveOptimizationFlagInheritedFromTypeCatalog EffectivePredictiveOptimizationFlagInheritedFromType = `CATALOG` @@ -4827,22 +4605,6 @@ func (f *EffectivePredictiveOptimizationFlagInheritedFromType) Type() string { return "EffectivePredictiveOptimizationFlagInheritedFromType" } -func effectivePredictiveOptimizationFlagInheritedFromTypeToPb(st *EffectivePredictiveOptimizationFlagInheritedFromType) (*effectivePredictiveOptimizationFlagInheritedFromTypePb, error) { - if st == nil { - return nil, nil - } - pb := effectivePredictiveOptimizationFlagInheritedFromTypePb(*st) - return &pb, nil -} - -func effectivePredictiveOptimizationFlagInheritedFromTypeFromPb(pb *effectivePredictiveOptimizationFlagInheritedFromTypePb) (*EffectivePredictiveOptimizationFlagInheritedFromType, error) { - if pb == nil { - return nil, nil - } - st := EffectivePredictiveOptimizationFlagInheritedFromType(*pb) - return &st, nil -} - type EffectivePrivilege struct { // The full name of the object that conveys this privilege via inheritance. // This field is omitted when privilege is not inherited (it's assigned to @@ -4924,7 +4686,6 @@ func (st EffectivePrivilegeAssignment) MarshalJSON() ([]byte, error) { } type EnablePredictiveOptimization string -type enablePredictiveOptimizationPb string const EnablePredictiveOptimizationDisable EnablePredictiveOptimization = `DISABLE` @@ -4953,22 +4714,6 @@ func (f *EnablePredictiveOptimization) Type() string { return "EnablePredictiveOptimization" } -func enablePredictiveOptimizationToPb(st *EnablePredictiveOptimization) (*enablePredictiveOptimizationPb, error) { - if st == nil { - return nil, nil - } - pb := enablePredictiveOptimizationPb(*st) - return &pb, nil -} - -func enablePredictiveOptimizationFromPb(pb *enablePredictiveOptimizationPb) (*EnablePredictiveOptimization, error) { - if pb == nil { - return nil, nil - } - st := EnablePredictiveOptimization(*pb) - return &st, nil -} - type EnableRequest struct { // the catalog for which the system schema is to enabled in // Wire name: 'catalog_name' @@ -5551,7 +5296,6 @@ func (st FunctionInfo) MarshalJSON() ([]byte, error) { // Function parameter style. **S** is the value for SQL. type FunctionInfoParameterStyle string -type functionInfoParameterStylePb string const FunctionInfoParameterStyleS FunctionInfoParameterStyle = `S` @@ -5576,28 +5320,11 @@ func (f *FunctionInfoParameterStyle) Type() string { return "FunctionInfoParameterStyle" } -func functionInfoParameterStyleToPb(st *FunctionInfoParameterStyle) (*functionInfoParameterStylePb, error) { - if st == nil { - return nil, nil - } - pb := functionInfoParameterStylePb(*st) - return &pb, nil -} - -func functionInfoParameterStyleFromPb(pb *functionInfoParameterStylePb) (*FunctionInfoParameterStyle, error) { - if pb == nil { - return nil, nil - } - st := FunctionInfoParameterStyle(*pb) - return &st, nil -} - // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return type is // not supported), and the __sql_data_access__ field must be **NO_SQL**. type FunctionInfoRoutineBody string -type functionInfoRoutineBodyPb string const FunctionInfoRoutineBodyExternal FunctionInfoRoutineBody = `EXTERNAL` @@ -5624,25 +5351,8 @@ func (f *FunctionInfoRoutineBody) Type() string { return "FunctionInfoRoutineBody" } -func functionInfoRoutineBodyToPb(st *FunctionInfoRoutineBody) (*functionInfoRoutineBodyPb, error) { - if st == nil { - return nil, nil - } - pb := functionInfoRoutineBodyPb(*st) - return &pb, nil -} - -func functionInfoRoutineBodyFromPb(pb *functionInfoRoutineBodyPb) (*FunctionInfoRoutineBody, error) { - if pb == nil { - return nil, nil - } - st := FunctionInfoRoutineBody(*pb) - return &st, nil -} - // The security type of the function. type FunctionInfoSecurityType string -type functionInfoSecurityTypePb string const FunctionInfoSecurityTypeDefiner FunctionInfoSecurityType = `DEFINER` @@ -5667,25 +5377,8 @@ func (f *FunctionInfoSecurityType) Type() string { return "FunctionInfoSecurityType" } -func functionInfoSecurityTypeToPb(st *FunctionInfoSecurityType) (*functionInfoSecurityTypePb, error) { - if st == nil { - return nil, nil - } - pb := functionInfoSecurityTypePb(*st) - return &pb, nil -} - -func functionInfoSecurityTypeFromPb(pb *functionInfoSecurityTypePb) (*FunctionInfoSecurityType, error) { - if pb == nil { - return nil, nil - } - st := FunctionInfoSecurityType(*pb) - return &st, nil -} - // Function SQL data access. type FunctionInfoSqlDataAccess string -type functionInfoSqlDataAccessPb string const FunctionInfoSqlDataAccessContainsSql FunctionInfoSqlDataAccess = `CONTAINS_SQL` @@ -5714,22 +5407,6 @@ func (f *FunctionInfoSqlDataAccess) Type() string { return "FunctionInfoSqlDataAccess" } -func functionInfoSqlDataAccessToPb(st *FunctionInfoSqlDataAccess) (*functionInfoSqlDataAccessPb, error) { - if st == nil { - return nil, nil - } - pb := functionInfoSqlDataAccessPb(*st) - return &pb, nil -} - -func functionInfoSqlDataAccessFromPb(pb *functionInfoSqlDataAccessPb) (*FunctionInfoSqlDataAccess, error) { - if pb == nil { - return nil, nil - } - st := FunctionInfoSqlDataAccess(*pb) - return &st, nil -} - type FunctionParameterInfo struct { // User-provided free-form text description. // Wire name: 'comment' @@ -5830,7 +5507,6 @@ func (st FunctionParameterInfos) MarshalJSON() ([]byte, error) { // The mode of the function parameter. type FunctionParameterMode string -type functionParameterModePb string const FunctionParameterModeIn FunctionParameterMode = `IN` @@ -5855,25 +5531,8 @@ func (f *FunctionParameterMode) Type() string { return "FunctionParameterMode" } -func functionParameterModeToPb(st *FunctionParameterMode) (*functionParameterModePb, error) { - if st == nil { - return nil, nil - } - pb := functionParameterModePb(*st) - return &pb, nil -} - -func functionParameterModeFromPb(pb *functionParameterModePb) (*FunctionParameterMode, error) { - if pb == nil { - return nil, nil - } - st := FunctionParameterMode(*pb) - return &st, nil -} - // The type of function parameter. type FunctionParameterType string -type functionParameterTypePb string const FunctionParameterTypeColumn FunctionParameterType = `COLUMN` @@ -5900,22 +5559,6 @@ func (f *FunctionParameterType) Type() string { return "FunctionParameterType" } -func functionParameterTypeToPb(st *FunctionParameterType) (*functionParameterTypePb, error) { - if st == nil { - return nil, nil - } - pb := functionParameterTypePb(*st) - return &pb, nil -} - -func functionParameterTypeFromPb(pb *functionParameterTypePb) (*FunctionParameterType, error) { - if pb == nil { - return nil, nil - } - st := FunctionParameterType(*pb) - return &st, nil -} - // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account type GcpOauthToken struct { @@ -6963,7 +6606,6 @@ func (st GetMetastoreSummaryResponse) MarshalJSON() ([]byte, error) { // The scope of Delta Sharing enabled for the metastore. type GetMetastoreSummaryResponseDeltaSharingScope string -type getMetastoreSummaryResponseDeltaSharingScopePb string const GetMetastoreSummaryResponseDeltaSharingScopeInternal GetMetastoreSummaryResponseDeltaSharingScope = `INTERNAL` @@ -6990,22 +6632,6 @@ func (f *GetMetastoreSummaryResponseDeltaSharingScope) Type() string { return "GetMetastoreSummaryResponseDeltaSharingScope" } -func getMetastoreSummaryResponseDeltaSharingScopeToPb(st *GetMetastoreSummaryResponseDeltaSharingScope) (*getMetastoreSummaryResponseDeltaSharingScopePb, error) { - if st == nil { - return nil, nil - } - pb := getMetastoreSummaryResponseDeltaSharingScopePb(*st) - return &pb, nil -} - -func getMetastoreSummaryResponseDeltaSharingScopeFromPb(pb *getMetastoreSummaryResponseDeltaSharingScopePb) (*GetMetastoreSummaryResponseDeltaSharingScope, error) { - if pb == nil { - return nil, nil - } - st := GetMetastoreSummaryResponseDeltaSharingScope(*pb) - return &st, nil -} - // Get a Model Version type GetModelVersionRequest struct { // The three-level (fully qualified) name of the model version @@ -7479,7 +7105,6 @@ func (st GetWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { } type IsolationMode string -type isolationModePb string const IsolationModeIsolationModeIsolated IsolationMode = `ISOLATION_MODE_ISOLATED` @@ -7506,22 +7131,6 @@ func (f *IsolationMode) Type() string { return "IsolationMode" } -func isolationModeToPb(st *IsolationMode) (*isolationModePb, error) { - if st == nil { - return nil, nil - } - pb := isolationModePb(*st) - return &pb, nil -} - -func isolationModeFromPb(pb *isolationModePb) (*IsolationMode, error) { - if pb == nil { - return nil, nil - } - st := IsolationMode(*pb) - return &st, nil -} - // Get all workspaces assigned to a metastore type ListAccountMetastoreAssignmentsRequest struct { // Unity Catalog metastore ID @@ -9025,7 +8634,6 @@ func (st ListVolumesResponseContent) MarshalJSON() ([]byte, error) { // The artifact pattern matching type type MatchType string -type matchTypePb string const MatchTypePrefixMatch MatchType = `PREFIX_MATCH` @@ -9050,22 +8658,6 @@ func (f *MatchType) Type() string { return "MatchType" } -func matchTypeToPb(st *MatchType) (*matchTypePb, error) { - if st == nil { - return nil, nil - } - pb := matchTypePb(*st) - return &pb, nil -} - -func matchTypeFromPb(pb *matchTypePb) (*MatchType, error) { - if pb == nil { - return nil, nil - } - st := MatchType(*pb) - return &st, nil -} - type MetastoreAssignment struct { // The name of the default catalog in the metastore. // Wire name: 'default_catalog_name' @@ -9198,7 +8790,6 @@ func (st MetastoreInfo) MarshalJSON() ([]byte, error) { // The scope of Delta Sharing enabled for the metastore. type MetastoreInfoDeltaSharingScope string -type metastoreInfoDeltaSharingScopePb string const MetastoreInfoDeltaSharingScopeInternal MetastoreInfoDeltaSharingScope = `INTERNAL` @@ -9225,22 +8816,6 @@ func (f *MetastoreInfoDeltaSharingScope) Type() string { return "MetastoreInfoDeltaSharingScope" } -func metastoreInfoDeltaSharingScopeToPb(st *MetastoreInfoDeltaSharingScope) (*metastoreInfoDeltaSharingScopePb, error) { - if st == nil { - return nil, nil - } - pb := metastoreInfoDeltaSharingScopePb(*st) - return &pb, nil -} - -func metastoreInfoDeltaSharingScopeFromPb(pb *metastoreInfoDeltaSharingScopePb) (*MetastoreInfoDeltaSharingScope, error) { - if pb == nil { - return nil, nil - } - st := MetastoreInfoDeltaSharingScope(*pb) - return &st, nil -} - type ModelVersionInfo struct { // List of aliases associated with the model version // Wire name: 'aliases' @@ -9345,7 +8920,6 @@ func (st ModelVersionInfo) MarshalJSON() ([]byte, error) { // files are uploaded and the model version is finalized. Only model versions in // READY status can be loaded for inference or served. type ModelVersionInfoStatus string -type modelVersionInfoStatusPb string const ModelVersionInfoStatusFailedRegistration ModelVersionInfoStatus = `FAILED_REGISTRATION` @@ -9374,22 +8948,6 @@ func (f *ModelVersionInfoStatus) Type() string { return "ModelVersionInfoStatus" } -func modelVersionInfoStatusToPb(st *ModelVersionInfoStatus) (*modelVersionInfoStatusPb, error) { - if st == nil { - return nil, nil - } - pb := modelVersionInfoStatusPb(*st) - return &pb, nil -} - -func modelVersionInfoStatusFromPb(pb *modelVersionInfoStatusPb) (*ModelVersionInfoStatus, error) { - if pb == nil { - return nil, nil - } - st := ModelVersionInfoStatus(*pb) - return &st, nil -} - type MonitorCronSchedule struct { // Read only field that indicates whether a schedule is paused or not. // Wire name: 'pause_status' @@ -9432,7 +8990,6 @@ func (st MonitorCronSchedule) MarshalJSON() ([]byte, error) { // Read only field that indicates whether a schedule is paused or not. type MonitorCronSchedulePauseStatus string -type monitorCronSchedulePauseStatusPb string const MonitorCronSchedulePauseStatusPaused MonitorCronSchedulePauseStatus = `PAUSED` @@ -9459,22 +9016,6 @@ func (f *MonitorCronSchedulePauseStatus) Type() string { return "MonitorCronSchedulePauseStatus" } -func monitorCronSchedulePauseStatusToPb(st *MonitorCronSchedulePauseStatus) (*monitorCronSchedulePauseStatusPb, error) { - if st == nil { - return nil, nil - } - pb := monitorCronSchedulePauseStatusPb(*st) - return &pb, nil -} - -func monitorCronSchedulePauseStatusFromPb(pb *monitorCronSchedulePauseStatusPb) (*MonitorCronSchedulePauseStatus, error) { - if pb == nil { - return nil, nil - } - st := MonitorCronSchedulePauseStatus(*pb) - return &st, nil -} - type MonitorDataClassificationConfig struct { // Whether data classification is enabled. // Wire name: 'enabled' @@ -9608,7 +9149,6 @@ func (st MonitorInferenceLog) MarshalJSON() ([]byte, error) { // Problem type the model aims to solve. Determines the type of model-quality // metrics that will be computed. type MonitorInferenceLogProblemType string -type monitorInferenceLogProblemTypePb string const MonitorInferenceLogProblemTypeProblemTypeClassification MonitorInferenceLogProblemType = `PROBLEM_TYPE_CLASSIFICATION` @@ -9635,22 +9175,6 @@ func (f *MonitorInferenceLogProblemType) Type() string { return "MonitorInferenceLogProblemType" } -func monitorInferenceLogProblemTypeToPb(st *MonitorInferenceLogProblemType) (*monitorInferenceLogProblemTypePb, error) { - if st == nil { - return nil, nil - } - pb := monitorInferenceLogProblemTypePb(*st) - return &pb, nil -} - -func monitorInferenceLogProblemTypeFromPb(pb *monitorInferenceLogProblemTypePb) (*MonitorInferenceLogProblemType, error) { - if pb == nil { - return nil, nil - } - st := MonitorInferenceLogProblemType(*pb) - return &st, nil -} - type MonitorInfo struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). // Wire name: 'assets_dir' @@ -9750,7 +9274,6 @@ func (st MonitorInfo) MarshalJSON() ([]byte, error) { // The status of the monitor. type MonitorInfoStatus string -type monitorInfoStatusPb string const MonitorInfoStatusMonitorStatusActive MonitorInfoStatus = `MONITOR_STATUS_ACTIVE` @@ -9783,22 +9306,6 @@ func (f *MonitorInfoStatus) Type() string { return "MonitorInfoStatus" } -func monitorInfoStatusToPb(st *MonitorInfoStatus) (*monitorInfoStatusPb, error) { - if st == nil { - return nil, nil - } - pb := monitorInfoStatusPb(*st) - return &pb, nil -} - -func monitorInfoStatusFromPb(pb *monitorInfoStatusPb) (*MonitorInfoStatus, error) { - if pb == nil { - return nil, nil - } - st := MonitorInfoStatus(*pb) - return &st, nil -} - type MonitorMetric struct { // Jinja template for a SQL expression that specifies how to compute the // metric. See [create metric definition]. @@ -9867,7 +9374,6 @@ func (st MonitorMetric) MarshalJSON() ([]byte, error) { // metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate // or derived metrics type MonitorMetricType string -type monitorMetricTypePb string const MonitorMetricTypeCustomMetricTypeAggregate MonitorMetricType = `CUSTOM_METRIC_TYPE_AGGREGATE` @@ -9896,22 +9402,6 @@ func (f *MonitorMetricType) Type() string { return "MonitorMetricType" } -func monitorMetricTypeToPb(st *MonitorMetricType) (*monitorMetricTypePb, error) { - if st == nil { - return nil, nil - } - pb := monitorMetricTypePb(*st) - return &pb, nil -} - -func monitorMetricTypeFromPb(pb *monitorMetricTypePb) (*MonitorMetricType, error) { - if pb == nil { - return nil, nil - } - st := MonitorMetricType(*pb) - return &st, nil -} - type MonitorNotifications struct { // Who to send notifications to on monitor failure. // Wire name: 'on_failure' @@ -10000,7 +9490,6 @@ func (st MonitorRefreshInfo) MarshalJSON() ([]byte, error) { // The current state of the refresh. type MonitorRefreshInfoState string -type monitorRefreshInfoStatePb string const MonitorRefreshInfoStateCanceled MonitorRefreshInfoState = `CANCELED` @@ -10033,25 +9522,8 @@ func (f *MonitorRefreshInfoState) Type() string { return "MonitorRefreshInfoState" } -func monitorRefreshInfoStateToPb(st *MonitorRefreshInfoState) (*monitorRefreshInfoStatePb, error) { - if st == nil { - return nil, nil - } - pb := monitorRefreshInfoStatePb(*st) - return &pb, nil -} - -func monitorRefreshInfoStateFromPb(pb *monitorRefreshInfoStatePb) (*MonitorRefreshInfoState, error) { - if pb == nil { - return nil, nil - } - st := MonitorRefreshInfoState(*pb) - return &st, nil -} - // The method by which the refresh was triggered. type MonitorRefreshInfoTrigger string -type monitorRefreshInfoTriggerPb string const MonitorRefreshInfoTriggerManual MonitorRefreshInfoTrigger = `MANUAL` @@ -10078,22 +9550,6 @@ func (f *MonitorRefreshInfoTrigger) Type() string { return "MonitorRefreshInfoTrigger" } -func monitorRefreshInfoTriggerToPb(st *MonitorRefreshInfoTrigger) (*monitorRefreshInfoTriggerPb, error) { - if st == nil { - return nil, nil - } - pb := monitorRefreshInfoTriggerPb(*st) - return &pb, nil -} - -func monitorRefreshInfoTriggerFromPb(pb *monitorRefreshInfoTriggerPb) (*MonitorRefreshInfoTrigger, error) { - if pb == nil { - return nil, nil - } - st := MonitorRefreshInfoTrigger(*pb) - return &st, nil -} - type MonitorRefreshListResponse struct { // List of refreshes. // Wire name: 'refreshes' @@ -10437,7 +9893,6 @@ func (st OnlineTableSpecTriggeredSchedulingPolicy) MarshalJSON() ([]byte, error) // The state of an online table. type OnlineTableState string -type onlineTableStatePb string const OnlineTableStateOffline OnlineTableState = `OFFLINE` @@ -10482,22 +9937,6 @@ func (f *OnlineTableState) Type() string { return "OnlineTableState" } -func onlineTableStateToPb(st *OnlineTableState) (*onlineTableStatePb, error) { - if st == nil { - return nil, nil - } - pb := onlineTableStatePb(*st) - return &pb, nil -} - -func onlineTableStateFromPb(pb *onlineTableStatePb) (*OnlineTableState, error) { - if pb == nil { - return nil, nil - } - st := OnlineTableState(*pb) - return &st, nil -} - // Status of an online table. type OnlineTableStatus struct { // Detailed status of an online table. Shown if the online table is in the @@ -10708,7 +10147,6 @@ func (st PrimaryKeyConstraint) MarshalJSON() ([]byte, error) { } type Privilege string -type privilegePb string const PrivilegeAccess Privilege = `ACCESS` @@ -10829,22 +10267,6 @@ func (f *Privilege) Type() string { return "Privilege" } -func privilegeToPb(st *Privilege) (*privilegePb, error) { - if st == nil { - return nil, nil - } - pb := privilegePb(*st) - return &pb, nil -} - -func privilegeFromPb(pb *privilegePb) (*Privilege, error) { - if pb == nil { - return nil, nil - } - st := Privilege(*pb) - return &st, nil -} - type PrivilegeAssignment struct { // The principal (user email address or group name). // Wire name: 'principal' @@ -10882,24 +10304,7 @@ func (st PrivilegeAssignment) MarshalJSON() ([]byte, error) { } // An object containing map of key-value properties attached to the connection. - type PropertiesKvPairs map[string]string -type propertiesKvPairsPb PropertiesKvPairs - -func propertiesKvPairsToPb(st *PropertiesKvPairs) (*propertiesKvPairsPb, error) { - if st == nil { - return nil, nil - } - stPb := propertiesKvPairsPb(*st) - return &stPb, nil -} -func propertiesKvPairsFromPb(stPb *propertiesKvPairsPb) (*PropertiesKvPairs, error) { - if stPb == nil { - return nil, nil - } - st := PropertiesKvPairs(*stPb) - return &st, nil -} // Status of an asynchronously provisioned resource. type ProvisioningInfo struct { @@ -10934,7 +10339,6 @@ func (st ProvisioningInfo) MarshalJSON() ([]byte, error) { } type ProvisioningInfoState string -type provisioningInfoStatePb string const ProvisioningInfoStateActive ProvisioningInfoState = `ACTIVE` @@ -10969,22 +10373,6 @@ func (f *ProvisioningInfoState) Type() string { return "ProvisioningInfoState" } -func provisioningInfoStateToPb(st *ProvisioningInfoState) (*provisioningInfoStatePb, error) { - if st == nil { - return nil, nil - } - pb := provisioningInfoStatePb(*st) - return &pb, nil -} - -func provisioningInfoStateFromPb(pb *provisioningInfoStatePb) (*ProvisioningInfoState, error) { - if pb == nil { - return nil, nil - } - st := ProvisioningInfoState(*pb) - return &st, nil -} - // Detailed status of an online table. Shown if the online table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state. type ProvisioningStatus struct { @@ -11453,48 +10841,13 @@ func (st SchemaInfo) MarshalJSON() ([]byte, error) { } // A map of key-value properties attached to the securable. - type SecurableOptionsMap map[string]string -type securableOptionsMapPb SecurableOptionsMap - -func securableOptionsMapToPb(st *SecurableOptionsMap) (*securableOptionsMapPb, error) { - if st == nil { - return nil, nil - } - stPb := securableOptionsMapPb(*st) - return &stPb, nil -} -func securableOptionsMapFromPb(stPb *securableOptionsMapPb) (*SecurableOptionsMap, error) { - if stPb == nil { - return nil, nil - } - st := SecurableOptionsMap(*stPb) - return &st, nil -} // A map of key-value properties attached to the securable. - type SecurablePropertiesMap map[string]string -type securablePropertiesMapPb SecurablePropertiesMap - -func securablePropertiesMapToPb(st *SecurablePropertiesMap) (*securablePropertiesMapPb, error) { - if st == nil { - return nil, nil - } - stPb := securablePropertiesMapPb(*st) - return &stPb, nil -} -func securablePropertiesMapFromPb(stPb *securablePropertiesMapPb) (*SecurablePropertiesMap, error) { - if stPb == nil { - return nil, nil - } - st := SecurablePropertiesMap(*stPb) - return &st, nil -} // The type of Unity Catalog securable. type SecurableType string -type securableTypePb string const SecurableTypeCatalog SecurableType = `CATALOG` @@ -11553,22 +10906,6 @@ func (f *SecurableType) Type() string { return "SecurableType" } -func securableTypeToPb(st *SecurableType) (*securableTypePb, error) { - if st == nil { - return nil, nil - } - pb := securableTypePb(*st) - return &pb, nil -} - -func securableTypeFromPb(pb *securableTypePb) (*SecurableType, error) { - if pb == nil { - return nil, nil - } - st := SecurableType(*pb) - return &st, nil -} - type SetArtifactAllowlist struct { // A list of allowed artifact match patterns. // Wire name: 'artifact_matchers' @@ -11692,7 +11029,6 @@ func (st SseEncryptionDetails) MarshalJSON() ([]byte, error) { } type SseEncryptionDetailsAlgorithm string -type sseEncryptionDetailsAlgorithmPb string const SseEncryptionDetailsAlgorithmAwsSseKms SseEncryptionDetailsAlgorithm = `AWS_SSE_KMS` @@ -11719,22 +11055,6 @@ func (f *SseEncryptionDetailsAlgorithm) Type() string { return "SseEncryptionDetailsAlgorithm" } -func sseEncryptionDetailsAlgorithmToPb(st *SseEncryptionDetailsAlgorithm) (*sseEncryptionDetailsAlgorithmPb, error) { - if st == nil { - return nil, nil - } - pb := sseEncryptionDetailsAlgorithmPb(*st) - return &pb, nil -} - -func sseEncryptionDetailsAlgorithmFromPb(pb *sseEncryptionDetailsAlgorithmPb) (*SseEncryptionDetailsAlgorithm, error) { - if pb == nil { - return nil, nil - } - st := SseEncryptionDetailsAlgorithm(*pb) - return &st, nil -} - type StorageCredentialInfo struct { // The AWS IAM role configuration. // Wire name: 'aws_iam_role' @@ -11893,7 +11213,6 @@ func (st SyncedDatabaseTable) MarshalJSON() ([]byte, error) { } type SyncedTableSchedulingPolicy string -type syncedTableSchedulingPolicyPb string const SyncedTableSchedulingPolicyContinuous SyncedTableSchedulingPolicy = `CONTINUOUS` @@ -11922,22 +11241,6 @@ func (f *SyncedTableSchedulingPolicy) Type() string { return "SyncedTableSchedulingPolicy" } -func syncedTableSchedulingPolicyToPb(st *SyncedTableSchedulingPolicy) (*syncedTableSchedulingPolicyPb, error) { - if st == nil { - return nil, nil - } - pb := syncedTableSchedulingPolicyPb(*st) - return &pb, nil -} - -func syncedTableSchedulingPolicyFromPb(pb *syncedTableSchedulingPolicyPb) (*SyncedTableSchedulingPolicy, error) { - if pb == nil { - return nil, nil - } - st := SyncedTableSchedulingPolicy(*pb) - return &st, nil -} - // Specification of a synced database table. type SyncedTableSpec struct { // If true, the synced table's logical database and schema resources in PG @@ -12275,7 +11578,6 @@ func (st TableInfo) MarshalJSON() ([]byte, error) { } type TableOperation string -type tableOperationPb string const TableOperationRead TableOperation = `READ` @@ -12302,22 +11604,6 @@ func (f *TableOperation) Type() string { return "TableOperation" } -func tableOperationToPb(st *TableOperation) (*tableOperationPb, error) { - if st == nil { - return nil, nil - } - pb := tableOperationPb(*st) - return &pb, nil -} - -func tableOperationFromPb(pb *tableOperationPb) (*TableOperation, error) { - if pb == nil { - return nil, nil - } - st := TableOperation(*pb) - return &st, nil -} - type TableRowFilter struct { // The full name of the row filter SQL UDF. // Wire name: 'function_name' @@ -12391,7 +11677,6 @@ func (st TableSummary) MarshalJSON() ([]byte, error) { } type TableType string -type tableTypePb string const TableTypeExternal TableType = `EXTERNAL` @@ -12430,22 +11715,6 @@ func (f *TableType) Type() string { return "TableType" } -func tableTypeToPb(st *TableType) (*tableTypePb, error) { - if st == nil { - return nil, nil - } - pb := tableTypePb(*st) - return &pb, nil -} - -func tableTypeFromPb(pb *tableTypePb) (*TableType, error) { - if pb == nil { - return nil, nil - } - st := TableType(*pb) - return &st, nil -} - type TagKeyValue struct { // name of the tag // Wire name: 'key' @@ -13118,7 +12387,6 @@ func (st UpdateMetastoreAssignment) MarshalJSON() ([]byte, error) { // The scope of Delta Sharing enabled for the metastore. type UpdateMetastoreDeltaSharingScope string -type updateMetastoreDeltaSharingScopePb string const UpdateMetastoreDeltaSharingScopeInternal UpdateMetastoreDeltaSharingScope = `INTERNAL` @@ -13145,22 +12413,6 @@ func (f *UpdateMetastoreDeltaSharingScope) Type() string { return "UpdateMetastoreDeltaSharingScope" } -func updateMetastoreDeltaSharingScopeToPb(st *UpdateMetastoreDeltaSharingScope) (*updateMetastoreDeltaSharingScopePb, error) { - if st == nil { - return nil, nil - } - pb := updateMetastoreDeltaSharingScopePb(*st) - return &pb, nil -} - -func updateMetastoreDeltaSharingScopeFromPb(pb *updateMetastoreDeltaSharingScopePb) (*UpdateMetastoreDeltaSharingScope, error) { - if pb == nil { - return nil, nil - } - st := UpdateMetastoreDeltaSharingScope(*pb) - return &st, nil -} - type UpdateModelVersionRequest struct { // The comment attached to the model version // Wire name: 'comment' @@ -13790,7 +13042,6 @@ func (st ValidateCredentialResponse) MarshalJSON() ([]byte, error) { // A enum represents the result of the file operation type ValidateCredentialResult string -type validateCredentialResultPb string const ValidateCredentialResultFail ValidateCredentialResult = `FAIL` @@ -13819,22 +13070,6 @@ func (f *ValidateCredentialResult) Type() string { return "ValidateCredentialResult" } -func validateCredentialResultToPb(st *ValidateCredentialResult) (*validateCredentialResultPb, error) { - if st == nil { - return nil, nil - } - pb := validateCredentialResultPb(*st) - return &pb, nil -} - -func validateCredentialResultFromPb(pb *validateCredentialResultPb) (*ValidateCredentialResult, error) { - if pb == nil { - return nil, nil - } - st := ValidateCredentialResult(*pb) - return &st, nil -} - type ValidateStorageCredential struct { // The AWS IAM role configuration. // Wire name: 'aws_iam_role' @@ -13969,7 +13204,6 @@ func (st ValidationResult) MarshalJSON() ([]byte, error) { // The operation tested. type ValidationResultOperation string -type validationResultOperationPb string const ValidationResultOperationDelete ValidationResultOperation = `DELETE` @@ -14002,25 +13236,8 @@ func (f *ValidationResultOperation) Type() string { return "ValidationResultOperation" } -func validationResultOperationToPb(st *ValidationResultOperation) (*validationResultOperationPb, error) { - if st == nil { - return nil, nil - } - pb := validationResultOperationPb(*st) - return &pb, nil -} - -func validationResultOperationFromPb(pb *validationResultOperationPb) (*ValidationResultOperation, error) { - if pb == nil { - return nil, nil - } - st := ValidationResultOperation(*pb) - return &st, nil -} - // The results of the tested operation. type ValidationResultResult string -type validationResultResultPb string const ValidationResultResultFail ValidationResultResult = `FAIL` @@ -14049,22 +13266,6 @@ func (f *ValidationResultResult) Type() string { return "ValidationResultResult" } -func validationResultResultToPb(st *ValidationResultResult) (*validationResultResultPb, error) { - if st == nil { - return nil, nil - } - pb := validationResultResultPb(*st) - return &pb, nil -} - -func validationResultResultFromPb(pb *validationResultResultPb) (*ValidationResultResult, error) { - if pb == nil { - return nil, nil - } - st := ValidationResultResult(*pb) - return &st, nil -} - type VolumeInfo struct { // The AWS access point to use when accesing s3 for this external location. // Wire name: 'access_point' @@ -14160,7 +13361,6 @@ func (st VolumeInfo) MarshalJSON() ([]byte, error) { // // [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external type VolumeType string -type volumeTypePb string const VolumeTypeExternal VolumeType = `EXTERNAL` @@ -14187,22 +13387,6 @@ func (f *VolumeType) Type() string { return "VolumeType" } -func volumeTypeToPb(st *VolumeType) (*volumeTypePb, error) { - if st == nil { - return nil, nil - } - pb := volumeTypePb(*st) - return &pb, nil -} - -func volumeTypeFromPb(pb *volumeTypePb) (*VolumeType, error) { - if pb == nil { - return nil, nil - } - st := VolumeType(*pb) - return &st, nil -} - type WorkspaceBinding struct { // One of READ_WRITE/READ_ONLY. Default is READ_WRITE. // Wire name: 'binding_type' @@ -14240,7 +13424,6 @@ func (st WorkspaceBinding) MarshalJSON() ([]byte, error) { // Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` // enum in `credentials_common.proto`. type WorkspaceBindingBindingType string -type workspaceBindingBindingTypePb string const WorkspaceBindingBindingTypeBindingTypeReadOnly WorkspaceBindingBindingType = `BINDING_TYPE_READ_ONLY` @@ -14267,22 +13450,6 @@ func (f *WorkspaceBindingBindingType) Type() string { return "WorkspaceBindingBindingType" } -func workspaceBindingBindingTypeToPb(st *WorkspaceBindingBindingType) (*workspaceBindingBindingTypePb, error) { - if st == nil { - return nil, nil - } - pb := workspaceBindingBindingTypePb(*st) - return &pb, nil -} - -func workspaceBindingBindingTypeFromPb(pb *workspaceBindingBindingTypePb) (*WorkspaceBindingBindingType, error) { - if pb == nil { - return nil, nil - } - st := WorkspaceBindingBindingType(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index 7cb5ca182..0dad474ef 100755 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -85,7 +85,6 @@ func (st CleanRoom) MarshalJSON() ([]byte, error) { } type CleanRoomAccessRestricted string -type cleanRoomAccessRestrictedPb string const CleanRoomAccessRestrictedCspMismatch CleanRoomAccessRestricted = `CSP_MISMATCH` @@ -112,22 +111,6 @@ func (f *CleanRoomAccessRestricted) Type() string { return "CleanRoomAccessRestricted" } -func cleanRoomAccessRestrictedToPb(st *CleanRoomAccessRestricted) (*cleanRoomAccessRestrictedPb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomAccessRestrictedPb(*st) - return &pb, nil -} - -func cleanRoomAccessRestrictedFromPb(pb *cleanRoomAccessRestrictedPb) (*CleanRoomAccessRestricted, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomAccessRestricted(*pb) - return &st, nil -} - // Metadata of the clean room asset type CleanRoomAsset struct { // When the asset is added to the clean room, in epoch milliseconds. @@ -213,7 +196,6 @@ func (st CleanRoomAsset) MarshalJSON() ([]byte, error) { } type CleanRoomAssetAssetType string -type cleanRoomAssetAssetTypePb string const CleanRoomAssetAssetTypeForeignTable CleanRoomAssetAssetType = `FOREIGN_TABLE` @@ -246,22 +228,6 @@ func (f *CleanRoomAssetAssetType) Type() string { return "CleanRoomAssetAssetType" } -func cleanRoomAssetAssetTypeToPb(st *CleanRoomAssetAssetType) (*cleanRoomAssetAssetTypePb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomAssetAssetTypePb(*st) - return &pb, nil -} - -func cleanRoomAssetAssetTypeFromPb(pb *cleanRoomAssetAssetTypePb) (*CleanRoomAssetAssetType, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomAssetAssetType(*pb) - return &st, nil -} - type CleanRoomAssetForeignTable struct { // The metadata information of the columns in the foreign table // Wire name: 'columns' @@ -374,7 +340,6 @@ func (st CleanRoomAssetNotebook) MarshalJSON() ([]byte, error) { } type CleanRoomAssetStatusEnum string -type cleanRoomAssetStatusEnumPb string const CleanRoomAssetStatusEnumActive CleanRoomAssetStatusEnum = `ACTIVE` @@ -403,22 +368,6 @@ func (f *CleanRoomAssetStatusEnum) Type() string { return "CleanRoomAssetStatusEnum" } -func cleanRoomAssetStatusEnumToPb(st *CleanRoomAssetStatusEnum) (*cleanRoomAssetStatusEnumPb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomAssetStatusEnumPb(*st) - return &pb, nil -} - -func cleanRoomAssetStatusEnumFromPb(pb *cleanRoomAssetStatusEnumPb) (*CleanRoomAssetStatusEnum, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomAssetStatusEnum(*pb) - return &st, nil -} - type CleanRoomAssetTable struct { // The metadata information of the columns in the table // Wire name: 'columns' @@ -698,7 +647,6 @@ func (st CleanRoomNotebookReview) MarshalJSON() ([]byte, error) { } type CleanRoomNotebookReviewNotebookReviewState string -type cleanRoomNotebookReviewNotebookReviewStatePb string const CleanRoomNotebookReviewNotebookReviewStateApproved CleanRoomNotebookReviewNotebookReviewState = `APPROVED` @@ -727,24 +675,7 @@ func (f *CleanRoomNotebookReviewNotebookReviewState) Type() string { return "CleanRoomNotebookReviewNotebookReviewState" } -func cleanRoomNotebookReviewNotebookReviewStateToPb(st *CleanRoomNotebookReviewNotebookReviewState) (*cleanRoomNotebookReviewNotebookReviewStatePb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomNotebookReviewNotebookReviewStatePb(*st) - return &pb, nil -} - -func cleanRoomNotebookReviewNotebookReviewStateFromPb(pb *cleanRoomNotebookReviewNotebookReviewStatePb) (*CleanRoomNotebookReviewNotebookReviewState, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomNotebookReviewNotebookReviewState(*pb) - return &st, nil -} - type CleanRoomNotebookReviewNotebookReviewSubReason string -type cleanRoomNotebookReviewNotebookReviewSubReasonPb string const CleanRoomNotebookReviewNotebookReviewSubReasonAutoApproved CleanRoomNotebookReviewNotebookReviewSubReason = `AUTO_APPROVED` @@ -771,22 +702,6 @@ func (f *CleanRoomNotebookReviewNotebookReviewSubReason) Type() string { return "CleanRoomNotebookReviewNotebookReviewSubReason" } -func cleanRoomNotebookReviewNotebookReviewSubReasonToPb(st *CleanRoomNotebookReviewNotebookReviewSubReason) (*cleanRoomNotebookReviewNotebookReviewSubReasonPb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomNotebookReviewNotebookReviewSubReasonPb(*st) - return &pb, nil -} - -func cleanRoomNotebookReviewNotebookReviewSubReasonFromPb(pb *cleanRoomNotebookReviewNotebookReviewSubReasonPb) (*CleanRoomNotebookReviewNotebookReviewSubReason, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomNotebookReviewNotebookReviewSubReason(*pb) - return &st, nil -} - // Stores information about a single task run. type CleanRoomNotebookTaskRun struct { // Job run info of the task in the runner's local workspace. This field is @@ -891,7 +806,6 @@ func (st CleanRoomOutputCatalog) MarshalJSON() ([]byte, error) { } type CleanRoomOutputCatalogOutputCatalogStatus string -type cleanRoomOutputCatalogOutputCatalogStatusPb string const CleanRoomOutputCatalogOutputCatalogStatusCreated CleanRoomOutputCatalogOutputCatalogStatus = `CREATED` @@ -920,22 +834,6 @@ func (f *CleanRoomOutputCatalogOutputCatalogStatus) Type() string { return "CleanRoomOutputCatalogOutputCatalogStatus" } -func cleanRoomOutputCatalogOutputCatalogStatusToPb(st *CleanRoomOutputCatalogOutputCatalogStatus) (*cleanRoomOutputCatalogOutputCatalogStatusPb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomOutputCatalogOutputCatalogStatusPb(*st) - return &pb, nil -} - -func cleanRoomOutputCatalogOutputCatalogStatusFromPb(pb *cleanRoomOutputCatalogOutputCatalogStatusPb) (*CleanRoomOutputCatalogOutputCatalogStatus, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomOutputCatalogOutputCatalogStatus(*pb) - return &st, nil -} - // Publicly visible central clean room details. type CleanRoomRemoteDetail struct { // Central clean room ID. @@ -996,7 +894,6 @@ func (st CleanRoomRemoteDetail) MarshalJSON() ([]byte, error) { } type CleanRoomStatusEnum string -type cleanRoomStatusEnumPb string const CleanRoomStatusEnumActive CleanRoomStatusEnum = `ACTIVE` @@ -1027,22 +924,6 @@ func (f *CleanRoomStatusEnum) Type() string { return "CleanRoomStatusEnum" } -func cleanRoomStatusEnumToPb(st *CleanRoomStatusEnum) (*cleanRoomStatusEnumPb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomStatusEnumPb(*st) - return &pb, nil -} - -func cleanRoomStatusEnumFromPb(pb *cleanRoomStatusEnumPb) (*CleanRoomStatusEnum, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomStatusEnum(*pb) - return &st, nil -} - type CollaboratorJobRunInfo struct { // Alias of the collaborator that triggered the task run. // Wire name: 'collaborator_alias' diff --git a/service/compute/internal.go b/service/compute/internal.go index fc0a41265..180c967b7 100755 --- a/service/compute/internal.go +++ b/service/compute/internal.go @@ -6596,6 +6596,24 @@ func (st logSyncStatusPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } +type mapAnyPb MapAny + +func mapAnyToPb(st *MapAny) (*mapAnyPb, error) { + if st == nil { + return nil, nil + } + stPb := mapAnyPb(*st) + return &stPb, nil +} + +func mapAnyFromPb(stPb *mapAnyPb) (*MapAny, error) { + if stPb == nil { + return nil, nil + } + st := MapAny(*stPb) + return &st, nil +} + func mavenLibraryToPb(st *MavenLibrary) (*mavenLibraryPb, error) { if st == nil { return nil, nil diff --git a/service/compute/model.go b/service/compute/model.go index d1afe38f5..9533374c3 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -296,7 +296,6 @@ func (st AwsAttributes) MarshalJSON() ([]byte, error) { // Note: If `first_on_demand` is zero, this availability type will be used for // the entire cluster. type AwsAvailability string -type awsAvailabilityPb string const AwsAvailabilityOnDemand AwsAvailability = `ON_DEMAND` @@ -325,22 +324,6 @@ func (f *AwsAvailability) Type() string { return "AwsAvailability" } -func awsAvailabilityToPb(st *AwsAvailability) (*awsAvailabilityPb, error) { - if st == nil { - return nil, nil - } - pb := awsAvailabilityPb(*st) - return &pb, nil -} - -func awsAvailabilityFromPb(pb *awsAvailabilityPb) (*AwsAvailability, error) { - if pb == nil { - return nil, nil - } - st := AwsAvailability(*pb) - return &st, nil -} - // Attributes set during cluster creation which are related to Microsoft Azure. type AzureAttributes struct { // Availability type used for all subsequent nodes past the @@ -402,7 +385,6 @@ func (st AzureAttributes) MarshalJSON() ([]byte, error) { // ones. Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. type AzureAvailability string -type azureAvailabilityPb string const AzureAvailabilityOnDemandAzure AzureAvailability = `ON_DEMAND_AZURE` @@ -431,22 +413,6 @@ func (f *AzureAvailability) Type() string { return "AzureAvailability" } -func azureAvailabilityToPb(st *AzureAvailability) (*azureAvailabilityPb, error) { - if st == nil { - return nil, nil - } - pb := azureAvailabilityPb(*st) - return &pb, nil -} - -func azureAvailabilityFromPb(pb *azureAvailabilityPb) (*AzureAvailability, error) { - if pb == nil { - return nil, nil - } - st := AzureAvailability(*pb) - return &st, nil -} - type CancelCommand struct { // Wire name: 'clusterId' @@ -675,7 +641,6 @@ func (st CloudProviderNodeInfo) MarshalJSON() ([]byte, error) { } type CloudProviderNodeStatus string -type cloudProviderNodeStatusPb string const CloudProviderNodeStatusNotAvailableInRegion CloudProviderNodeStatus = `NotAvailableInRegion` @@ -702,22 +667,6 @@ func (f *CloudProviderNodeStatus) Type() string { return "CloudProviderNodeStatus" } -func cloudProviderNodeStatusToPb(st *CloudProviderNodeStatus) (*cloudProviderNodeStatusPb, error) { - if st == nil { - return nil, nil - } - pb := cloudProviderNodeStatusPb(*st) - return &pb, nil -} - -func cloudProviderNodeStatusFromPb(pb *cloudProviderNodeStatusPb) (*CloudProviderNodeStatus, error) { - if pb == nil { - return nil, nil - } - st := CloudProviderNodeStatus(*pb) - return &st, nil -} - type ClusterAccessControlRequest struct { // name of the group // Wire name: 'group_name' @@ -1583,7 +1532,6 @@ func (st ClusterPermission) MarshalJSON() ([]byte, error) { // Permission level type ClusterPermissionLevel string -type clusterPermissionLevelPb string const ClusterPermissionLevelCanAttachTo ClusterPermissionLevel = `CAN_ATTACH_TO` @@ -1612,22 +1560,6 @@ func (f *ClusterPermissionLevel) Type() string { return "ClusterPermissionLevel" } -func clusterPermissionLevelToPb(st *ClusterPermissionLevel) (*clusterPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := clusterPermissionLevelPb(*st) - return &pb, nil -} - -func clusterPermissionLevelFromPb(pb *clusterPermissionLevelPb) (*ClusterPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := ClusterPermissionLevel(*pb) - return &st, nil -} - type ClusterPermissions struct { // Wire name: 'access_control_list' @@ -1865,7 +1797,6 @@ func (st ClusterPolicyPermission) MarshalJSON() ([]byte, error) { // Permission level type ClusterPolicyPermissionLevel string -type clusterPolicyPermissionLevelPb string const ClusterPolicyPermissionLevelCanUse ClusterPolicyPermissionLevel = `CAN_USE` @@ -1890,22 +1821,6 @@ func (f *ClusterPolicyPermissionLevel) Type() string { return "ClusterPolicyPermissionLevel" } -func clusterPolicyPermissionLevelToPb(st *ClusterPolicyPermissionLevel) (*clusterPolicyPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := clusterPolicyPermissionLevelPb(*st) - return &pb, nil -} - -func clusterPolicyPermissionLevelFromPb(pb *clusterPolicyPermissionLevelPb) (*ClusterPolicyPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := ClusterPolicyPermissionLevel(*pb) - return &st, nil -} - type ClusterPolicyPermissions struct { // Wire name: 'access_control_list' @@ -2113,7 +2028,6 @@ func (st ClusterSize) MarshalJSON() ([]byte, error) { // by the Databricks Jobs Scheduler, or through an API request. This is the same // as cluster_creator, but read only. type ClusterSource string -type clusterSourcePb string const ClusterSourceApi ClusterSource = `API` @@ -2150,22 +2064,6 @@ func (f *ClusterSource) Type() string { return "ClusterSource" } -func clusterSourceToPb(st *ClusterSource) (*clusterSourcePb, error) { - if st == nil { - return nil, nil - } - pb := clusterSourcePb(*st) - return &pb, nil -} - -func clusterSourceFromPb(pb *clusterSourcePb) (*ClusterSource, error) { - if pb == nil { - return nil, nil - } - st := ClusterSource(*pb) - return &st, nil -} - // Contains a snapshot of the latest user specified settings that were used to // create/edit the cluster. type ClusterSpec struct { @@ -2496,7 +2394,6 @@ func (st Command) MarshalJSON() ([]byte, error) { } type CommandStatus string -type commandStatusPb string const CommandStatusCancelled CommandStatus = `Cancelled` @@ -2531,22 +2428,6 @@ func (f *CommandStatus) Type() string { return "CommandStatus" } -func commandStatusToPb(st *CommandStatus) (*commandStatusPb, error) { - if st == nil { - return nil, nil - } - pb := commandStatusPb(*st) - return &pb, nil -} - -func commandStatusFromPb(pb *commandStatusPb) (*CommandStatus, error) { - if pb == nil { - return nil, nil - } - st := CommandStatus(*pb) - return &st, nil -} - // Get command info type CommandStatusRequest struct { @@ -2625,7 +2506,6 @@ func (st CommandStatusResponse) MarshalJSON() ([]byte, error) { } type ContextStatus string -type contextStatusPb string const ContextStatusError ContextStatus = `Error` @@ -2654,22 +2534,6 @@ func (f *ContextStatus) Type() string { return "ContextStatus" } -func contextStatusToPb(st *ContextStatus) (*contextStatusPb, error) { - if st == nil { - return nil, nil - } - pb := contextStatusPb(*st) - return &pb, nil -} - -func contextStatusFromPb(pb *contextStatusPb) (*ContextStatus, error) { - if pb == nil { - return nil, nil - } - st := ContextStatus(*pb) - return &st, nil -} - // Get status type ContextStatusRequest struct { @@ -3460,7 +3324,6 @@ func (st DataPlaneEventDetails) MarshalJSON() ([]byte, error) { } type DataPlaneEventDetailsEventType string -type dataPlaneEventDetailsEventTypePb string const DataPlaneEventDetailsEventTypeNodeBlacklisted DataPlaneEventDetailsEventType = `NODE_BLACKLISTED` @@ -3487,22 +3350,6 @@ func (f *DataPlaneEventDetailsEventType) Type() string { return "DataPlaneEventDetailsEventType" } -func dataPlaneEventDetailsEventTypeToPb(st *DataPlaneEventDetailsEventType) (*dataPlaneEventDetailsEventTypePb, error) { - if st == nil { - return nil, nil - } - pb := dataPlaneEventDetailsEventTypePb(*st) - return &pb, nil -} - -func dataPlaneEventDetailsEventTypeFromPb(pb *dataPlaneEventDetailsEventTypePb) (*DataPlaneEventDetailsEventType, error) { - if pb == nil { - return nil, nil - } - st := DataPlaneEventDetailsEventType(*pb) - return &st, nil -} - // Data security mode decides what data governance model to use when accessing // data from a cluster. // @@ -3533,7 +3380,6 @@ func dataPlaneEventDetailsEventTypeFromPb(pb *dataPlaneEventDetailsEventTypePb) // `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have // UC nor passthrough enabled. type DataSecurityMode string -type dataSecurityModePb string // will choose the most appropriate access mode depending on your // compute configuration. @@ -3595,22 +3441,6 @@ func (f *DataSecurityMode) Type() string { return "DataSecurityMode" } -func dataSecurityModeToPb(st *DataSecurityMode) (*dataSecurityModePb, error) { - if st == nil { - return nil, nil - } - pb := dataSecurityModePb(*st) - return &pb, nil -} - -func dataSecurityModeFromPb(pb *dataSecurityModePb) (*DataSecurityMode, error) { - if pb == nil { - return nil, nil - } - st := DataSecurityMode(*pb) - return &st, nil -} - // A storage location in DBFS type DbfsStorageInfo struct { // dbfs destination, e.g. `dbfs:/my/path` @@ -4053,7 +3883,6 @@ func (st DiskType) MarshalJSON() ([]byte, error) { // All Azure Disk types that Databricks supports. See // https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks type DiskTypeAzureDiskVolumeType string -type diskTypeAzureDiskVolumeTypePb string const DiskTypeAzureDiskVolumeTypePremiumLrs DiskTypeAzureDiskVolumeType = `PREMIUM_LRS` @@ -4080,26 +3909,9 @@ func (f *DiskTypeAzureDiskVolumeType) Type() string { return "DiskTypeAzureDiskVolumeType" } -func diskTypeAzureDiskVolumeTypeToPb(st *DiskTypeAzureDiskVolumeType) (*diskTypeAzureDiskVolumeTypePb, error) { - if st == nil { - return nil, nil - } - pb := diskTypeAzureDiskVolumeTypePb(*st) - return &pb, nil -} - -func diskTypeAzureDiskVolumeTypeFromPb(pb *diskTypeAzureDiskVolumeTypePb) (*DiskTypeAzureDiskVolumeType, error) { - if pb == nil { - return nil, nil - } - st := DiskTypeAzureDiskVolumeType(*pb) - return &st, nil -} - // All EBS volume types that Databricks supports. See // https://aws.amazon.com/ebs/details/ for details. type DiskTypeEbsVolumeType string -type diskTypeEbsVolumeTypePb string const DiskTypeEbsVolumeTypeGeneralPurposeSsd DiskTypeEbsVolumeType = `GENERAL_PURPOSE_SSD` @@ -4126,22 +3938,6 @@ func (f *DiskTypeEbsVolumeType) Type() string { return "DiskTypeEbsVolumeType" } -func diskTypeEbsVolumeTypeToPb(st *DiskTypeEbsVolumeType) (*diskTypeEbsVolumeTypePb, error) { - if st == nil { - return nil, nil - } - pb := diskTypeEbsVolumeTypePb(*st) - return &pb, nil -} - -func diskTypeEbsVolumeTypeFromPb(pb *diskTypeEbsVolumeTypePb) (*DiskTypeEbsVolumeType, error) { - if pb == nil { - return nil, nil - } - st := DiskTypeEbsVolumeType(*pb) - return &st, nil -} - type DockerBasicAuth struct { // Password of the user // Wire name: 'password' @@ -4217,7 +4013,6 @@ func (st DockerImage) MarshalJSON() ([]byte, error) { // All EBS volume types that Databricks supports. See // https://aws.amazon.com/ebs/details/ for details. type EbsVolumeType string -type ebsVolumeTypePb string const EbsVolumeTypeGeneralPurposeSsd EbsVolumeType = `GENERAL_PURPOSE_SSD` @@ -4244,22 +4039,6 @@ func (f *EbsVolumeType) Type() string { return "EbsVolumeType" } -func ebsVolumeTypeToPb(st *EbsVolumeType) (*ebsVolumeTypePb, error) { - if st == nil { - return nil, nil - } - pb := ebsVolumeTypePb(*st) - return &pb, nil -} - -func ebsVolumeTypeFromPb(pb *ebsVolumeTypePb) (*EbsVolumeType, error) { - if pb == nil { - return nil, nil - } - st := EbsVolumeType(*pb) - return &st, nil -} - type EditCluster struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from @@ -5010,7 +4789,6 @@ func (st EventDetails) MarshalJSON() ([]byte, error) { // The cause of a change in target size. type EventDetailsCause string -type eventDetailsCausePb string const EventDetailsCauseAutorecovery EventDetailsCause = `AUTORECOVERY` @@ -5041,24 +4819,7 @@ func (f *EventDetailsCause) Type() string { return "EventDetailsCause" } -func eventDetailsCauseToPb(st *EventDetailsCause) (*eventDetailsCausePb, error) { - if st == nil { - return nil, nil - } - pb := eventDetailsCausePb(*st) - return &pb, nil -} - -func eventDetailsCauseFromPb(pb *eventDetailsCausePb) (*EventDetailsCause, error) { - if pb == nil { - return nil, nil - } - st := EventDetailsCause(*pb) - return &st, nil -} - type EventType string -type eventTypePb string const EventTypeAddNodesFailed EventType = `ADD_NODES_FAILED` @@ -5139,22 +4900,6 @@ func (f *EventType) Type() string { return "EventType" } -func eventTypeToPb(st *EventType) (*eventTypePb, error) { - if st == nil { - return nil, nil - } - pb := eventTypePb(*st) - return &pb, nil -} - -func eventTypeFromPb(pb *eventTypePb) (*EventType, error) { - if pb == nil { - return nil, nil - } - st := EventType(*pb) - return &st, nil -} - // Attributes set during cluster creation which are related to GCP. type GcpAttributes struct { // This field determines whether the spark executors will be scheduled to @@ -5227,7 +4972,6 @@ func (st GcpAttributes) MarshalJSON() ([]byte, error) { // on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the // former is unavailable. type GcpAvailability string -type gcpAvailabilityPb string const GcpAvailabilityOnDemandGcp GcpAvailability = `ON_DEMAND_GCP` @@ -5256,22 +5000,6 @@ func (f *GcpAvailability) Type() string { return "GcpAvailability" } -func gcpAvailabilityToPb(st *GcpAvailability) (*gcpAvailabilityPb, error) { - if st == nil { - return nil, nil - } - pb := gcpAvailabilityPb(*st) - return &pb, nil -} - -func gcpAvailabilityFromPb(pb *gcpAvailabilityPb) (*GcpAvailability, error) { - if pb == nil { - return nil, nil - } - st := GcpAvailability(*pb) - return &st, nil -} - // A storage location in Google Cloud Platform's GCS type GcsStorageInfo struct { // GCS destination/URI, e.g. `gs://my-bucket/some-prefix` @@ -5705,7 +5433,6 @@ func (st GetEvents) MarshalJSON() ([]byte, error) { } type GetEventsOrder string -type getEventsOrderPb string const GetEventsOrderAsc GetEventsOrder = `ASC` @@ -5732,22 +5459,6 @@ func (f *GetEventsOrder) Type() string { return "GetEventsOrder" } -func getEventsOrderToPb(st *GetEventsOrder) (*getEventsOrderPb, error) { - if st == nil { - return nil, nil - } - pb := getEventsOrderPb(*st) - return &pb, nil -} - -func getEventsOrderFromPb(pb *getEventsOrderPb) (*GetEventsOrder, error) { - if pb == nil { - return nil, nil - } - st := GetEventsOrder(*pb) - return &st, nil -} - type GetEventsResponse struct { // Wire name: 'events' @@ -6428,7 +6139,6 @@ func (st InitScriptEventDetails) MarshalJSON() ([]byte, error) { // Result of attempted script execution type InitScriptExecutionDetailsInitScriptExecutionStatus string -type initScriptExecutionDetailsInitScriptExecutionStatusPb string const InitScriptExecutionDetailsInitScriptExecutionStatusFailedExecution InitScriptExecutionDetailsInitScriptExecutionStatus = `FAILED_EXECUTION` @@ -6465,22 +6175,6 @@ func (f *InitScriptExecutionDetailsInitScriptExecutionStatus) Type() string { return "InitScriptExecutionDetailsInitScriptExecutionStatus" } -func initScriptExecutionDetailsInitScriptExecutionStatusToPb(st *InitScriptExecutionDetailsInitScriptExecutionStatus) (*initScriptExecutionDetailsInitScriptExecutionStatusPb, error) { - if st == nil { - return nil, nil - } - pb := initScriptExecutionDetailsInitScriptExecutionStatusPb(*st) - return &pb, nil -} - -func initScriptExecutionDetailsInitScriptExecutionStatusFromPb(pb *initScriptExecutionDetailsInitScriptExecutionStatusPb) (*InitScriptExecutionDetailsInitScriptExecutionStatus, error) { - if pb == nil { - return nil, nil - } - st := InitScriptExecutionDetailsInitScriptExecutionStatus(*pb) - return &st, nil -} - // Config for an individual init script Next ID: 11 type InitScriptInfo struct { // destination needs to be provided, e.g. @@ -6948,7 +6642,6 @@ func (st InstancePoolAwsAttributes) MarshalJSON() ([]byte, error) { // The set of AWS availability types supported when setting up nodes for a // cluster. type InstancePoolAwsAttributesAvailability string -type instancePoolAwsAttributesAvailabilityPb string const InstancePoolAwsAttributesAvailabilityOnDemand InstancePoolAwsAttributesAvailability = `ON_DEMAND` @@ -6975,22 +6668,6 @@ func (f *InstancePoolAwsAttributesAvailability) Type() string { return "InstancePoolAwsAttributesAvailability" } -func instancePoolAwsAttributesAvailabilityToPb(st *InstancePoolAwsAttributesAvailability) (*instancePoolAwsAttributesAvailabilityPb, error) { - if st == nil { - return nil, nil - } - pb := instancePoolAwsAttributesAvailabilityPb(*st) - return &pb, nil -} - -func instancePoolAwsAttributesAvailabilityFromPb(pb *instancePoolAwsAttributesAvailabilityPb) (*InstancePoolAwsAttributesAvailability, error) { - if pb == nil { - return nil, nil - } - st := InstancePoolAwsAttributesAvailability(*pb) - return &st, nil -} - // Attributes set during instance pool creation which are related to Azure. type InstancePoolAzureAttributes struct { // Availability type used for the spot nodes. @@ -7036,7 +6713,6 @@ func (st InstancePoolAzureAttributes) MarshalJSON() ([]byte, error) { // The set of Azure availability types supported when setting up nodes for a // cluster. type InstancePoolAzureAttributesAvailability string -type instancePoolAzureAttributesAvailabilityPb string const InstancePoolAzureAttributesAvailabilityOnDemandAzure InstancePoolAzureAttributesAvailability = `ON_DEMAND_AZURE` @@ -7063,22 +6739,6 @@ func (f *InstancePoolAzureAttributesAvailability) Type() string { return "InstancePoolAzureAttributesAvailability" } -func instancePoolAzureAttributesAvailabilityToPb(st *InstancePoolAzureAttributesAvailability) (*instancePoolAzureAttributesAvailabilityPb, error) { - if st == nil { - return nil, nil - } - pb := instancePoolAzureAttributesAvailabilityPb(*st) - return &pb, nil -} - -func instancePoolAzureAttributesAvailabilityFromPb(pb *instancePoolAzureAttributesAvailabilityPb) (*InstancePoolAzureAttributesAvailability, error) { - if pb == nil { - return nil, nil - } - st := InstancePoolAzureAttributesAvailability(*pb) - return &st, nil -} - // Attributes set during instance pool creation which are related to GCP. type InstancePoolGcpAttributes struct { // This field determines whether the instance pool will contain preemptible @@ -7182,7 +6842,6 @@ func (st InstancePoolPermission) MarshalJSON() ([]byte, error) { // Permission level type InstancePoolPermissionLevel string -type instancePoolPermissionLevelPb string const InstancePoolPermissionLevelCanAttachTo InstancePoolPermissionLevel = `CAN_ATTACH_TO` @@ -7209,22 +6868,6 @@ func (f *InstancePoolPermissionLevel) Type() string { return "InstancePoolPermissionLevel" } -func instancePoolPermissionLevelToPb(st *InstancePoolPermissionLevel) (*instancePoolPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := instancePoolPermissionLevelPb(*st) - return &pb, nil -} - -func instancePoolPermissionLevelFromPb(pb *instancePoolPermissionLevelPb) (*InstancePoolPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := InstancePoolPermissionLevel(*pb) - return &st, nil -} - type InstancePoolPermissions struct { // Wire name: 'access_control_list' @@ -7340,7 +6983,6 @@ func (st InstancePoolPermissionsRequest) MarshalJSON() ([]byte, error) { // - “ACTIVE“ -> “STOPPED“ - “ACTIVE“ -> “DELETED“ - “STOPPED“ -> // “ACTIVE“ - “STOPPED“ -> “DELETED“ type InstancePoolState string -type instancePoolStatePb string const InstancePoolStateActive InstancePoolState = `ACTIVE` @@ -7369,22 +7011,6 @@ func (f *InstancePoolState) Type() string { return "InstancePoolState" } -func instancePoolStateToPb(st *InstancePoolState) (*instancePoolStatePb, error) { - if st == nil { - return nil, nil - } - pb := instancePoolStatePb(*st) - return &pb, nil -} - -func instancePoolStateFromPb(pb *instancePoolStatePb) (*InstancePoolState, error) { - if pb == nil { - return nil, nil - } - st := InstancePoolState(*pb) - return &st, nil -} - type InstancePoolStats struct { // Number of active instances in the pool that are NOT part of a cluster. // Wire name: 'idle_count' @@ -7530,7 +7156,6 @@ func (st InstanceProfile) MarshalJSON() ([]byte, error) { // // [simple form]: https://docs.databricks.com/compute/simple-form.html type Kind string -type kindPb string const KindClassicPreview Kind = `CLASSIC_PREVIEW` @@ -7555,24 +7180,7 @@ func (f *Kind) Type() string { return "Kind" } -func kindToPb(st *Kind) (*kindPb, error) { - if st == nil { - return nil, nil - } - pb := kindPb(*st) - return &pb, nil -} - -func kindFromPb(pb *kindPb) (*Kind, error) { - if pb == nil { - return nil, nil - } - st := Kind(*pb) - return &st, nil -} - type Language string -type languagePb string const LanguagePython Language = `python` @@ -7601,22 +7209,6 @@ func (f *Language) Type() string { return "Language" } -func languageToPb(st *Language) (*languagePb, error) { - if st == nil { - return nil, nil - } - pb := languagePb(*st) - return &pb, nil -} - -func languageFromPb(pb *languagePb) (*Language, error) { - if pb == nil { - return nil, nil - } - st := Language(*pb) - return &st, nil -} - type Library struct { // Specification of a CRAN library to be installed as part of the library // Wire name: 'cran' @@ -7734,7 +7326,6 @@ func (st LibraryFullStatus) MarshalJSON() ([]byte, error) { // The status of a library on a specific cluster. type LibraryInstallStatus string -type libraryInstallStatusPb string const LibraryInstallStatusFailed LibraryInstallStatus = `FAILED` @@ -7773,22 +7364,6 @@ func (f *LibraryInstallStatus) Type() string { return "LibraryInstallStatus" } -func libraryInstallStatusToPb(st *LibraryInstallStatus) (*libraryInstallStatusPb, error) { - if st == nil { - return nil, nil - } - pb := libraryInstallStatusPb(*st) - return &pb, nil -} - -func libraryInstallStatusFromPb(pb *libraryInstallStatusPb) (*LibraryInstallStatus, error) { - if pb == nil { - return nil, nil - } - st := LibraryInstallStatus(*pb) - return &st, nil -} - type ListAllClusterLibraryStatusesResponse struct { // A list of cluster statuses. // Wire name: 'statuses' @@ -8147,7 +7722,6 @@ func (st ListClustersSortBy) MarshalJSON() ([]byte, error) { } type ListClustersSortByDirection string -type listClustersSortByDirectionPb string const ListClustersSortByDirectionAsc ListClustersSortByDirection = `ASC` @@ -8174,24 +7748,7 @@ func (f *ListClustersSortByDirection) Type() string { return "ListClustersSortByDirection" } -func listClustersSortByDirectionToPb(st *ListClustersSortByDirection) (*listClustersSortByDirectionPb, error) { - if st == nil { - return nil, nil - } - pb := listClustersSortByDirectionPb(*st) - return &pb, nil -} - -func listClustersSortByDirectionFromPb(pb *listClustersSortByDirectionPb) (*ListClustersSortByDirection, error) { - if pb == nil { - return nil, nil - } - st := ListClustersSortByDirection(*pb) - return &st, nil -} - type ListClustersSortByField string -type listClustersSortByFieldPb string const ListClustersSortByFieldClusterName ListClustersSortByField = `CLUSTER_NAME` @@ -8218,22 +7775,6 @@ func (f *ListClustersSortByField) Type() string { return "ListClustersSortByField" } -func listClustersSortByFieldToPb(st *ListClustersSortByField) (*listClustersSortByFieldPb, error) { - if st == nil { - return nil, nil - } - pb := listClustersSortByFieldPb(*st) - return &pb, nil -} - -func listClustersSortByFieldFromPb(pb *listClustersSortByFieldPb) (*ListClustersSortByField, error) { - if pb == nil { - return nil, nil - } - st := ListClustersSortByField(*pb) - return &st, nil -} - type ListGlobalInitScriptsResponse struct { // Wire name: 'scripts' @@ -8464,7 +8005,6 @@ func (st ListPolicyFamiliesResponse) MarshalJSON() ([]byte, error) { } type ListSortColumn string -type listSortColumnPb string const ListSortColumnPolicyCreationTime ListSortColumn = `POLICY_CREATION_TIME` @@ -8491,24 +8031,7 @@ func (f *ListSortColumn) Type() string { return "ListSortColumn" } -func listSortColumnToPb(st *ListSortColumn) (*listSortColumnPb, error) { - if st == nil { - return nil, nil - } - pb := listSortColumnPb(*st) - return &pb, nil -} - -func listSortColumnFromPb(pb *listSortColumnPb) (*ListSortColumn, error) { - if pb == nil { - return nil, nil - } - st := ListSortColumn(*pb) - return &st, nil -} - type ListSortOrder string -type listSortOrderPb string const ListSortOrderAsc ListSortOrder = `ASC` @@ -8535,22 +8058,6 @@ func (f *ListSortOrder) Type() string { return "ListSortOrder" } -func listSortOrderToPb(st *ListSortOrder) (*listSortOrderPb, error) { - if st == nil { - return nil, nil - } - pb := listSortOrderPb(*st) - return &pb, nil -} - -func listSortOrderFromPb(pb *listSortOrderPb) (*ListSortOrder, error) { - if pb == nil { - return nil, nil - } - st := ListSortOrder(*pb) - return &st, nil -} - type LocalFileInfo struct { // local file destination, e.g. `file:/my/local/file.sh` // Wire name: 'destination' @@ -8658,22 +8165,6 @@ func (st LogSyncStatus) MarshalJSON() ([]byte, error) { } type MapAny map[string]any -type mapAnyPb MapAny - -func mapAnyToPb(st *MapAny) (*mapAnyPb, error) { - if st == nil { - return nil, nil - } - stPb := mapAnyPb(*st) - return &stPb, nil -} -func mapAnyFromPb(stPb *mapAnyPb) (*MapAny, error) { - if stPb == nil { - return nil, nil - } - st := MapAny(*stPb) - return &st, nil -} type MavenLibrary struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". @@ -9466,7 +8957,6 @@ func (st RestartClusterResponse) MarshalJSON() ([]byte, error) { } type ResultType string -type resultTypePb string const ResultTypeError ResultType = `error` @@ -9499,22 +8989,6 @@ func (f *ResultType) Type() string { return "ResultType" } -func resultTypeToPb(st *ResultType) (*resultTypePb, error) { - if st == nil { - return nil, nil - } - pb := resultTypePb(*st) - return &pb, nil -} - -func resultTypeFromPb(pb *resultTypePb) (*ResultType, error) { - if pb == nil { - return nil, nil - } - st := ResultType(*pb) - return &st, nil -} - type Results struct { // The cause of the error // Wire name: 'cause' @@ -9577,7 +9051,6 @@ func (st Results) MarshalJSON() ([]byte, error) { } type RuntimeEngine string -type runtimeEnginePb string const RuntimeEngineNull RuntimeEngine = `NULL` @@ -9606,22 +9079,6 @@ func (f *RuntimeEngine) Type() string { return "RuntimeEngine" } -func runtimeEngineToPb(st *RuntimeEngine) (*runtimeEnginePb, error) { - if st == nil { - return nil, nil - } - pb := runtimeEnginePb(*st) - return &pb, nil -} - -func runtimeEngineFromPb(pb *runtimeEnginePb) (*RuntimeEngine, error) { - if pb == nil { - return nil, nil - } - st := RuntimeEngine(*pb) - return &st, nil -} - // A storage location in Amazon S3 type S3StorageInfo struct { // (Optional) Set canned access control list for the logs, e.g. @@ -9887,7 +9344,6 @@ func (st StartClusterResponse) MarshalJSON() ([]byte, error) { // `RESTARTING` -> `RUNNING` - `RESTARTING` -> `TERMINATING` - `RESIZING` -> // `RUNNING` - `RESIZING` -> `TERMINATING` - `TERMINATING` -> `TERMINATED` type State string -type statePb string const StateError State = `ERROR` @@ -9926,22 +9382,6 @@ func (f *State) Type() string { return "State" } -func stateToPb(st *State) (*statePb, error) { - if st == nil { - return nil, nil - } - pb := statePb(*st) - return &pb, nil -} - -func stateFromPb(pb *statePb) (*State, error) { - if pb == nil { - return nil, nil - } - st := State(*pb) - return &st, nil -} - type TerminationReason struct { // status code indicating why the cluster was terminated // Wire name: 'code' @@ -9982,7 +9422,6 @@ func (st TerminationReason) MarshalJSON() ([]byte, error) { // The status code indicating why the cluster was terminated type TerminationReasonCode string -type terminationReasonCodePb string const TerminationReasonCodeAbuseDetected TerminationReasonCode = `ABUSE_DETECTED` @@ -10347,25 +9786,8 @@ func (f *TerminationReasonCode) Type() string { return "TerminationReasonCode" } -func terminationReasonCodeToPb(st *TerminationReasonCode) (*terminationReasonCodePb, error) { - if st == nil { - return nil, nil - } - pb := terminationReasonCodePb(*st) - return &pb, nil -} - -func terminationReasonCodeFromPb(pb *terminationReasonCodePb) (*TerminationReasonCode, error) { - if pb == nil { - return nil, nil - } - st := TerminationReasonCode(*pb) - return &st, nil -} - // type of the termination type TerminationReasonType string -type terminationReasonTypePb string const TerminationReasonTypeClientError TerminationReasonType = `CLIENT_ERROR` @@ -10396,22 +9818,6 @@ func (f *TerminationReasonType) Type() string { return "TerminationReasonType" } -func terminationReasonTypeToPb(st *TerminationReasonType) (*terminationReasonTypePb, error) { - if st == nil { - return nil, nil - } - pb := terminationReasonTypePb(*st) - return &pb, nil -} - -func terminationReasonTypeFromPb(pb *terminationReasonTypePb) (*TerminationReasonType, error) { - if pb == nil { - return nil, nil - } - st := TerminationReasonType(*pb) - return &st, nil -} - type UninstallLibraries struct { // Unique identifier for the cluster on which to uninstall these libraries. // Wire name: 'cluster_id' diff --git a/service/dashboards/model.go b/service/dashboards/model.go index 2663b9375..f8aaa3b9c 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -421,7 +421,6 @@ func (st Dashboard) MarshalJSON() ([]byte, error) { } type DashboardView string -type dashboardViewPb string const DashboardViewDashboardViewBasic DashboardView = `DASHBOARD_VIEW_BASIC` @@ -446,22 +445,6 @@ func (f *DashboardView) Type() string { return "DashboardView" } -func dashboardViewToPb(st *DashboardView) (*dashboardViewPb, error) { - if st == nil { - return nil, nil - } - pb := dashboardViewPb(*st) - return &pb, nil -} - -func dashboardViewFromPb(pb *dashboardViewPb) (*DashboardView, error) { - if pb == nil { - return nil, nil - } - st := DashboardView(*pb) - return &st, nil -} - // Delete dashboard schedule type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. @@ -1858,7 +1841,6 @@ func (st GetSubscriptionRequest) MarshalJSON() ([]byte, error) { } type LifecycleState string -type lifecycleStatePb string const LifecycleStateActive LifecycleState = `ACTIVE` @@ -1885,22 +1867,6 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } -func lifecycleStateToPb(st *LifecycleState) (*lifecycleStatePb, error) { - if st == nil { - return nil, nil - } - pb := lifecycleStatePb(*st) - return &pb, nil -} - -func lifecycleStateFromPb(pb *lifecycleStatePb) (*LifecycleState, error) { - if pb == nil { - return nil, nil - } - st := LifecycleState(*pb) - return &st, nil -} - // List dashboards type ListDashboardsRequest struct { // The number of dashboards to return per page. @@ -2181,7 +2147,6 @@ func (st MessageError) MarshalJSON() ([]byte, error) { } type MessageErrorType string -type messageErrorTypePb string const MessageErrorTypeBlockMultipleExecutionsException MessageErrorType = `BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION` @@ -2310,22 +2275,6 @@ func (f *MessageErrorType) Type() string { return "MessageErrorType" } -func messageErrorTypeToPb(st *MessageErrorType) (*messageErrorTypePb, error) { - if st == nil { - return nil, nil - } - pb := messageErrorTypePb(*st) - return &pb, nil -} - -func messageErrorTypeFromPb(pb *messageErrorTypePb) (*MessageErrorType, error) { - if pb == nil { - return nil, nil - } - st := MessageErrorType(*pb) - return &st, nil -} - // MessageStatus. The possible values are: * `FETCHING_METADATA`: Fetching // metadata from the data sources. * `FILTERING_CONTEXT`: Running smart context // step to determine relevant context. * `ASKING_AI`: Waiting for the LLM to @@ -2343,7 +2292,6 @@ func messageErrorTypeFromPb(pb *messageErrorTypePb) (*MessageErrorType, error) { // [executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) // API. * `CANCELLED`: Message has been cancelled. type MessageStatus string -type messageStatusPb string // Waiting for the LLM to respond to the user's question. const MessageStatusAskingAi MessageStatus = `ASKING_AI` @@ -2404,22 +2352,6 @@ func (f *MessageStatus) Type() string { return "MessageStatus" } -func messageStatusToPb(st *MessageStatus) (*messageStatusPb, error) { - if st == nil { - return nil, nil - } - pb := messageStatusPb(*st) - return &pb, nil -} - -func messageStatusFromPb(pb *messageStatusPb) (*MessageStatus, error) { - if pb == nil { - return nil, nil - } - st := MessageStatus(*pb) - return &st, nil -} - type MigrateDashboardRequest struct { // Display name for the new Lakeview dashboard. // Wire name: 'display_name' @@ -2834,7 +2766,6 @@ func (st Schedule) MarshalJSON() ([]byte, error) { } type SchedulePauseStatus string -type schedulePauseStatusPb string const SchedulePauseStatusPaused SchedulePauseStatus = `PAUSED` @@ -2861,22 +2792,6 @@ func (f *SchedulePauseStatus) Type() string { return "SchedulePauseStatus" } -func schedulePauseStatusToPb(st *SchedulePauseStatus) (*schedulePauseStatusPb, error) { - if st == nil { - return nil, nil - } - pb := schedulePauseStatusPb(*st) - return &pb, nil -} - -func schedulePauseStatusFromPb(pb *schedulePauseStatusPb) (*SchedulePauseStatus, error) { - if pb == nil { - return nil, nil - } - st := SchedulePauseStatus(*pb) - return &st, nil -} - type Subscriber struct { // The destination to receive the subscription email. This parameter is // mutually exclusive with `user_subscriber`. diff --git a/service/iam/model.go b/service/iam/model.go index a3ebdf1c6..62e93b5d9 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -1032,7 +1032,6 @@ func (st GetServicePrincipalRequest) MarshalJSON() ([]byte, error) { } type GetSortOrder string -type getSortOrderPb string const GetSortOrderAscending GetSortOrder = `ascending` @@ -1059,22 +1058,6 @@ func (f *GetSortOrder) Type() string { return "GetSortOrder" } -func getSortOrderToPb(st *GetSortOrder) (*getSortOrderPb, error) { - if st == nil { - return nil, nil - } - pb := getSortOrderPb(*st) - return &pb, nil -} - -func getSortOrderFromPb(pb *getSortOrderPb) (*GetSortOrder, error) { - if pb == nil { - return nil, nil - } - st := GetSortOrder(*pb) - return &st, nil -} - // Get user details. type GetUserRequest struct { // Comma-separated list of attributes to return in response. @@ -1268,7 +1251,6 @@ func (st Group) MarshalJSON() ([]byte, error) { } type GroupSchema string -type groupSchemaPb string const GroupSchemaUrnIetfParamsScimSchemasCore20Group GroupSchema = `urn:ietf:params:scim:schemas:core:2.0:Group` @@ -1293,22 +1275,6 @@ func (f *GroupSchema) Type() string { return "GroupSchema" } -func groupSchemaToPb(st *GroupSchema) (*groupSchemaPb, error) { - if st == nil { - return nil, nil - } - pb := groupSchemaPb(*st) - return &pb, nil -} - -func groupSchemaFromPb(pb *groupSchemaPb) (*GroupSchema, error) { - if pb == nil { - return nil, nil - } - st := GroupSchema(*pb) - return &st, nil -} - // List group details. type ListAccountGroupsRequest struct { // Comma-separated list of attributes to return in response. @@ -1589,7 +1555,6 @@ func (st ListGroupsResponse) MarshalJSON() ([]byte, error) { } type ListResponseSchema string -type listResponseSchemaPb string const ListResponseSchemaUrnIetfParamsScimApiMessages20ListResponse ListResponseSchema = `urn:ietf:params:scim:api:messages:2.0:ListResponse` @@ -1614,22 +1579,6 @@ func (f *ListResponseSchema) Type() string { return "ListResponseSchema" } -func listResponseSchemaToPb(st *ListResponseSchema) (*listResponseSchemaPb, error) { - if st == nil { - return nil, nil - } - pb := listResponseSchemaPb(*st) - return &pb, nil -} - -func listResponseSchemaFromPb(pb *listResponseSchemaPb) (*ListResponseSchema, error) { - if pb == nil { - return nil, nil - } - st := ListResponseSchema(*pb) - return &st, nil -} - type ListServicePrincipalResponse struct { // Total results returned in the response. // Wire name: 'itemsPerPage' @@ -1735,7 +1684,6 @@ func (st ListServicePrincipalsRequest) MarshalJSON() ([]byte, error) { } type ListSortOrder string -type listSortOrderPb string const ListSortOrderAscending ListSortOrder = `ascending` @@ -1762,22 +1710,6 @@ func (f *ListSortOrder) Type() string { return "ListSortOrder" } -func listSortOrderToPb(st *ListSortOrder) (*listSortOrderPb, error) { - if st == nil { - return nil, nil - } - pb := listSortOrderPb(*st) - return &pb, nil -} - -func listSortOrderFromPb(pb *listSortOrderPb) (*ListSortOrder, error) { - if pb == nil { - return nil, nil - } - st := ListSortOrder(*pb) - return &st, nil -} - // List users. type ListUsersRequest struct { // Comma-separated list of attributes to return in response. @@ -2232,7 +2164,6 @@ func (st PasswordPermission) MarshalJSON() ([]byte, error) { // Permission level type PasswordPermissionLevel string -type passwordPermissionLevelPb string const PasswordPermissionLevelCanUse PasswordPermissionLevel = `CAN_USE` @@ -2257,22 +2188,6 @@ func (f *PasswordPermissionLevel) Type() string { return "PasswordPermissionLevel" } -func passwordPermissionLevelToPb(st *PasswordPermissionLevel) (*passwordPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := passwordPermissionLevelPb(*st) - return &pb, nil -} - -func passwordPermissionLevelFromPb(pb *passwordPermissionLevelPb) (*PasswordPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := PasswordPermissionLevel(*pb) - return &st, nil -} - type PasswordPermissions struct { // Wire name: 'access_control_list' @@ -2420,7 +2335,6 @@ func (st Patch) MarshalJSON() ([]byte, error) { // Type of patch operation. type PatchOp string -type patchOpPb string const PatchOpAdd PatchOp = `add` @@ -2449,22 +2363,6 @@ func (f *PatchOp) Type() string { return "PatchOp" } -func patchOpToPb(st *PatchOp) (*patchOpPb, error) { - if st == nil { - return nil, nil - } - pb := patchOpPb(*st) - return &pb, nil -} - -func patchOpFromPb(pb *patchOpPb) (*PatchOp, error) { - if pb == nil { - return nil, nil - } - st := PatchOp(*pb) - return &st, nil -} - type PatchResponse struct { } @@ -2494,7 +2392,6 @@ func (st PatchResponse) MarshalJSON() ([]byte, error) { } type PatchSchema string -type patchSchemaPb string const PatchSchemaUrnIetfParamsScimApiMessages20PatchOp PatchSchema = `urn:ietf:params:scim:api:messages:2.0:PatchOp` @@ -2519,22 +2416,6 @@ func (f *PatchSchema) Type() string { return "PatchSchema" } -func patchSchemaToPb(st *PatchSchema) (*patchSchemaPb, error) { - if st == nil { - return nil, nil - } - pb := patchSchemaPb(*st) - return &pb, nil -} - -func patchSchemaFromPb(pb *patchSchemaPb) (*PatchSchema, error) { - if pb == nil { - return nil, nil - } - st := PatchSchema(*pb) - return &st, nil -} - type Permission struct { // Wire name: 'inherited' @@ -2648,7 +2529,6 @@ func (st PermissionAssignments) MarshalJSON() ([]byte, error) { // Permission level type PermissionLevel string -type permissionLevelPb string const PermissionLevelCanAttachTo PermissionLevel = `CAN_ATTACH_TO` @@ -2709,22 +2589,6 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } -func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := permissionLevelPb(*st) - return &pb, nil -} - -func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := PermissionLevel(*pb) - return &st, nil -} - type PermissionOutput struct { // The results of a permissions query. // Wire name: 'description' @@ -2847,7 +2711,6 @@ func (st PrincipalOutput) MarshalJSON() ([]byte, error) { // Defines the identity to be used for authZ of the request on the server side. // See one pager for for more information: http://go/acl/service-identity type RequestAuthzIdentity string -type requestAuthzIdentityPb string const RequestAuthzIdentityRequestAuthzIdentityServiceIdentity RequestAuthzIdentity = `REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY` @@ -2874,22 +2737,6 @@ func (f *RequestAuthzIdentity) Type() string { return "RequestAuthzIdentity" } -func requestAuthzIdentityToPb(st *RequestAuthzIdentity) (*requestAuthzIdentityPb, error) { - if st == nil { - return nil, nil - } - pb := requestAuthzIdentityPb(*st) - return &pb, nil -} - -func requestAuthzIdentityFromPb(pb *requestAuthzIdentityPb) (*RequestAuthzIdentity, error) { - if pb == nil { - return nil, nil - } - st := RequestAuthzIdentity(*pb) - return &st, nil -} - type ResourceInfo struct { // Id of the current resource. // Wire name: 'id' @@ -3146,7 +2993,6 @@ func (st ServicePrincipal) MarshalJSON() ([]byte, error) { } type ServicePrincipalSchema string -type servicePrincipalSchemaPb string const ServicePrincipalSchemaUrnIetfParamsScimSchemasCore20ServicePrincipal ServicePrincipalSchema = `urn:ietf:params:scim:schemas:core:2.0:ServicePrincipal` @@ -3171,22 +3017,6 @@ func (f *ServicePrincipalSchema) Type() string { return "ServicePrincipalSchema" } -func servicePrincipalSchemaToPb(st *ServicePrincipalSchema) (*servicePrincipalSchemaPb, error) { - if st == nil { - return nil, nil - } - pb := servicePrincipalSchemaPb(*st) - return &pb, nil -} - -func servicePrincipalSchemaFromPb(pb *servicePrincipalSchemaPb) (*ServicePrincipalSchema, error) { - if pb == nil { - return nil, nil - } - st := ServicePrincipalSchema(*pb) - return &st, nil -} - type SetObjectPermissions struct { // Wire name: 'access_control_list' @@ -3445,7 +3275,6 @@ func (st User) MarshalJSON() ([]byte, error) { } type UserSchema string -type userSchemaPb string const UserSchemaUrnIetfParamsScimSchemasCore20User UserSchema = `urn:ietf:params:scim:schemas:core:2.0:User` @@ -3472,24 +3301,7 @@ func (f *UserSchema) Type() string { return "UserSchema" } -func userSchemaToPb(st *UserSchema) (*userSchemaPb, error) { - if st == nil { - return nil, nil - } - pb := userSchemaPb(*st) - return &pb, nil -} - -func userSchemaFromPb(pb *userSchemaPb) (*UserSchema, error) { - if pb == nil { - return nil, nil - } - st := UserSchema(*pb) - return &st, nil -} - type WorkspacePermission string -type workspacePermissionPb string const WorkspacePermissionAdmin WorkspacePermission = `ADMIN` @@ -3518,22 +3330,6 @@ func (f *WorkspacePermission) Type() string { return "WorkspacePermission" } -func workspacePermissionToPb(st *WorkspacePermission) (*workspacePermissionPb, error) { - if st == nil { - return nil, nil - } - pb := workspacePermissionPb(*st) - return &pb, nil -} - -func workspacePermissionFromPb(pb *workspacePermissionPb) (*WorkspacePermission, error) { - if pb == nil { - return nil, nil - } - st := WorkspacePermission(*pb) - return &st, nil -} - type WorkspacePermissions struct { // Array of permissions defined for a workspace. // Wire name: 'permissions' diff --git a/service/jobs/model.go b/service/jobs/model.go index 82aaf76ab..c2f02ff8d 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -12,7 +12,6 @@ import ( ) type AuthenticationMethod string -type authenticationMethodPb string const AuthenticationMethodOauth AuthenticationMethod = `OAUTH` @@ -39,22 +38,6 @@ func (f *AuthenticationMethod) Type() string { return "AuthenticationMethod" } -func authenticationMethodToPb(st *AuthenticationMethod) (*authenticationMethodPb, error) { - if st == nil { - return nil, nil - } - pb := authenticationMethodPb(*st) - return &pb, nil -} - -func authenticationMethodFromPb(pb *authenticationMethodPb) (*AuthenticationMethod, error) { - if pb == nil { - return nil, nil - } - st := AuthenticationMethod(*pb) - return &st, nil -} - type BaseJob struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). @@ -452,7 +435,6 @@ func (st CancelRunResponse) MarshalJSON() ([]byte, error) { // Copied from elastic-spark-common/api/messages/runs.proto. Using the original // definition to remove coupling with jobs API definition type CleanRoomTaskRunLifeCycleState string -type cleanRoomTaskRunLifeCycleStatePb string const CleanRoomTaskRunLifeCycleStateBlocked CleanRoomTaskRunLifeCycleState = `BLOCKED` @@ -495,26 +477,9 @@ func (f *CleanRoomTaskRunLifeCycleState) Type() string { return "CleanRoomTaskRunLifeCycleState" } -func cleanRoomTaskRunLifeCycleStateToPb(st *CleanRoomTaskRunLifeCycleState) (*cleanRoomTaskRunLifeCycleStatePb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomTaskRunLifeCycleStatePb(*st) - return &pb, nil -} - -func cleanRoomTaskRunLifeCycleStateFromPb(pb *cleanRoomTaskRunLifeCycleStatePb) (*CleanRoomTaskRunLifeCycleState, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomTaskRunLifeCycleState(*pb) - return &st, nil -} - // Copied from elastic-spark-common/api/messages/runs.proto. Using the original // definition to avoid cyclic dependency. type CleanRoomTaskRunResultState string -type cleanRoomTaskRunResultStatePb string const CleanRoomTaskRunResultStateCanceled CleanRoomTaskRunResultState = `CANCELED` @@ -563,22 +528,6 @@ func (f *CleanRoomTaskRunResultState) Type() string { return "CleanRoomTaskRunResultState" } -func cleanRoomTaskRunResultStateToPb(st *CleanRoomTaskRunResultState) (*cleanRoomTaskRunResultStatePb, error) { - if st == nil { - return nil, nil - } - pb := cleanRoomTaskRunResultStatePb(*st) - return &pb, nil -} - -func cleanRoomTaskRunResultStateFromPb(pb *cleanRoomTaskRunResultStatePb) (*CleanRoomTaskRunResultState, error) { - if pb == nil { - return nil, nil - } - st := CleanRoomTaskRunResultState(*pb) - return &st, nil -} - // Stores the run state of the clean rooms notebook task. type CleanRoomTaskRunState struct { // A value indicating the run's current lifecycle state. This field is @@ -837,7 +786,6 @@ func (st ComputeConfig) MarshalJSON() ([]byte, error) { } type Condition string -type conditionPb string const ConditionAllUpdated Condition = `ALL_UPDATED` @@ -864,22 +812,6 @@ func (f *Condition) Type() string { return "Condition" } -func conditionToPb(st *Condition) (*conditionPb, error) { - if st == nil { - return nil, nil - } - pb := conditionPb(*st) - return &pb, nil -} - -func conditionFromPb(pb *conditionPb) (*Condition, error) { - if pb == nil { - return nil, nil - } - st := Condition(*pb) - return &st, nil -} - type ConditionTask struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. @@ -939,7 +871,6 @@ func (st ConditionTask) MarshalJSON() ([]byte, error) { // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it will // be serialized to `“true”` or `“false”` for the comparison. type ConditionTaskOp string -type conditionTaskOpPb string const ConditionTaskOpEqualTo ConditionTaskOp = `EQUAL_TO` @@ -974,22 +905,6 @@ func (f *ConditionTaskOp) Type() string { return "ConditionTaskOp" } -func conditionTaskOpToPb(st *ConditionTaskOp) (*conditionTaskOpPb, error) { - if st == nil { - return nil, nil - } - pb := conditionTaskOpPb(*st) - return &pb, nil -} - -func conditionTaskOpFromPb(pb *conditionTaskOpPb) (*ConditionTaskOp, error) { - if pb == nil { - return nil, nil - } - st := ConditionTaskOp(*pb) - return &st, nil -} - type Continuous struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. @@ -2020,7 +1935,6 @@ func (st ForEachTaskTaskRunStats) MarshalJSON() ([]byte, error) { } type Format string -type formatPb string const FormatMultiTask Format = `MULTI_TASK` @@ -2047,22 +1961,6 @@ func (f *Format) Type() string { return "Format" } -func formatToPb(st *Format) (*formatPb, error) { - if st == nil { - return nil, nil - } - pb := formatPb(*st) - return &pb, nil -} - -func formatFromPb(pb *formatPb) (*Format, error) { - if pb == nil { - return nil, nil - } - st := Format(*pb) - return &st, nil -} - type GenAiComputeTask struct { // Command launcher to run the actual script, e.g. bash, python etc. // Wire name: 'command' @@ -2419,7 +2317,6 @@ func (st GetRunRequest) MarshalJSON() ([]byte, error) { } type GitProvider string -type gitProviderPb string const GitProviderAwsCodeCommit GitProvider = `awsCodeCommit` @@ -2458,22 +2355,6 @@ func (f *GitProvider) Type() string { return "GitProvider" } -func gitProviderToPb(st *GitProvider) (*gitProviderPb, error) { - if st == nil { - return nil, nil - } - pb := gitProviderPb(*st) - return &pb, nil -} - -func gitProviderFromPb(pb *gitProviderPb) (*GitProvider, error) { - if pb == nil { - return nil, nil - } - st := GitProvider(*pb) - return &st, nil -} - // Read-only state of the remote repository at the time the job was run. This // field is only included on job runs. type GitSnapshot struct { @@ -2856,7 +2737,6 @@ func (st JobDeployment) MarshalJSON() ([]byte, error) { // * `BUNDLE`: The job is managed by Databricks Asset Bundle. type JobDeploymentKind string -type jobDeploymentKindPb string // The job is managed by Databricks Asset Bundle. const JobDeploymentKindBundle JobDeploymentKind = `BUNDLE` @@ -2882,28 +2762,11 @@ func (f *JobDeploymentKind) Type() string { return "JobDeploymentKind" } -func jobDeploymentKindToPb(st *JobDeploymentKind) (*jobDeploymentKindPb, error) { - if st == nil { - return nil, nil - } - pb := jobDeploymentKindPb(*st) - return &pb, nil -} - -func jobDeploymentKindFromPb(pb *jobDeploymentKindPb) (*JobDeploymentKind, error) { - if pb == nil { - return nil, nil - } - st := JobDeploymentKind(*pb) - return &st, nil -} - // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. type JobEditMode string -type jobEditModePb string // The job is in an editable state and can be modified. const JobEditModeEditable JobEditMode = `EDITABLE` @@ -2932,22 +2795,6 @@ func (f *JobEditMode) Type() string { return "JobEditMode" } -func jobEditModeToPb(st *JobEditMode) (*jobEditModePb, error) { - if st == nil { - return nil, nil - } - pb := jobEditModePb(*st) - return &pb, nil -} - -func jobEditModeFromPb(pb *jobEditModePb) (*JobEditMode, error) { - if pb == nil { - return nil, nil - } - st := JobEditMode(*pb) - return &st, nil -} - type JobEmailNotifications struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the @@ -3207,7 +3054,6 @@ func (st JobPermission) MarshalJSON() ([]byte, error) { // Permission level type JobPermissionLevel string -type jobPermissionLevelPb string const JobPermissionLevelCanManage JobPermissionLevel = `CAN_MANAGE` @@ -3238,22 +3084,6 @@ func (f *JobPermissionLevel) Type() string { return "JobPermissionLevel" } -func jobPermissionLevelToPb(st *JobPermissionLevel) (*jobPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := jobPermissionLevelPb(*st) - return &pb, nil -} - -func jobPermissionLevelFromPb(pb *jobPermissionLevelPb) (*JobPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := JobPermissionLevel(*pb) - return &st, nil -} - type JobPermissions struct { // Wire name: 'access_control_list' @@ -3629,7 +3459,6 @@ func (st JobSource) MarshalJSON() ([]byte, error) { // from the remote job specification and is allowed for live edit. Import the // remote job specification again from UI to make the job fully synced. type JobSourceDirtyState string -type jobSourceDirtyStatePb string // The job is temporary disconnected from the remote job specification and is // allowed for live edit. Import the remote job specification again from UI to @@ -3661,22 +3490,6 @@ func (f *JobSourceDirtyState) Type() string { return "JobSourceDirtyState" } -func jobSourceDirtyStateToPb(st *JobSourceDirtyState) (*jobSourceDirtyStatePb, error) { - if st == nil { - return nil, nil - } - pb := jobSourceDirtyStatePb(*st) - return &pb, nil -} - -func jobSourceDirtyStateFromPb(pb *jobSourceDirtyStatePb) (*JobSourceDirtyState, error) { - if pb == nil { - return nil, nil - } - st := JobSourceDirtyState(*pb) - return &st, nil -} - // Specifies the health metric that is being evaluated for a particular health // rule. // @@ -3690,7 +3503,6 @@ func jobSourceDirtyStateFromPb(pb *jobSourceDirtyStatePb) (*JobSourceDirtyState, // number of outstanding files across all streams. This metric is in Public // Preview. type JobsHealthMetric string -type jobsHealthMetricPb string // Expected total time for a run in seconds. const JobsHealthMetricRunDurationSeconds JobsHealthMetric = `RUN_DURATION_SECONDS` @@ -3732,26 +3544,9 @@ func (f *JobsHealthMetric) Type() string { return "JobsHealthMetric" } -func jobsHealthMetricToPb(st *JobsHealthMetric) (*jobsHealthMetricPb, error) { - if st == nil { - return nil, nil - } - pb := jobsHealthMetricPb(*st) - return &pb, nil -} - -func jobsHealthMetricFromPb(pb *jobsHealthMetricPb) (*JobsHealthMetric, error) { - if pb == nil { - return nil, nil - } - st := JobsHealthMetric(*pb) - return &st, nil -} - // Specifies the operator used to compare the health metric value with the // specified threshold. type JobsHealthOperator string -type jobsHealthOperatorPb string const JobsHealthOperatorGreaterThan JobsHealthOperator = `GREATER_THAN` @@ -3776,22 +3571,6 @@ func (f *JobsHealthOperator) Type() string { return "JobsHealthOperator" } -func jobsHealthOperatorToPb(st *JobsHealthOperator) (*jobsHealthOperatorPb, error) { - if st == nil { - return nil, nil - } - pb := jobsHealthOperatorPb(*st) - return &pb, nil -} - -func jobsHealthOperatorFromPb(pb *jobsHealthOperatorPb) (*JobsHealthOperator, error) { - if pb == nil { - return nil, nil - } - st := JobsHealthOperator(*pb) - return &st, nil -} - type JobsHealthRule struct { // Specifies the health metric that is being evaluated for a particular // health rule. @@ -4339,7 +4118,6 @@ func (st OutputSchemaInfo) MarshalJSON() ([]byte, error) { } type PauseStatus string -type pauseStatusPb string const PauseStatusPaused PauseStatus = `PAUSED` @@ -4366,28 +4144,11 @@ func (f *PauseStatus) Type() string { return "PauseStatus" } -func pauseStatusToPb(st *PauseStatus) (*pauseStatusPb, error) { - if st == nil { - return nil, nil - } - pb := pauseStatusPb(*st) - return &pb, nil -} - -func pauseStatusFromPb(pb *pauseStatusPb) (*PauseStatus, error) { - if pb == nil { - return nil, nil - } - st := PauseStatus(*pb) - return &st, nil -} - // PerformanceTarget defines how performant (lower latency) or cost efficient // the execution of run on serverless compute should be. The performance mode on // the job or pipeline should map to a performance setting that is passed to // Cluster Manager (see cluster-common PerformanceTarget). type PerformanceTarget string -type performanceTargetPb string const PerformanceTargetPerformanceOptimized PerformanceTarget = `PERFORMANCE_OPTIMIZED` @@ -4414,22 +4175,6 @@ func (f *PerformanceTarget) Type() string { return "PerformanceTarget" } -func performanceTargetToPb(st *PerformanceTarget) (*performanceTargetPb, error) { - if st == nil { - return nil, nil - } - pb := performanceTargetPb(*st) - return &pb, nil -} - -func performanceTargetFromPb(pb *performanceTargetPb) (*PerformanceTarget, error) { - if pb == nil { - return nil, nil - } - st := PerformanceTarget(*pb) - return &st, nil -} - type PeriodicTriggerConfiguration struct { // The interval at which the trigger should run. // Wire name: 'interval' @@ -4465,7 +4210,6 @@ func (st PeriodicTriggerConfiguration) MarshalJSON() ([]byte, error) { } type PeriodicTriggerConfigurationTimeUnit string -type periodicTriggerConfigurationTimeUnitPb string const PeriodicTriggerConfigurationTimeUnitDays PeriodicTriggerConfigurationTimeUnit = `DAYS` @@ -4494,22 +4238,6 @@ func (f *PeriodicTriggerConfigurationTimeUnit) Type() string { return "PeriodicTriggerConfigurationTimeUnit" } -func periodicTriggerConfigurationTimeUnitToPb(st *PeriodicTriggerConfigurationTimeUnit) (*periodicTriggerConfigurationTimeUnitPb, error) { - if st == nil { - return nil, nil - } - pb := periodicTriggerConfigurationTimeUnitPb(*st) - return &pb, nil -} - -func periodicTriggerConfigurationTimeUnitFromPb(pb *periodicTriggerConfigurationTimeUnitPb) (*PeriodicTriggerConfigurationTimeUnit, error) { - if pb == nil { - return nil, nil - } - st := PeriodicTriggerConfigurationTimeUnit(*pb) - return &st, nil -} - type PipelineParams struct { // If true, triggers a full refresh on the delta live table. // Wire name: 'full_refresh' @@ -4805,7 +4533,6 @@ func (st QueueDetails) MarshalJSON() ([]byte, error) { // limit of concurrent job runs. * `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run // was queued due to reaching the workspace limit of active run job tasks. type QueueDetailsCodeCode string -type queueDetailsCodeCodePb string // The run was queued due to reaching the workspace limit of active task runs. const QueueDetailsCodeCodeActiveRunsLimitReached QueueDetailsCodeCode = `ACTIVE_RUNS_LIMIT_REACHED` @@ -4838,22 +4565,6 @@ func (f *QueueDetailsCodeCode) Type() string { return "QueueDetailsCodeCode" } -func queueDetailsCodeCodeToPb(st *QueueDetailsCodeCode) (*queueDetailsCodeCodePb, error) { - if st == nil { - return nil, nil - } - pb := queueDetailsCodeCodePb(*st) - return &pb, nil -} - -func queueDetailsCodeCodeFromPb(pb *queueDetailsCodeCodePb) (*QueueDetailsCodeCode, error) { - if pb == nil { - return nil, nil - } - st := QueueDetailsCodeCode(*pb) - return &st, nil -} - type QueueSettings struct { // If true, enable queueing for the job. This is a required field. // Wire name: 'enabled' @@ -4952,7 +4663,6 @@ func (st RepairHistoryItem) MarshalJSON() ([]byte, error) { // The repair history item type. Indicates whether a run is the original run or // a repair run. type RepairHistoryItemType string -type repairHistoryItemTypePb string const RepairHistoryItemTypeOriginal RepairHistoryItemType = `ORIGINAL` @@ -4979,22 +4689,6 @@ func (f *RepairHistoryItemType) Type() string { return "RepairHistoryItemType" } -func repairHistoryItemTypeToPb(st *RepairHistoryItemType) (*repairHistoryItemTypePb, error) { - if st == nil { - return nil, nil - } - pb := repairHistoryItemTypePb(*st) - return &pb, nil -} - -func repairHistoryItemTypeFromPb(pb *repairHistoryItemTypePb) (*RepairHistoryItemType, error) { - if pb == nil { - return nil, nil - } - st := RepairHistoryItemType(*pb) - return &st, nil -} - type RepairRun struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt @@ -5866,7 +5560,6 @@ func (st RunForEachTask) MarshalJSON() ([]byte, error) { // `AT_LEAST_ONE_FAILED`: At least one dependency failed * `ALL_FAILED`: ALl // dependencies have failed type RunIf string -type runIfPb string // All dependencies have been completed const RunIfAllDone RunIf = `ALL_DONE` @@ -5907,22 +5600,6 @@ func (f *RunIf) Type() string { return "RunIf" } -func runIfToPb(st *RunIf) (*runIfPb, error) { - if st == nil { - return nil, nil - } - pb := runIfPb(*st) - return &pb, nil -} - -func runIfFromPb(pb *runIfPb) (*RunIf, error) { - if pb == nil { - return nil, nil - } - st := RunIf(*pb) - return &st, nil -} - type RunJobOutput struct { // The run id of the triggered job run // Wire name: 'run_id' @@ -6095,7 +5772,6 @@ func (st RunJobTask) MarshalJSON() ([]byte, error) { // terminal. * `BLOCKED`: The run is blocked on an upstream dependency. * // `WAITING_FOR_RETRY`: The run is waiting for a retry. type RunLifeCycleState string -type runLifeCycleStatePb string // The run is blocked on an upstream dependency. const RunLifeCycleStateBlocked RunLifeCycleState = `BLOCKED` @@ -6152,25 +5828,8 @@ func (f *RunLifeCycleState) Type() string { return "RunLifeCycleState" } -func runLifeCycleStateToPb(st *RunLifeCycleState) (*runLifeCycleStatePb, error) { - if st == nil { - return nil, nil - } - pb := runLifeCycleStatePb(*st) - return &pb, nil -} - -func runLifeCycleStateFromPb(pb *runLifeCycleStatePb) (*RunLifeCycleState, error) { - if pb == nil { - return nil, nil - } - st := RunLifeCycleState(*pb) - return &st, nil -} - // The current state of the run. type RunLifecycleStateV2State string -type runLifecycleStateV2StatePb string const RunLifecycleStateV2StateBlocked RunLifecycleStateV2State = `BLOCKED` @@ -6207,22 +5866,6 @@ func (f *RunLifecycleStateV2State) Type() string { return "RunLifecycleStateV2State" } -func runLifecycleStateV2StateToPb(st *RunLifecycleStateV2State) (*runLifecycleStateV2StatePb, error) { - if st == nil { - return nil, nil - } - pb := runLifecycleStateV2StatePb(*st) - return &pb, nil -} - -func runLifecycleStateV2StateFromPb(pb *runLifecycleStateV2StatePb) (*RunLifecycleStateV2State, error) { - if pb == nil { - return nil, nil - } - st := RunLifecycleStateV2State(*pb) - return &st, nil -} - type RunNow struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt @@ -6635,7 +6278,6 @@ func (st RunParameters) MarshalJSON() ([]byte, error) { // canceled. * `DISABLED`: The run was skipped because it was disabled // explicitly by the user. type RunResultState string -type runResultStatePb string // The run was canceled at user request. const RunResultStateCanceled RunResultState = `CANCELED` @@ -6689,22 +6331,6 @@ func (f *RunResultState) Type() string { return "RunResultState" } -func runResultStateToPb(st *RunResultState) (*runResultStatePb, error) { - if st == nil { - return nil, nil - } - pb := runResultStatePb(*st) - return &pb, nil -} - -func runResultStateFromPb(pb *runResultStatePb) (*RunResultState, error) { - if pb == nil { - return nil, nil - } - st := RunResultState(*pb) - return &st, nil -} - // The current state of the run. type RunState struct { // A value indicating the run's current lifecycle state. This field is @@ -7066,7 +6692,6 @@ func (st RunTask) MarshalJSON() ([]byte, error) { // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow type RunType string -type runTypePb string // Normal job run. A run created with :method:jobs/runNow. const RunTypeJobRun RunType = `JOB_RUN` @@ -7100,22 +6725,6 @@ func (f *RunType) Type() string { return "RunType" } -func runTypeToPb(st *RunType) (*runTypePb, error) { - if st == nil { - return nil, nil - } - pb := runTypePb(*st) - return &pb, nil -} - -func runTypeFromPb(pb *runTypePb) (*RunType, error) { - if pb == nil { - return nil, nil - } - st := RunType(*pb) - return &st, nil -} - // Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file // will be retrieved\ from the local Databricks workspace. When set to `GIT`, // the SQL file will be retrieved from a Git repository defined in `git_source`. @@ -7125,7 +6734,6 @@ func runTypeFromPb(pb *runTypePb) (*RunType, error) { // * `WORKSPACE`: SQL file is located in Databricks workspace. * `GIT`: SQL file // is located in cloud Git provider. type Source string -type sourcePb string // SQL file is located in cloud Git provider. const SourceGit Source = `GIT` @@ -7154,22 +6762,6 @@ func (f *Source) Type() string { return "Source" } -func sourceToPb(st *Source) (*sourcePb, error) { - if st == nil { - return nil, nil - } - pb := sourcePb(*st) - return &pb, nil -} - -func sourceFromPb(pb *sourcePb) (*Source, error) { - if pb == nil { - return nil, nil - } - st := Source(*pb) - return &st, nil -} - type SparkJarTask struct { // Deprecated since 04/2016. Provide a `jar` through the `libraries` field // instead. For an example, see :method:jobs/create. @@ -7368,7 +6960,6 @@ func (st SqlAlertOutput) MarshalJSON() ([]byte, error) { // fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled trigger // conditions type SqlAlertState string -type sqlAlertStatePb string const SqlAlertStateOk SqlAlertState = `OK` @@ -7397,22 +6988,6 @@ func (f *SqlAlertState) Type() string { return "SqlAlertState" } -func sqlAlertStateToPb(st *SqlAlertState) (*sqlAlertStatePb, error) { - if st == nil { - return nil, nil - } - pb := sqlAlertStatePb(*st) - return &pb, nil -} - -func sqlAlertStateFromPb(pb *sqlAlertStatePb) (*SqlAlertState, error) { - if pb == nil { - return nil, nil - } - st := SqlAlertState(*pb) - return &st, nil -} - type SqlDashboardOutput struct { // The canonical identifier of the SQL warehouse. // Wire name: 'warehouse_id' @@ -7501,7 +7076,6 @@ func (st SqlDashboardWidgetOutput) MarshalJSON() ([]byte, error) { } type SqlDashboardWidgetOutputStatus string -type sqlDashboardWidgetOutputStatusPb string const SqlDashboardWidgetOutputStatusCancelled SqlDashboardWidgetOutputStatus = `CANCELLED` @@ -7534,22 +7108,6 @@ func (f *SqlDashboardWidgetOutputStatus) Type() string { return "SqlDashboardWidgetOutputStatus" } -func sqlDashboardWidgetOutputStatusToPb(st *SqlDashboardWidgetOutputStatus) (*sqlDashboardWidgetOutputStatusPb, error) { - if st == nil { - return nil, nil - } - pb := sqlDashboardWidgetOutputStatusPb(*st) - return &pb, nil -} - -func sqlDashboardWidgetOutputStatusFromPb(pb *sqlDashboardWidgetOutputStatusPb) (*SqlDashboardWidgetOutputStatus, error) { - if pb == nil { - return nil, nil - } - st := SqlDashboardWidgetOutputStatus(*pb) - return &st, nil -} - type SqlOutput struct { // The output of a SQL alert task, if available. // Wire name: 'alert_output' @@ -7947,7 +7505,6 @@ func (st SqlTaskSubscription) MarshalJSON() ([]byte, error) { } type StorageMode string -type storageModePb string const StorageModeDirectQuery StorageMode = `DIRECT_QUERY` @@ -7976,22 +7533,6 @@ func (f *StorageMode) Type() string { return "StorageMode" } -func storageModeToPb(st *StorageMode) (*storageModePb, error) { - if st == nil { - return nil, nil - } - pb := storageModePb(*st) - return &pb, nil -} - -func storageModeFromPb(pb *storageModePb) (*StorageMode, error) { - if pb == nil { - return nil, nil - } - st := StorageMode(*pb) - return &st, nil -} - type SubmitRun struct { // List of permissions to set on the job. // Wire name: 'access_control_list' @@ -8813,7 +8354,6 @@ func (st TaskNotificationSettings) MarshalJSON() ([]byte, error) { // // [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now type TerminationCodeCode string -type terminationCodeCodePb string const TerminationCodeCodeBudgetPolicyLimitExceeded TerminationCodeCode = `BUDGET_POLICY_LIMIT_EXCEEDED` @@ -8933,22 +8473,6 @@ func (f *TerminationCodeCode) Type() string { return "TerminationCodeCode" } -func terminationCodeCodeToPb(st *TerminationCodeCode) (*terminationCodeCodePb, error) { - if st == nil { - return nil, nil - } - pb := terminationCodeCodePb(*st) - return &pb, nil -} - -func terminationCodeCodeFromPb(pb *terminationCodeCodePb) (*TerminationCodeCode, error) { - if pb == nil { - return nil, nil - } - st := TerminationCodeCode(*pb) - return &st, nil -} - type TerminationDetails struct { // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed @@ -9052,7 +8576,6 @@ func (st TerminationDetails) MarshalJSON() ([]byte, error) { // // [status page]: https://status.databricks.com/ type TerminationTypeType string -type terminationTypeTypePb string // The run was terminated because of an error caused by user input or the job // configuration. @@ -9091,22 +8614,6 @@ func (f *TerminationTypeType) Type() string { return "TerminationTypeType" } -func terminationTypeTypeToPb(st *TerminationTypeType) (*terminationTypeTypePb, error) { - if st == nil { - return nil, nil - } - pb := terminationTypeTypePb(*st) - return &pb, nil -} - -func terminationTypeTypeFromPb(pb *terminationTypeTypePb) (*TerminationTypeType, error) { - if pb == nil { - return nil, nil - } - st := TerminationTypeType(*pb) - return &st, nil -} - // Additional details about what triggered the run type TriggerInfo struct { // The run id of the Run Job task run @@ -9197,7 +8704,6 @@ func (st TriggerSettings) MarshalJSON() ([]byte, error) { // `CONTINUOUS_RESTART`: Indicates a run created by user to manually restart a // continuous job run. type TriggerType string -type triggerTypePb string // Indicates a run that is triggered by a file arrival. const TriggerTypeFileArrival TriggerType = `FILE_ARRIVAL` @@ -9240,22 +8746,6 @@ func (f *TriggerType) Type() string { return "TriggerType" } -func triggerTypeToPb(st *TriggerType) (*triggerTypePb, error) { - if st == nil { - return nil, nil - } - pb := triggerTypePb(*st) - return &pb, nil -} - -func triggerTypeFromPb(pb *triggerTypePb) (*TriggerType, error) { - if pb == nil { - return nil, nil - } - st := TriggerType(*pb) - return &st, nil -} - type UpdateJob struct { // Remove top-level fields in the job settings. Removing nested fields is // not supported, except for tasks and job clusters (`tasks/task_1`). This @@ -9376,7 +8866,6 @@ func (st ViewItem) MarshalJSON() ([]byte, error) { // * `NOTEBOOK`: Notebook view item. * `DASHBOARD`: Dashboard view item. type ViewType string -type viewTypePb string // Dashboard view item. const ViewTypeDashboard ViewType = `DASHBOARD` @@ -9405,26 +8894,9 @@ func (f *ViewType) Type() string { return "ViewType" } -func viewTypeToPb(st *ViewType) (*viewTypePb, error) { - if st == nil { - return nil, nil - } - pb := viewTypePb(*st) - return &pb, nil -} - -func viewTypeFromPb(pb *viewTypePb) (*ViewType, error) { - if pb == nil { - return nil, nil - } - st := ViewType(*pb) - return &st, nil -} - // * `CODE`: Code view of the notebook. * `DASHBOARDS`: All dashboard views of // the notebook. * `ALL`: All views of the notebook. type ViewsToExport string -type viewsToExportPb string // All views of the notebook. const ViewsToExportAll ViewsToExport = `ALL` @@ -9456,22 +8928,6 @@ func (f *ViewsToExport) Type() string { return "ViewsToExport" } -func viewsToExportToPb(st *ViewsToExport) (*viewsToExportPb, error) { - if st == nil { - return nil, nil - } - pb := viewsToExportPb(*st) - return &pb, nil -} - -func viewsToExportFromPb(pb *viewsToExportPb) (*ViewsToExport, error) { - if pb == nil { - return nil, nil - } - st := ViewsToExport(*pb) - return &st, nil -} - type Webhook struct { // Wire name: 'id' diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 42e7544a8..565b05a9b 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -75,7 +75,6 @@ func (st AddExchangeForListingResponse) MarshalJSON() ([]byte, error) { } type AssetType string -type assetTypePb string const AssetTypeAssetTypeApp AssetType = `ASSET_TYPE_APP` @@ -112,22 +111,6 @@ func (f *AssetType) Type() string { return "AssetType" } -func assetTypeToPb(st *AssetType) (*assetTypePb, error) { - if st == nil { - return nil, nil - } - pb := assetTypePb(*st) - return &pb, nil -} - -func assetTypeFromPb(pb *assetTypePb) (*AssetType, error) { - if pb == nil { - return nil, nil - } - st := AssetType(*pb) - return &st, nil -} - // Get one batch of listings. One may specify up to 50 IDs per request. type BatchGetListingsRequest struct { @@ -255,7 +238,6 @@ func (st BatchGetProvidersResponse) MarshalJSON() ([]byte, error) { } type Category string -type categoryPb string const CategoryAdvertisingAndMarketing Category = `ADVERTISING_AND_MARKETING` @@ -322,22 +304,6 @@ func (f *Category) Type() string { return "Category" } -func categoryToPb(st *Category) (*categoryPb, error) { - if st == nil { - return nil, nil - } - pb := categoryPb(*st) - return &pb, nil -} - -func categoryFromPb(pb *categoryPb) (*Category, error) { - if pb == nil { - return nil, nil - } - st := Category(*pb) - return &st, nil -} - type ConsumerTerms struct { // Wire name: 'version' @@ -414,7 +380,6 @@ func (st ContactInfo) MarshalJSON() ([]byte, error) { } type Cost string -type costPb string const CostFree Cost = `FREE` @@ -441,22 +406,6 @@ func (f *Cost) Type() string { return "Cost" } -func costToPb(st *Cost) (*costPb, error) { - if st == nil { - return nil, nil - } - pb := costPb(*st) - return &pb, nil -} - -func costFromPb(pb *costPb) (*Cost, error) { - if pb == nil { - return nil, nil - } - st := Cost(*pb) - return &st, nil -} - type CreateExchangeFilterRequest struct { // Wire name: 'filter' @@ -931,7 +880,6 @@ func (st CreateProviderResponse) MarshalJSON() ([]byte, error) { } type DataRefresh string -type dataRefreshPb string const DataRefreshDaily DataRefresh = `DAILY` @@ -972,22 +920,6 @@ func (f *DataRefresh) Type() string { return "DataRefresh" } -func dataRefreshToPb(st *DataRefresh) (*dataRefreshPb, error) { - if st == nil { - return nil, nil - } - pb := dataRefreshPb(*st) - return &pb, nil -} - -func dataRefreshFromPb(pb *dataRefreshPb) (*DataRefresh, error) { - if pb == nil { - return nil, nil - } - st := DataRefresh(*pb) - return &st, nil -} - type DataRefreshInfo struct { // Wire name: 'interval' @@ -1386,7 +1318,6 @@ func (st DeleteProviderResponse) MarshalJSON() ([]byte, error) { } type DeltaSharingRecipientType string -type deltaSharingRecipientTypePb string const DeltaSharingRecipientTypeDeltaSharingRecipientTypeDatabricks DeltaSharingRecipientType = `DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS` @@ -1413,22 +1344,6 @@ func (f *DeltaSharingRecipientType) Type() string { return "DeltaSharingRecipientType" } -func deltaSharingRecipientTypeToPb(st *DeltaSharingRecipientType) (*deltaSharingRecipientTypePb, error) { - if st == nil { - return nil, nil - } - pb := deltaSharingRecipientTypePb(*st) - return &pb, nil -} - -func deltaSharingRecipientTypeFromPb(pb *deltaSharingRecipientTypePb) (*DeltaSharingRecipientType, error) { - if pb == nil { - return nil, nil - } - st := DeltaSharingRecipientType(*pb) - return &st, nil -} - type Exchange struct { // Wire name: 'comment' @@ -1544,7 +1459,6 @@ func (st ExchangeFilter) MarshalJSON() ([]byte, error) { } type ExchangeFilterType string -type exchangeFilterTypePb string const ExchangeFilterTypeGlobalMetastoreId ExchangeFilterType = `GLOBAL_METASTORE_ID` @@ -1569,22 +1483,6 @@ func (f *ExchangeFilterType) Type() string { return "ExchangeFilterType" } -func exchangeFilterTypeToPb(st *ExchangeFilterType) (*exchangeFilterTypePb, error) { - if st == nil { - return nil, nil - } - pb := exchangeFilterTypePb(*st) - return &pb, nil -} - -func exchangeFilterTypeFromPb(pb *exchangeFilterTypePb) (*ExchangeFilterType, error) { - if pb == nil { - return nil, nil - } - st := ExchangeFilterType(*pb) - return &st, nil -} - type ExchangeListing struct { // Wire name: 'created_at' @@ -1734,7 +1632,6 @@ func (st FileParent) MarshalJSON() ([]byte, error) { } type FileParentType string -type fileParentTypePb string const FileParentTypeListing FileParentType = `LISTING` @@ -1763,24 +1660,7 @@ func (f *FileParentType) Type() string { return "FileParentType" } -func fileParentTypeToPb(st *FileParentType) (*fileParentTypePb, error) { - if st == nil { - return nil, nil - } - pb := fileParentTypePb(*st) - return &pb, nil -} - -func fileParentTypeFromPb(pb *fileParentTypePb) (*FileParentType, error) { - if pb == nil { - return nil, nil - } - st := FileParentType(*pb) - return &st, nil -} - type FileStatus string -type fileStatusPb string const FileStatusFileStatusPublished FileStatus = `FILE_STATUS_PUBLISHED` @@ -1811,24 +1691,7 @@ func (f *FileStatus) Type() string { return "FileStatus" } -func fileStatusToPb(st *FileStatus) (*fileStatusPb, error) { - if st == nil { - return nil, nil - } - pb := fileStatusPb(*st) - return &pb, nil -} - -func fileStatusFromPb(pb *fileStatusPb) (*FileStatus, error) { - if pb == nil { - return nil, nil - } - st := FileStatus(*pb) - return &st, nil -} - type FulfillmentType string -type fulfillmentTypePb string const FulfillmentTypeInstall FulfillmentType = `INSTALL` @@ -1855,22 +1718,6 @@ func (f *FulfillmentType) Type() string { return "FulfillmentType" } -func fulfillmentTypeToPb(st *FulfillmentType) (*fulfillmentTypePb, error) { - if st == nil { - return nil, nil - } - pb := fulfillmentTypePb(*st) - return &pb, nil -} - -func fulfillmentTypeFromPb(pb *fulfillmentTypePb) (*FulfillmentType, error) { - if pb == nil { - return nil, nil - } - st := FulfillmentType(*pb) - return &st, nil -} - // Get an exchange type GetExchangeRequest struct { @@ -2469,7 +2316,6 @@ func (st InstallationDetail) MarshalJSON() ([]byte, error) { } type InstallationStatus string -type installationStatusPb string const InstallationStatusFailed InstallationStatus = `FAILED` @@ -2496,22 +2342,6 @@ func (f *InstallationStatus) Type() string { return "InstallationStatus" } -func installationStatusToPb(st *InstallationStatus) (*installationStatusPb, error) { - if st == nil { - return nil, nil - } - pb := installationStatusPb(*st) - return &pb, nil -} - -func installationStatusFromPb(pb *installationStatusPb) (*InstallationStatus, error) { - if pb == nil { - return nil, nil - } - st := InstallationStatus(*pb) - return &st, nil -} - // List all installations type ListAllInstallationsRequest struct { @@ -3607,7 +3437,6 @@ func (st ListingSetting) MarshalJSON() ([]byte, error) { } type ListingShareType string -type listingShareTypePb string const ListingShareTypeFull ListingShareType = `FULL` @@ -3634,25 +3463,8 @@ func (f *ListingShareType) Type() string { return "ListingShareType" } -func listingShareTypeToPb(st *ListingShareType) (*listingShareTypePb, error) { - if st == nil { - return nil, nil - } - pb := listingShareTypePb(*st) - return &pb, nil -} - -func listingShareTypeFromPb(pb *listingShareTypePb) (*ListingShareType, error) { - if pb == nil { - return nil, nil - } - st := ListingShareType(*pb) - return &st, nil -} - // Enums type ListingStatus string -type listingStatusPb string const ListingStatusDraft ListingStatus = `DRAFT` @@ -3683,22 +3495,6 @@ func (f *ListingStatus) Type() string { return "ListingStatus" } -func listingStatusToPb(st *ListingStatus) (*listingStatusPb, error) { - if st == nil { - return nil, nil - } - pb := listingStatusPb(*st) - return &pb, nil -} - -func listingStatusFromPb(pb *listingStatusPb) (*ListingStatus, error) { - if pb == nil { - return nil, nil - } - st := ListingStatus(*pb) - return &st, nil -} - type ListingSummary struct { // Wire name: 'categories' @@ -3823,7 +3619,6 @@ func (st ListingTag) MarshalJSON() ([]byte, error) { } type ListingTagType string -type listingTagTypePb string const ListingTagTypeListingTagTypeLanguage ListingTagType = `LISTING_TAG_TYPE_LANGUAGE` @@ -3850,24 +3645,7 @@ func (f *ListingTagType) Type() string { return "ListingTagType" } -func listingTagTypeToPb(st *ListingTagType) (*listingTagTypePb, error) { - if st == nil { - return nil, nil - } - pb := listingTagTypePb(*st) - return &pb, nil -} - -func listingTagTypeFromPb(pb *listingTagTypePb) (*ListingTagType, error) { - if pb == nil { - return nil, nil - } - st := ListingTagType(*pb) - return &st, nil -} - type ListingType string -type listingTypePb string const ListingTypePersonalized ListingType = `PERSONALIZED` @@ -3894,24 +3672,7 @@ func (f *ListingType) Type() string { return "ListingType" } -func listingTypeToPb(st *ListingType) (*listingTypePb, error) { - if st == nil { - return nil, nil - } - pb := listingTypePb(*st) - return &pb, nil -} - -func listingTypeFromPb(pb *listingTypePb) (*ListingType, error) { - if pb == nil { - return nil, nil - } - st := ListingType(*pb) - return &st, nil -} - type MarketplaceFileType string -type marketplaceFileTypePb string const MarketplaceFileTypeApp MarketplaceFileType = `APP` @@ -3940,22 +3701,6 @@ func (f *MarketplaceFileType) Type() string { return "MarketplaceFileType" } -func marketplaceFileTypeToPb(st *MarketplaceFileType) (*marketplaceFileTypePb, error) { - if st == nil { - return nil, nil - } - pb := marketplaceFileTypePb(*st) - return &pb, nil -} - -func marketplaceFileTypeFromPb(pb *marketplaceFileTypePb) (*MarketplaceFileType, error) { - if pb == nil { - return nil, nil - } - st := MarketplaceFileType(*pb) - return &st, nil -} - type PersonalizationRequest struct { // Wire name: 'comment' @@ -4036,7 +3781,6 @@ func (st PersonalizationRequest) MarshalJSON() ([]byte, error) { } type PersonalizationRequestStatus string -type personalizationRequestStatusPb string const PersonalizationRequestStatusDenied PersonalizationRequestStatus = `DENIED` @@ -4067,22 +3811,6 @@ func (f *PersonalizationRequestStatus) Type() string { return "PersonalizationRequestStatus" } -func personalizationRequestStatusToPb(st *PersonalizationRequestStatus) (*personalizationRequestStatusPb, error) { - if st == nil { - return nil, nil - } - pb := personalizationRequestStatusPb(*st) - return &pb, nil -} - -func personalizationRequestStatusFromPb(pb *personalizationRequestStatusPb) (*PersonalizationRequestStatus, error) { - if pb == nil { - return nil, nil - } - st := PersonalizationRequestStatus(*pb) - return &st, nil -} - type ProviderAnalyticsDashboard struct { // Wire name: 'id' @@ -5094,7 +4822,6 @@ func (st UpdateProviderResponse) MarshalJSON() ([]byte, error) { } type Visibility string -type visibilityPb string const VisibilityPrivate Visibility = `PRIVATE` @@ -5121,22 +4848,6 @@ func (f *Visibility) Type() string { return "Visibility" } -func visibilityToPb(st *Visibility) (*visibilityPb, error) { - if st == nil { - return nil, nil - } - pb := visibilityPb(*st) - return &pb, nil -} - -func visibilityFromPb(pb *visibilityPb) (*Visibility, error) { - if pb == nil { - return nil, nil - } - st := Visibility(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/ml/model.go b/service/ml/model.go index 0a7957d66..aeb50a777 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -109,7 +109,6 @@ func (st Activity) MarshalJSON() ([]byte, error) { // // * `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request type ActivityAction string -type activityActionPb string // Approve a transition request const ActivityActionApproveTransitionRequest ActivityAction = `APPROVE_TRANSITION_REQUEST` @@ -141,22 +140,6 @@ func (f *ActivityAction) Type() string { return "ActivityAction" } -func activityActionToPb(st *ActivityAction) (*activityActionPb, error) { - if st == nil { - return nil, nil - } - pb := activityActionPb(*st) - return &pb, nil -} - -func activityActionFromPb(pb *activityActionPb) (*ActivityAction, error) { - if pb == nil { - return nil, nil - } - st := ActivityAction(*pb) - return &st, nil -} - // Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the // corresponding stage transition. // @@ -171,7 +154,6 @@ func activityActionFromPb(pb *activityActionPb) (*ActivityAction, error) { // * `SYSTEM_TRANSITION`: For events performed as a side effect, such as // archiving existing model versions in a stage. type ActivityType string -type activityTypePb string // User applied the corresponding stage transition. const ActivityTypeAppliedTransition ActivityType = `APPLIED_TRANSITION` @@ -215,22 +197,6 @@ func (f *ActivityType) Type() string { return "ActivityType" } -func activityTypeToPb(st *ActivityType) (*activityTypePb, error) { - if st == nil { - return nil, nil - } - pb := activityTypePb(*st) - return &pb, nil -} - -func activityTypeFromPb(pb *activityTypePb) (*ActivityType, error) { - if pb == nil { - return nil, nil - } - st := ActivityType(*pb) - return &st, nil -} - type ApproveTransitionRequest struct { // Specifies whether to archive all current model versions in the target // stage. @@ -403,7 +369,6 @@ func (st ArtifactCredentialInfoHttpHeader) MarshalJSON() ([]byte, error) { // The type of a given artifact access credential type ArtifactCredentialType string -type artifactCredentialTypePb string const ArtifactCredentialTypeAwsPresignedUrl ArtifactCredentialType = `AWS_PRESIGNED_URL` @@ -434,28 +399,11 @@ func (f *ArtifactCredentialType) Type() string { return "ArtifactCredentialType" } -func artifactCredentialTypeToPb(st *ArtifactCredentialType) (*artifactCredentialTypePb, error) { - if st == nil { - return nil, nil - } - pb := artifactCredentialTypePb(*st) - return &pb, nil -} - -func artifactCredentialTypeFromPb(pb *artifactCredentialTypePb) (*ArtifactCredentialType, error) { - if pb == nil { - return nil, nil - } - st := ArtifactCredentialType(*pb) - return &st, nil -} - // An action that a user (with sufficient permissions) could take on a comment. // Valid values are: * `EDIT_COMMENT`: Edit the comment // // * `DELETE_COMMENT`: Delete the comment type CommentActivityAction string -type commentActivityActionPb string // Delete the comment const CommentActivityActionDeleteComment CommentActivityAction = `DELETE_COMMENT` @@ -484,22 +432,6 @@ func (f *CommentActivityAction) Type() string { return "CommentActivityAction" } -func commentActivityActionToPb(st *CommentActivityAction) (*commentActivityActionPb, error) { - if st == nil { - return nil, nil - } - pb := commentActivityActionPb(*st) - return &pb, nil -} - -func commentActivityActionFromPb(pb *commentActivityActionPb) (*CommentActivityAction, error) { - if pb == nil { - return nil, nil - } - st := CommentActivityAction(*pb) - return &st, nil -} - // Comment details. type CommentObject struct { // Array of actions on the activity allowed for the current viewer. @@ -2212,7 +2144,6 @@ func (st DeleteTransitionRequestResponse) MarshalJSON() ([]byte, error) { } type DeleteTransitionRequestStage string -type deleteTransitionRequestStagePb string const DeleteTransitionRequestStageArchived DeleteTransitionRequestStage = `Archived` @@ -2243,22 +2174,6 @@ func (f *DeleteTransitionRequestStage) Type() string { return "DeleteTransitionRequestStage" } -func deleteTransitionRequestStageToPb(st *DeleteTransitionRequestStage) (*deleteTransitionRequestStagePb, error) { - if st == nil { - return nil, nil - } - pb := deleteTransitionRequestStagePb(*st) - return &pb, nil -} - -func deleteTransitionRequestStageFromPb(pb *deleteTransitionRequestStagePb) (*DeleteTransitionRequestStage, error) { - if pb == nil { - return nil, nil - } - st := DeleteTransitionRequestStage(*pb) - return &st, nil -} - // Delete a webhook type DeleteWebhookRequest struct { // Webhook ID required to delete a registry webhook. @@ -2502,7 +2417,6 @@ func (st ExperimentPermission) MarshalJSON() ([]byte, error) { // Permission level type ExperimentPermissionLevel string -type experimentPermissionLevelPb string const ExperimentPermissionLevelCanEdit ExperimentPermissionLevel = `CAN_EDIT` @@ -2531,22 +2445,6 @@ func (f *ExperimentPermissionLevel) Type() string { return "ExperimentPermissionLevel" } -func experimentPermissionLevelToPb(st *ExperimentPermissionLevel) (*experimentPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := experimentPermissionLevelPb(*st) - return &pb, nil -} - -func experimentPermissionLevelFromPb(pb *experimentPermissionLevelPb) (*ExperimentPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := ExperimentPermissionLevel(*pb) - return &st, nil -} - type ExperimentPermissions struct { // Wire name: 'access_control_list' @@ -2842,7 +2740,6 @@ func (st ForecastingExperiment) MarshalJSON() ([]byte, error) { } type ForecastingExperimentState string -type forecastingExperimentStatePb string const ForecastingExperimentStateCancelled ForecastingExperimentState = `CANCELLED` @@ -2875,22 +2772,6 @@ func (f *ForecastingExperimentState) Type() string { return "ForecastingExperimentState" } -func forecastingExperimentStateToPb(st *ForecastingExperimentState) (*forecastingExperimentStatePb, error) { - if st == nil { - return nil, nil - } - pb := forecastingExperimentStatePb(*st) - return &pb, nil -} - -func forecastingExperimentStateFromPb(pb *forecastingExperimentStatePb) (*ForecastingExperimentState, error) { - if pb == nil { - return nil, nil - } - st := ForecastingExperimentState(*pb) - return &st, nil -} - // Get an experiment by name type GetByNameRequest struct { // Name of the associated experiment. @@ -5202,7 +5083,6 @@ func (st LoggedModelParameter) MarshalJSON() ([]byte, error) { // A LoggedModelStatus enum value represents the status of a logged model. type LoggedModelStatus string -type loggedModelStatusPb string const LoggedModelStatusLoggedModelPending LoggedModelStatus = `LOGGED_MODEL_PENDING` @@ -5231,22 +5111,6 @@ func (f *LoggedModelStatus) Type() string { return "LoggedModelStatus" } -func loggedModelStatusToPb(st *LoggedModelStatus) (*loggedModelStatusPb, error) { - if st == nil { - return nil, nil - } - pb := loggedModelStatusPb(*st) - return &pb, nil -} - -func loggedModelStatusFromPb(pb *loggedModelStatusPb) (*LoggedModelStatus, error) { - if pb == nil { - return nil, nil - } - st := LoggedModelStatus(*pb) - return &st, nil -} - // Tag for a LoggedModel. type LoggedModelTag struct { // The tag key. @@ -5723,7 +5587,6 @@ func (st ModelVersionDatabricks) MarshalJSON() ([]byte, error) { // Current status of `model_version` type ModelVersionStatus string -type modelVersionStatusPb string const ModelVersionStatusFailedRegistration ModelVersionStatus = `FAILED_REGISTRATION` @@ -5752,22 +5615,6 @@ func (f *ModelVersionStatus) Type() string { return "ModelVersionStatus" } -func modelVersionStatusToPb(st *ModelVersionStatus) (*modelVersionStatusPb, error) { - if st == nil { - return nil, nil - } - pb := modelVersionStatusPb(*st) - return &pb, nil -} - -func modelVersionStatusFromPb(pb *modelVersionStatusPb) (*ModelVersionStatus, error) { - if pb == nil { - return nil, nil - } - st := ModelVersionStatus(*pb) - return &st, nil -} - type ModelVersionTag struct { // The tag key. // Wire name: 'key' @@ -5844,7 +5691,6 @@ func (st Param) MarshalJSON() ([]byte, error) { // Permission level of the requesting user on the object. For what is allowed at // each level, see [MLflow Model permissions](..). type PermissionLevel string -type permissionLevelPb string const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT` @@ -5877,22 +5723,6 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } -func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := permissionLevelPb(*st) - return &pb, nil -} - -func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := PermissionLevel(*pb) - return &st, nil -} - type RegisteredModelAccessControlRequest struct { // name of the group // Wire name: 'group_name' @@ -6021,7 +5851,6 @@ func (st RegisteredModelPermission) MarshalJSON() ([]byte, error) { // Permission level type RegisteredModelPermissionLevel string -type registeredModelPermissionLevelPb string const RegisteredModelPermissionLevelCanEdit RegisteredModelPermissionLevel = `CAN_EDIT` @@ -6054,22 +5883,6 @@ func (f *RegisteredModelPermissionLevel) Type() string { return "RegisteredModelPermissionLevel" } -func registeredModelPermissionLevelToPb(st *RegisteredModelPermissionLevel) (*registeredModelPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := registeredModelPermissionLevelPb(*st) - return &pb, nil -} - -func registeredModelPermissionLevelFromPb(pb *registeredModelPermissionLevelPb) (*RegisteredModelPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := RegisteredModelPermissionLevel(*pb) - return &st, nil -} - type RegisteredModelPermissions struct { // Wire name: 'access_control_list' @@ -6276,7 +6089,6 @@ func (st RegistryWebhook) MarshalJSON() ([]byte, error) { } type RegistryWebhookEvent string -type registryWebhookEventPb string const RegistryWebhookEventCommentCreated RegistryWebhookEvent = `COMMENT_CREATED` @@ -6323,22 +6135,6 @@ func (f *RegistryWebhookEvent) Type() string { return "RegistryWebhookEvent" } -func registryWebhookEventToPb(st *RegistryWebhookEvent) (*registryWebhookEventPb, error) { - if st == nil { - return nil, nil - } - pb := registryWebhookEventPb(*st) - return &pb, nil -} - -func registryWebhookEventFromPb(pb *registryWebhookEventPb) (*RegistryWebhookEvent, error) { - if pb == nil { - return nil, nil - } - st := RegistryWebhookEvent(*pb) - return &st, nil -} - // Enable or disable triggering the webhook, or put the webhook into test mode. // The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated // event happens. @@ -6348,7 +6144,6 @@ func registryWebhookEventFromPb(pb *registryWebhookEventPb) (*RegistryWebhookEve // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not // triggered on a real event. type RegistryWebhookStatus string -type registryWebhookStatusPb string // Webhook is triggered when an associated event happens. const RegistryWebhookStatusActive RegistryWebhookStatus = `ACTIVE` @@ -6381,22 +6176,6 @@ func (f *RegistryWebhookStatus) Type() string { return "RegistryWebhookStatus" } -func registryWebhookStatusToPb(st *RegistryWebhookStatus) (*registryWebhookStatusPb, error) { - if st == nil { - return nil, nil - } - pb := registryWebhookStatusPb(*st) - return &pb, nil -} - -func registryWebhookStatusFromPb(pb *registryWebhookStatusPb) (*RegistryWebhookStatus, error) { - if pb == nil { - return nil, nil - } - st := RegistryWebhookStatus(*pb) - return &st, nil -} - type RejectTransitionRequest struct { // User-provided comment on the action. // Wire name: 'comment' @@ -6883,7 +6662,6 @@ func (st RunInfo) MarshalJSON() ([]byte, error) { // Status of a run. type RunInfoStatus string -type runInfoStatusPb string const RunInfoStatusFailed RunInfoStatus = `FAILED` @@ -6916,22 +6694,6 @@ func (f *RunInfoStatus) Type() string { return "RunInfoStatus" } -func runInfoStatusToPb(st *RunInfoStatus) (*runInfoStatusPb, error) { - if st == nil { - return nil, nil - } - pb := runInfoStatusPb(*st) - return &pb, nil -} - -func runInfoStatusFromPb(pb *runInfoStatusPb) (*RunInfoStatus, error) { - if pb == nil { - return nil, nil - } - st := RunInfoStatus(*pb) - return &st, nil -} - // Run inputs. type RunInputs struct { // Run metrics. @@ -7893,7 +7655,6 @@ func (st SetTagResponse) MarshalJSON() ([]byte, error) { // // * `Archived`: Archived stage. type Stage string -type stagePb string // Archived stage. const StageArchived Stage = `Archived` @@ -7928,22 +7689,6 @@ func (f *Stage) Type() string { return "Stage" } -func stageToPb(st *Stage) (*stagePb, error) { - if st == nil { - return nil, nil - } - pb := stagePb(*st) - return &pb, nil -} - -func stageFromPb(pb *stagePb) (*Stage, error) { - if pb == nil { - return nil, nil - } - st := Stage(*pb) - return &st, nil -} - // The status of the model version. Valid values are: * `PENDING_REGISTRATION`: // Request to register a new model version is pending as server performs // background tasks. @@ -7952,7 +7697,6 @@ func stageFromPb(pb *stagePb) (*Stage, error) { // // * `READY`: Model version is ready for use. type Status string -type statusPb string // Request to register a new model version has failed. const StatusFailedRegistration Status = `FAILED_REGISTRATION` @@ -7985,22 +7729,6 @@ func (f *Status) Type() string { return "Status" } -func statusToPb(st *Status) (*statusPb, error) { - if st == nil { - return nil, nil - } - pb := statusPb(*st) - return &pb, nil -} - -func statusFromPb(pb *statusPb) (*Status, error) { - if pb == nil { - return nil, nil - } - st := Status(*pb) - return &st, nil -} - // Test webhook response object. type TestRegistryWebhook struct { // Body of the response from the webhook URL @@ -8672,7 +8400,6 @@ func (st UpdateRunResponse) MarshalJSON() ([]byte, error) { // Status of a run. type UpdateRunStatus string -type updateRunStatusPb string const UpdateRunStatusFailed UpdateRunStatus = `FAILED` @@ -8705,22 +8432,6 @@ func (f *UpdateRunStatus) Type() string { return "UpdateRunStatus" } -func updateRunStatusToPb(st *UpdateRunStatus) (*updateRunStatusPb, error) { - if st == nil { - return nil, nil - } - pb := updateRunStatusPb(*st) - return &pb, nil -} - -func updateRunStatusFromPb(pb *updateRunStatusPb) (*UpdateRunStatus, error) { - if pb == nil { - return nil, nil - } - st := UpdateRunStatus(*pb) - return &st, nil -} - type UpdateWebhookResponse struct { } @@ -8751,7 +8462,6 @@ func (st UpdateWebhookResponse) MarshalJSON() ([]byte, error) { // Qualifier for the view type. type ViewType string -type viewTypePb string const ViewTypeActiveOnly ViewType = `ACTIVE_ONLY` @@ -8780,22 +8490,6 @@ func (f *ViewType) Type() string { return "ViewType" } -func viewTypeToPb(st *ViewType) (*viewTypePb, error) { - if st == nil { - return nil, nil - } - pb := viewTypePb(*st) - return &pb, nil -} - -func viewTypeFromPb(pb *viewTypePb) (*ViewType, error) { - if pb == nil { - return nil, nil - } - st := ViewType(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 324e64e09..7a725ad5d 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -254,7 +254,6 @@ func (st DataPlaneId) MarshalJSON() ([]byte, error) { // window starting at start_hour). If not specified all days of the week will be // used. type DayOfWeek string -type dayOfWeekPb string const DayOfWeekFriday DayOfWeek = `FRIDAY` @@ -291,22 +290,6 @@ func (f *DayOfWeek) Type() string { return "DayOfWeek" } -func dayOfWeekToPb(st *DayOfWeek) (*dayOfWeekPb, error) { - if st == nil { - return nil, nil - } - pb := dayOfWeekPb(*st) - return &pb, nil -} - -func dayOfWeekFromPb(pb *dayOfWeekPb) (*DayOfWeek, error) { - if pb == nil { - return nil, nil - } - st := DayOfWeek(*pb) - return &st, nil -} - // Delete a pipeline type DeletePipelineRequest struct { @@ -370,7 +353,6 @@ func (st DeletePipelineResponse) MarshalJSON() ([]byte, error) { // The deployment method that manages the pipeline: - BUNDLE: The pipeline is // managed by a Databricks Asset Bundle. type DeploymentKind string -type deploymentKindPb string const DeploymentKindBundle DeploymentKind = `BUNDLE` @@ -395,22 +377,6 @@ func (f *DeploymentKind) Type() string { return "DeploymentKind" } -func deploymentKindToPb(st *DeploymentKind) (*deploymentKindPb, error) { - if st == nil { - return nil, nil - } - pb := deploymentKindPb(*st) - return &pb, nil -} - -func deploymentKindFromPb(pb *deploymentKindPb) (*DeploymentKind, error) { - if pb == nil { - return nil, nil - } - st := DeploymentKind(*pb) - return &st, nil -} - type EditPipeline struct { // If false, deployment will fail if name has changed and conflicts the name // of another pipeline. @@ -612,7 +578,6 @@ func (st ErrorDetail) MarshalJSON() ([]byte, error) { // The severity level of the event. type EventLevel string -type eventLevelPb string const EventLevelError EventLevel = `ERROR` @@ -643,22 +608,6 @@ func (f *EventLevel) Type() string { return "EventLevel" } -func eventLevelToPb(st *EventLevel) (*eventLevelPb, error) { - if st == nil { - return nil, nil - } - pb := eventLevelPb(*st) - return &pb, nil -} - -func eventLevelFromPb(pb *eventLevelPb) (*EventLevel, error) { - if pb == nil { - return nil, nil - } - st := EventLevel(*pb) - return &st, nil -} - // Configurable event log parameters. type EventLogSpec struct { // The UC catalog the event log is published under. @@ -963,7 +912,6 @@ func (st GetPipelineResponse) MarshalJSON() ([]byte, error) { // The health of a pipeline. type GetPipelineResponseHealth string -type getPipelineResponseHealthPb string const GetPipelineResponseHealthHealthy GetPipelineResponseHealth = `HEALTHY` @@ -990,22 +938,6 @@ func (f *GetPipelineResponseHealth) Type() string { return "GetPipelineResponseHealth" } -func getPipelineResponseHealthToPb(st *GetPipelineResponseHealth) (*getPipelineResponseHealthPb, error) { - if st == nil { - return nil, nil - } - pb := getPipelineResponseHealthPb(*st) - return &pb, nil -} - -func getPipelineResponseHealthFromPb(pb *getPipelineResponseHealthPb) (*GetPipelineResponseHealth, error) { - if pb == nil { - return nil, nil - } - st := GetPipelineResponseHealth(*pb) - return &st, nil -} - // Get a pipeline update type GetUpdateRequest struct { // The ID of the pipeline. @@ -1216,7 +1148,6 @@ func (st IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { } type IngestionSourceType string -type ingestionSourceTypePb string const IngestionSourceTypeDynamics365 IngestionSourceType = `DYNAMICS365` @@ -1263,22 +1194,6 @@ func (f *IngestionSourceType) Type() string { return "IngestionSourceType" } -func ingestionSourceTypeToPb(st *IngestionSourceType) (*ingestionSourceTypePb, error) { - if st == nil { - return nil, nil - } - pb := ingestionSourceTypePb(*st) - return &pb, nil -} - -func ingestionSourceTypeFromPb(pb *ingestionSourceTypePb) (*IngestionSourceType, error) { - if pb == nil { - return nil, nil - } - st := IngestionSourceType(*pb) - return &st, nil -} - // List pipeline events type ListPipelineEventsRequest struct { // Criteria to select a subset of results, expressed using a SQL-like @@ -1583,7 +1498,6 @@ func (st ManualTrigger) MarshalJSON() ([]byte, error) { // Maturity level for EventDetails. type MaturityLevel string -type maturityLevelPb string const MaturityLevelDeprecated MaturityLevel = `DEPRECATED` @@ -1612,22 +1526,6 @@ func (f *MaturityLevel) Type() string { return "MaturityLevel" } -func maturityLevelToPb(st *MaturityLevel) (*maturityLevelPb, error) { - if st == nil { - return nil, nil - } - pb := maturityLevelPb(*st) - return &pb, nil -} - -func maturityLevelFromPb(pb *maturityLevelPb) (*MaturityLevel, error) { - if pb == nil { - return nil, nil - } - st := MaturityLevel(*pb) - return &st, nil -} - type NotebookLibrary struct { // The absolute path of the source code. // Wire name: 'path' @@ -2096,7 +1994,6 @@ func (st PipelineClusterAutoscale) MarshalJSON() ([]byte, error) { // Autoscaling is available for `updates` clusters only. The legacy autoscaling // feature is used for `maintenance` clusters. type PipelineClusterAutoscaleMode string -type pipelineClusterAutoscaleModePb string const PipelineClusterAutoscaleModeEnhanced PipelineClusterAutoscaleMode = `ENHANCED` @@ -2123,22 +2020,6 @@ func (f *PipelineClusterAutoscaleMode) Type() string { return "PipelineClusterAutoscaleMode" } -func pipelineClusterAutoscaleModeToPb(st *PipelineClusterAutoscaleMode) (*pipelineClusterAutoscaleModePb, error) { - if st == nil { - return nil, nil - } - pb := pipelineClusterAutoscaleModePb(*st) - return &pb, nil -} - -func pipelineClusterAutoscaleModeFromPb(pb *pipelineClusterAutoscaleModePb) (*PipelineClusterAutoscaleMode, error) { - if pb == nil { - return nil, nil - } - st := PipelineClusterAutoscaleMode(*pb) - return &st, nil -} - type PipelineDeployment struct { // The deployment method that manages the pipeline. // Wire name: 'kind' @@ -2325,7 +2206,6 @@ func (st PipelinePermission) MarshalJSON() ([]byte, error) { // Permission level type PipelinePermissionLevel string -type pipelinePermissionLevelPb string const PipelinePermissionLevelCanManage PipelinePermissionLevel = `CAN_MANAGE` @@ -2356,22 +2236,6 @@ func (f *PipelinePermissionLevel) Type() string { return "PipelinePermissionLevel" } -func pipelinePermissionLevelToPb(st *PipelinePermissionLevel) (*pipelinePermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := pipelinePermissionLevelPb(*st) - return &pb, nil -} - -func pipelinePermissionLevelFromPb(pb *pipelinePermissionLevelPb) (*PipelinePermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := PipelinePermissionLevel(*pb) - return &st, nil -} - type PipelinePermissions struct { // Wire name: 'access_control_list' @@ -2598,7 +2462,6 @@ func (st PipelineSpec) MarshalJSON() ([]byte, error) { // The pipeline state. type PipelineState string -type pipelineStatePb string const PipelineStateDeleted PipelineState = `DELETED` @@ -2639,22 +2502,6 @@ func (f *PipelineState) Type() string { return "PipelineState" } -func pipelineStateToPb(st *PipelineState) (*pipelineStatePb, error) { - if st == nil { - return nil, nil - } - pb := pipelineStatePb(*st) - return &pb, nil -} - -func pipelineStateFromPb(pb *pipelineStatePb) (*PipelineState, error) { - if pb == nil { - return nil, nil - } - st := PipelineState(*pb) - return &st, nil -} - type PipelineStateInfo struct { // The unique identifier of the cluster running the pipeline. // Wire name: 'cluster_id' @@ -2713,7 +2560,6 @@ func (st PipelineStateInfo) MarshalJSON() ([]byte, error) { // The health of a pipeline. type PipelineStateInfoHealth string -type pipelineStateInfoHealthPb string const PipelineStateInfoHealthHealthy PipelineStateInfoHealth = `HEALTHY` @@ -2740,22 +2586,6 @@ func (f *PipelineStateInfoHealth) Type() string { return "PipelineStateInfoHealth" } -func pipelineStateInfoHealthToPb(st *PipelineStateInfoHealth) (*pipelineStateInfoHealthPb, error) { - if st == nil { - return nil, nil - } - pb := pipelineStateInfoHealthPb(*st) - return &pb, nil -} - -func pipelineStateInfoHealthFromPb(pb *pipelineStateInfoHealthPb) (*PipelineStateInfoHealth, error) { - if pb == nil { - return nil, nil - } - st := PipelineStateInfoHealth(*pb) - return &st, nil -} - type PipelineTrigger struct { // Wire name: 'cron' @@ -3151,7 +2981,6 @@ func (st StartUpdate) MarshalJSON() ([]byte, error) { // What triggered this update. type StartUpdateCause string -type startUpdateCausePb string const StartUpdateCauseApiCall StartUpdateCause = `API_CALL` @@ -3188,22 +3017,6 @@ func (f *StartUpdateCause) Type() string { return "StartUpdateCause" } -func startUpdateCauseToPb(st *StartUpdateCause) (*startUpdateCausePb, error) { - if st == nil { - return nil, nil - } - pb := startUpdateCausePb(*st) - return &pb, nil -} - -func startUpdateCauseFromPb(pb *startUpdateCausePb) (*StartUpdateCause, error) { - if pb == nil { - return nil, nil - } - st := StartUpdateCause(*pb) - return &st, nil -} - type StartUpdateResponse struct { // Wire name: 'update_id' @@ -3413,7 +3226,6 @@ func (st TableSpecificConfig) MarshalJSON() ([]byte, error) { // The SCD type to use to ingest the table. type TableSpecificConfigScdType string -type tableSpecificConfigScdTypePb string const TableSpecificConfigScdTypeScdType1 TableSpecificConfigScdType = `SCD_TYPE_1` @@ -3440,22 +3252,6 @@ func (f *TableSpecificConfigScdType) Type() string { return "TableSpecificConfigScdType" } -func tableSpecificConfigScdTypeToPb(st *TableSpecificConfigScdType) (*tableSpecificConfigScdTypePb, error) { - if st == nil { - return nil, nil - } - pb := tableSpecificConfigScdTypePb(*st) - return &pb, nil -} - -func tableSpecificConfigScdTypeFromPb(pb *tableSpecificConfigScdTypePb) (*TableSpecificConfigScdType, error) { - if pb == nil { - return nil, nil - } - st := TableSpecificConfigScdType(*pb) - return &st, nil -} - type UpdateInfo struct { // What triggered this update. // Wire name: 'cause' @@ -3529,7 +3325,6 @@ func (st UpdateInfo) MarshalJSON() ([]byte, error) { // What triggered this update. type UpdateInfoCause string -type updateInfoCausePb string const UpdateInfoCauseApiCall UpdateInfoCause = `API_CALL` @@ -3566,25 +3361,8 @@ func (f *UpdateInfoCause) Type() string { return "UpdateInfoCause" } -func updateInfoCauseToPb(st *UpdateInfoCause) (*updateInfoCausePb, error) { - if st == nil { - return nil, nil - } - pb := updateInfoCausePb(*st) - return &pb, nil -} - -func updateInfoCauseFromPb(pb *updateInfoCausePb) (*UpdateInfoCause, error) { - if pb == nil { - return nil, nil - } - st := UpdateInfoCause(*pb) - return &st, nil -} - // The update state. type UpdateInfoState string -type updateInfoStatePb string const UpdateInfoStateCanceled UpdateInfoState = `CANCELED` @@ -3629,22 +3407,6 @@ func (f *UpdateInfoState) Type() string { return "UpdateInfoState" } -func updateInfoStateToPb(st *UpdateInfoState) (*updateInfoStatePb, error) { - if st == nil { - return nil, nil - } - pb := updateInfoStatePb(*st) - return &pb, nil -} - -func updateInfoStateFromPb(pb *updateInfoStatePb) (*UpdateInfoState, error) { - if pb == nil { - return nil, nil - } - st := UpdateInfoState(*pb) - return &st, nil -} - type UpdateStateInfo struct { // Wire name: 'creation_time' @@ -3686,7 +3448,6 @@ func (st UpdateStateInfo) MarshalJSON() ([]byte, error) { // The update state. type UpdateStateInfoState string -type updateStateInfoStatePb string const UpdateStateInfoStateCanceled UpdateStateInfoState = `CANCELED` @@ -3731,22 +3492,6 @@ func (f *UpdateStateInfoState) Type() string { return "UpdateStateInfoState" } -func updateStateInfoStateToPb(st *UpdateStateInfoState) (*updateStateInfoStatePb, error) { - if st == nil { - return nil, nil - } - pb := updateStateInfoStatePb(*st) - return &pb, nil -} - -func updateStateInfoStateFromPb(pb *updateStateInfoStatePb) (*UpdateStateInfoState, error) { - if pb == nil { - return nil, nil - } - st := UpdateStateInfoState(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/pkg.go b/service/pkg.go index 00f58b46e..74dffcabb 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -54,10 +54,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. -// // - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. // +// - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. @@ -365,8 +365,8 @@ var ( _ *marketplace.ConsumerListingsAPI = nil _ *marketplace.ConsumerPersonalizationRequestsAPI = nil _ *marketplace.ConsumerProvidersAPI = nil - _ *catalog.CredentialsAPI = nil _ *provisioning.CredentialsAPI = nil + _ *catalog.CredentialsAPI = nil _ *settings.CredentialsManagerAPI = nil _ *settings.CspEnablementAccountAPI = nil _ *iam.CurrentUserAPI = nil diff --git a/service/provisioning/internal.go b/service/provisioning/internal.go index 16e09b49f..d5a4106f2 100755 --- a/service/provisioning/internal.go +++ b/service/provisioning/internal.go @@ -652,6 +652,24 @@ func (st credentialPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } +type customTagsPb CustomTags + +func customTagsToPb(st *CustomTags) (*customTagsPb, error) { + if st == nil { + return nil, nil + } + stPb := customTagsPb(*st) + return &stPb, nil +} + +func customTagsFromPb(stPb *customTagsPb) (*CustomTags, error) { + if stPb == nil { + return nil, nil + } + st := CustomTags(*stPb) + return &st, nil +} + func customerFacingGcpCloudResourceContainerToPb(st *CustomerFacingGcpCloudResourceContainer) (*customerFacingGcpCloudResourceContainerPb, error) { if st == nil { return nil, nil diff --git a/service/provisioning/model.go b/service/provisioning/model.go index 27449ff31..13f20114b 100755 --- a/service/provisioning/model.go +++ b/service/provisioning/model.go @@ -700,24 +700,7 @@ func (st Credential) MarshalJSON() ([]byte, error) { // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - type CustomTags map[string]string -type customTagsPb CustomTags - -func customTagsToPb(st *CustomTags) (*customTagsPb, error) { - if st == nil { - return nil, nil - } - stPb := customTagsPb(*st) - return &stPb, nil -} -func customTagsFromPb(stPb *customTagsPb) (*CustomTags, error) { - if stPb == nil { - return nil, nil - } - st := CustomTags(*stPb) - return &st, nil -} // The general workspace configurations that are specific to Google Cloud. type CustomerFacingGcpCloudResourceContainer struct { @@ -1059,7 +1042,6 @@ func (st DeleteWorkspaceRequest) MarshalJSON() ([]byte, error) { // // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html type EndpointUseCase string -type endpointUseCasePb string const EndpointUseCaseDataplaneRelayAccess EndpointUseCase = `DATAPLANE_RELAY_ACCESS` @@ -1086,26 +1068,9 @@ func (f *EndpointUseCase) Type() string { return "EndpointUseCase" } -func endpointUseCaseToPb(st *EndpointUseCase) (*endpointUseCasePb, error) { - if st == nil { - return nil, nil - } - pb := endpointUseCasePb(*st) - return &pb, nil -} - -func endpointUseCaseFromPb(pb *endpointUseCasePb) (*EndpointUseCase, error) { - if pb == nil { - return nil, nil - } - st := EndpointUseCase(*pb) - return &st, nil -} - // The AWS resource associated with this error: credentials, VPC, subnet, // security group, or network ACL. type ErrorType string -type errorTypePb string const ErrorTypeCredentials ErrorType = `credentials` @@ -1138,22 +1103,6 @@ func (f *ErrorType) Type() string { return "ErrorType" } -func errorTypeToPb(st *ErrorType) (*errorTypePb, error) { - if st == nil { - return nil, nil - } - pb := errorTypePb(*st) - return &pb, nil -} - -func errorTypeFromPb(pb *errorTypePb) (*ErrorType, error) { - if pb == nil { - return nil, nil - } - st := ErrorType(*pb) - return &st, nil -} - type ExternalCustomerInfo struct { // Email of the authoritative user. // Wire name: 'authoritative_user_email' @@ -1671,7 +1620,6 @@ func (st GkeConfig) MarshalJSON() ([]byte, error) { // Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of a // public GKE cluster have public IP addresses. type GkeConfigConnectivityType string -type gkeConfigConnectivityTypePb string const GkeConfigConnectivityTypePrivateNodePublicMaster GkeConfigConnectivityType = `PRIVATE_NODE_PUBLIC_MASTER` @@ -1698,27 +1646,10 @@ func (f *GkeConfigConnectivityType) Type() string { return "GkeConfigConnectivityType" } -func gkeConfigConnectivityTypeToPb(st *GkeConfigConnectivityType) (*gkeConfigConnectivityTypePb, error) { - if st == nil { - return nil, nil - } - pb := gkeConfigConnectivityTypePb(*st) - return &pb, nil -} - -func gkeConfigConnectivityTypeFromPb(pb *gkeConfigConnectivityTypePb) (*GkeConfigConnectivityType, error) { - if pb == nil { - return nil, nil - } - st := GkeConfigConnectivityType(*pb) - return &st, nil -} - // Possible values are: * `MANAGED_SERVICES`: Encrypts notebook and secret data // in the control plane * `STORAGE`: Encrypts the workspace's root S3 bucket // (root DBFS and system data) and, optionally, cluster EBS volumes. type KeyUseCase string -type keyUseCasePb string // Encrypts notebook and secret data in the control plane const KeyUseCaseManagedServices KeyUseCase = `MANAGED_SERVICES` @@ -1748,22 +1679,6 @@ func (f *KeyUseCase) Type() string { return "KeyUseCase" } -func keyUseCaseToPb(st *KeyUseCase) (*keyUseCasePb, error) { - if st == nil { - return nil, nil - } - pb := keyUseCasePb(*st) - return &pb, nil -} - -func keyUseCaseFromPb(pb *keyUseCasePb) (*KeyUseCase, error) { - if pb == nil { - return nil, nil - } - st := KeyUseCase(*pb) - return &st, nil -} - type Network struct { // The Databricks account ID associated with this network configuration. // Wire name: 'account_id' @@ -1959,7 +1874,6 @@ func (st NetworkWarning) MarshalJSON() ([]byte, error) { // // [AWS Pricing]: https://databricks.com/product/aws-pricing type PricingTier string -type pricingTierPb string const PricingTierCommunityEdition PricingTier = `COMMUNITY_EDITION` @@ -1994,22 +1908,6 @@ func (f *PricingTier) Type() string { return "PricingTier" } -func pricingTierToPb(st *PricingTier) (*pricingTierPb, error) { - if st == nil { - return nil, nil - } - pb := pricingTierPb(*st) - return &pb, nil -} - -func pricingTierFromPb(pb *pricingTierPb) (*PricingTier, error) { - if pb == nil { - return nil, nil - } - st := PricingTier(*pb) - return &st, nil -} - // The private access level controls which VPC endpoints can connect to the UI // or API of any workspace that attaches this private access settings object. * // `ACCOUNT` level access (the default) allows only VPC endpoints that are @@ -2017,7 +1915,6 @@ func pricingTierFromPb(pb *pricingTierPb) (*PricingTier, error) { // level access allows only specified VPC endpoints connect to your workspace. // For details, see `allowed_vpc_endpoint_ids`. type PrivateAccessLevel string -type privateAccessLevelPb string const PrivateAccessLevelAccount PrivateAccessLevel = `ACCOUNT` @@ -2044,22 +1941,6 @@ func (f *PrivateAccessLevel) Type() string { return "PrivateAccessLevel" } -func privateAccessLevelToPb(st *PrivateAccessLevel) (*privateAccessLevelPb, error) { - if st == nil { - return nil, nil - } - pb := privateAccessLevelPb(*st) - return &pb, nil -} - -func privateAccessLevelFromPb(pb *privateAccessLevelPb) (*PrivateAccessLevel, error) { - if pb == nil { - return nil, nil - } - st := PrivateAccessLevel(*pb) - return &st, nil -} - type PrivateAccessSettings struct { // The Databricks account ID that hosts the credential. // Wire name: 'account_id' @@ -2515,7 +2396,6 @@ func (st VpcEndpoint) MarshalJSON() ([]byte, error) { // workspace: * `UNATTACHED`: Unattached. * `VALID`: Valid. * `BROKEN`: Broken. // * `WARNED`: Warned. type VpcStatus string -type vpcStatusPb string // Broken. const VpcStatusBroken VpcStatus = `BROKEN` @@ -2550,25 +2430,8 @@ func (f *VpcStatus) Type() string { return "VpcStatus" } -func vpcStatusToPb(st *VpcStatus) (*vpcStatusPb, error) { - if st == nil { - return nil, nil - } - pb := vpcStatusPb(*st) - return &pb, nil -} - -func vpcStatusFromPb(pb *vpcStatusPb) (*VpcStatus, error) { - if pb == nil { - return nil, nil - } - st := VpcStatus(*pb) - return &st, nil -} - // The AWS resource associated with this warning: a subnet or a security group. type WarningType string -type warningTypePb string const WarningTypeSecurityGroup WarningType = `securityGroup` @@ -2595,22 +2458,6 @@ func (f *WarningType) Type() string { return "WarningType" } -func warningTypeToPb(st *WarningType) (*warningTypePb, error) { - if st == nil { - return nil, nil - } - pb := warningTypePb(*st) - return &pb, nil -} - -func warningTypeFromPb(pb *warningTypePb) (*WarningType, error) { - if pb == nil { - return nil, nil - } - st := WarningType(*pb) - return &st, nil -} - type Workspace struct { // Databricks account ID. // Wire name: 'account_id' @@ -2766,7 +2613,6 @@ func (st Workspace) MarshalJSON() ([]byte, error) { // `PROVISIONING` initially. Continue to check the status until the status is // `RUNNING`. type WorkspaceStatus string -type workspaceStatusPb string const WorkspaceStatusBanned WorkspaceStatus = `BANNED` @@ -2801,22 +2647,6 @@ func (f *WorkspaceStatus) Type() string { return "WorkspaceStatus" } -func workspaceStatusToPb(st *WorkspaceStatus) (*workspaceStatusPb, error) { - if st == nil { - return nil, nil - } - pb := workspaceStatusPb(*st) - return &pb, nil -} - -func workspaceStatusFromPb(pb *workspaceStatusPb) (*WorkspaceStatus, error) { - if pb == nil { - return nil, nil - } - st := WorkspaceStatus(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/qualitymonitor/model.go b/service/qualitymonitor/model.go index 4f7e2f74b..b90a3adae 100755 --- a/service/qualitymonitor/model.go +++ b/service/qualitymonitor/model.go @@ -55,7 +55,6 @@ func (st AnomalyDetectionConfig) MarshalJSON() ([]byte, error) { // Status of Anomaly Detection Job Run type AnomalyDetectionRunStatus string -type anomalyDetectionRunStatusPb string const AnomalyDetectionRunStatusAnomalyDetectionRunStatusCanceled AnomalyDetectionRunStatus = `ANOMALY_DETECTION_RUN_STATUS_CANCELED` @@ -94,22 +93,6 @@ func (f *AnomalyDetectionRunStatus) Type() string { return "AnomalyDetectionRunStatus" } -func anomalyDetectionRunStatusToPb(st *AnomalyDetectionRunStatus) (*anomalyDetectionRunStatusPb, error) { - if st == nil { - return nil, nil - } - pb := anomalyDetectionRunStatusPb(*st) - return &pb, nil -} - -func anomalyDetectionRunStatusFromPb(pb *anomalyDetectionRunStatusPb) (*AnomalyDetectionRunStatus, error) { - if pb == nil { - return nil, nil - } - st := AnomalyDetectionRunStatus(*pb) - return &st, nil -} - // Create a quality monitor type CreateQualityMonitorRequest struct { diff --git a/service/serving/model.go b/service/serving/model.go index 9fe9e6ea5..c6d632f8b 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -178,7 +178,6 @@ func (st AiGatewayGuardrailPiiBehavior) MarshalJSON() ([]byte, error) { } type AiGatewayGuardrailPiiBehaviorBehavior string -type aiGatewayGuardrailPiiBehaviorBehaviorPb string const AiGatewayGuardrailPiiBehaviorBehaviorBlock AiGatewayGuardrailPiiBehaviorBehavior = `BLOCK` @@ -205,22 +204,6 @@ func (f *AiGatewayGuardrailPiiBehaviorBehavior) Type() string { return "AiGatewayGuardrailPiiBehaviorBehavior" } -func aiGatewayGuardrailPiiBehaviorBehaviorToPb(st *AiGatewayGuardrailPiiBehaviorBehavior) (*aiGatewayGuardrailPiiBehaviorBehaviorPb, error) { - if st == nil { - return nil, nil - } - pb := aiGatewayGuardrailPiiBehaviorBehaviorPb(*st) - return &pb, nil -} - -func aiGatewayGuardrailPiiBehaviorBehaviorFromPb(pb *aiGatewayGuardrailPiiBehaviorBehaviorPb) (*AiGatewayGuardrailPiiBehaviorBehavior, error) { - if pb == nil { - return nil, nil - } - st := AiGatewayGuardrailPiiBehaviorBehavior(*pb) - return &st, nil -} - type AiGatewayGuardrails struct { // Configuration for input guardrail filters. // Wire name: 'input' @@ -343,7 +326,6 @@ func (st AiGatewayRateLimit) MarshalJSON() ([]byte, error) { } type AiGatewayRateLimitKey string -type aiGatewayRateLimitKeyPb string const AiGatewayRateLimitKeyEndpoint AiGatewayRateLimitKey = `endpoint` @@ -370,24 +352,7 @@ func (f *AiGatewayRateLimitKey) Type() string { return "AiGatewayRateLimitKey" } -func aiGatewayRateLimitKeyToPb(st *AiGatewayRateLimitKey) (*aiGatewayRateLimitKeyPb, error) { - if st == nil { - return nil, nil - } - pb := aiGatewayRateLimitKeyPb(*st) - return &pb, nil -} - -func aiGatewayRateLimitKeyFromPb(pb *aiGatewayRateLimitKeyPb) (*AiGatewayRateLimitKey, error) { - if pb == nil { - return nil, nil - } - st := AiGatewayRateLimitKey(*pb) - return &st, nil -} - type AiGatewayRateLimitRenewalPeriod string -type aiGatewayRateLimitRenewalPeriodPb string const AiGatewayRateLimitRenewalPeriodMinute AiGatewayRateLimitRenewalPeriod = `minute` @@ -412,22 +377,6 @@ func (f *AiGatewayRateLimitRenewalPeriod) Type() string { return "AiGatewayRateLimitRenewalPeriod" } -func aiGatewayRateLimitRenewalPeriodToPb(st *AiGatewayRateLimitRenewalPeriod) (*aiGatewayRateLimitRenewalPeriodPb, error) { - if st == nil { - return nil, nil - } - pb := aiGatewayRateLimitRenewalPeriodPb(*st) - return &pb, nil -} - -func aiGatewayRateLimitRenewalPeriodFromPb(pb *aiGatewayRateLimitRenewalPeriodPb) (*AiGatewayRateLimitRenewalPeriod, error) { - if pb == nil { - return nil, nil - } - st := AiGatewayRateLimitRenewalPeriod(*pb) - return &st, nil -} - type AiGatewayUsageTrackingConfig struct { // Whether to enable usage tracking. // Wire name: 'enabled' @@ -536,7 +485,6 @@ func (st AmazonBedrockConfig) MarshalJSON() ([]byte, error) { } type AmazonBedrockConfigBedrockProvider string -type amazonBedrockConfigBedrockProviderPb string const AmazonBedrockConfigBedrockProviderAi21labs AmazonBedrockConfigBedrockProvider = `ai21labs` @@ -567,22 +515,6 @@ func (f *AmazonBedrockConfigBedrockProvider) Type() string { return "AmazonBedrockConfigBedrockProvider" } -func amazonBedrockConfigBedrockProviderToPb(st *AmazonBedrockConfigBedrockProvider) (*amazonBedrockConfigBedrockProviderPb, error) { - if st == nil { - return nil, nil - } - pb := amazonBedrockConfigBedrockProviderPb(*st) - return &pb, nil -} - -func amazonBedrockConfigBedrockProviderFromPb(pb *amazonBedrockConfigBedrockProviderPb) (*AmazonBedrockConfigBedrockProvider, error) { - if pb == nil { - return nil, nil - } - st := AmazonBedrockConfigBedrockProvider(*pb) - return &st, nil -} - type AnthropicConfig struct { // The Databricks secret key reference for an Anthropic API key. If you // prefer to paste your API key directly, see `anthropic_api_key_plaintext`. @@ -934,7 +866,6 @@ func (st ChatMessage) MarshalJSON() ([]byte, error) { // The role of the message. One of [system, user, assistant]. type ChatMessageRole string -type chatMessageRolePb string const ChatMessageRoleAssistant ChatMessageRole = `assistant` @@ -963,22 +894,6 @@ func (f *ChatMessageRole) Type() string { return "ChatMessageRole" } -func chatMessageRoleToPb(st *ChatMessageRole) (*chatMessageRolePb, error) { - if st == nil { - return nil, nil - } - pb := chatMessageRolePb(*st) - return &pb, nil -} - -func chatMessageRoleFromPb(pb *chatMessageRolePb) (*ChatMessageRole, error) { - if pb == nil { - return nil, nil - } - st := ChatMessageRole(*pb) - return &st, nil -} - type CohereConfig struct { // This is an optional field to provide a customized base URL for the Cohere // API. If left unspecified, the standard Cohere base URL is used. @@ -1395,7 +1310,6 @@ func (st EmbeddingsV1ResponseEmbeddingElement) MarshalJSON() ([]byte, error) { // This will always be 'embedding'. type EmbeddingsV1ResponseEmbeddingElementObject string -type embeddingsV1ResponseEmbeddingElementObjectPb string const EmbeddingsV1ResponseEmbeddingElementObjectEmbedding EmbeddingsV1ResponseEmbeddingElementObject = `embedding` @@ -1420,22 +1334,6 @@ func (f *EmbeddingsV1ResponseEmbeddingElementObject) Type() string { return "EmbeddingsV1ResponseEmbeddingElementObject" } -func embeddingsV1ResponseEmbeddingElementObjectToPb(st *EmbeddingsV1ResponseEmbeddingElementObject) (*embeddingsV1ResponseEmbeddingElementObjectPb, error) { - if st == nil { - return nil, nil - } - pb := embeddingsV1ResponseEmbeddingElementObjectPb(*st) - return &pb, nil -} - -func embeddingsV1ResponseEmbeddingElementObjectFromPb(pb *embeddingsV1ResponseEmbeddingElementObjectPb) (*EmbeddingsV1ResponseEmbeddingElementObject, error) { - if pb == nil { - return nil, nil - } - st := EmbeddingsV1ResponseEmbeddingElementObject(*pb) - return &st, nil -} - type EndpointCoreConfigInput struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. Note: this field is deprecated for creating @@ -1666,7 +1564,6 @@ func (st EndpointState) MarshalJSON() ([]byte, error) { } type EndpointStateConfigUpdate string -type endpointStateConfigUpdatePb string const EndpointStateConfigUpdateInProgress EndpointStateConfigUpdate = `IN_PROGRESS` @@ -1697,24 +1594,7 @@ func (f *EndpointStateConfigUpdate) Type() string { return "EndpointStateConfigUpdate" } -func endpointStateConfigUpdateToPb(st *EndpointStateConfigUpdate) (*endpointStateConfigUpdatePb, error) { - if st == nil { - return nil, nil - } - pb := endpointStateConfigUpdatePb(*st) - return &pb, nil -} - -func endpointStateConfigUpdateFromPb(pb *endpointStateConfigUpdatePb) (*EndpointStateConfigUpdate, error) { - if pb == nil { - return nil, nil - } - st := EndpointStateConfigUpdate(*pb) - return &st, nil -} - type EndpointStateReady string -type endpointStateReadyPb string const EndpointStateReadyNotReady EndpointStateReady = `NOT_READY` @@ -1741,22 +1621,6 @@ func (f *EndpointStateReady) Type() string { return "EndpointStateReady" } -func endpointStateReadyToPb(st *EndpointStateReady) (*endpointStateReadyPb, error) { - if st == nil { - return nil, nil - } - pb := endpointStateReadyPb(*st) - return &pb, nil -} - -func endpointStateReadyFromPb(pb *endpointStateReadyPb) (*EndpointStateReady, error) { - if pb == nil { - return nil, nil - } - st := EndpointStateReady(*pb) - return &st, nil -} - type EndpointTag struct { // Key field for a serving endpoint tag. // Wire name: 'key' @@ -1940,7 +1804,6 @@ func (st ExternalFunctionRequest) MarshalJSON() ([]byte, error) { } type ExternalFunctionRequestHttpMethod string -type externalFunctionRequestHttpMethodPb string const ExternalFunctionRequestHttpMethodDelete ExternalFunctionRequestHttpMethod = `DELETE` @@ -1973,22 +1836,6 @@ func (f *ExternalFunctionRequestHttpMethod) Type() string { return "ExternalFunctionRequestHttpMethod" } -func externalFunctionRequestHttpMethodToPb(st *ExternalFunctionRequestHttpMethod) (*externalFunctionRequestHttpMethodPb, error) { - if st == nil { - return nil, nil - } - pb := externalFunctionRequestHttpMethodPb(*st) - return &pb, nil -} - -func externalFunctionRequestHttpMethodFromPb(pb *externalFunctionRequestHttpMethodPb) (*ExternalFunctionRequestHttpMethod, error) { - if pb == nil { - return nil, nil - } - st := ExternalFunctionRequestHttpMethod(*pb) - return &st, nil -} - type ExternalModel struct { // AI21Labs Config. Only required if the provider is 'ai21labs'. // Wire name: 'ai21labs_config' @@ -2059,7 +1906,6 @@ func (st ExternalModel) MarshalJSON() ([]byte, error) { } type ExternalModelProvider string -type externalModelProviderPb string const ExternalModelProviderAi21labs ExternalModelProvider = `ai21labs` @@ -2100,22 +1946,6 @@ func (f *ExternalModelProvider) Type() string { return "ExternalModelProvider" } -func externalModelProviderToPb(st *ExternalModelProvider) (*externalModelProviderPb, error) { - if st == nil { - return nil, nil - } - pb := externalModelProviderPb(*st) - return &pb, nil -} - -func externalModelProviderFromPb(pb *externalModelProviderPb) (*ExternalModelProvider, error) { - if pb == nil { - return nil, nil - } - st := ExternalModelProvider(*pb) - return &st, nil -} - type ExternalModelUsageElement struct { // The number of tokens in the chat/completions response. // Wire name: 'completion_tokens' @@ -3251,7 +3081,6 @@ func (st QueryEndpointResponse) MarshalJSON() ([]byte, error) { // The type of object returned by the __external/foundation model__ serving // endpoint, one of [text_completion, chat.completion, list (of embeddings)]. type QueryEndpointResponseObject string -type queryEndpointResponseObjectPb string const QueryEndpointResponseObjectChatCompletion QueryEndpointResponseObject = `chat.completion` @@ -3280,22 +3109,6 @@ func (f *QueryEndpointResponseObject) Type() string { return "QueryEndpointResponseObject" } -func queryEndpointResponseObjectToPb(st *QueryEndpointResponseObject) (*queryEndpointResponseObjectPb, error) { - if st == nil { - return nil, nil - } - pb := queryEndpointResponseObjectPb(*st) - return &pb, nil -} - -func queryEndpointResponseObjectFromPb(pb *queryEndpointResponseObjectPb) (*QueryEndpointResponseObject, error) { - if pb == nil { - return nil, nil - } - st := QueryEndpointResponseObject(*pb) - return &st, nil -} - type RateLimit struct { // Used to specify how many calls are allowed for a key within the // renewal_period. @@ -3338,7 +3151,6 @@ func (st RateLimit) MarshalJSON() ([]byte, error) { } type RateLimitKey string -type rateLimitKeyPb string const RateLimitKeyEndpoint RateLimitKey = `endpoint` @@ -3365,24 +3177,7 @@ func (f *RateLimitKey) Type() string { return "RateLimitKey" } -func rateLimitKeyToPb(st *RateLimitKey) (*rateLimitKeyPb, error) { - if st == nil { - return nil, nil - } - pb := rateLimitKeyPb(*st) - return &pb, nil -} - -func rateLimitKeyFromPb(pb *rateLimitKeyPb) (*RateLimitKey, error) { - if pb == nil { - return nil, nil - } - st := RateLimitKey(*pb) - return &st, nil -} - type RateLimitRenewalPeriod string -type rateLimitRenewalPeriodPb string const RateLimitRenewalPeriodMinute RateLimitRenewalPeriod = `minute` @@ -3407,22 +3202,6 @@ func (f *RateLimitRenewalPeriod) Type() string { return "RateLimitRenewalPeriod" } -func rateLimitRenewalPeriodToPb(st *RateLimitRenewalPeriod) (*rateLimitRenewalPeriodPb, error) { - if st == nil { - return nil, nil - } - pb := rateLimitRenewalPeriodPb(*st) - return &pb, nil -} - -func rateLimitRenewalPeriodFromPb(pb *rateLimitRenewalPeriodPb) (*RateLimitRenewalPeriod, error) { - if pb == nil { - return nil, nil - } - st := RateLimitRenewalPeriod(*pb) - return &st, nil -} - type Route struct { // The name of the served model this route configures traffic for. // Wire name: 'served_model_name' @@ -3809,7 +3588,6 @@ func (st ServedModelInput) MarshalJSON() ([]byte, error) { // Please keep this in sync with with workload types in // InferenceEndpointEntities.scala type ServedModelInputWorkloadType string -type servedModelInputWorkloadTypePb string const ServedModelInputWorkloadTypeCpu ServedModelInputWorkloadType = `CPU` @@ -3842,22 +3620,6 @@ func (f *ServedModelInputWorkloadType) Type() string { return "ServedModelInputWorkloadType" } -func servedModelInputWorkloadTypeToPb(st *ServedModelInputWorkloadType) (*servedModelInputWorkloadTypePb, error) { - if st == nil { - return nil, nil - } - pb := servedModelInputWorkloadTypePb(*st) - return &pb, nil -} - -func servedModelInputWorkloadTypeFromPb(pb *servedModelInputWorkloadTypePb) (*ServedModelInputWorkloadType, error) { - if pb == nil { - return nil, nil - } - st := ServedModelInputWorkloadType(*pb) - return &st, nil -} - type ServedModelOutput struct { // Wire name: 'creation_timestamp' @@ -4024,7 +3786,6 @@ func (st ServedModelState) MarshalJSON() ([]byte, error) { } type ServedModelStateDeployment string -type servedModelStateDeploymentPb string const ServedModelStateDeploymentAborted ServedModelStateDeployment = `DEPLOYMENT_ABORTED` @@ -4057,22 +3818,6 @@ func (f *ServedModelStateDeployment) Type() string { return "ServedModelStateDeployment" } -func servedModelStateDeploymentToPb(st *ServedModelStateDeployment) (*servedModelStateDeploymentPb, error) { - if st == nil { - return nil, nil - } - pb := servedModelStateDeploymentPb(*st) - return &pb, nil -} - -func servedModelStateDeploymentFromPb(pb *servedModelStateDeploymentPb) (*ServedModelStateDeployment, error) { - if pb == nil { - return nil, nil - } - st := ServedModelStateDeployment(*pb) - return &st, nil -} - type ServerLogsResponse struct { // The most recent log lines of the model server processing invocation // requests. @@ -4341,7 +4086,6 @@ func (st ServingEndpointDetailed) MarshalJSON() ([]byte, error) { } type ServingEndpointDetailedPermissionLevel string -type servingEndpointDetailedPermissionLevelPb string const ServingEndpointDetailedPermissionLevelCanManage ServingEndpointDetailedPermissionLevel = `CAN_MANAGE` @@ -4370,22 +4114,6 @@ func (f *ServingEndpointDetailedPermissionLevel) Type() string { return "ServingEndpointDetailedPermissionLevel" } -func servingEndpointDetailedPermissionLevelToPb(st *ServingEndpointDetailedPermissionLevel) (*servingEndpointDetailedPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := servingEndpointDetailedPermissionLevelPb(*st) - return &pb, nil -} - -func servingEndpointDetailedPermissionLevelFromPb(pb *servingEndpointDetailedPermissionLevelPb) (*ServingEndpointDetailedPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := ServingEndpointDetailedPermissionLevel(*pb) - return &st, nil -} - type ServingEndpointPermission struct { // Wire name: 'inherited' @@ -4427,7 +4155,6 @@ func (st ServingEndpointPermission) MarshalJSON() ([]byte, error) { // Permission level type ServingEndpointPermissionLevel string -type servingEndpointPermissionLevelPb string const ServingEndpointPermissionLevelCanManage ServingEndpointPermissionLevel = `CAN_MANAGE` @@ -4456,22 +4183,6 @@ func (f *ServingEndpointPermissionLevel) Type() string { return "ServingEndpointPermissionLevel" } -func servingEndpointPermissionLevelToPb(st *ServingEndpointPermissionLevel) (*servingEndpointPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := servingEndpointPermissionLevelPb(*st) - return &pb, nil -} - -func servingEndpointPermissionLevelFromPb(pb *servingEndpointPermissionLevelPb) (*ServingEndpointPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := ServingEndpointPermissionLevel(*pb) - return &st, nil -} - type ServingEndpointPermissions struct { // Wire name: 'access_control_list' @@ -4584,7 +4295,6 @@ func (st ServingEndpointPermissionsRequest) MarshalJSON() ([]byte, error) { // Please keep this in sync with with workload types in // InferenceEndpointEntities.scala type ServingModelWorkloadType string -type servingModelWorkloadTypePb string const ServingModelWorkloadTypeCpu ServingModelWorkloadType = `CPU` @@ -4617,22 +4327,6 @@ func (f *ServingModelWorkloadType) Type() string { return "ServingModelWorkloadType" } -func servingModelWorkloadTypeToPb(st *ServingModelWorkloadType) (*servingModelWorkloadTypePb, error) { - if st == nil { - return nil, nil - } - pb := servingModelWorkloadTypePb(*st) - return &pb, nil -} - -func servingModelWorkloadTypeFromPb(pb *servingModelWorkloadTypePb) (*ServingModelWorkloadType, error) { - if pb == nil { - return nil, nil - } - st := ServingModelWorkloadType(*pb) - return &st, nil -} - type TrafficConfig struct { // The list of routes that define traffic to each served entity. // Wire name: 'routes' diff --git a/service/settings/internal.go b/service/settings/internal.go index 2865f211d..ed62e745d 100755 --- a/service/settings/internal.go +++ b/service/settings/internal.go @@ -6869,6 +6869,24 @@ func updateWorkspaceNetworkOptionRequestFromPb(pb *updateWorkspaceNetworkOptionR return st, nil } +type workspaceConfPb WorkspaceConf + +func workspaceConfToPb(st *WorkspaceConf) (*workspaceConfPb, error) { + if st == nil { + return nil, nil + } + stPb := workspaceConfPb(*st) + return &stPb, nil +} + +func workspaceConfFromPb(stPb *workspaceConfPb) (*WorkspaceConf, error) { + if stPb == nil { + return nil, nil + } + st := WorkspaceConf(*stPb) + return &st, nil +} + func workspaceNetworkOptionToPb(st *WorkspaceNetworkOption) (*workspaceNetworkOptionPb, error) { if st == nil { return nil, nil diff --git a/service/settings/model.go b/service/settings/model.go index 4e0c5775d..885406fa5 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -129,7 +129,6 @@ func (st AibiDashboardEmbeddingAccessPolicy) MarshalJSON() ([]byte, error) { } type AibiDashboardEmbeddingAccessPolicyAccessPolicyType string -type aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb string const AibiDashboardEmbeddingAccessPolicyAccessPolicyTypeAllowAllDomains AibiDashboardEmbeddingAccessPolicyAccessPolicyType = `ALLOW_ALL_DOMAINS` @@ -158,22 +157,6 @@ func (f *AibiDashboardEmbeddingAccessPolicyAccessPolicyType) Type() string { return "AibiDashboardEmbeddingAccessPolicyAccessPolicyType" } -func aibiDashboardEmbeddingAccessPolicyAccessPolicyTypeToPb(st *AibiDashboardEmbeddingAccessPolicyAccessPolicyType) (*aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb, error) { - if st == nil { - return nil, nil - } - pb := aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb(*st) - return &pb, nil -} - -func aibiDashboardEmbeddingAccessPolicyAccessPolicyTypeFromPb(pb *aibiDashboardEmbeddingAccessPolicyAccessPolicyTypePb) (*AibiDashboardEmbeddingAccessPolicyAccessPolicyType, error) { - if pb == nil { - return nil, nil - } - st := AibiDashboardEmbeddingAccessPolicyAccessPolicyType(*pb) - return &st, nil -} - type AibiDashboardEmbeddingAccessPolicySetting struct { // Wire name: 'aibi_dashboard_embedding_access_policy' @@ -513,7 +496,6 @@ func (st ClusterAutoRestartMessageMaintenanceWindow) MarshalJSON() ([]byte, erro } type ClusterAutoRestartMessageMaintenanceWindowDayOfWeek string -type clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb string const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekFriday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `FRIDAY` @@ -550,22 +532,6 @@ func (f *ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) Type() string { return "ClusterAutoRestartMessageMaintenanceWindowDayOfWeek" } -func clusterAutoRestartMessageMaintenanceWindowDayOfWeekToPb(st *ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) (*clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb, error) { - if st == nil { - return nil, nil - } - pb := clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb(*st) - return &pb, nil -} - -func clusterAutoRestartMessageMaintenanceWindowDayOfWeekFromPb(pb *clusterAutoRestartMessageMaintenanceWindowDayOfWeekPb) (*ClusterAutoRestartMessageMaintenanceWindowDayOfWeek, error) { - if pb == nil { - return nil, nil - } - st := ClusterAutoRestartMessageMaintenanceWindowDayOfWeek(*pb) - return &st, nil -} - type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule struct { // Wire name: 'day_of_week' @@ -604,7 +570,6 @@ func (st ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) Marshal } type ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency string -type clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb string const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyEveryWeek ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `EVERY_WEEK` @@ -641,22 +606,6 @@ func (f *ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) Type() stri return "ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency" } -func clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyToPb(st *ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) (*clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb, error) { - if st == nil { - return nil, nil - } - pb := clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb(*st) - return &pb, nil -} - -func clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyFromPb(pb *clusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyPb) (*ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency, error) { - if pb == nil { - return nil, nil - } - st := ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency(*pb) - return &st, nil -} - type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime struct { // Wire name: 'hours' @@ -781,7 +730,6 @@ func (st ComplianceSecurityProfileSetting) MarshalJSON() ([]byte, error) { // Compliance stardard for SHIELD customers type ComplianceStandard string -type complianceStandardPb string const ComplianceStandardCanadaProtectedB ComplianceStandard = `CANADA_PROTECTED_B` @@ -830,22 +778,6 @@ func (f *ComplianceStandard) Type() string { return "ComplianceStandard" } -func complianceStandardToPb(st *ComplianceStandard) (*complianceStandardPb, error) { - if st == nil { - return nil, nil - } - pb := complianceStandardPb(*st) - return &pb, nil -} - -func complianceStandardFromPb(pb *complianceStandardPb) (*ComplianceStandard, error) { - if pb == nil { - return nil, nil - } - st := ComplianceStandard(*pb) - return &st, nil -} - type Config struct { // Wire name: 'email' @@ -2578,7 +2510,6 @@ func (st DeleteTokenManagementRequest) MarshalJSON() ([]byte, error) { } type DestinationType string -type destinationTypePb string const DestinationTypeEmail DestinationType = `EMAIL` @@ -2611,22 +2542,6 @@ func (f *DestinationType) Type() string { return "DestinationType" } -func destinationTypeToPb(st *DestinationType) (*destinationTypePb, error) { - if st == nil { - return nil, nil - } - pb := destinationTypePb(*st) - return &pb, nil -} - -func destinationTypeFromPb(pb *destinationTypePb) (*DestinationType, error) { - if pb == nil { - return nil, nil - } - st := DestinationType(*pb) - return &st, nil -} - type DisableLegacyAccess struct { // Wire name: 'disable_legacy_access' @@ -2907,7 +2822,6 @@ func (st EgressNetworkPolicyInternetAccessPolicyInternetDestination) MarshalJSON // from the user. In the future, users may be able to select HTTP filtering // (i.e. SNI based filtering, filtering by FQDN). type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol string -type egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb string const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolTcp EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol = `TCP` @@ -2932,24 +2846,7 @@ func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDesti return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol" } -func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolToPb(st *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol) (*egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolFromPb(pb *egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolPb) (*EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol(*pb) - return &st, nil -} - type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType string -type egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb string const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeFqdn EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType = `FQDN` @@ -2974,22 +2871,6 @@ func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDesti return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType" } -func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType) (*egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypePb) (*EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType(*pb) - return &st, nil -} - type EgressNetworkPolicyInternetAccessPolicyLogOnlyMode struct { // Wire name: 'log_only_mode_type' @@ -3025,7 +2906,6 @@ func (st EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) MarshalJSON() ([]by } type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType string -type egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb string const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeAllServices EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType = `ALL_SERVICES` @@ -3052,25 +2932,8 @@ func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) Type return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType" } -func egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) (*egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType(*pb) - return &st, nil -} - // The values should match the list of workloads used in networkconfig.proto type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType string -type egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb string const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeDbsql EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType = `DBSQL` @@ -3097,22 +2960,6 @@ func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) Type() return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType" } -func egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) (*egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(*pb) - return &st, nil -} - // At which level can Databricks and Databricks managed compute access Internet. // FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. // RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and @@ -3120,7 +2967,6 @@ func egressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeFromPb(pb *eg // PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via // private link. type EgressNetworkPolicyInternetAccessPolicyRestrictionMode string -type egressNetworkPolicyInternetAccessPolicyRestrictionModePb string const EgressNetworkPolicyInternetAccessPolicyRestrictionModeFullAccess EgressNetworkPolicyInternetAccessPolicyRestrictionMode = `FULL_ACCESS` @@ -3149,22 +2995,6 @@ func (f *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) Type() string { return "EgressNetworkPolicyInternetAccessPolicyRestrictionMode" } -func egressNetworkPolicyInternetAccessPolicyRestrictionModeToPb(st *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) (*egressNetworkPolicyInternetAccessPolicyRestrictionModePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyRestrictionModePb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyRestrictionModeFromPb(pb *egressNetworkPolicyInternetAccessPolicyRestrictionModePb) (*EgressNetworkPolicyInternetAccessPolicyRestrictionMode, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyRestrictionMode(*pb) - return &st, nil -} - // Users can specify accessible storage destinations. type EgressNetworkPolicyInternetAccessPolicyStorageDestination struct { @@ -3221,7 +3051,6 @@ func (st EgressNetworkPolicyInternetAccessPolicyStorageDestination) MarshalJSON( } type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType string -type egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb string const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeAwsS3 EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `AWS_S3` @@ -3252,22 +3081,6 @@ func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestina return "EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType" } -func egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeToPb(st *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType) (*egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeFromPb(pb *egressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypePb) (*EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType(*pb) - return &st, nil -} - type EgressNetworkPolicyNetworkAccessPolicy struct { // List of internet destinations that serverless workloads are allowed to // access when in RESTRICTED_ACCESS mode. @@ -3353,7 +3166,6 @@ func (st EgressNetworkPolicyNetworkAccessPolicyInternetDestination) MarshalJSON( } type EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType string -type egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb string const EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeDnsName EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType = `DNS_NAME` @@ -3378,22 +3190,6 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestin return "EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType" } -func egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeToPb(st *EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType) (*egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationTypePb) (*EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType(*pb) - return &st, nil -} - type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement struct { // When empty, it means dry run for all products. When non-empty, it means // dry run for specific products and for the other products, they will run @@ -3434,7 +3230,6 @@ func (st EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement) MarshalJSON() // The values should match the list of workloads used in networkconfig.proto type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter string -type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb string const EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterDbsql EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter = `DBSQL` @@ -3461,24 +3256,7 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProduc return "EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter" } -func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterToPb(st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter) (*egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb(*st) - return &pb, nil -} - -func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilterPb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter(*pb) - return &st, nil -} - type EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode string -type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb string const EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeDryRun EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode = `DRY_RUN` @@ -3505,28 +3283,11 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode) return "EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode" } -func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeToPb(st *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode) (*egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb(*st) - return &pb, nil -} - -func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementModePb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode(*pb) - return &st, nil -} - // At which level can Databricks and Databricks managed compute access Internet. // FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. // RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and // storage destinations, as well as UC connections and external locations. type EgressNetworkPolicyNetworkAccessPolicyRestrictionMode string -type egressNetworkPolicyNetworkAccessPolicyRestrictionModePb string const EgressNetworkPolicyNetworkAccessPolicyRestrictionModeFullAccess EgressNetworkPolicyNetworkAccessPolicyRestrictionMode = `FULL_ACCESS` @@ -3553,22 +3314,6 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyRestrictionMode) Type() string { return "EgressNetworkPolicyNetworkAccessPolicyRestrictionMode" } -func egressNetworkPolicyNetworkAccessPolicyRestrictionModeToPb(st *EgressNetworkPolicyNetworkAccessPolicyRestrictionMode) (*egressNetworkPolicyNetworkAccessPolicyRestrictionModePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyNetworkAccessPolicyRestrictionModePb(*st) - return &pb, nil -} - -func egressNetworkPolicyNetworkAccessPolicyRestrictionModeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyRestrictionModePb) (*EgressNetworkPolicyNetworkAccessPolicyRestrictionMode, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyNetworkAccessPolicyRestrictionMode(*pb) - return &st, nil -} - // Users can specify accessible storage destinations. type EgressNetworkPolicyNetworkAccessPolicyStorageDestination struct { // The Azure storage account name. @@ -3616,7 +3361,6 @@ func (st EgressNetworkPolicyNetworkAccessPolicyStorageDestination) MarshalJSON() } type EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType string -type egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb string const EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeAwsS3 EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType = `AWS_S3` @@ -3645,28 +3389,11 @@ func (f *EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinat return "EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType" } -func egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeToPb(st *EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType) (*egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb(*st) - return &pb, nil -} - -func egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypeFromPb(pb *egressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationTypePb) (*EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType, error) { - if pb == nil { - return nil, nil - } - st := EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType(*pb) - return &st, nil -} - // The target resources that are supported by Network Connectivity Config. Note: // some egress types can support general types that are not defined in // EgressResourceType. E.g.: Azure private endpoint supports private link // enabled Azure services. type EgressResourceType string -type egressResourceTypePb string const EgressResourceTypeAzureBlobStorage EgressResourceType = `AZURE_BLOB_STORAGE` @@ -3691,22 +3418,6 @@ func (f *EgressResourceType) Type() string { return "EgressResourceType" } -func egressResourceTypeToPb(st *EgressResourceType) (*egressResourceTypePb, error) { - if st == nil { - return nil, nil - } - pb := egressResourceTypePb(*st) - return &pb, nil -} - -func egressResourceTypeFromPb(pb *egressResourceTypePb) (*EgressResourceType, error) { - if pb == nil { - return nil, nil - } - st := EgressResourceType(*pb) - return &st, nil -} - type EmailConfig struct { // Email addresses to notify. // Wire name: 'addresses' @@ -5881,7 +5592,6 @@ func (st ListTokensResponse) MarshalJSON() ([]byte, error) { // Exclude this IP or range. IP addresses in the block list are excluded even if // they are included in an allow list. type ListType string -type listTypePb string // An allow list. Include this IP or range. const ListTypeAllow ListType = `ALLOW` @@ -5911,22 +5621,6 @@ func (f *ListType) Type() string { return "ListType" } -func listTypeToPb(st *ListType) (*listTypePb, error) { - if st == nil { - return nil, nil - } - pb := listTypePb(*st) - return &pb, nil -} - -func listTypeFromPb(pb *listTypePb) (*ListType, error) { - if pb == nil { - return nil, nil - } - st := ListType(*pb) - return &st, nil -} - type LlmProxyPartnerPoweredAccount struct { // Wire name: 'boolean_val' @@ -6230,7 +5924,6 @@ func (st NccAzurePrivateEndpointRule) MarshalJSON() ([]byte, error) { } type NccAzurePrivateEndpointRuleConnectionState string -type nccAzurePrivateEndpointRuleConnectionStatePb string const NccAzurePrivateEndpointRuleConnectionStateDisconnected NccAzurePrivateEndpointRuleConnectionState = `DISCONNECTED` @@ -6265,22 +5958,6 @@ func (f *NccAzurePrivateEndpointRuleConnectionState) Type() string { return "NccAzurePrivateEndpointRuleConnectionState" } -func nccAzurePrivateEndpointRuleConnectionStateToPb(st *NccAzurePrivateEndpointRuleConnectionState) (*nccAzurePrivateEndpointRuleConnectionStatePb, error) { - if st == nil { - return nil, nil - } - pb := nccAzurePrivateEndpointRuleConnectionStatePb(*st) - return &pb, nil -} - -func nccAzurePrivateEndpointRuleConnectionStateFromPb(pb *nccAzurePrivateEndpointRuleConnectionStatePb) (*NccAzurePrivateEndpointRuleConnectionState, error) { - if pb == nil { - return nil, nil - } - st := NccAzurePrivateEndpointRuleConnectionState(*pb) - return &st, nil -} - // The stable Azure service endpoints. You can configure the firewall of your // Azure resources to allow traffic from your Databricks serverless compute // resources. @@ -6688,7 +6365,6 @@ func (st PersonalComputeMessage) MarshalJSON() ([]byte, error) { // added to the ACLs of that workspace’s Personal Compute default policy // before they will be able to create compute resources through that policy. type PersonalComputeMessageEnum string -type personalComputeMessageEnumPb string const PersonalComputeMessageEnumDelegate PersonalComputeMessageEnum = `DELEGATE` @@ -6715,22 +6391,6 @@ func (f *PersonalComputeMessageEnum) Type() string { return "PersonalComputeMessageEnum" } -func personalComputeMessageEnumToPb(st *PersonalComputeMessageEnum) (*personalComputeMessageEnumPb, error) { - if st == nil { - return nil, nil - } - pb := personalComputeMessageEnumPb(*st) - return &pb, nil -} - -func personalComputeMessageEnumFromPb(pb *personalComputeMessageEnumPb) (*PersonalComputeMessageEnum, error) { - if pb == nil { - return nil, nil - } - st := PersonalComputeMessageEnum(*pb) - return &st, nil -} - type PersonalComputeSetting struct { // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to @@ -6932,7 +6592,6 @@ func (st RestrictWorkspaceAdminsMessage) MarshalJSON() ([]byte, error) { } type RestrictWorkspaceAdminsMessageStatus string -type restrictWorkspaceAdminsMessageStatusPb string const RestrictWorkspaceAdminsMessageStatusAllowAll RestrictWorkspaceAdminsMessageStatus = `ALLOW_ALL` @@ -6959,22 +6618,6 @@ func (f *RestrictWorkspaceAdminsMessageStatus) Type() string { return "RestrictWorkspaceAdminsMessageStatus" } -func restrictWorkspaceAdminsMessageStatusToPb(st *RestrictWorkspaceAdminsMessageStatus) (*restrictWorkspaceAdminsMessageStatusPb, error) { - if st == nil { - return nil, nil - } - pb := restrictWorkspaceAdminsMessageStatusPb(*st) - return &pb, nil -} - -func restrictWorkspaceAdminsMessageStatusFromPb(pb *restrictWorkspaceAdminsMessageStatusPb) (*RestrictWorkspaceAdminsMessageStatus, error) { - if pb == nil { - return nil, nil - } - st := RestrictWorkspaceAdminsMessageStatus(*pb) - return &st, nil -} - type RestrictWorkspaceAdminsSetting struct { // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to @@ -7367,7 +7010,6 @@ func (st TokenPermission) MarshalJSON() ([]byte, error) { // Permission level type TokenPermissionLevel string -type tokenPermissionLevelPb string const TokenPermissionLevelCanUse TokenPermissionLevel = `CAN_USE` @@ -7392,22 +7034,6 @@ func (f *TokenPermissionLevel) Type() string { return "TokenPermissionLevel" } -func tokenPermissionLevelToPb(st *TokenPermissionLevel) (*tokenPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := tokenPermissionLevelPb(*st) - return &pb, nil -} - -func tokenPermissionLevelFromPb(pb *tokenPermissionLevelPb) (*TokenPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := TokenPermissionLevel(*pb) - return &st, nil -} - type TokenPermissions struct { // Wire name: 'access_control_list' @@ -7517,7 +7143,6 @@ func (st TokenPermissionsRequest) MarshalJSON() ([]byte, error) { // The type of token request. As of now, only `AZURE_ACTIVE_DIRECTORY_TOKEN` is // supported. type TokenType string -type tokenTypePb string const TokenTypeArclightAzureExchangeToken TokenType = `ARCLIGHT_AZURE_EXCHANGE_TOKEN` @@ -7550,22 +7175,6 @@ func (f *TokenType) Type() string { return "TokenType" } -func tokenTypeToPb(st *TokenType) (*tokenTypePb, error) { - if st == nil { - return nil, nil - } - pb := tokenTypePb(*st) - return &pb, nil -} - -func tokenTypeFromPb(pb *tokenTypePb) (*TokenType, error) { - if pb == nil { - return nil, nil - } - st := TokenType(*pb) - return &st, nil -} - // Details required to update a setting. type UpdateAccountIpAccessEnableRequest struct { // This should always be set to true for Settings API. Added for AIP @@ -8827,22 +8436,6 @@ func (st UpdateWorkspaceNetworkOptionRequest) MarshalJSON() ([]byte, error) { } type WorkspaceConf map[string]string -type workspaceConfPb WorkspaceConf - -func workspaceConfToPb(st *WorkspaceConf) (*workspaceConfPb, error) { - if st == nil { - return nil, nil - } - stPb := workspaceConfPb(*st) - return &stPb, nil -} -func workspaceConfFromPb(stPb *workspaceConfPb) (*WorkspaceConf, error) { - if stPb == nil { - return nil, nil - } - st := WorkspaceConf(*stPb) - return &st, nil -} type WorkspaceNetworkOption struct { // The network policy ID to apply to the workspace. This controls the diff --git a/service/sharing/model.go b/service/sharing/model.go index d321bcb60..3027acdcf 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -13,7 +13,6 @@ import ( // The delta sharing authentication type. type AuthenticationType string -type authenticationTypePb string const AuthenticationTypeDatabricks AuthenticationType = `DATABRICKS` @@ -42,26 +41,9 @@ func (f *AuthenticationType) Type() string { return "AuthenticationType" } -func authenticationTypeToPb(st *AuthenticationType) (*authenticationTypePb, error) { - if st == nil { - return nil, nil - } - pb := authenticationTypePb(*st) - return &pb, nil -} - -func authenticationTypeFromPb(pb *authenticationTypePb) (*AuthenticationType, error) { - if pb == nil { - return nil, nil - } - st := AuthenticationType(*pb) - return &st, nil -} - // UC supported column types Copied from // https://src.dev.databricks.com/databricks/universe@23a85902bb58695ab9293adc9f327b0714b55e72/-/blob/managed-catalog/api/messages/table.proto?L68 type ColumnTypeName string -type columnTypeNamePb string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -128,22 +110,6 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } -func columnTypeNameToPb(st *ColumnTypeName) (*columnTypeNamePb, error) { - if st == nil { - return nil, nil - } - pb := columnTypeNamePb(*st) - return &pb, nil -} - -func columnTypeNameFromPb(pb *columnTypeNamePb) (*ColumnTypeName, error) { - if pb == nil { - return nil, nil - } - st := ColumnTypeName(*pb) - return &st, nil -} - // Create recipient federation policy type CreateFederationPolicyRequest struct { @@ -856,7 +822,6 @@ func (st FunctionParameterInfos) MarshalJSON() ([]byte, error) { } type FunctionParameterMode string -type functionParameterModePb string const FunctionParameterModeIn FunctionParameterMode = `IN` @@ -885,24 +850,7 @@ func (f *FunctionParameterMode) Type() string { return "FunctionParameterMode" } -func functionParameterModeToPb(st *FunctionParameterMode) (*functionParameterModePb, error) { - if st == nil { - return nil, nil - } - pb := functionParameterModePb(*st) - return &pb, nil -} - -func functionParameterModeFromPb(pb *functionParameterModePb) (*FunctionParameterMode, error) { - if pb == nil { - return nil, nil - } - st := FunctionParameterMode(*pb) - return &st, nil -} - type FunctionParameterType string -type functionParameterTypePb string const FunctionParameterTypeColumn FunctionParameterType = `COLUMN` @@ -929,22 +877,6 @@ func (f *FunctionParameterType) Type() string { return "FunctionParameterType" } -func functionParameterTypeToPb(st *FunctionParameterType) (*functionParameterTypePb, error) { - if st == nil { - return nil, nil - } - pb := functionParameterTypePb(*st) - return &pb, nil -} - -func functionParameterTypeFromPb(pb *functionParameterTypePb) (*FunctionParameterType, error) { - if pb == nil { - return nil, nil - } - st := FunctionParameterType(*pb) - return &st, nil -} - // Get a share activation URL type GetActivationUrlInfoRequest struct { // The one time activation url. It also accepts activation token. @@ -1904,7 +1836,6 @@ func (st PartitionValue) MarshalJSON() ([]byte, error) { } type PartitionValueOp string -type partitionValueOpPb string const PartitionValueOpEqual PartitionValueOp = `EQUAL` @@ -1931,22 +1862,6 @@ func (f *PartitionValueOp) Type() string { return "PartitionValueOp" } -func partitionValueOpToPb(st *PartitionValueOp) (*partitionValueOpPb, error) { - if st == nil { - return nil, nil - } - pb := partitionValueOpPb(*st) - return &pb, nil -} - -func partitionValueOpFromPb(pb *partitionValueOpPb) (*PartitionValueOp, error) { - if pb == nil { - return nil, nil - } - st := PartitionValueOp(*pb) - return &st, nil -} - type PermissionsChange struct { // The set of privileges to add. // Wire name: 'add' @@ -1987,7 +1902,6 @@ func (st PermissionsChange) MarshalJSON() ([]byte, error) { } type Privilege string -type privilegePb string const PrivilegeAccess Privilege = `ACCESS` @@ -2100,22 +2014,6 @@ func (f *Privilege) Type() string { return "Privilege" } -func privilegeToPb(st *Privilege) (*privilegePb, error) { - if st == nil { - return nil, nil - } - pb := privilegePb(*st) - return &pb, nil -} - -func privilegeFromPb(pb *privilegePb) (*Privilege, error) { - if pb == nil { - return nil, nil - } - st := Privilege(*pb) - return &st, nil -} - type PrivilegeAssignment struct { // The principal (user email address or group name). // Wire name: 'principal' @@ -2867,7 +2765,6 @@ func (st SharedDataObject) MarshalJSON() ([]byte, error) { } type SharedDataObjectDataObjectType string -type sharedDataObjectDataObjectTypePb string const SharedDataObjectDataObjectTypeFeatureSpec SharedDataObjectDataObjectType = `FEATURE_SPEC` @@ -2908,24 +2805,7 @@ func (f *SharedDataObjectDataObjectType) Type() string { return "SharedDataObjectDataObjectType" } -func sharedDataObjectDataObjectTypeToPb(st *SharedDataObjectDataObjectType) (*sharedDataObjectDataObjectTypePb, error) { - if st == nil { - return nil, nil - } - pb := sharedDataObjectDataObjectTypePb(*st) - return &pb, nil -} - -func sharedDataObjectDataObjectTypeFromPb(pb *sharedDataObjectDataObjectTypePb) (*SharedDataObjectDataObjectType, error) { - if pb == nil { - return nil, nil - } - st := SharedDataObjectDataObjectType(*pb) - return &st, nil -} - type SharedDataObjectHistoryDataSharingStatus string -type sharedDataObjectHistoryDataSharingStatusPb string const SharedDataObjectHistoryDataSharingStatusDisabled SharedDataObjectHistoryDataSharingStatus = `DISABLED` @@ -2952,24 +2832,7 @@ func (f *SharedDataObjectHistoryDataSharingStatus) Type() string { return "SharedDataObjectHistoryDataSharingStatus" } -func sharedDataObjectHistoryDataSharingStatusToPb(st *SharedDataObjectHistoryDataSharingStatus) (*sharedDataObjectHistoryDataSharingStatusPb, error) { - if st == nil { - return nil, nil - } - pb := sharedDataObjectHistoryDataSharingStatusPb(*st) - return &pb, nil -} - -func sharedDataObjectHistoryDataSharingStatusFromPb(pb *sharedDataObjectHistoryDataSharingStatusPb) (*SharedDataObjectHistoryDataSharingStatus, error) { - if pb == nil { - return nil, nil - } - st := SharedDataObjectHistoryDataSharingStatus(*pb) - return &st, nil -} - type SharedDataObjectStatus string -type sharedDataObjectStatusPb string const SharedDataObjectStatusActive SharedDataObjectStatus = `ACTIVE` @@ -2996,22 +2859,6 @@ func (f *SharedDataObjectStatus) Type() string { return "SharedDataObjectStatus" } -func sharedDataObjectStatusToPb(st *SharedDataObjectStatus) (*sharedDataObjectStatusPb, error) { - if st == nil { - return nil, nil - } - pb := sharedDataObjectStatusPb(*st) - return &pb, nil -} - -func sharedDataObjectStatusFromPb(pb *sharedDataObjectStatusPb) (*SharedDataObjectStatus, error) { - if pb == nil { - return nil, nil - } - st := SharedDataObjectStatus(*pb) - return &st, nil -} - type SharedDataObjectUpdate struct { // One of: **ADD**, **REMOVE**, **UPDATE**. // Wire name: 'action' @@ -3047,7 +2894,6 @@ func (st SharedDataObjectUpdate) MarshalJSON() ([]byte, error) { } type SharedDataObjectUpdateAction string -type sharedDataObjectUpdateActionPb string const SharedDataObjectUpdateActionAdd SharedDataObjectUpdateAction = `ADD` @@ -3076,25 +2922,8 @@ func (f *SharedDataObjectUpdateAction) Type() string { return "SharedDataObjectUpdateAction" } -func sharedDataObjectUpdateActionToPb(st *SharedDataObjectUpdateAction) (*sharedDataObjectUpdateActionPb, error) { - if st == nil { - return nil, nil - } - pb := sharedDataObjectUpdateActionPb(*st) - return &pb, nil -} - -func sharedDataObjectUpdateActionFromPb(pb *sharedDataObjectUpdateActionPb) (*SharedDataObjectUpdateAction, error) { - if pb == nil { - return nil, nil - } - st := SharedDataObjectUpdateAction(*pb) - return &st, nil -} - // The SecurableKind of a delta-shared object. type SharedSecurableKind string -type sharedSecurableKindPb string const SharedSecurableKindFunctionFeatureSpec SharedSecurableKind = `FUNCTION_FEATURE_SPEC` @@ -3123,22 +2952,6 @@ func (f *SharedSecurableKind) Type() string { return "SharedSecurableKind" } -func sharedSecurableKindToPb(st *SharedSecurableKind) (*sharedSecurableKindPb, error) { - if st == nil { - return nil, nil - } - pb := sharedSecurableKindPb(*st) - return &pb, nil -} - -func sharedSecurableKindFromPb(pb *sharedSecurableKindPb) (*SharedSecurableKind, error) { - if pb == nil { - return nil, nil - } - st := SharedSecurableKind(*pb) - return &st, nil -} - type Table struct { // The comment of the table. // Wire name: 'comment' @@ -3253,7 +3066,6 @@ func (st TableInternalAttributes) MarshalJSON() ([]byte, error) { } type TableInternalAttributesSharedTableType string -type tableInternalAttributesSharedTableTypePb string const TableInternalAttributesSharedTableTypeDirectoryBasedTable TableInternalAttributesSharedTableType = `DIRECTORY_BASED_TABLE` @@ -3288,22 +3100,6 @@ func (f *TableInternalAttributesSharedTableType) Type() string { return "TableInternalAttributesSharedTableType" } -func tableInternalAttributesSharedTableTypeToPb(st *TableInternalAttributesSharedTableType) (*tableInternalAttributesSharedTableTypePb, error) { - if st == nil { - return nil, nil - } - pb := tableInternalAttributesSharedTableTypePb(*st) - return &pb, nil -} - -func tableInternalAttributesSharedTableTypeFromPb(pb *tableInternalAttributesSharedTableTypePb) (*TableInternalAttributesSharedTableType, error) { - if pb == nil { - return nil, nil - } - st := TableInternalAttributesSharedTableType(*pb) - return &st, nil -} - // Update recipient federation policy type UpdateFederationPolicyRequest struct { // Name of the policy. This is the name of the current name of the policy. diff --git a/service/sql/model.go b/service/sql/model.go index a452930e5..342eaa4fc 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -50,7 +50,6 @@ func (st AccessControl) MarshalJSON() ([]byte, error) { } type Aggregation string -type aggregationPb string const AggregationAvg Aggregation = `AVG` @@ -89,22 +88,6 @@ func (f *Aggregation) Type() string { return "Aggregation" } -func aggregationToPb(st *Aggregation) (*aggregationPb, error) { - if st == nil { - return nil, nil - } - pb := aggregationPb(*st) - return &pb, nil -} - -func aggregationFromPb(pb *aggregationPb) (*Aggregation, error) { - if pb == nil { - return nil, nil - } - st := Aggregation(*pb) - return &st, nil -} - type Alert struct { // Trigger conditions of the alert. // Wire name: 'condition' @@ -300,7 +283,6 @@ func (st AlertConditionThreshold) MarshalJSON() ([]byte, error) { // code UNKNOWN - alert not yet evaluated TRIGGERED - alert is triggered OK - // alert is not triggered ERROR - alert evaluation failed type AlertEvaluationState string -type alertEvaluationStatePb string const AlertEvaluationStateError AlertEvaluationState = `ERROR` @@ -331,22 +313,6 @@ func (f *AlertEvaluationState) Type() string { return "AlertEvaluationState" } -func alertEvaluationStateToPb(st *AlertEvaluationState) (*alertEvaluationStatePb, error) { - if st == nil { - return nil, nil - } - pb := alertEvaluationStatePb(*st) - return &pb, nil -} - -func alertEvaluationStateFromPb(pb *alertEvaluationStatePb) (*AlertEvaluationState, error) { - if pb == nil { - return nil, nil - } - st := AlertEvaluationState(*pb) - return &st, nil -} - type AlertOperandColumn struct { // Wire name: 'name' @@ -420,7 +386,6 @@ func (st AlertOperandValue) MarshalJSON() ([]byte, error) { } type AlertOperator string -type alertOperatorPb string const AlertOperatorEqual AlertOperator = `EQUAL` @@ -457,22 +422,6 @@ func (f *AlertOperator) Type() string { return "AlertOperator" } -func alertOperatorToPb(st *AlertOperator) (*alertOperatorPb, error) { - if st == nil { - return nil, nil - } - pb := alertOperatorPb(*st) - return &pb, nil -} - -func alertOperatorFromPb(pb *alertOperatorPb) (*AlertOperator, error) { - if pb == nil { - return nil, nil - } - st := AlertOperator(*pb) - return &st, nil -} - // Alert configuration options. type AlertOptions struct { // Name of column in the query result to compare in alert evaluation. @@ -537,7 +486,6 @@ func (st AlertOptions) MarshalJSON() ([]byte, error) { // State that alert evaluates to when query result is empty. type AlertOptionsEmptyResultState string -type alertOptionsEmptyResultStatePb string const AlertOptionsEmptyResultStateOk AlertOptionsEmptyResultState = `ok` @@ -566,22 +514,6 @@ func (f *AlertOptionsEmptyResultState) Type() string { return "AlertOptionsEmptyResultState" } -func alertOptionsEmptyResultStateToPb(st *AlertOptionsEmptyResultState) (*alertOptionsEmptyResultStatePb, error) { - if st == nil { - return nil, nil - } - pb := alertOptionsEmptyResultStatePb(*st) - return &pb, nil -} - -func alertOptionsEmptyResultStateFromPb(pb *alertOptionsEmptyResultStatePb) (*AlertOptionsEmptyResultState, error) { - if pb == nil { - return nil, nil - } - st := AlertOptionsEmptyResultState(*pb) - return &st, nil -} - type AlertQuery struct { // The timestamp when this query was created. // Wire name: 'created_at' @@ -665,7 +597,6 @@ func (st AlertQuery) MarshalJSON() ([]byte, error) { } type AlertState string -type alertStatePb string const AlertStateOk AlertState = `OK` @@ -694,22 +625,6 @@ func (f *AlertState) Type() string { return "AlertState" } -func alertStateToPb(st *AlertState) (*alertStatePb, error) { - if st == nil { - return nil, nil - } - pb := alertStatePb(*st) - return &pb, nil -} - -func alertStateFromPb(pb *alertStatePb) (*AlertState, error) { - if pb == nil { - return nil, nil - } - st := AlertState(*pb) - return &st, nil -} - type AlertV2 struct { // The timestamp indicating when the alert was created. // Wire name: 'create_time' @@ -1208,7 +1123,6 @@ func (st ChannelInfo) MarshalJSON() ([]byte, error) { } type ChannelName string -type channelNamePb string const ChannelNameChannelNameCurrent ChannelName = `CHANNEL_NAME_CURRENT` @@ -1239,22 +1153,6 @@ func (f *ChannelName) Type() string { return "ChannelName" } -func channelNameToPb(st *ChannelName) (*channelNamePb, error) { - if st == nil { - return nil, nil - } - pb := channelNamePb(*st) - return &pb, nil -} - -func channelNameFromPb(pb *channelNamePb) (*ChannelName, error) { - if pb == nil { - return nil, nil - } - st := ChannelName(*pb) - return &st, nil -} - type ClientConfig struct { // Wire name: 'allow_custom_js_visualizations' @@ -1372,7 +1270,6 @@ func (st ColumnInfo) MarshalJSON() ([]byte, error) { // The name of the base data type. This doesn't include details for complex // types such as STRUCT, MAP or ARRAY. type ColumnInfoTypeName string -type columnInfoTypeNamePb string const ColumnInfoTypeNameArray ColumnInfoTypeName = `ARRAY` @@ -1433,24 +1330,7 @@ func (f *ColumnInfoTypeName) Type() string { return "ColumnInfoTypeName" } -func columnInfoTypeNameToPb(st *ColumnInfoTypeName) (*columnInfoTypeNamePb, error) { - if st == nil { - return nil, nil - } - pb := columnInfoTypeNamePb(*st) - return &pb, nil -} - -func columnInfoTypeNameFromPb(pb *columnInfoTypeNamePb) (*ColumnInfoTypeName, error) { - if pb == nil { - return nil, nil - } - st := ColumnInfoTypeName(*pb) - return &st, nil -} - type ComparisonOperator string -type comparisonOperatorPb string const ComparisonOperatorEqual ComparisonOperator = `EQUAL` @@ -1489,22 +1369,6 @@ func (f *ComparisonOperator) Type() string { return "ComparisonOperator" } -func comparisonOperatorToPb(st *ComparisonOperator) (*comparisonOperatorPb, error) { - if st == nil { - return nil, nil - } - pb := comparisonOperatorPb(*st) - return &pb, nil -} - -func comparisonOperatorFromPb(pb *comparisonOperatorPb) (*ComparisonOperator, error) { - if pb == nil { - return nil, nil - } - st := ComparisonOperator(*pb) - return &st, nil -} - type CreateAlert struct { // Name of the alert. // Wire name: 'name' @@ -2026,7 +1890,6 @@ func (st CreateWarehouseRequest) MarshalJSON() ([]byte, error) { // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type CreateWarehouseRequestWarehouseType string -type createWarehouseRequestWarehouseTypePb string const CreateWarehouseRequestWarehouseTypeClassic CreateWarehouseRequestWarehouseType = `CLASSIC` @@ -2055,22 +1918,6 @@ func (f *CreateWarehouseRequestWarehouseType) Type() string { return "CreateWarehouseRequestWarehouseType" } -func createWarehouseRequestWarehouseTypeToPb(st *CreateWarehouseRequestWarehouseType) (*createWarehouseRequestWarehouseTypePb, error) { - if st == nil { - return nil, nil - } - pb := createWarehouseRequestWarehouseTypePb(*st) - return &pb, nil -} - -func createWarehouseRequestWarehouseTypeFromPb(pb *createWarehouseRequestWarehouseTypePb) (*CreateWarehouseRequestWarehouseType, error) { - if pb == nil { - return nil, nil - } - st := CreateWarehouseRequestWarehouseType(*pb) - return &st, nil -} - type CreateWarehouseResponse struct { // Id for the SQL warehouse. This value is unique across all SQL warehouses. // Wire name: 'id' @@ -2489,7 +2336,6 @@ func (st DataSource) MarshalJSON() ([]byte, error) { } type DatePrecision string -type datePrecisionPb string const DatePrecisionDayPrecision DatePrecision = `DAY_PRECISION` @@ -2518,22 +2364,6 @@ func (f *DatePrecision) Type() string { return "DatePrecision" } -func datePrecisionToPb(st *DatePrecision) (*datePrecisionPb, error) { - if st == nil { - return nil, nil - } - pb := datePrecisionPb(*st) - return &pb, nil -} - -func datePrecisionFromPb(pb *datePrecisionPb) (*DatePrecision, error) { - if pb == nil { - return nil, nil - } - st := DatePrecision(*pb) - return &st, nil -} - type DateRange struct { // Wire name: 'end' @@ -2612,7 +2442,6 @@ func (st DateRangeValue) MarshalJSON() ([]byte, error) { } type DateRangeValueDynamicDateRange string -type dateRangeValueDynamicDateRangePb string const DateRangeValueDynamicDateRangeLast12Months DateRangeValueDynamicDateRange = `LAST_12_MONTHS` @@ -2669,22 +2498,6 @@ func (f *DateRangeValueDynamicDateRange) Type() string { return "DateRangeValueDynamicDateRange" } -func dateRangeValueDynamicDateRangeToPb(st *DateRangeValueDynamicDateRange) (*dateRangeValueDynamicDateRangePb, error) { - if st == nil { - return nil, nil - } - pb := dateRangeValueDynamicDateRangePb(*st) - return &pb, nil -} - -func dateRangeValueDynamicDateRangeFromPb(pb *dateRangeValueDynamicDateRangePb) (*DateRangeValueDynamicDateRange, error) { - if pb == nil { - return nil, nil - } - st := DateRangeValueDynamicDateRange(*pb) - return &st, nil -} - type DateValue struct { // Manually specified date-time value. // Wire name: 'date_value' @@ -2726,7 +2539,6 @@ func (st DateValue) MarshalJSON() ([]byte, error) { } type DateValueDynamicDate string -type dateValueDynamicDatePb string const DateValueDynamicDateNow DateValueDynamicDate = `NOW` @@ -2753,22 +2565,6 @@ func (f *DateValueDynamicDate) Type() string { return "DateValueDynamicDate" } -func dateValueDynamicDateToPb(st *DateValueDynamicDate) (*dateValueDynamicDatePb, error) { - if st == nil { - return nil, nil - } - pb := dateValueDynamicDatePb(*st) - return &pb, nil -} - -func dateValueDynamicDateFromPb(pb *dateValueDynamicDatePb) (*DateValueDynamicDate, error) { - if pb == nil { - return nil, nil - } - st := DateValueDynamicDate(*pb) - return &st, nil -} - // Delete an alert type DeleteAlertsLegacyRequest struct { @@ -3050,7 +2846,6 @@ func (st DeleteWarehouseResponse) MarshalJSON() ([]byte, error) { } type Disposition string -type dispositionPb string const DispositionExternalLinks Disposition = `EXTERNAL_LINKS` @@ -3077,22 +2872,6 @@ func (f *Disposition) Type() string { return "Disposition" } -func dispositionToPb(st *Disposition) (*dispositionPb, error) { - if st == nil { - return nil, nil - } - pb := dispositionPb(*st) - return &pb, nil -} - -func dispositionFromPb(pb *dispositionPb) (*Disposition, error) { - if pb == nil { - return nil, nil - } - st := Disposition(*pb) - return &st, nil -} - type EditAlert struct { // Wire name: 'alert_id' @@ -3249,7 +3028,6 @@ func (st EditWarehouseRequest) MarshalJSON() ([]byte, error) { // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type EditWarehouseRequestWarehouseType string -type editWarehouseRequestWarehouseTypePb string const EditWarehouseRequestWarehouseTypeClassic EditWarehouseRequestWarehouseType = `CLASSIC` @@ -3278,22 +3056,6 @@ func (f *EditWarehouseRequestWarehouseType) Type() string { return "EditWarehouseRequestWarehouseType" } -func editWarehouseRequestWarehouseTypeToPb(st *EditWarehouseRequestWarehouseType) (*editWarehouseRequestWarehouseTypePb, error) { - if st == nil { - return nil, nil - } - pb := editWarehouseRequestWarehouseTypePb(*st) - return &pb, nil -} - -func editWarehouseRequestWarehouseTypeFromPb(pb *editWarehouseRequestWarehouseTypePb) (*EditWarehouseRequestWarehouseType, error) { - if pb == nil { - return nil, nil - } - st := EditWarehouseRequestWarehouseType(*pb) - return &st, nil -} - type EditWarehouseResponse struct { } @@ -3563,7 +3325,6 @@ func (st EndpointInfo) MarshalJSON() ([]byte, error) { // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type EndpointInfoWarehouseType string -type endpointInfoWarehouseTypePb string const EndpointInfoWarehouseTypeClassic EndpointInfoWarehouseType = `CLASSIC` @@ -3592,22 +3353,6 @@ func (f *EndpointInfoWarehouseType) Type() string { return "EndpointInfoWarehouseType" } -func endpointInfoWarehouseTypeToPb(st *EndpointInfoWarehouseType) (*endpointInfoWarehouseTypePb, error) { - if st == nil { - return nil, nil - } - pb := endpointInfoWarehouseTypePb(*st) - return &pb, nil -} - -func endpointInfoWarehouseTypeFromPb(pb *endpointInfoWarehouseTypePb) (*EndpointInfoWarehouseType, error) { - if pb == nil { - return nil, nil - } - st := EndpointInfoWarehouseType(*pb) - return &st, nil -} - type EndpointTagPair struct { // Wire name: 'key' @@ -3886,7 +3631,6 @@ func (st ExecuteStatementRequest) MarshalJSON() ([]byte, error) { // :method:statementexecution/getStatement. When set to `CANCEL`, the statement // execution is canceled and the call returns with a `CANCELED` state. type ExecuteStatementRequestOnWaitTimeout string -type executeStatementRequestOnWaitTimeoutPb string const ExecuteStatementRequestOnWaitTimeoutCancel ExecuteStatementRequestOnWaitTimeout = `CANCEL` @@ -3913,22 +3657,6 @@ func (f *ExecuteStatementRequestOnWaitTimeout) Type() string { return "ExecuteStatementRequestOnWaitTimeout" } -func executeStatementRequestOnWaitTimeoutToPb(st *ExecuteStatementRequestOnWaitTimeout) (*executeStatementRequestOnWaitTimeoutPb, error) { - if st == nil { - return nil, nil - } - pb := executeStatementRequestOnWaitTimeoutPb(*st) - return &pb, nil -} - -func executeStatementRequestOnWaitTimeoutFromPb(pb *executeStatementRequestOnWaitTimeoutPb) (*ExecuteStatementRequestOnWaitTimeout, error) { - if pb == nil { - return nil, nil - } - st := ExecuteStatementRequestOnWaitTimeout(*pb) - return &st, nil -} - type ExternalLink struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. @@ -4090,7 +3818,6 @@ func (st ExternalQuerySourceJobInfo) MarshalJSON() ([]byte, error) { } type Format string -type formatPb string const FormatArrowStream Format = `ARROW_STREAM` @@ -4119,22 +3846,6 @@ func (f *Format) Type() string { return "Format" } -func formatToPb(st *Format) (*formatPb, error) { - if st == nil { - return nil, nil - } - pb := formatPb(*st) - return &pb, nil -} - -func formatFromPb(pb *formatPb) (*Format, error) { - if pb == nil { - return nil, nil - } - st := Format(*pb) - return &st, nil -} - // Get an alert type GetAlertRequest struct { @@ -4725,7 +4436,6 @@ func (st GetWarehouseResponse) MarshalJSON() ([]byte, error) { // you must set to `PRO` and also set the field `enable_serverless_compute` to // `true`. type GetWarehouseResponseWarehouseType string -type getWarehouseResponseWarehouseTypePb string const GetWarehouseResponseWarehouseTypeClassic GetWarehouseResponseWarehouseType = `CLASSIC` @@ -4754,22 +4464,6 @@ func (f *GetWarehouseResponseWarehouseType) Type() string { return "GetWarehouseResponseWarehouseType" } -func getWarehouseResponseWarehouseTypeToPb(st *GetWarehouseResponseWarehouseType) (*getWarehouseResponseWarehouseTypePb, error) { - if st == nil { - return nil, nil - } - pb := getWarehouseResponseWarehouseTypePb(*st) - return &pb, nil -} - -func getWarehouseResponseWarehouseTypeFromPb(pb *getWarehouseResponseWarehouseTypePb) (*GetWarehouseResponseWarehouseType, error) { - if pb == nil { - return nil, nil - } - st := GetWarehouseResponseWarehouseType(*pb) - return &st, nil -} - type GetWorkspaceWarehouseConfigResponse struct { // Optional: Channel selection details // Wire name: 'channel' @@ -4836,7 +4530,6 @@ func (st GetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { // Security policy for warehouses type GetWorkspaceWarehouseConfigResponseSecurityPolicy string -type getWorkspaceWarehouseConfigResponseSecurityPolicyPb string const GetWorkspaceWarehouseConfigResponseSecurityPolicyDataAccessControl GetWorkspaceWarehouseConfigResponseSecurityPolicy = `DATA_ACCESS_CONTROL` @@ -4865,22 +4558,6 @@ func (f *GetWorkspaceWarehouseConfigResponseSecurityPolicy) Type() string { return "GetWorkspaceWarehouseConfigResponseSecurityPolicy" } -func getWorkspaceWarehouseConfigResponseSecurityPolicyToPb(st *GetWorkspaceWarehouseConfigResponseSecurityPolicy) (*getWorkspaceWarehouseConfigResponseSecurityPolicyPb, error) { - if st == nil { - return nil, nil - } - pb := getWorkspaceWarehouseConfigResponseSecurityPolicyPb(*st) - return &pb, nil -} - -func getWorkspaceWarehouseConfigResponseSecurityPolicyFromPb(pb *getWorkspaceWarehouseConfigResponseSecurityPolicyPb) (*GetWorkspaceWarehouseConfigResponseSecurityPolicy, error) { - if pb == nil { - return nil, nil - } - st := GetWorkspaceWarehouseConfigResponseSecurityPolicy(*pb) - return &st, nil -} - type LegacyAlert struct { // Timestamp when the alert was created. // Wire name: 'created_at' @@ -4952,7 +4629,6 @@ func (st LegacyAlert) MarshalJSON() ([]byte, error) { // `triggered` (evaluated and fulfilled trigger conditions), or `ok` (evaluated // and did not fulfill trigger conditions). type LegacyAlertState string -type legacyAlertStatePb string const LegacyAlertStateOk LegacyAlertState = `ok` @@ -4981,22 +4657,6 @@ func (f *LegacyAlertState) Type() string { return "LegacyAlertState" } -func legacyAlertStateToPb(st *LegacyAlertState) (*legacyAlertStatePb, error) { - if st == nil { - return nil, nil - } - pb := legacyAlertStatePb(*st) - return &pb, nil -} - -func legacyAlertStateFromPb(pb *legacyAlertStatePb) (*LegacyAlertState, error) { - if pb == nil { - return nil, nil - } - st := LegacyAlertState(*pb) - return &st, nil -} - type LegacyQuery struct { // Describes whether the authenticated user is allowed to edit the // definition of this query. @@ -5183,7 +4843,6 @@ func (st LegacyVisualization) MarshalJSON() ([]byte, error) { } type LifecycleState string -type lifecycleStatePb string const LifecycleStateActive LifecycleState = `ACTIVE` @@ -5210,22 +4869,6 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } -func lifecycleStateToPb(st *LifecycleState) (*lifecycleStatePb, error) { - if st == nil { - return nil, nil - } - pb := lifecycleStatePb(*st) - return &pb, nil -} - -func lifecycleStateFromPb(pb *lifecycleStatePb) (*LifecycleState, error) { - if pb == nil { - return nil, nil - } - st := LifecycleState(*pb) - return &st, nil -} - // List alerts type ListAlertsRequest struct { @@ -5501,7 +5144,6 @@ func (st ListDashboardsRequest) MarshalJSON() ([]byte, error) { } type ListOrder string -type listOrderPb string const ListOrderCreatedAt ListOrder = `created_at` @@ -5528,22 +5170,6 @@ func (f *ListOrder) Type() string { return "ListOrder" } -func listOrderToPb(st *ListOrder) (*listOrderPb, error) { - if st == nil { - return nil, nil - } - pb := listOrderPb(*st) - return &pb, nil -} - -func listOrderFromPb(pb *listOrderPb) (*ListOrder, error) { - if pb == nil { - return nil, nil - } - st := ListOrder(*pb) - return &st, nil -} - // Get a list of queries type ListQueriesLegacyRequest struct { // Name of query attribute to order by. Default sort order is ascending. @@ -6099,7 +5725,6 @@ func (st NumericValue) MarshalJSON() ([]byte, error) { // A singular noun object type. type ObjectType string -type objectTypePb string const ObjectTypeAlert ObjectType = `alert` @@ -6130,25 +5755,8 @@ func (f *ObjectType) Type() string { return "ObjectType" } -func objectTypeToPb(st *ObjectType) (*objectTypePb, error) { - if st == nil { - return nil, nil - } - pb := objectTypePb(*st) - return &pb, nil -} - -func objectTypeFromPb(pb *objectTypePb) (*ObjectType, error) { - if pb == nil { - return nil, nil - } - st := ObjectType(*pb) - return &st, nil -} - // Always a plural of the object type. type ObjectTypePlural string -type objectTypePluralPb string const ObjectTypePluralAlerts ObjectTypePlural = `alerts` @@ -6179,22 +5787,6 @@ func (f *ObjectTypePlural) Type() string { return "ObjectTypePlural" } -func objectTypePluralToPb(st *ObjectTypePlural) (*objectTypePluralPb, error) { - if st == nil { - return nil, nil - } - pb := objectTypePluralPb(*st) - return &pb, nil -} - -func objectTypePluralFromPb(pb *objectTypePluralPb) (*ObjectTypePlural, error) { - if pb == nil { - return nil, nil - } - st := ObjectTypePlural(*pb) - return &st, nil -} - type OdbcParams struct { // Wire name: 'hostname' @@ -6239,7 +5831,6 @@ func (st OdbcParams) MarshalJSON() ([]byte, error) { // The singular form of the type of object which can be owned. type OwnableObjectType string -type ownableObjectTypePb string const OwnableObjectTypeAlert OwnableObjectType = `alert` @@ -6268,22 +5859,6 @@ func (f *OwnableObjectType) Type() string { return "OwnableObjectType" } -func ownableObjectTypeToPb(st *OwnableObjectType) (*ownableObjectTypePb, error) { - if st == nil { - return nil, nil - } - pb := ownableObjectTypePb(*st) - return &pb, nil -} - -func ownableObjectTypeFromPb(pb *ownableObjectTypePb) (*OwnableObjectType, error) { - if pb == nil { - return nil, nil - } - st := OwnableObjectType(*pb) - return &st, nil -} - type Parameter struct { // List of valid parameter values, newline delimited. Only applies for // dropdown list parameters. @@ -6341,7 +5916,6 @@ func (st Parameter) MarshalJSON() ([]byte, error) { // Parameters can have several different types. type ParameterType string -type parameterTypePb string const ParameterTypeDatetime ParameterType = `datetime` @@ -6374,26 +5948,9 @@ func (f *ParameterType) Type() string { return "ParameterType" } -func parameterTypeToPb(st *ParameterType) (*parameterTypePb, error) { - if st == nil { - return nil, nil - } - pb := parameterTypePb(*st) - return &pb, nil -} - -func parameterTypeFromPb(pb *parameterTypePb) (*ParameterType, error) { - if pb == nil { - return nil, nil - } - st := ParameterType(*pb) - return &st, nil -} - // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * `CAN_EDIT`: // Can edit the query * `CAN_MANAGE`: Can manage the query type PermissionLevel string -type permissionLevelPb string // Can edit the query const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT` @@ -6428,25 +5985,8 @@ func (f *PermissionLevel) Type() string { return "PermissionLevel" } -func permissionLevelToPb(st *PermissionLevel) (*permissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := permissionLevelPb(*st) - return &pb, nil -} - -func permissionLevelFromPb(pb *permissionLevelPb) (*PermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := PermissionLevel(*pb) - return &st, nil -} - // Possible Reasons for which we have not saved plans in the database type PlansState string -type plansStatePb string const PlansStateEmpty PlansState = `EMPTY` @@ -6481,22 +6021,6 @@ func (f *PlansState) Type() string { return "PlansState" } -func plansStateToPb(st *PlansState) (*plansStatePb, error) { - if st == nil { - return nil, nil - } - pb := plansStatePb(*st) - return &pb, nil -} - -func plansStateFromPb(pb *plansStatePb) (*PlansState, error) { - if pb == nil { - return nil, nil - } - st := PlansState(*pb) - return &st, nil -} - type Query struct { // Whether to apply a 1000 row limit to the query result. // Wire name: 'apply_auto_limit' @@ -7155,7 +6679,6 @@ func (st QueryPostContent) MarshalJSON() ([]byte, error) { } type QueryStatementType string -type queryStatementTypePb string const QueryStatementTypeAlter QueryStatementType = `ALTER` @@ -7222,25 +6745,8 @@ func (f *QueryStatementType) Type() string { return "QueryStatementType" } -func queryStatementTypeToPb(st *QueryStatementType) (*queryStatementTypePb, error) { - if st == nil { - return nil, nil - } - pb := queryStatementTypePb(*st) - return &pb, nil -} - -func queryStatementTypeFromPb(pb *queryStatementTypePb) (*QueryStatementType, error) { - if pb == nil { - return nil, nil - } - st := QueryStatementType(*pb) - return &st, nil -} - // Statuses which are also used by OperationStatus in runtime type QueryStatus string -type queryStatusPb string const QueryStatusCanceled QueryStatus = `CANCELED` @@ -7279,22 +6785,6 @@ func (f *QueryStatus) Type() string { return "QueryStatus" } -func queryStatusToPb(st *QueryStatus) (*queryStatusPb, error) { - if st == nil { - return nil, nil - } - pb := queryStatusPb(*st) - return &pb, nil -} - -func queryStatusFromPb(pb *queryStatusPb) (*QueryStatus, error) { - if pb == nil { - return nil, nil - } - st := QueryStatus(*pb) - return &st, nil -} - type RepeatedEndpointConfPairs struct { // Deprecated: Use configuration_pairs // Wire name: 'config_pair' @@ -7575,7 +7065,6 @@ func (st ResultSchema) MarshalJSON() ([]byte, error) { } type RunAsMode string -type runAsModePb string const RunAsModeOwner RunAsMode = `OWNER` @@ -7602,27 +7091,10 @@ func (f *RunAsMode) Type() string { return "RunAsMode" } -func runAsModeToPb(st *RunAsMode) (*runAsModePb, error) { - if st == nil { - return nil, nil - } - pb := runAsModePb(*st) - return &pb, nil -} - -func runAsModeFromPb(pb *runAsModePb) (*RunAsMode, error) { - if pb == nil { - return nil, nil - } - st := RunAsMode(*pb) - return &st, nil -} - // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as owner" // behavior) type RunAsRole string -type runAsRolePb string const RunAsRoleOwner RunAsRole = `owner` @@ -7649,24 +7121,7 @@ func (f *RunAsRole) Type() string { return "RunAsRole" } -func runAsRoleToPb(st *RunAsRole) (*runAsRolePb, error) { - if st == nil { - return nil, nil - } - pb := runAsRolePb(*st) - return &pb, nil -} - -func runAsRoleFromPb(pb *runAsRolePb) (*RunAsRole, error) { - if pb == nil { - return nil, nil - } - st := RunAsRole(*pb) - return &st, nil -} - type SchedulePauseStatus string -type schedulePauseStatusPb string const SchedulePauseStatusPaused SchedulePauseStatus = `PAUSED` @@ -7693,22 +7148,6 @@ func (f *SchedulePauseStatus) Type() string { return "SchedulePauseStatus" } -func schedulePauseStatusToPb(st *SchedulePauseStatus) (*schedulePauseStatusPb, error) { - if st == nil { - return nil, nil - } - pb := schedulePauseStatusPb(*st) - return &pb, nil -} - -func schedulePauseStatusFromPb(pb *schedulePauseStatusPb) (*SchedulePauseStatus, error) { - if pb == nil { - return nil, nil - } - st := SchedulePauseStatus(*pb) - return &st, nil -} - type ServiceError struct { // Wire name: 'error_code' @@ -7746,7 +7185,6 @@ func (st ServiceError) MarshalJSON() ([]byte, error) { } type ServiceErrorCode string -type serviceErrorCodePb string const ServiceErrorCodeAborted ServiceErrorCode = `ABORTED` @@ -7797,22 +7235,6 @@ func (f *ServiceErrorCode) Type() string { return "ServiceErrorCode" } -func serviceErrorCodeToPb(st *ServiceErrorCode) (*serviceErrorCodePb, error) { - if st == nil { - return nil, nil - } - pb := serviceErrorCodePb(*st) - return &pb, nil -} - -func serviceErrorCodeFromPb(pb *serviceErrorCodePb) (*ServiceErrorCode, error) { - if pb == nil { - return nil, nil - } - st := ServiceErrorCode(*pb) - return &st, nil -} - // Set object ACL type SetRequest struct { @@ -7957,7 +7379,6 @@ func (st SetWorkspaceWarehouseConfigRequest) MarshalJSON() ([]byte, error) { // Security policy for warehouses type SetWorkspaceWarehouseConfigRequestSecurityPolicy string -type setWorkspaceWarehouseConfigRequestSecurityPolicyPb string const SetWorkspaceWarehouseConfigRequestSecurityPolicyDataAccessControl SetWorkspaceWarehouseConfigRequestSecurityPolicy = `DATA_ACCESS_CONTROL` @@ -7986,22 +7407,6 @@ func (f *SetWorkspaceWarehouseConfigRequestSecurityPolicy) Type() string { return "SetWorkspaceWarehouseConfigRequestSecurityPolicy" } -func setWorkspaceWarehouseConfigRequestSecurityPolicyToPb(st *SetWorkspaceWarehouseConfigRequestSecurityPolicy) (*setWorkspaceWarehouseConfigRequestSecurityPolicyPb, error) { - if st == nil { - return nil, nil - } - pb := setWorkspaceWarehouseConfigRequestSecurityPolicyPb(*st) - return &pb, nil -} - -func setWorkspaceWarehouseConfigRequestSecurityPolicyFromPb(pb *setWorkspaceWarehouseConfigRequestSecurityPolicyPb) (*SetWorkspaceWarehouseConfigRequestSecurityPolicy, error) { - if pb == nil { - return nil, nil - } - st := SetWorkspaceWarehouseConfigRequestSecurityPolicy(*pb) - return &st, nil -} - type SetWorkspaceWarehouseConfigResponse struct { } @@ -8032,7 +7437,6 @@ func (st SetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { // Configurations whether the warehouse should use spot instances. type SpotInstancePolicy string -type spotInstancePolicyPb string const SpotInstancePolicyCostOptimized SpotInstancePolicy = `COST_OPTIMIZED` @@ -8061,22 +7465,6 @@ func (f *SpotInstancePolicy) Type() string { return "SpotInstancePolicy" } -func spotInstancePolicyToPb(st *SpotInstancePolicy) (*spotInstancePolicyPb, error) { - if st == nil { - return nil, nil - } - pb := spotInstancePolicyPb(*st) - return &pb, nil -} - -func spotInstancePolicyFromPb(pb *spotInstancePolicyPb) (*SpotInstancePolicy, error) { - if pb == nil { - return nil, nil - } - st := SpotInstancePolicy(*pb) - return &st, nil -} - // Start a warehouse type StartRequest struct { // Required. Id of the SQL warehouse. @@ -8139,7 +7527,6 @@ func (st StartWarehouseResponse) MarshalJSON() ([]byte, error) { // State of the warehouse type State string -type statePb string const StateDeleted State = `DELETED` @@ -8174,22 +7561,6 @@ func (f *State) Type() string { return "State" } -func stateToPb(st *State) (*statePb, error) { - if st == nil { - return nil, nil - } - pb := statePb(*st) - return &pb, nil -} - -func stateFromPb(pb *statePb) (*State, error) { - if pb == nil { - return nil, nil - } - st := State(*pb) - return &st, nil -} - type StatementParameterListItem struct { // The name of a parameter marker to be substituted in the statement. // Wire name: 'name' @@ -8287,7 +7658,6 @@ func (st StatementResponse) MarshalJSON() ([]byte, error) { // cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`: execution // successful, and statement closed; result no longer available for fetch type StatementState string -type statementStatePb string // user canceled; can come from explicit cancel call, or timeout with // `on_wait_timeout=CANCEL` @@ -8330,22 +7700,6 @@ func (f *StatementState) Type() string { return "StatementState" } -func statementStateToPb(st *StatementState) (*statementStatePb, error) { - if st == nil { - return nil, nil - } - pb := statementStatePb(*st) - return &pb, nil -} - -func statementStateFromPb(pb *statementStatePb) (*StatementState, error) { - if pb == nil { - return nil, nil - } - st := StatementState(*pb) - return &st, nil -} - // The status response includes execution state and if relevant, error // information. type StatementStatus struct { @@ -8390,7 +7744,6 @@ func (st StatementStatus) MarshalJSON() ([]byte, error) { // Health status of the warehouse. type Status string -type statusPb string const StatusDegraded Status = `DEGRADED` @@ -8421,22 +7774,6 @@ func (f *Status) Type() string { return "Status" } -func statusToPb(st *Status) (*statusPb, error) { - if st == nil { - return nil, nil - } - pb := statusPb(*st) - return &pb, nil -} - -func statusFromPb(pb *statusPb) (*Status, error) { - if pb == nil { - return nil, nil - } - st := Status(*pb) - return &st, nil -} - // Stop a warehouse type StopRequest struct { // Required. Id of the SQL warehouse. @@ -8529,7 +7866,6 @@ func (st Success) MarshalJSON() ([]byte, error) { } type SuccessMessage string -type successMessagePb string const SuccessMessageSuccess SuccessMessage = `Success` @@ -8554,22 +7890,6 @@ func (f *SuccessMessage) Type() string { return "SuccessMessage" } -func successMessageToPb(st *SuccessMessage) (*successMessagePb, error) { - if st == nil { - return nil, nil - } - pb := successMessagePb(*st) - return &pb, nil -} - -func successMessageFromPb(pb *successMessagePb) (*SuccessMessage, error) { - if pb == nil { - return nil, nil - } - st := SuccessMessage(*pb) - return &st, nil -} - type TerminationReason struct { // status code indicating why the cluster was terminated // Wire name: 'code' @@ -8610,7 +7930,6 @@ func (st TerminationReason) MarshalJSON() ([]byte, error) { // status code indicating why the cluster was terminated type TerminationReasonCode string -type terminationReasonCodePb string const TerminationReasonCodeAbuseDetected TerminationReasonCode = `ABUSE_DETECTED` @@ -8791,25 +8110,8 @@ func (f *TerminationReasonCode) Type() string { return "TerminationReasonCode" } -func terminationReasonCodeToPb(st *TerminationReasonCode) (*terminationReasonCodePb, error) { - if st == nil { - return nil, nil - } - pb := terminationReasonCodePb(*st) - return &pb, nil -} - -func terminationReasonCodeFromPb(pb *terminationReasonCodePb) (*TerminationReasonCode, error) { - if pb == nil { - return nil, nil - } - st := TerminationReasonCode(*pb) - return &st, nil -} - // type of the termination type TerminationReasonType string -type terminationReasonTypePb string const TerminationReasonTypeClientError TerminationReasonType = `CLIENT_ERROR` @@ -8840,22 +8142,6 @@ func (f *TerminationReasonType) Type() string { return "TerminationReasonType" } -func terminationReasonTypeToPb(st *TerminationReasonType) (*terminationReasonTypePb, error) { - if st == nil { - return nil, nil - } - pb := terminationReasonTypePb(*st) - return &pb, nil -} - -func terminationReasonTypeFromPb(pb *terminationReasonTypePb) (*TerminationReasonType, error) { - if pb == nil { - return nil, nil - } - st := TerminationReasonType(*pb) - return &st, nil -} - type TextValue struct { // Wire name: 'value' @@ -9725,7 +9011,6 @@ func (st WarehousePermission) MarshalJSON() ([]byte, error) { // Permission level type WarehousePermissionLevel string -type warehousePermissionLevelPb string const WarehousePermissionLevelCanManage WarehousePermissionLevel = `CAN_MANAGE` @@ -9758,22 +9043,6 @@ func (f *WarehousePermissionLevel) Type() string { return "WarehousePermissionLevel" } -func warehousePermissionLevelToPb(st *WarehousePermissionLevel) (*warehousePermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := warehousePermissionLevelPb(*st) - return &pb, nil -} - -func warehousePermissionLevelFromPb(pb *warehousePermissionLevelPb) (*WarehousePermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := WarehousePermissionLevel(*pb) - return &st, nil -} - type WarehousePermissions struct { // Wire name: 'access_control_list' @@ -9922,7 +9191,6 @@ func (st WarehouseTypePair) MarshalJSON() ([]byte, error) { // Warehouse type: `PRO` or `CLASSIC`. type WarehouseTypePairWarehouseType string -type warehouseTypePairWarehouseTypePb string const WarehouseTypePairWarehouseTypeClassic WarehouseTypePairWarehouseType = `CLASSIC` @@ -9951,22 +9219,6 @@ func (f *WarehouseTypePairWarehouseType) Type() string { return "WarehouseTypePairWarehouseType" } -func warehouseTypePairWarehouseTypeToPb(st *WarehouseTypePairWarehouseType) (*warehouseTypePairWarehouseTypePb, error) { - if st == nil { - return nil, nil - } - pb := warehouseTypePairWarehouseTypePb(*st) - return &pb, nil -} - -func warehouseTypePairWarehouseTypeFromPb(pb *warehouseTypePairWarehouseTypePb) (*WarehouseTypePairWarehouseType, error) { - if pb == nil { - return nil, nil - } - st := WarehouseTypePairWarehouseType(*pb) - return &st, nil -} - type Widget struct { // The unique ID for this widget. // Wire name: 'id' diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 3c709cdb4..02b454c48 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -207,7 +207,6 @@ func (st DeleteDataResult) MarshalJSON() ([]byte, error) { } type DeleteDataStatus string -type deleteDataStatusPb string const DeleteDataStatusFailure DeleteDataStatus = `FAILURE` @@ -236,22 +235,6 @@ func (f *DeleteDataStatus) Type() string { return "DeleteDataStatus" } -func deleteDataStatusToPb(st *DeleteDataStatus) (*deleteDataStatusPb, error) { - if st == nil { - return nil, nil - } - pb := deleteDataStatusPb(*st) - return &pb, nil -} - -func deleteDataStatusFromPb(pb *deleteDataStatusPb) (*DeleteDataStatus, error) { - if pb == nil { - return nil, nil - } - st := DeleteDataStatus(*pb) - return &st, nil -} - // Delete data from index type DeleteDataVectorIndexRequest struct { // Name of the vector index where data is to be deleted. Must be a Direct @@ -772,7 +755,6 @@ func (st EndpointStatus) MarshalJSON() ([]byte, error) { // Current state of the endpoint type EndpointStatusState string -type endpointStatusStatePb string const EndpointStatusStateOffline EndpointStatusState = `OFFLINE` @@ -801,25 +783,8 @@ func (f *EndpointStatusState) Type() string { return "EndpointStatusState" } -func endpointStatusStateToPb(st *EndpointStatusState) (*endpointStatusStatePb, error) { - if st == nil { - return nil, nil - } - pb := endpointStatusStatePb(*st) - return &pb, nil -} - -func endpointStatusStateFromPb(pb *endpointStatusStatePb) (*EndpointStatusState, error) { - if pb == nil { - return nil, nil - } - st := EndpointStatusState(*pb) - return &st, nil -} - // Type of endpoint. type EndpointType string -type endpointTypePb string const EndpointTypeStandard EndpointType = `STANDARD` @@ -844,22 +809,6 @@ func (f *EndpointType) Type() string { return "EndpointType" } -func endpointTypeToPb(st *EndpointType) (*endpointTypePb, error) { - if st == nil { - return nil, nil - } - pb := endpointTypePb(*st) - return &pb, nil -} - -func endpointTypeFromPb(pb *endpointTypePb) (*EndpointType, error) { - if pb == nil { - return nil, nil - } - st := EndpointType(*pb) - return &st, nil -} - // Get an endpoint type GetEndpointRequest struct { // Name of the endpoint @@ -1261,7 +1210,6 @@ func (st PatchEndpointBudgetPolicyResponse) MarshalJSON() ([]byte, error) { // continuous execution, the pipeline processes new data as it arrives in the // source table to keep vector index fresh. type PipelineType string -type pipelineTypePb string // If the pipeline uses continuous execution, the pipeline processes new data as // it arrives in the source table to keep vector index fresh. @@ -1294,22 +1242,6 @@ func (f *PipelineType) Type() string { return "PipelineType" } -func pipelineTypeToPb(st *PipelineType) (*pipelineTypePb, error) { - if st == nil { - return nil, nil - } - pb := pipelineTypePb(*st) - return &pb, nil -} - -func pipelineTypeFromPb(pb *pipelineTypePb) (*PipelineType, error) { - if pb == nil { - return nil, nil - } - st := PipelineType(*pb) - return &st, nil -} - // Request payload for getting next page of results. type QueryVectorIndexNextPageRequest struct { // Name of the endpoint. @@ -1806,7 +1738,6 @@ func (st UpsertDataResult) MarshalJSON() ([]byte, error) { } type UpsertDataStatus string -type upsertDataStatusPb string const UpsertDataStatusFailure UpsertDataStatus = `FAILURE` @@ -1835,22 +1766,6 @@ func (f *UpsertDataStatus) Type() string { return "UpsertDataStatus" } -func upsertDataStatusToPb(st *UpsertDataStatus) (*upsertDataStatusPb, error) { - if st == nil { - return nil, nil - } - pb := upsertDataStatusPb(*st) - return &pb, nil -} - -func upsertDataStatusFromPb(pb *upsertDataStatusPb) (*UpsertDataStatus, error) { - if pb == nil { - return nil, nil - } - st := UpsertDataStatus(*pb) - return &st, nil -} - type UpsertDataVectorIndexRequest struct { // Name of the vector index where data is to be upserted. Must be a Direct // Vector Access Index. @@ -2073,7 +1988,6 @@ func (st VectorIndexStatus) MarshalJSON() ([]byte, error) { // vectors and metadata through our REST and SDK APIs. With this model, the user // manages index updates. type VectorIndexType string -type vectorIndexTypePb string // An index that automatically syncs with a source Delta Table, automatically // and incrementally updating the index as the underlying data in the Delta @@ -2105,22 +2019,6 @@ func (f *VectorIndexType) Type() string { return "VectorIndexType" } -func vectorIndexTypeToPb(st *VectorIndexType) (*vectorIndexTypePb, error) { - if st == nil { - return nil, nil - } - pb := vectorIndexTypePb(*st) - return &pb, nil -} - -func vectorIndexTypeFromPb(pb *vectorIndexTypePb) (*VectorIndexType, error) { - if pb == nil { - return nil, nil - } - st := VectorIndexType(*pb) - return &st, nil -} - func durationToPb(d *time.Duration) (*string, error) { if d == nil { return nil, nil diff --git a/service/workspace/model.go b/service/workspace/model.go index 1e3283d46..000553753 100755 --- a/service/workspace/model.go +++ b/service/workspace/model.go @@ -44,7 +44,6 @@ func (st AclItem) MarshalJSON() ([]byte, error) { } type AclPermission string -type aclPermissionPb string const AclPermissionManage AclPermission = `MANAGE` @@ -73,22 +72,6 @@ func (f *AclPermission) Type() string { return "AclPermission" } -func aclPermissionToPb(st *AclPermission) (*aclPermissionPb, error) { - if st == nil { - return nil, nil - } - pb := aclPermissionPb(*st) - return &pb, nil -} - -func aclPermissionFromPb(pb *aclPermissionPb) (*AclPermission, error) { - if pb == nil { - return nil, nil - } - st := AclPermission(*pb) - return &st, nil -} - type AzureKeyVaultSecretScopeMetadata struct { // The DNS of the KeyVault // Wire name: 'dns_name' @@ -800,7 +783,6 @@ func (st DeleteSecretResponse) MarshalJSON() ([]byte, error) { // The format for workspace import and export. type ExportFormat string -type exportFormatPb string const ExportFormatAuto ExportFormat = `AUTO` @@ -837,22 +819,6 @@ func (f *ExportFormat) Type() string { return "ExportFormat" } -func exportFormatToPb(st *ExportFormat) (*exportFormatPb, error) { - if st == nil { - return nil, nil - } - pb := exportFormatPb(*st) - return &pb, nil -} - -func exportFormatFromPb(pb *exportFormatPb) (*ExportFormat, error) { - if pb == nil { - return nil, nil - } - st := ExportFormat(*pb) - return &st, nil -} - // Export a workspace object type ExportRequest struct { // This specifies the format of the exported file. By default, this is @@ -1497,7 +1463,6 @@ func (st Import) MarshalJSON() ([]byte, error) { // The format for workspace import and export. type ImportFormat string -type importFormatPb string const ImportFormatAuto ImportFormat = `AUTO` @@ -1534,22 +1499,6 @@ func (f *ImportFormat) Type() string { return "ImportFormat" } -func importFormatToPb(st *ImportFormat) (*importFormatPb, error) { - if st == nil { - return nil, nil - } - pb := importFormatPb(*st) - return &pb, nil -} - -func importFormatFromPb(pb *importFormatPb) (*ImportFormat, error) { - if pb == nil { - return nil, nil - } - st := ImportFormat(*pb) - return &st, nil -} - type ImportResponse struct { } @@ -1580,7 +1529,6 @@ func (st ImportResponse) MarshalJSON() ([]byte, error) { // The language of notebook. type Language string -type languagePb string const LanguagePython Language = `PYTHON` @@ -1611,22 +1559,6 @@ func (f *Language) Type() string { return "Language" } -func languageToPb(st *Language) (*languagePb, error) { - if st == nil { - return nil, nil - } - pb := languagePb(*st) - return &pb, nil -} - -func languageFromPb(pb *languagePb) (*Language, error) { - if pb == nil { - return nil, nil - } - st := Language(*pb) - return &st, nil -} - // Lists ACLs type ListAclsRequest struct { // The name of the scope to fetch ACL information from. @@ -2086,7 +2018,6 @@ func (st ObjectInfo) MarshalJSON() ([]byte, error) { // The type of the object in workspace. type ObjectType string -type objectTypePb string const ObjectTypeDashboard ObjectType = `DASHBOARD` @@ -2121,22 +2052,6 @@ func (f *ObjectType) Type() string { return "ObjectType" } -func objectTypeToPb(st *ObjectType) (*objectTypePb, error) { - if st == nil { - return nil, nil - } - pb := objectTypePb(*st) - return &pb, nil -} - -func objectTypeFromPb(pb *objectTypePb) (*ObjectType, error) { - if pb == nil { - return nil, nil - } - st := ObjectType(*pb) - return &st, nil -} - type PutAcl struct { // The permission level applied to the principal. // Wire name: 'permission' @@ -2452,7 +2367,6 @@ func (st RepoPermission) MarshalJSON() ([]byte, error) { // Permission level type RepoPermissionLevel string -type repoPermissionLevelPb string const RepoPermissionLevelCanEdit RepoPermissionLevel = `CAN_EDIT` @@ -2483,22 +2397,6 @@ func (f *RepoPermissionLevel) Type() string { return "RepoPermissionLevel" } -func repoPermissionLevelToPb(st *RepoPermissionLevel) (*repoPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := repoPermissionLevelPb(*st) - return &pb, nil -} - -func repoPermissionLevelFromPb(pb *repoPermissionLevelPb) (*RepoPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := RepoPermissionLevel(*pb) - return &st, nil -} - type RepoPermissions struct { // Wire name: 'access_control_list' @@ -2609,7 +2507,6 @@ func (st RepoPermissionsRequest) MarshalJSON() ([]byte, error) { } type ScopeBackendType string -type scopeBackendTypePb string const ScopeBackendTypeAzureKeyvault ScopeBackendType = `AZURE_KEYVAULT` @@ -2636,22 +2533,6 @@ func (f *ScopeBackendType) Type() string { return "ScopeBackendType" } -func scopeBackendTypeToPb(st *ScopeBackendType) (*scopeBackendTypePb, error) { - if st == nil { - return nil, nil - } - pb := scopeBackendTypePb(*st) - return &pb, nil -} - -func scopeBackendTypeFromPb(pb *scopeBackendTypePb) (*ScopeBackendType, error) { - if pb == nil { - return nil, nil - } - st := ScopeBackendType(*pb) - return &st, nil -} - type SecretMetadata struct { // A unique name to identify the secret. // Wire name: 'key' @@ -3082,7 +2963,6 @@ func (st WorkspaceObjectPermission) MarshalJSON() ([]byte, error) { // Permission level type WorkspaceObjectPermissionLevel string -type workspaceObjectPermissionLevelPb string const WorkspaceObjectPermissionLevelCanEdit WorkspaceObjectPermissionLevel = `CAN_EDIT` @@ -3113,22 +2993,6 @@ func (f *WorkspaceObjectPermissionLevel) Type() string { return "WorkspaceObjectPermissionLevel" } -func workspaceObjectPermissionLevelToPb(st *WorkspaceObjectPermissionLevel) (*workspaceObjectPermissionLevelPb, error) { - if st == nil { - return nil, nil - } - pb := workspaceObjectPermissionLevelPb(*st) - return &pb, nil -} - -func workspaceObjectPermissionLevelFromPb(pb *workspaceObjectPermissionLevelPb) (*WorkspaceObjectPermissionLevel, error) { - if pb == nil { - return nil, nil - } - st := WorkspaceObjectPermissionLevel(*pb) - return &st, nil -} - type WorkspaceObjectPermissions struct { // Wire name: 'access_control_list' From 8b97a265025cf580d400396fa81ab1af8ca45bdd Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Thu, 22 May 2025 08:27:58 +0000 Subject: [PATCH 3/3] more cleanup --- .codegen/_openapi_sha | 2 +- service/apps/internal.go | 342 ++- service/apps/model.go | 56 - service/billing/internal.go | 399 ++-- service/billing/model.go | 56 - service/catalog/internal.go | 3288 ++++++++-------------------- service/catalog/model.go | 56 - service/cleanrooms/internal.go | 380 ++-- service/cleanrooms/model.go | 56 - service/compute/internal.go | 2346 ++++++-------------- service/compute/model.go | 56 - service/dashboards/internal.go | 654 ++---- service/dashboards/model.go | 56 - service/files/internal.go | 185 +- service/files/model.go | 56 - service/iam/internal.go | 716 ++---- service/iam/model.go | 56 - service/jobs/internal.go | 2286 ++++++------------- service/jobs/model.go | 56 - service/marketplace/internal.go | 962 +++----- service/marketplace/model.go | 56 - service/ml/internal.go | 1502 ++++--------- service/ml/model.go | 56 - service/oauth2/internal.go | 422 ++-- service/oauth2/model.go | 56 - service/pipelines/internal.go | 1060 +++------ service/pipelines/model.go | 56 - service/pkg.go | 6 +- service/provisioning/internal.go | 606 ++--- service/provisioning/model.go | 56 - service/qualitymonitor/internal.go | 104 +- service/qualitymonitor/model.go | 56 - service/serving/internal.go | 1085 +++------ service/serving/model.go | 56 - service/settings/internal.go | 1068 +++------ service/settings/model.go | 56 - service/sharing/internal.go | 910 +++----- service/sharing/model.go | 56 - service/sql/internal.go | 2494 ++++++--------------- service/sql/model.go | 56 - service/vectorsearch/internal.go | 414 ++-- service/vectorsearch/model.go | 56 - service/workspace/internal.go | 486 ++-- service/workspace/model.go | 56 - 44 files changed, 6647 insertions(+), 16246 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 3e6708180..407ae0e94 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -2cee201b2e8d656f7306b2f9ec98edfa721e9829 \ No newline at end of file +file:/home/hector.castejon/openapi/sha:2cee201b2e8d656f7306b2f9ec98edfa721e9829.json \ No newline at end of file diff --git a/service/apps/internal.go b/service/apps/internal.go index 232dfa780..6a914880b 100755 --- a/service/apps/internal.go +++ b/service/apps/internal.go @@ -3,6 +3,10 @@ package apps import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,49 +16,27 @@ func appToPb(st *App) (*appPb, error) { } pb := &appPb{} pb.ActiveDeployment = st.ActiveDeployment - pb.AppStatus = st.AppStatus - pb.BudgetPolicyId = st.BudgetPolicyId - pb.ComputeStatus = st.ComputeStatus - pb.CreateTime = st.CreateTime - pb.Creator = st.Creator - pb.DefaultSourceCodePath = st.DefaultSourceCodePath - pb.Description = st.Description - pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId - pb.EffectiveUserApiScopes = st.EffectiveUserApiScopes - pb.Id = st.Id - pb.Name = st.Name - pb.Oauth2AppClientId = st.Oauth2AppClientId - pb.Oauth2AppIntegrationId = st.Oauth2AppIntegrationId - pb.PendingDeployment = st.PendingDeployment - pb.Resources = st.Resources - pb.ServicePrincipalClientId = st.ServicePrincipalClientId - pb.ServicePrincipalId = st.ServicePrincipalId - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UpdateTime = st.UpdateTime - pb.Updater = st.Updater - pb.Url = st.Url - pb.UserApiScopes = st.UserApiScopes pb.ForceSendFields = st.ForceSendFields @@ -62,51 +44,29 @@ func appToPb(st *App) (*appPb, error) { } type appPb struct { - ActiveDeployment *AppDeployment `json:"active_deployment,omitempty"` - - AppStatus *ApplicationStatus `json:"app_status,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - ComputeStatus *ComputeStatus `json:"compute_status,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - Creator string `json:"creator,omitempty"` - - DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` - - Description string `json:"description,omitempty"` - - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` - - EffectiveUserApiScopes []string `json:"effective_user_api_scopes,omitempty"` - - Id string `json:"id,omitempty"` - - Name string `json:"name"` - - Oauth2AppClientId string `json:"oauth2_app_client_id,omitempty"` - - Oauth2AppIntegrationId string `json:"oauth2_app_integration_id,omitempty"` - - PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` - - Resources []AppResource `json:"resources,omitempty"` - - ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` - - ServicePrincipalId int64 `json:"service_principal_id,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - Updater string `json:"updater,omitempty"` - - Url string `json:"url,omitempty"` - - UserApiScopes []string `json:"user_api_scopes,omitempty"` + ActiveDeployment *AppDeployment `json:"active_deployment,omitempty"` + AppStatus *ApplicationStatus `json:"app_status,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + ComputeStatus *ComputeStatus `json:"compute_status,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + Description string `json:"description,omitempty"` + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + EffectiveUserApiScopes []string `json:"effective_user_api_scopes,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name"` + Oauth2AppClientId string `json:"oauth2_app_client_id,omitempty"` + Oauth2AppIntegrationId string `json:"oauth2_app_integration_id,omitempty"` + PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` + Resources []AppResource `json:"resources,omitempty"` + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + Updater string `json:"updater,omitempty"` + Url string `json:"url,omitempty"` + UserApiScopes []string `json:"user_api_scopes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -158,11 +118,8 @@ func appAccessControlRequestToPb(st *AppAccessControlRequest) (*appAccessControl } pb := &appAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -170,13 +127,10 @@ func appAccessControlRequestToPb(st *AppAccessControlRequest) (*appAccessControl } type appAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -209,13 +163,9 @@ func appAccessControlResponseToPb(st *AppAccessControlResponse) (*appAccessContr } pb := &appAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -223,15 +173,11 @@ func appAccessControlResponseToPb(st *AppAccessControlResponse) (*appAccessContr } type appAccessControlResponsePb struct { - AllPermissions []AppPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []AppPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -265,19 +211,12 @@ func appDeploymentToPb(st *AppDeployment) (*appDeploymentPb, error) { } pb := &appDeploymentPb{} pb.CreateTime = st.CreateTime - pb.Creator = st.Creator - pb.DeploymentArtifacts = st.DeploymentArtifacts - pb.DeploymentId = st.DeploymentId - pb.Mode = st.Mode - pb.SourceCodePath = st.SourceCodePath - pb.Status = st.Status - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -285,21 +224,14 @@ func appDeploymentToPb(st *AppDeployment) (*appDeploymentPb, error) { } type appDeploymentPb struct { - CreateTime string `json:"create_time,omitempty"` - - Creator string `json:"creator,omitempty"` - + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` DeploymentArtifacts *AppDeploymentArtifacts `json:"deployment_artifacts,omitempty"` - - DeploymentId string `json:"deployment_id,omitempty"` - - Mode AppDeploymentMode `json:"mode,omitempty"` - - SourceCodePath string `json:"source_code_path,omitempty"` - - Status *AppDeploymentStatus `json:"status,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode AppDeploymentMode `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *AppDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -372,7 +304,6 @@ func appDeploymentStatusToPb(st *AppDeploymentStatus) (*appDeploymentStatusPb, e } pb := &appDeploymentStatusPb{} pb.Message = st.Message - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -380,9 +311,8 @@ func appDeploymentStatusToPb(st *AppDeploymentStatus) (*appDeploymentStatusPb, e } type appDeploymentStatusPb struct { - Message string `json:"message,omitempty"` - - State AppDeploymentState `json:"state,omitempty"` + Message string `json:"message,omitempty"` + State AppDeploymentState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -413,9 +343,7 @@ func appPermissionToPb(st *AppPermission) (*appPermissionPb, error) { } pb := &appPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -423,11 +351,9 @@ func appPermissionToPb(st *AppPermission) (*appPermissionPb, error) { } type appPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -459,9 +385,7 @@ func appPermissionsToPb(st *AppPermissions) (*appPermissionsPb, error) { } pb := &appPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -470,10 +394,8 @@ func appPermissionsToPb(st *AppPermissions) (*appPermissionsPb, error) { type appPermissionsPb struct { AccessControlList []AppAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -505,7 +427,6 @@ func appPermissionsDescriptionToPb(st *AppPermissionsDescription) (*appPermissio } pb := &appPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -513,8 +434,7 @@ func appPermissionsDescriptionToPb(st *AppPermissionsDescription) (*appPermissio } type appPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel AppPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -546,7 +466,6 @@ func appPermissionsRequestToPb(st *AppPermissionsRequest) (*appPermissionsReques } pb := &appPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.AppName = st.AppName return pb, nil @@ -554,8 +473,7 @@ func appPermissionsRequestToPb(st *AppPermissionsRequest) (*appPermissionsReques type appPermissionsRequestPb struct { AccessControlList []AppAccessControlRequest `json:"access_control_list,omitempty"` - - AppName string `json:"-" url:"-"` + AppName string `json:"-" url:"-"` } func appPermissionsRequestFromPb(pb *appPermissionsRequestPb) (*AppPermissionsRequest, error) { @@ -575,17 +493,11 @@ func appResourceToPb(st *AppResource) (*appResourcePb, error) { } pb := &appResourcePb{} pb.Description = st.Description - pb.Job = st.Job - pb.Name = st.Name - pb.Secret = st.Secret - pb.ServingEndpoint = st.ServingEndpoint - pb.SqlWarehouse = st.SqlWarehouse - pb.UcSecurable = st.UcSecurable pb.ForceSendFields = st.ForceSendFields @@ -593,19 +505,13 @@ func appResourceToPb(st *AppResource) (*appResourcePb, error) { } type appResourcePb struct { - Description string `json:"description,omitempty"` - - Job *AppResourceJob `json:"job,omitempty"` - - Name string `json:"name"` - - Secret *AppResourceSecret `json:"secret,omitempty"` - + Description string `json:"description,omitempty"` + Job *AppResourceJob `json:"job,omitempty"` + Name string `json:"name"` + Secret *AppResourceSecret `json:"secret,omitempty"` ServingEndpoint *AppResourceServingEndpoint `json:"serving_endpoint,omitempty"` - - SqlWarehouse *AppResourceSqlWarehouse `json:"sql_warehouse,omitempty"` - - UcSecurable *AppResourceUcSecurable `json:"uc_securable,omitempty"` + SqlWarehouse *AppResourceSqlWarehouse `json:"sql_warehouse,omitempty"` + UcSecurable *AppResourceUcSecurable `json:"uc_securable,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -641,15 +547,13 @@ func appResourceJobToPb(st *AppResourceJob) (*appResourceJobPb, error) { } pb := &appResourceJobPb{} pb.Id = st.Id - pb.Permission = st.Permission return pb, nil } type appResourceJobPb struct { - Id string `json:"id"` - + Id string `json:"id"` Permission AppResourceJobJobPermission `json:"permission"` } @@ -670,20 +574,16 @@ func appResourceSecretToPb(st *AppResourceSecret) (*appResourceSecretPb, error) } pb := &appResourceSecretPb{} pb.Key = st.Key - pb.Permission = st.Permission - pb.Scope = st.Scope return pb, nil } type appResourceSecretPb struct { - Key string `json:"key"` - + Key string `json:"key"` Permission AppResourceSecretSecretPermission `json:"permission"` - - Scope string `json:"scope"` + Scope string `json:"scope"` } func appResourceSecretFromPb(pb *appResourceSecretPb) (*AppResourceSecret, error) { @@ -704,15 +604,13 @@ func appResourceServingEndpointToPb(st *AppResourceServingEndpoint) (*appResourc } pb := &appResourceServingEndpointPb{} pb.Name = st.Name - pb.Permission = st.Permission return pb, nil } type appResourceServingEndpointPb struct { - Name string `json:"name"` - + Name string `json:"name"` Permission AppResourceServingEndpointServingEndpointPermission `json:"permission"` } @@ -733,15 +631,13 @@ func appResourceSqlWarehouseToPb(st *AppResourceSqlWarehouse) (*appResourceSqlWa } pb := &appResourceSqlWarehousePb{} pb.Id = st.Id - pb.Permission = st.Permission return pb, nil } type appResourceSqlWarehousePb struct { - Id string `json:"id"` - + Id string `json:"id"` Permission AppResourceSqlWarehouseSqlWarehousePermission `json:"permission"` } @@ -762,20 +658,16 @@ func appResourceUcSecurableToPb(st *AppResourceUcSecurable) (*appResourceUcSecur } pb := &appResourceUcSecurablePb{} pb.Permission = st.Permission - pb.SecurableFullName = st.SecurableFullName - pb.SecurableType = st.SecurableType return pb, nil } type appResourceUcSecurablePb struct { - Permission AppResourceUcSecurableUcSecurablePermission `json:"permission"` - - SecurableFullName string `json:"securable_full_name"` - - SecurableType AppResourceUcSecurableUcSecurableType `json:"securable_type"` + Permission AppResourceUcSecurableUcSecurablePermission `json:"permission"` + SecurableFullName string `json:"securable_full_name"` + SecurableType AppResourceUcSecurableUcSecurableType `json:"securable_type"` } func appResourceUcSecurableFromPb(pb *appResourceUcSecurablePb) (*AppResourceUcSecurable, error) { @@ -796,7 +688,6 @@ func applicationStatusToPb(st *ApplicationStatus) (*applicationStatusPb, error) } pb := &applicationStatusPb{} pb.Message = st.Message - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -804,9 +695,8 @@ func applicationStatusToPb(st *ApplicationStatus) (*applicationStatusPb, error) } type applicationStatusPb struct { - Message string `json:"message,omitempty"` - - State ApplicationState `json:"state,omitempty"` + Message string `json:"message,omitempty"` + State ApplicationState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -837,7 +727,6 @@ func computeStatusToPb(st *ComputeStatus) (*computeStatusPb, error) { } pb := &computeStatusPb{} pb.Message = st.Message - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -845,9 +734,8 @@ func computeStatusToPb(st *ComputeStatus) (*computeStatusPb, error) { } type computeStatusPb struct { - Message string `json:"message,omitempty"` - - State ComputeState `json:"state,omitempty"` + Message string `json:"message,omitempty"` + State ComputeState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -878,7 +766,6 @@ func createAppDeploymentRequestToPb(st *CreateAppDeploymentRequest) (*createAppD } pb := &createAppDeploymentRequestPb{} pb.AppDeployment = st.AppDeployment - pb.AppName = st.AppName return pb, nil @@ -886,8 +773,7 @@ func createAppDeploymentRequestToPb(st *CreateAppDeploymentRequest) (*createAppD type createAppDeploymentRequestPb struct { AppDeployment AppDeployment `json:"app_deployment"` - - AppName string `json:"-" url:"-"` + AppName string `json:"-" url:"-"` } func createAppDeploymentRequestFromPb(pb *createAppDeploymentRequestPb) (*CreateAppDeploymentRequest, error) { @@ -907,7 +793,6 @@ func createAppRequestToPb(st *CreateAppRequest) (*createAppRequestPb, error) { } pb := &createAppRequestPb{} pb.App = st.App - pb.NoCompute = st.NoCompute pb.ForceSendFields = st.ForceSendFields @@ -915,8 +800,7 @@ func createAppRequestToPb(st *CreateAppRequest) (*createAppRequestPb, error) { } type createAppRequestPb struct { - App App `json:"app"` - + App App `json:"app"` NoCompute bool `json:"-" url:"no_compute,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -972,15 +856,13 @@ func getAppDeploymentRequestToPb(st *GetAppDeploymentRequest) (*getAppDeployment } pb := &getAppDeploymentRequestPb{} pb.AppName = st.AppName - pb.DeploymentId = st.DeploymentId return pb, nil } type getAppDeploymentRequestPb struct { - AppName string `json:"-" url:"-"` - + AppName string `json:"-" url:"-"` DeploymentId string `json:"-" url:"-"` } @@ -1097,9 +979,7 @@ func listAppDeploymentsRequestToPb(st *ListAppDeploymentsRequest) (*listAppDeplo } pb := &listAppDeploymentsRequestPb{} pb.AppName = st.AppName - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1107,10 +987,8 @@ func listAppDeploymentsRequestToPb(st *ListAppDeploymentsRequest) (*listAppDeplo } type listAppDeploymentsRequestPb struct { - AppName string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + AppName string `json:"-" url:"-"` + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1143,7 +1021,6 @@ func listAppDeploymentsResponseToPb(st *ListAppDeploymentsResponse) (*listAppDep } pb := &listAppDeploymentsResponsePb{} pb.AppDeployments = st.AppDeployments - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1152,8 +1029,7 @@ func listAppDeploymentsResponseToPb(st *ListAppDeploymentsResponse) (*listAppDep type listAppDeploymentsResponsePb struct { AppDeployments []AppDeployment `json:"app_deployments,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1184,7 +1060,6 @@ func listAppsRequestToPb(st *ListAppsRequest) (*listAppsRequestPb, error) { } pb := &listAppsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1192,8 +1067,7 @@ func listAppsRequestToPb(st *ListAppsRequest) (*listAppsRequestPb, error) { } type listAppsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1225,7 +1099,6 @@ func listAppsResponseToPb(st *ListAppsResponse) (*listAppsResponsePb, error) { } pb := &listAppsResponsePb{} pb.Apps = st.Apps - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1233,8 +1106,7 @@ func listAppsResponseToPb(st *ListAppsResponse) (*listAppsResponsePb, error) { } type listAppsResponsePb struct { - Apps []App `json:"apps,omitempty"` - + Apps []App `json:"apps,omitempty"` NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1314,15 +1186,13 @@ func updateAppRequestToPb(st *UpdateAppRequest) (*updateAppRequestPb, error) { } pb := &updateAppRequestPb{} pb.App = st.App - pb.Name = st.Name return pb, nil } type updateAppRequestPb struct { - App App `json:"app"` - + App App `json:"app"` Name string `json:"-" url:"-"` } @@ -1336,3 +1206,57 @@ func updateAppRequestFromPb(pb *updateAppRequestPb) (*UpdateAppRequest, error) { return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/apps/model.go b/service/apps/model.go index f635ade9c..6c610fd0d 100755 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -5,8 +5,6 @@ package apps import ( "encoding/json" "fmt" - "strings" - "time" ) type App struct { @@ -1621,57 +1619,3 @@ func (st UpdateAppRequest) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/billing/internal.go b/service/billing/internal.go index 17e9bc8fe..0eb7960b0 100755 --- a/service/billing/internal.go +++ b/service/billing/internal.go @@ -3,7 +3,10 @@ package billing import ( + "fmt" "io" + "strings" + "time" "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" @@ -15,9 +18,7 @@ func actionConfigurationToPb(st *ActionConfiguration) (*actionConfigurationPb, e } pb := &actionConfigurationPb{} pb.ActionConfigurationId = st.ActionConfigurationId - pb.ActionType = st.ActionType - pb.Target = st.Target pb.ForceSendFields = st.ForceSendFields @@ -25,11 +26,9 @@ func actionConfigurationToPb(st *ActionConfiguration) (*actionConfigurationPb, e } type actionConfigurationPb struct { - ActionConfigurationId string `json:"action_configuration_id,omitempty"` - - ActionType ActionConfigurationType `json:"action_type,omitempty"` - - Target string `json:"target,omitempty"` + ActionConfigurationId string `json:"action_configuration_id,omitempty"` + ActionType ActionConfigurationType `json:"action_type,omitempty"` + Target string `json:"target,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -61,15 +60,10 @@ func alertConfigurationToPb(st *AlertConfiguration) (*alertConfigurationPb, erro } pb := &alertConfigurationPb{} pb.ActionConfigurations = st.ActionConfigurations - pb.AlertConfigurationId = st.AlertConfigurationId - pb.QuantityThreshold = st.QuantityThreshold - pb.QuantityType = st.QuantityType - pb.TimePeriod = st.TimePeriod - pb.TriggerType = st.TriggerType pb.ForceSendFields = st.ForceSendFields @@ -77,17 +71,12 @@ func alertConfigurationToPb(st *AlertConfiguration) (*alertConfigurationPb, erro } type alertConfigurationPb struct { - ActionConfigurations []ActionConfiguration `json:"action_configurations,omitempty"` - - AlertConfigurationId string `json:"alert_configuration_id,omitempty"` - - QuantityThreshold string `json:"quantity_threshold,omitempty"` - - QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` - - TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` - - TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + ActionConfigurations []ActionConfiguration `json:"action_configurations,omitempty"` + AlertConfigurationId string `json:"alert_configuration_id,omitempty"` + QuantityThreshold string `json:"quantity_threshold,omitempty"` + QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -122,17 +111,11 @@ func budgetConfigurationToPb(st *BudgetConfiguration) (*budgetConfigurationPb, e } pb := &budgetConfigurationPb{} pb.AccountId = st.AccountId - pb.AlertConfigurations = st.AlertConfigurations - pb.BudgetConfigurationId = st.BudgetConfigurationId - pb.CreateTime = st.CreateTime - pb.DisplayName = st.DisplayName - pb.Filter = st.Filter - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -140,19 +123,13 @@ func budgetConfigurationToPb(st *BudgetConfiguration) (*budgetConfigurationPb, e } type budgetConfigurationPb struct { - AccountId string `json:"account_id,omitempty"` - - AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` - - BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` - - CreateTime int64 `json:"create_time,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` - - UpdateTime int64 `json:"update_time,omitempty"` + AccountId string `json:"account_id,omitempty"` + AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + CreateTime int64 `json:"create_time,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + UpdateTime int64 `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -188,15 +165,13 @@ func budgetConfigurationFilterToPb(st *BudgetConfigurationFilter) (*budgetConfig } pb := &budgetConfigurationFilterPb{} pb.Tags = st.Tags - pb.WorkspaceId = st.WorkspaceId return pb, nil } type budgetConfigurationFilterPb struct { - Tags []BudgetConfigurationFilterTagClause `json:"tags,omitempty"` - + Tags []BudgetConfigurationFilterTagClause `json:"tags,omitempty"` WorkspaceId *BudgetConfigurationFilterWorkspaceIdClause `json:"workspace_id,omitempty"` } @@ -217,7 +192,6 @@ func budgetConfigurationFilterClauseToPb(st *BudgetConfigurationFilterClause) (* } pb := &budgetConfigurationFilterClausePb{} pb.Operator = st.Operator - pb.Values = st.Values return pb, nil @@ -225,8 +199,7 @@ func budgetConfigurationFilterClauseToPb(st *BudgetConfigurationFilterClause) (* type budgetConfigurationFilterClausePb struct { Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` - - Values []string `json:"values,omitempty"` + Values []string `json:"values,omitempty"` } func budgetConfigurationFilterClauseFromPb(pb *budgetConfigurationFilterClausePb) (*BudgetConfigurationFilterClause, error) { @@ -246,7 +219,6 @@ func budgetConfigurationFilterTagClauseToPb(st *BudgetConfigurationFilterTagClau } pb := &budgetConfigurationFilterTagClausePb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -254,8 +226,7 @@ func budgetConfigurationFilterTagClauseToPb(st *BudgetConfigurationFilterTagClau } type budgetConfigurationFilterTagClausePb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value *BudgetConfigurationFilterClause `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -287,7 +258,6 @@ func budgetConfigurationFilterWorkspaceIdClauseToPb(st *BudgetConfigurationFilte } pb := &budgetConfigurationFilterWorkspaceIdClausePb{} pb.Operator = st.Operator - pb.Values = st.Values return pb, nil @@ -295,8 +265,7 @@ func budgetConfigurationFilterWorkspaceIdClauseToPb(st *BudgetConfigurationFilte type budgetConfigurationFilterWorkspaceIdClausePb struct { Operator BudgetConfigurationFilterOperator `json:"operator,omitempty"` - - Values []int64 `json:"values,omitempty"` + Values []int64 `json:"values,omitempty"` } func budgetConfigurationFilterWorkspaceIdClauseFromPb(pb *budgetConfigurationFilterWorkspaceIdClausePb) (*BudgetConfigurationFilterWorkspaceIdClause, error) { @@ -316,11 +285,8 @@ func budgetPolicyToPb(st *BudgetPolicy) (*budgetPolicyPb, error) { } pb := &budgetPolicyPb{} pb.BindingWorkspaceIds = st.BindingWorkspaceIds - pb.CustomTags = st.CustomTags - pb.PolicyId = st.PolicyId - pb.PolicyName = st.PolicyName pb.ForceSendFields = st.ForceSendFields @@ -328,13 +294,10 @@ func budgetPolicyToPb(st *BudgetPolicy) (*budgetPolicyPb, error) { } type budgetPolicyPb struct { - BindingWorkspaceIds []int64 `json:"binding_workspace_ids,omitempty"` - - CustomTags []compute.CustomPolicyTag `json:"custom_tags,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - PolicyName string `json:"policy_name,omitempty"` + BindingWorkspaceIds []int64 `json:"binding_workspace_ids,omitempty"` + CustomTags []compute.CustomPolicyTag `json:"custom_tags,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + PolicyName string `json:"policy_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -367,7 +330,6 @@ func createBillingUsageDashboardRequestToPb(st *CreateBillingUsageDashboardReque } pb := &createBillingUsageDashboardRequestPb{} pb.DashboardType = st.DashboardType - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -376,8 +338,7 @@ func createBillingUsageDashboardRequestToPb(st *CreateBillingUsageDashboardReque type createBillingUsageDashboardRequestPb struct { DashboardType UsageDashboardType `json:"dashboard_type,omitempty"` - - WorkspaceId int64 `json:"workspace_id,omitempty"` + WorkspaceId int64 `json:"workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -444,11 +405,8 @@ func createBudgetConfigurationBudgetToPb(st *CreateBudgetConfigurationBudget) (* } pb := &createBudgetConfigurationBudgetPb{} pb.AccountId = st.AccountId - pb.AlertConfigurations = st.AlertConfigurations - pb.DisplayName = st.DisplayName - pb.Filter = st.Filter pb.ForceSendFields = st.ForceSendFields @@ -456,13 +414,10 @@ func createBudgetConfigurationBudgetToPb(st *CreateBudgetConfigurationBudget) (* } type createBudgetConfigurationBudgetPb struct { - AccountId string `json:"account_id,omitempty"` - + AccountId string `json:"account_id,omitempty"` AlertConfigurations []CreateBudgetConfigurationBudgetAlertConfigurations `json:"alert_configurations,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -495,7 +450,6 @@ func createBudgetConfigurationBudgetActionConfigurationsToPb(st *CreateBudgetCon } pb := &createBudgetConfigurationBudgetActionConfigurationsPb{} pb.ActionType = st.ActionType - pb.Target = st.Target pb.ForceSendFields = st.ForceSendFields @@ -504,8 +458,7 @@ func createBudgetConfigurationBudgetActionConfigurationsToPb(st *CreateBudgetCon type createBudgetConfigurationBudgetActionConfigurationsPb struct { ActionType ActionConfigurationType `json:"action_type,omitempty"` - - Target string `json:"target,omitempty"` + Target string `json:"target,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -536,13 +489,9 @@ func createBudgetConfigurationBudgetAlertConfigurationsToPb(st *CreateBudgetConf } pb := &createBudgetConfigurationBudgetAlertConfigurationsPb{} pb.ActionConfigurations = st.ActionConfigurations - pb.QuantityThreshold = st.QuantityThreshold - pb.QuantityType = st.QuantityType - pb.TimePeriod = st.TimePeriod - pb.TriggerType = st.TriggerType pb.ForceSendFields = st.ForceSendFields @@ -551,14 +500,10 @@ func createBudgetConfigurationBudgetAlertConfigurationsToPb(st *CreateBudgetConf type createBudgetConfigurationBudgetAlertConfigurationsPb struct { ActionConfigurations []CreateBudgetConfigurationBudgetActionConfigurations `json:"action_configurations,omitempty"` - - QuantityThreshold string `json:"quantity_threshold,omitempty"` - - QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` - - TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` - - TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` + QuantityThreshold string `json:"quantity_threshold,omitempty"` + QuantityType AlertConfigurationQuantityType `json:"quantity_type,omitempty"` + TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` + TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -640,7 +585,6 @@ func createBudgetPolicyRequestToPb(st *CreateBudgetPolicyRequest) (*createBudget } pb := &createBudgetPolicyRequestPb{} pb.Policy = st.Policy - pb.RequestId = st.RequestId pb.ForceSendFields = st.ForceSendFields @@ -648,9 +592,8 @@ func createBudgetPolicyRequestToPb(st *CreateBudgetPolicyRequest) (*createBudget } type createBudgetPolicyRequestPb struct { - Policy *BudgetPolicy `json:"policy,omitempty"` - - RequestId string `json:"request_id,omitempty"` + Policy *BudgetPolicy `json:"policy,omitempty"` + RequestId string `json:"request_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -681,21 +624,13 @@ func createLogDeliveryConfigurationParamsToPb(st *CreateLogDeliveryConfiguration } pb := &createLogDeliveryConfigurationParamsPb{} pb.ConfigName = st.ConfigName - pb.CredentialsId = st.CredentialsId - pb.DeliveryPathPrefix = st.DeliveryPathPrefix - pb.DeliveryStartTime = st.DeliveryStartTime - pb.LogType = st.LogType - pb.OutputFormat = st.OutputFormat - pb.Status = st.Status - pb.StorageConfigurationId = st.StorageConfigurationId - pb.WorkspaceIdsFilter = st.WorkspaceIdsFilter pb.ForceSendFields = st.ForceSendFields @@ -703,23 +638,15 @@ func createLogDeliveryConfigurationParamsToPb(st *CreateLogDeliveryConfiguration } type createLogDeliveryConfigurationParamsPb struct { - ConfigName string `json:"config_name,omitempty"` - - CredentialsId string `json:"credentials_id"` - - DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` - - DeliveryStartTime string `json:"delivery_start_time,omitempty"` - - LogType LogType `json:"log_type"` - - OutputFormat OutputFormat `json:"output_format"` - - Status LogDeliveryConfigStatus `json:"status,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id"` - - WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + ConfigName string `json:"config_name,omitempty"` + CredentialsId string `json:"credentials_id"` + DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + DeliveryStartTime string `json:"delivery_start_time,omitempty"` + LogType LogType `json:"log_type"` + OutputFormat OutputFormat `json:"output_format"` + Status LogDeliveryConfigStatus `json:"status,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id"` + WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -847,9 +774,7 @@ func downloadRequestToPb(st *DownloadRequest) (*downloadRequestPb, error) { } pb := &downloadRequestPb{} pb.EndMonth = st.EndMonth - pb.PersonalData = st.PersonalData - pb.StartMonth = st.StartMonth pb.ForceSendFields = st.ForceSendFields @@ -857,11 +782,9 @@ func downloadRequestToPb(st *DownloadRequest) (*downloadRequestPb, error) { } type downloadRequestPb struct { - EndMonth string `json:"-" url:"end_month"` - - PersonalData bool `json:"-" url:"personal_data,omitempty"` - - StartMonth string `json:"-" url:"start_month"` + EndMonth string `json:"-" url:"end_month"` + PersonalData bool `json:"-" url:"personal_data,omitempty"` + StartMonth string `json:"-" url:"start_month"` ForceSendFields []string `json:"-" url:"-"` } @@ -917,9 +840,7 @@ func filterToPb(st *Filter) (*filterPb, error) { } pb := &filterPb{} pb.CreatorUserId = st.CreatorUserId - pb.CreatorUserName = st.CreatorUserName - pb.PolicyName = st.PolicyName pb.ForceSendFields = st.ForceSendFields @@ -927,11 +848,9 @@ func filterToPb(st *Filter) (*filterPb, error) { } type filterPb struct { - CreatorUserId int64 `json:"creator_user_id,omitempty" url:"creator_user_id,omitempty"` - + CreatorUserId int64 `json:"creator_user_id,omitempty" url:"creator_user_id,omitempty"` CreatorUserName string `json:"creator_user_name,omitempty" url:"creator_user_name,omitempty"` - - PolicyName string `json:"policy_name,omitempty" url:"policy_name,omitempty"` + PolicyName string `json:"policy_name,omitempty" url:"policy_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -963,7 +882,6 @@ func getBillingUsageDashboardRequestToPb(st *GetBillingUsageDashboardRequest) (* } pb := &getBillingUsageDashboardRequestPb{} pb.DashboardType = st.DashboardType - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -972,8 +890,7 @@ func getBillingUsageDashboardRequestToPb(st *GetBillingUsageDashboardRequest) (* type getBillingUsageDashboardRequestPb struct { DashboardType UsageDashboardType `json:"-" url:"dashboard_type,omitempty"` - - WorkspaceId int64 `json:"-" url:"workspace_id,omitempty"` + WorkspaceId int64 `json:"-" url:"workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1004,7 +921,6 @@ func getBillingUsageDashboardResponseToPb(st *GetBillingUsageDashboardResponse) } pb := &getBillingUsageDashboardResponsePb{} pb.DashboardId = st.DashboardId - pb.DashboardUrl = st.DashboardUrl pb.ForceSendFields = st.ForceSendFields @@ -1012,8 +928,7 @@ func getBillingUsageDashboardResponseToPb(st *GetBillingUsageDashboardResponse) } type getBillingUsageDashboardResponsePb struct { - DashboardId string `json:"dashboard_id,omitempty"` - + DashboardId string `json:"dashboard_id,omitempty"` DashboardUrl string `json:"dashboard_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1198,7 +1113,6 @@ func listBudgetConfigurationsResponseToPb(st *ListBudgetConfigurationsResponse) } pb := &listBudgetConfigurationsResponsePb{} pb.Budgets = st.Budgets - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1206,9 +1120,8 @@ func listBudgetConfigurationsResponseToPb(st *ListBudgetConfigurationsResponse) } type listBudgetConfigurationsResponsePb struct { - Budgets []BudgetConfiguration `json:"budgets,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Budgets []BudgetConfiguration `json:"budgets,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1239,11 +1152,8 @@ func listBudgetPoliciesRequestToPb(st *ListBudgetPoliciesRequest) (*listBudgetPo } pb := &listBudgetPoliciesRequestPb{} pb.FilterBy = st.FilterBy - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.SortSpec = st.SortSpec pb.ForceSendFields = st.ForceSendFields @@ -1251,13 +1161,10 @@ func listBudgetPoliciesRequestToPb(st *ListBudgetPoliciesRequest) (*listBudgetPo } type listBudgetPoliciesRequestPb struct { - FilterBy *Filter `json:"-" url:"filter_by,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SortSpec *SortSpec `json:"-" url:"sort_spec,omitempty"` + FilterBy *Filter `json:"-" url:"filter_by,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SortSpec *SortSpec `json:"-" url:"sort_spec,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1290,9 +1197,7 @@ func listBudgetPoliciesResponseToPb(st *ListBudgetPoliciesResponse) (*listBudget } pb := &listBudgetPoliciesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Policies = st.Policies - pb.PreviousPageToken = st.PreviousPageToken pb.ForceSendFields = st.ForceSendFields @@ -1300,11 +1205,9 @@ func listBudgetPoliciesResponseToPb(st *ListBudgetPoliciesResponse) (*listBudget } type listBudgetPoliciesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Policies []BudgetPolicy `json:"policies,omitempty"` - - PreviousPageToken string `json:"previous_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Policies []BudgetPolicy `json:"policies,omitempty"` + PreviousPageToken string `json:"previous_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1336,9 +1239,7 @@ func listLogDeliveryRequestToPb(st *ListLogDeliveryRequest) (*listLogDeliveryReq } pb := &listLogDeliveryRequestPb{} pb.CredentialsId = st.CredentialsId - pb.Status = st.Status - pb.StorageConfigurationId = st.StorageConfigurationId pb.ForceSendFields = st.ForceSendFields @@ -1346,11 +1247,9 @@ func listLogDeliveryRequestToPb(st *ListLogDeliveryRequest) (*listLogDeliveryReq } type listLogDeliveryRequestPb struct { - CredentialsId string `json:"-" url:"credentials_id,omitempty"` - - Status LogDeliveryConfigStatus `json:"-" url:"status,omitempty"` - - StorageConfigurationId string `json:"-" url:"storage_configuration_id,omitempty"` + CredentialsId string `json:"-" url:"credentials_id,omitempty"` + Status LogDeliveryConfigStatus `json:"-" url:"status,omitempty"` + StorageConfigurationId string `json:"-" url:"storage_configuration_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1382,31 +1281,18 @@ func logDeliveryConfigurationToPb(st *LogDeliveryConfiguration) (*logDeliveryCon } pb := &logDeliveryConfigurationPb{} pb.AccountId = st.AccountId - pb.ConfigId = st.ConfigId - pb.ConfigName = st.ConfigName - pb.CreationTime = st.CreationTime - pb.CredentialsId = st.CredentialsId - pb.DeliveryPathPrefix = st.DeliveryPathPrefix - pb.DeliveryStartTime = st.DeliveryStartTime - pb.LogDeliveryStatus = st.LogDeliveryStatus - pb.LogType = st.LogType - pb.OutputFormat = st.OutputFormat - pb.Status = st.Status - pb.StorageConfigurationId = st.StorageConfigurationId - pb.UpdateTime = st.UpdateTime - pb.WorkspaceIdsFilter = st.WorkspaceIdsFilter pb.ForceSendFields = st.ForceSendFields @@ -1414,33 +1300,20 @@ func logDeliveryConfigurationToPb(st *LogDeliveryConfiguration) (*logDeliveryCon } type logDeliveryConfigurationPb struct { - AccountId string `json:"account_id,omitempty"` - - ConfigId string `json:"config_id,omitempty"` - - ConfigName string `json:"config_name,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - CredentialsId string `json:"credentials_id,omitempty"` - - DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` - - DeliveryStartTime string `json:"delivery_start_time,omitempty"` - - LogDeliveryStatus *LogDeliveryStatus `json:"log_delivery_status,omitempty"` - - LogType LogType `json:"log_type,omitempty"` - - OutputFormat OutputFormat `json:"output_format,omitempty"` - - Status LogDeliveryConfigStatus `json:"status,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` - - UpdateTime int64 `json:"update_time,omitempty"` - - WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` + AccountId string `json:"account_id,omitempty"` + ConfigId string `json:"config_id,omitempty"` + ConfigName string `json:"config_name,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + CredentialsId string `json:"credentials_id,omitempty"` + DeliveryPathPrefix string `json:"delivery_path_prefix,omitempty"` + DeliveryStartTime string `json:"delivery_start_time,omitempty"` + LogDeliveryStatus *LogDeliveryStatus `json:"log_delivery_status,omitempty"` + LogType LogType `json:"log_type,omitempty"` + OutputFormat OutputFormat `json:"output_format,omitempty"` + Status LogDeliveryConfigStatus `json:"status,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + UpdateTime int64 `json:"update_time,omitempty"` + WorkspaceIdsFilter []int64 `json:"workspace_ids_filter,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1483,11 +1356,8 @@ func logDeliveryStatusToPb(st *LogDeliveryStatus) (*logDeliveryStatusPb, error) } pb := &logDeliveryStatusPb{} pb.LastAttemptTime = st.LastAttemptTime - pb.LastSuccessfulAttemptTime = st.LastSuccessfulAttemptTime - pb.Message = st.Message - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -1495,13 +1365,10 @@ func logDeliveryStatusToPb(st *LogDeliveryStatus) (*logDeliveryStatusPb, error) } type logDeliveryStatusPb struct { - LastAttemptTime string `json:"last_attempt_time,omitempty"` - - LastSuccessfulAttemptTime string `json:"last_successful_attempt_time,omitempty"` - - Message string `json:"message,omitempty"` - - Status DeliveryStatus `json:"status,omitempty"` + LastAttemptTime string `json:"last_attempt_time,omitempty"` + LastSuccessfulAttemptTime string `json:"last_successful_attempt_time,omitempty"` + Message string `json:"message,omitempty"` + Status DeliveryStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1555,7 +1422,6 @@ func sortSpecToPb(st *SortSpec) (*sortSpecPb, error) { } pb := &sortSpecPb{} pb.Descending = st.Descending - pb.Field = st.Field pb.ForceSendFields = st.ForceSendFields @@ -1563,9 +1429,8 @@ func sortSpecToPb(st *SortSpec) (*sortSpecPb, error) { } type sortSpecPb struct { - Descending bool `json:"descending,omitempty" url:"descending,omitempty"` - - Field SortSpecField `json:"field,omitempty" url:"field,omitempty"` + Descending bool `json:"descending,omitempty" url:"descending,omitempty"` + Field SortSpecField `json:"field,omitempty" url:"field,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1596,13 +1461,9 @@ func updateBudgetConfigurationBudgetToPb(st *UpdateBudgetConfigurationBudget) (* } pb := &updateBudgetConfigurationBudgetPb{} pb.AccountId = st.AccountId - pb.AlertConfigurations = st.AlertConfigurations - pb.BudgetConfigurationId = st.BudgetConfigurationId - pb.DisplayName = st.DisplayName - pb.Filter = st.Filter pb.ForceSendFields = st.ForceSendFields @@ -1610,15 +1471,11 @@ func updateBudgetConfigurationBudgetToPb(st *UpdateBudgetConfigurationBudget) (* } type updateBudgetConfigurationBudgetPb struct { - AccountId string `json:"account_id,omitempty"` - - AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` - - BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Filter *BudgetConfigurationFilter `json:"filter,omitempty"` + AccountId string `json:"account_id,omitempty"` + AlertConfigurations []AlertConfiguration `json:"alert_configurations,omitempty"` + BudgetConfigurationId string `json:"budget_configuration_id,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Filter *BudgetConfigurationFilter `json:"filter,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1652,16 +1509,14 @@ func updateBudgetConfigurationRequestToPb(st *UpdateBudgetConfigurationRequest) } pb := &updateBudgetConfigurationRequestPb{} pb.Budget = st.Budget - pb.BudgetId = st.BudgetId return pb, nil } type updateBudgetConfigurationRequestPb struct { - Budget UpdateBudgetConfigurationBudget `json:"budget"` - - BudgetId string `json:"-" url:"-"` + Budget UpdateBudgetConfigurationBudget `json:"budget"` + BudgetId string `json:"-" url:"-"` } func updateBudgetConfigurationRequestFromPb(pb *updateBudgetConfigurationRequestPb) (*UpdateBudgetConfigurationRequest, error) { @@ -1705,9 +1560,7 @@ func updateBudgetPolicyRequestToPb(st *UpdateBudgetPolicyRequest) (*updateBudget } pb := &updateBudgetPolicyRequestPb{} pb.LimitConfig = st.LimitConfig - pb.Policy = st.Policy - pb.PolicyId = st.PolicyId return pb, nil @@ -1715,10 +1568,8 @@ func updateBudgetPolicyRequestToPb(st *UpdateBudgetPolicyRequest) (*updateBudget type updateBudgetPolicyRequestPb struct { LimitConfig *LimitConfig `json:"-" url:"limit_config,omitempty"` - - Policy BudgetPolicy `json:"policy"` - - PolicyId string `json:"-" url:"-"` + Policy BudgetPolicy `json:"policy"` + PolicyId string `json:"-" url:"-"` } func updateBudgetPolicyRequestFromPb(pb *updateBudgetPolicyRequestPb) (*UpdateBudgetPolicyRequest, error) { @@ -1739,16 +1590,14 @@ func updateLogDeliveryConfigurationStatusRequestToPb(st *UpdateLogDeliveryConfig } pb := &updateLogDeliveryConfigurationStatusRequestPb{} pb.LogDeliveryConfigurationId = st.LogDeliveryConfigurationId - pb.Status = st.Status return pb, nil } type updateLogDeliveryConfigurationStatusRequestPb struct { - LogDeliveryConfigurationId string `json:"-" url:"-"` - - Status LogDeliveryConfigStatus `json:"status"` + LogDeliveryConfigurationId string `json:"-" url:"-"` + Status LogDeliveryConfigStatus `json:"status"` } func updateLogDeliveryConfigurationStatusRequestFromPb(pb *updateLogDeliveryConfigurationStatusRequestPb) (*UpdateLogDeliveryConfigurationStatusRequest, error) { @@ -1833,3 +1682,57 @@ func wrappedLogDeliveryConfigurationsFromPb(pb *wrappedLogDeliveryConfigurations return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/billing/model.go b/service/billing/model.go index b6a030c56..530786da4 100644 --- a/service/billing/model.go +++ b/service/billing/model.go @@ -6,8 +6,6 @@ import ( "encoding/json" "fmt" "io" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/compute" ) @@ -2302,57 +2300,3 @@ func (st WrappedLogDeliveryConfigurations) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/catalog/internal.go b/service/catalog/internal.go index 9d4c84e84..4d68639fd 100755 --- a/service/catalog/internal.go +++ b/service/catalog/internal.go @@ -3,6 +3,10 @@ package catalog import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -36,9 +40,7 @@ func accountsCreateMetastoreAssignmentToPb(st *AccountsCreateMetastoreAssignment } pb := &accountsCreateMetastoreAssignmentPb{} pb.MetastoreAssignment = st.MetastoreAssignment - pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -46,10 +48,8 @@ func accountsCreateMetastoreAssignmentToPb(st *AccountsCreateMetastoreAssignment type accountsCreateMetastoreAssignmentPb struct { MetastoreAssignment *CreateMetastoreAssignment `json:"metastore_assignment,omitempty"` - - MetastoreId string `json:"-" url:"-"` - - WorkspaceId int64 `json:"-" url:"-"` + MetastoreId string `json:"-" url:"-"` + WorkspaceId int64 `json:"-" url:"-"` } func accountsCreateMetastoreAssignmentFromPb(pb *accountsCreateMetastoreAssignmentPb) (*AccountsCreateMetastoreAssignment, error) { @@ -70,7 +70,6 @@ func accountsCreateStorageCredentialToPb(st *AccountsCreateStorageCredential) (* } pb := &accountsCreateStorageCredentialPb{} pb.CredentialInfo = st.CredentialInfo - pb.MetastoreId = st.MetastoreId return pb, nil @@ -78,8 +77,7 @@ func accountsCreateStorageCredentialToPb(st *AccountsCreateStorageCredential) (* type accountsCreateStorageCredentialPb struct { CredentialInfo *CreateStorageCredential `json:"credential_info,omitempty"` - - MetastoreId string `json:"-" url:"-"` + MetastoreId string `json:"-" url:"-"` } func accountsCreateStorageCredentialFromPb(pb *accountsCreateStorageCredentialPb) (*AccountsCreateStorageCredential, error) { @@ -171,15 +169,13 @@ func accountsUpdateMetastoreToPb(st *AccountsUpdateMetastore) (*accountsUpdateMe } pb := &accountsUpdateMetastorePb{} pb.MetastoreId = st.MetastoreId - pb.MetastoreInfo = st.MetastoreInfo return pb, nil } type accountsUpdateMetastorePb struct { - MetastoreId string `json:"-" url:"-"` - + MetastoreId string `json:"-" url:"-"` MetastoreInfo *UpdateMetastore `json:"metastore_info,omitempty"` } @@ -200,9 +196,7 @@ func accountsUpdateMetastoreAssignmentToPb(st *AccountsUpdateMetastoreAssignment } pb := &accountsUpdateMetastoreAssignmentPb{} pb.MetastoreAssignment = st.MetastoreAssignment - pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -210,10 +204,8 @@ func accountsUpdateMetastoreAssignmentToPb(st *AccountsUpdateMetastoreAssignment type accountsUpdateMetastoreAssignmentPb struct { MetastoreAssignment *UpdateMetastoreAssignment `json:"metastore_assignment,omitempty"` - - MetastoreId string `json:"-" url:"-"` - - WorkspaceId int64 `json:"-" url:"-"` + MetastoreId string `json:"-" url:"-"` + WorkspaceId int64 `json:"-" url:"-"` } func accountsUpdateMetastoreAssignmentFromPb(pb *accountsUpdateMetastoreAssignmentPb) (*AccountsUpdateMetastoreAssignment, error) { @@ -234,20 +226,16 @@ func accountsUpdateStorageCredentialToPb(st *AccountsUpdateStorageCredential) (* } pb := &accountsUpdateStorageCredentialPb{} pb.CredentialInfo = st.CredentialInfo - pb.MetastoreId = st.MetastoreId - pb.StorageCredentialName = st.StorageCredentialName return pb, nil } type accountsUpdateStorageCredentialPb struct { - CredentialInfo *UpdateStorageCredential `json:"credential_info,omitempty"` - - MetastoreId string `json:"-" url:"-"` - - StorageCredentialName string `json:"-" url:"-"` + CredentialInfo *UpdateStorageCredential `json:"credential_info,omitempty"` + MetastoreId string `json:"-" url:"-"` + StorageCredentialName string `json:"-" url:"-"` } func accountsUpdateStorageCredentialFromPb(pb *accountsUpdateStorageCredentialPb) (*AccountsUpdateStorageCredential, error) { @@ -268,11 +256,8 @@ func artifactAllowlistInfoToPb(st *ArtifactAllowlistInfo) (*artifactAllowlistInf } pb := &artifactAllowlistInfoPb{} pb.ArtifactMatchers = st.ArtifactMatchers - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.MetastoreId = st.MetastoreId pb.ForceSendFields = st.ForceSendFields @@ -281,12 +266,9 @@ func artifactAllowlistInfoToPb(st *ArtifactAllowlistInfo) (*artifactAllowlistInf type artifactAllowlistInfoPb struct { ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -319,15 +301,13 @@ func artifactMatcherToPb(st *ArtifactMatcher) (*artifactMatcherPb, error) { } pb := &artifactMatcherPb{} pb.Artifact = st.Artifact - pb.MatchType = st.MatchType return pb, nil } type artifactMatcherPb struct { - Artifact string `json:"artifact"` - + Artifact string `json:"artifact"` MatchType MatchType `json:"match_type"` } @@ -369,11 +349,8 @@ func awsCredentialsToPb(st *AwsCredentials) (*awsCredentialsPb, error) { } pb := &awsCredentialsPb{} pb.AccessKeyId = st.AccessKeyId - pb.AccessPoint = st.AccessPoint - pb.SecretAccessKey = st.SecretAccessKey - pb.SessionToken = st.SessionToken pb.ForceSendFields = st.ForceSendFields @@ -381,13 +358,10 @@ func awsCredentialsToPb(st *AwsCredentials) (*awsCredentialsPb, error) { } type awsCredentialsPb struct { - AccessKeyId string `json:"access_key_id,omitempty"` - - AccessPoint string `json:"access_point,omitempty"` - + AccessKeyId string `json:"access_key_id,omitempty"` + AccessPoint string `json:"access_point,omitempty"` SecretAccessKey string `json:"secret_access_key,omitempty"` - - SessionToken string `json:"session_token,omitempty"` + SessionToken string `json:"session_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -420,9 +394,7 @@ func awsIamRoleToPb(st *AwsIamRole) (*awsIamRolePb, error) { } pb := &awsIamRolePb{} pb.ExternalId = st.ExternalId - pb.RoleArn = st.RoleArn - pb.UnityCatalogIamArn = st.UnityCatalogIamArn pb.ForceSendFields = st.ForceSendFields @@ -430,10 +402,8 @@ func awsIamRoleToPb(st *AwsIamRole) (*awsIamRolePb, error) { } type awsIamRolePb struct { - ExternalId string `json:"external_id,omitempty"` - - RoleArn string `json:"role_arn,omitempty"` - + ExternalId string `json:"external_id,omitempty"` + RoleArn string `json:"role_arn,omitempty"` UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -490,9 +460,7 @@ func awsIamRoleResponseToPb(st *AwsIamRoleResponse) (*awsIamRoleResponsePb, erro } pb := &awsIamRoleResponsePb{} pb.ExternalId = st.ExternalId - pb.RoleArn = st.RoleArn - pb.UnityCatalogIamArn = st.UnityCatalogIamArn pb.ForceSendFields = st.ForceSendFields @@ -500,10 +468,8 @@ func awsIamRoleResponseToPb(st *AwsIamRoleResponse) (*awsIamRoleResponsePb, erro } type awsIamRoleResponsePb struct { - ExternalId string `json:"external_id,omitempty"` - - RoleArn string `json:"role_arn"` - + ExternalId string `json:"external_id,omitempty"` + RoleArn string `json:"role_arn"` UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -536,7 +502,6 @@ func awsSqsQueueToPb(st *AwsSqsQueue) (*awsSqsQueuePb, error) { } pb := &awsSqsQueuePb{} pb.ManagedResourceId = st.ManagedResourceId - pb.QueueUrl = st.QueueUrl pb.ForceSendFields = st.ForceSendFields @@ -545,8 +510,7 @@ func awsSqsQueueToPb(st *AwsSqsQueue) (*awsSqsQueuePb, error) { type awsSqsQueuePb struct { ManagedResourceId string `json:"managed_resource_id,omitempty"` - - QueueUrl string `json:"queue_url,omitempty"` + QueueUrl string `json:"queue_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -613,9 +577,7 @@ func azureManagedIdentityToPb(st *AzureManagedIdentity) (*azureManagedIdentityPb } pb := &azureManagedIdentityPb{} pb.AccessConnectorId = st.AccessConnectorId - pb.CredentialId = st.CredentialId - pb.ManagedIdentityId = st.ManagedIdentityId pb.ForceSendFields = st.ForceSendFields @@ -624,9 +586,7 @@ func azureManagedIdentityToPb(st *AzureManagedIdentity) (*azureManagedIdentityPb type azureManagedIdentityPb struct { AccessConnectorId string `json:"access_connector_id"` - - CredentialId string `json:"credential_id,omitempty"` - + CredentialId string `json:"credential_id,omitempty"` ManagedIdentityId string `json:"managed_identity_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -659,7 +619,6 @@ func azureManagedIdentityRequestToPb(st *AzureManagedIdentityRequest) (*azureMan } pb := &azureManagedIdentityRequestPb{} pb.AccessConnectorId = st.AccessConnectorId - pb.ManagedIdentityId = st.ManagedIdentityId pb.ForceSendFields = st.ForceSendFields @@ -668,7 +627,6 @@ func azureManagedIdentityRequestToPb(st *AzureManagedIdentityRequest) (*azureMan type azureManagedIdentityRequestPb struct { AccessConnectorId string `json:"access_connector_id"` - ManagedIdentityId string `json:"managed_identity_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -700,9 +658,7 @@ func azureManagedIdentityResponseToPb(st *AzureManagedIdentityResponse) (*azureM } pb := &azureManagedIdentityResponsePb{} pb.AccessConnectorId = st.AccessConnectorId - pb.CredentialId = st.CredentialId - pb.ManagedIdentityId = st.ManagedIdentityId pb.ForceSendFields = st.ForceSendFields @@ -711,9 +667,7 @@ func azureManagedIdentityResponseToPb(st *AzureManagedIdentityResponse) (*azureM type azureManagedIdentityResponsePb struct { AccessConnectorId string `json:"access_connector_id"` - - CredentialId string `json:"credential_id,omitempty"` - + CredentialId string `json:"credential_id,omitempty"` ManagedIdentityId string `json:"managed_identity_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -746,11 +700,8 @@ func azureQueueStorageToPb(st *AzureQueueStorage) (*azureQueueStoragePb, error) } pb := &azureQueueStoragePb{} pb.ManagedResourceId = st.ManagedResourceId - pb.QueueUrl = st.QueueUrl - pb.ResourceGroup = st.ResourceGroup - pb.SubscriptionId = st.SubscriptionId pb.ForceSendFields = st.ForceSendFields @@ -759,12 +710,9 @@ func azureQueueStorageToPb(st *AzureQueueStorage) (*azureQueueStoragePb, error) type azureQueueStoragePb struct { ManagedResourceId string `json:"managed_resource_id,omitempty"` - - QueueUrl string `json:"queue_url,omitempty"` - - ResourceGroup string `json:"resource_group,omitempty"` - - SubscriptionId string `json:"subscription_id,omitempty"` + QueueUrl string `json:"queue_url,omitempty"` + ResourceGroup string `json:"resource_group,omitempty"` + SubscriptionId string `json:"subscription_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -797,9 +745,7 @@ func azureServicePrincipalToPb(st *AzureServicePrincipal) (*azureServicePrincipa } pb := &azureServicePrincipalPb{} pb.ApplicationId = st.ApplicationId - pb.ClientSecret = st.ClientSecret - pb.DirectoryId = st.DirectoryId return pb, nil @@ -807,10 +753,8 @@ func azureServicePrincipalToPb(st *AzureServicePrincipal) (*azureServicePrincipa type azureServicePrincipalPb struct { ApplicationId string `json:"application_id"` - - ClientSecret string `json:"client_secret"` - - DirectoryId string `json:"directory_id"` + ClientSecret string `json:"client_secret"` + DirectoryId string `json:"directory_id"` } func azureServicePrincipalFromPb(pb *azureServicePrincipalPb) (*AzureServicePrincipal, error) { @@ -867,7 +811,6 @@ func cancelRefreshRequestToPb(st *CancelRefreshRequest) (*cancelRefreshRequestPb } pb := &cancelRefreshRequestPb{} pb.RefreshId = st.RefreshId - pb.TableName = st.TableName return pb, nil @@ -875,7 +818,6 @@ func cancelRefreshRequestToPb(st *CancelRefreshRequest) (*cancelRefreshRequestPb type cancelRefreshRequestPb struct { RefreshId string `json:"-" url:"-"` - TableName string `json:"-" url:"-"` } @@ -917,49 +859,27 @@ func catalogInfoToPb(st *CatalogInfo) (*catalogInfoPb, error) { } pb := &catalogInfoPb{} pb.BrowseOnly = st.BrowseOnly - pb.CatalogType = st.CatalogType - pb.Comment = st.Comment - pb.ConnectionName = st.ConnectionName - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag - pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization - pb.FullName = st.FullName - pb.IsolationMode = st.IsolationMode - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Options = st.Options - pb.Owner = st.Owner - pb.Properties = st.Properties - pb.ProviderName = st.ProviderName - pb.ProvisioningInfo = st.ProvisioningInfo - pb.SecurableType = st.SecurableType - pb.ShareName = st.ShareName - pb.StorageLocation = st.StorageLocation - pb.StorageRoot = st.StorageRoot - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -967,51 +887,29 @@ func catalogInfoToPb(st *CatalogInfo) (*catalogInfoPb, error) { } type catalogInfoPb struct { - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogType CatalogType `json:"catalog_type,omitempty"` - - Comment string `json:"comment,omitempty"` - - ConnectionName string `json:"connection_name,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogType CatalogType `json:"catalog_type,omitempty"` + Comment string `json:"comment,omitempty"` + ConnectionName string `json:"connection_name,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` - - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` - - FullName string `json:"full_name,omitempty"` - - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Options map[string]string `json:"options,omitempty"` - - Owner string `json:"owner,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` - - ProviderName string `json:"provider_name,omitempty"` - - ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` - - SecurableType SecurableType `json:"securable_type,omitempty"` - - ShareName string `json:"share_name,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + FullName string `json:"full_name,omitempty"` + IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Options map[string]string `json:"options,omitempty"` + Owner string `json:"owner,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + ProviderName string `json:"provider_name,omitempty"` + ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` + SecurableType SecurableType `json:"securable_type,omitempty"` + ShareName string `json:"share_name,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1063,19 +961,15 @@ func cloudflareApiTokenToPb(st *CloudflareApiToken) (*cloudflareApiTokenPb, erro } pb := &cloudflareApiTokenPb{} pb.AccessKeyId = st.AccessKeyId - pb.AccountId = st.AccountId - pb.SecretAccessKey = st.SecretAccessKey return pb, nil } type cloudflareApiTokenPb struct { - AccessKeyId string `json:"access_key_id"` - - AccountId string `json:"account_id"` - + AccessKeyId string `json:"access_key_id"` + AccountId string `json:"account_id"` SecretAccessKey string `json:"secret_access_key"` } @@ -1097,27 +991,16 @@ func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { } pb := &columnInfoPb{} pb.Comment = st.Comment - pb.Mask = st.Mask - pb.Name = st.Name - pb.Nullable = st.Nullable - pb.PartitionIndex = st.PartitionIndex - pb.Position = st.Position - pb.TypeIntervalType = st.TypeIntervalType - pb.TypeJson = st.TypeJson - pb.TypeName = st.TypeName - pb.TypePrecision = st.TypePrecision - pb.TypeScale = st.TypeScale - pb.TypeText = st.TypeText pb.ForceSendFields = st.ForceSendFields @@ -1125,29 +1008,18 @@ func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { } type columnInfoPb struct { - Comment string `json:"comment,omitempty"` - - Mask *ColumnMask `json:"mask,omitempty"` - - Name string `json:"name,omitempty"` - - Nullable bool `json:"nullable,omitempty"` - - PartitionIndex int `json:"partition_index,omitempty"` - - Position int `json:"position,omitempty"` - - TypeIntervalType string `json:"type_interval_type,omitempty"` - - TypeJson string `json:"type_json,omitempty"` - - TypeName ColumnTypeName `json:"type_name,omitempty"` - - TypePrecision int `json:"type_precision,omitempty"` - - TypeScale int `json:"type_scale,omitempty"` - - TypeText string `json:"type_text,omitempty"` + Comment string `json:"comment,omitempty"` + Mask *ColumnMask `json:"mask,omitempty"` + Name string `json:"name,omitempty"` + Nullable bool `json:"nullable,omitempty"` + PartitionIndex int `json:"partition_index,omitempty"` + Position int `json:"position,omitempty"` + TypeIntervalType string `json:"type_interval_type,omitempty"` + TypeJson string `json:"type_json,omitempty"` + TypeName ColumnTypeName `json:"type_name,omitempty"` + TypePrecision int `json:"type_precision,omitempty"` + TypeScale int `json:"type_scale,omitempty"` + TypeText string `json:"type_text,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1188,7 +1060,6 @@ func columnMaskToPb(st *ColumnMask) (*columnMaskPb, error) { } pb := &columnMaskPb{} pb.FunctionName = st.FunctionName - pb.UsingColumnNames = st.UsingColumnNames pb.ForceSendFields = st.ForceSendFields @@ -1196,8 +1067,7 @@ func columnMaskToPb(st *ColumnMask) (*columnMaskPb, error) { } type columnMaskPb struct { - FunctionName string `json:"function_name,omitempty"` - + FunctionName string `json:"function_name,omitempty"` UsingColumnNames []string `json:"using_column_names,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1229,39 +1099,22 @@ func connectionInfoToPb(st *ConnectionInfo) (*connectionInfoPb, error) { } pb := &connectionInfoPb{} pb.Comment = st.Comment - pb.ConnectionId = st.ConnectionId - pb.ConnectionType = st.ConnectionType - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.CredentialType = st.CredentialType - pb.FullName = st.FullName - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Options = st.Options - pb.Owner = st.Owner - pb.Properties = st.Properties - pb.ProvisioningInfo = st.ProvisioningInfo - pb.ReadOnly = st.ReadOnly - pb.SecurableType = st.SecurableType - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -1269,41 +1122,24 @@ func connectionInfoToPb(st *ConnectionInfo) (*connectionInfoPb, error) { } type connectionInfoPb struct { - Comment string `json:"comment,omitempty"` - - ConnectionId string `json:"connection_id,omitempty"` - - ConnectionType ConnectionType `json:"connection_type,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - CredentialType CredentialType `json:"credential_type,omitempty"` - - FullName string `json:"full_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Options map[string]string `json:"options,omitempty"` - - Owner string `json:"owner,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` - + Comment string `json:"comment,omitempty"` + ConnectionId string `json:"connection_id,omitempty"` + ConnectionType ConnectionType `json:"connection_type,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + CredentialType CredentialType `json:"credential_type,omitempty"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Options map[string]string `json:"options,omitempty"` + Owner string `json:"owner,omitempty"` + Properties map[string]string `json:"properties,omitempty"` ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - SecurableType string `json:"securable_type,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - Url string `json:"url,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + SecurableType string `json:"securable_type,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1350,9 +1186,7 @@ func continuousUpdateStatusToPb(st *ContinuousUpdateStatus) (*continuousUpdateSt } pb := &continuousUpdateStatusPb{} pb.InitialPipelineSyncProgress = st.InitialPipelineSyncProgress - pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion - pb.Timestamp = st.Timestamp pb.ForceSendFields = st.ForceSendFields @@ -1361,10 +1195,8 @@ func continuousUpdateStatusToPb(st *ContinuousUpdateStatus) (*continuousUpdateSt type continuousUpdateStatusPb struct { InitialPipelineSyncProgress *PipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` - - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - - Timestamp string `json:"timestamp,omitempty"` + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + Timestamp string `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1396,19 +1228,12 @@ func createCatalogToPb(st *CreateCatalog) (*createCatalogPb, error) { } pb := &createCatalogPb{} pb.Comment = st.Comment - pb.ConnectionName = st.ConnectionName - pb.Name = st.Name - pb.Options = st.Options - pb.Properties = st.Properties - pb.ProviderName = st.ProviderName - pb.ShareName = st.ShareName - pb.StorageRoot = st.StorageRoot pb.ForceSendFields = st.ForceSendFields @@ -1416,21 +1241,14 @@ func createCatalogToPb(st *CreateCatalog) (*createCatalogPb, error) { } type createCatalogPb struct { - Comment string `json:"comment,omitempty"` - - ConnectionName string `json:"connection_name,omitempty"` - - Name string `json:"name"` - - Options map[string]string `json:"options,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` - - ProviderName string `json:"provider_name,omitempty"` - - ShareName string `json:"share_name,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` + Comment string `json:"comment,omitempty"` + ConnectionName string `json:"connection_name,omitempty"` + Name string `json:"name"` + Options map[string]string `json:"options,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + ProviderName string `json:"provider_name,omitempty"` + ShareName string `json:"share_name,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1467,15 +1285,10 @@ func createConnectionToPb(st *CreateConnection) (*createConnectionPb, error) { } pb := &createConnectionPb{} pb.Comment = st.Comment - pb.ConnectionType = st.ConnectionType - pb.Name = st.Name - pb.Options = st.Options - pb.Properties = st.Properties - pb.ReadOnly = st.ReadOnly pb.ForceSendFields = st.ForceSendFields @@ -1483,17 +1296,12 @@ func createConnectionToPb(st *CreateConnection) (*createConnectionPb, error) { } type createConnectionPb struct { - Comment string `json:"comment,omitempty"` - - ConnectionType ConnectionType `json:"connection_type"` - - Name string `json:"name"` - - Options map[string]string `json:"options"` - - Properties map[string]string `json:"properties,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` + Comment string `json:"comment,omitempty"` + ConnectionType ConnectionType `json:"connection_type"` + Name string `json:"name"` + Options map[string]string `json:"options"` + Properties map[string]string `json:"properties,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1528,21 +1336,13 @@ func createCredentialRequestToPb(st *CreateCredentialRequest) (*createCredential } pb := &createCredentialRequestPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.Comment = st.Comment - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.Name = st.Name - pb.Purpose = st.Purpose - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation pb.ForceSendFields = st.ForceSendFields @@ -1550,23 +1350,15 @@ func createCredentialRequestToPb(st *CreateCredentialRequest) (*createCredential } type createCredentialRequestPb struct { - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - Comment string `json:"comment,omitempty"` - + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + Comment string `json:"comment,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` - - Name string `json:"name"` - - Purpose CredentialPurpose `json:"purpose,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` + Name string `json:"name"` + Purpose CredentialPurpose `json:"purpose,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1676,23 +1468,14 @@ func createExternalLocationToPb(st *CreateExternalLocation) (*createExternalLoca } pb := &createExternalLocationPb{} pb.Comment = st.Comment - pb.CredentialName = st.CredentialName - pb.EnableFileEvents = st.EnableFileEvents - pb.EncryptionDetails = st.EncryptionDetails - pb.Fallback = st.Fallback - pb.FileEventQueue = st.FileEventQueue - pb.Name = st.Name - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -1700,28 +1483,19 @@ func createExternalLocationToPb(st *CreateExternalLocation) (*createExternalLoca } type createExternalLocationPb struct { - Comment string `json:"comment,omitempty"` - - CredentialName string `json:"credential_name"` - - EnableFileEvents bool `json:"enable_file_events,omitempty"` - + Comment string `json:"comment,omitempty"` + CredentialName string `json:"credential_name"` + EnableFileEvents bool `json:"enable_file_events,omitempty"` EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + Fallback bool `json:"fallback,omitempty"` + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + Name string `json:"name"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` + Url string `json:"url"` - Fallback bool `json:"fallback,omitempty"` - - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` - - Name string `json:"name"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` - - Url string `json:"url"` - - ForceSendFields []string `json:"-" url:"-"` -} + ForceSendFields []string `json:"-" url:"-"` +} func createExternalLocationFromPb(pb *createExternalLocationPb) (*CreateExternalLocation, error) { if pb == nil { @@ -1757,45 +1531,25 @@ func createFunctionToPb(st *CreateFunction) (*createFunctionPb, error) { } pb := &createFunctionPb{} pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.DataType = st.DataType - pb.ExternalLanguage = st.ExternalLanguage - pb.ExternalName = st.ExternalName - pb.FullDataType = st.FullDataType - pb.InputParams = st.InputParams - pb.IsDeterministic = st.IsDeterministic - pb.IsNullCall = st.IsNullCall - pb.Name = st.Name - pb.ParameterStyle = st.ParameterStyle - pb.Properties = st.Properties - pb.ReturnParams = st.ReturnParams - pb.RoutineBody = st.RoutineBody - pb.RoutineDefinition = st.RoutineDefinition - pb.RoutineDependencies = st.RoutineDependencies - pb.SchemaName = st.SchemaName - pb.SecurityType = st.SecurityType - pb.SpecificName = st.SpecificName - pb.SqlDataAccess = st.SqlDataAccess - pb.SqlPath = st.SqlPath pb.ForceSendFields = st.ForceSendFields @@ -1803,47 +1557,27 @@ func createFunctionToPb(st *CreateFunction) (*createFunctionPb, error) { } type createFunctionPb struct { - CatalogName string `json:"catalog_name"` - - Comment string `json:"comment,omitempty"` - - DataType ColumnTypeName `json:"data_type"` - - ExternalLanguage string `json:"external_language,omitempty"` - - ExternalName string `json:"external_name,omitempty"` - - FullDataType string `json:"full_data_type"` - - InputParams FunctionParameterInfos `json:"input_params"` - - IsDeterministic bool `json:"is_deterministic"` - - IsNullCall bool `json:"is_null_call"` - - Name string `json:"name"` - - ParameterStyle CreateFunctionParameterStyle `json:"parameter_style"` - - Properties string `json:"properties,omitempty"` - - ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` - - RoutineBody CreateFunctionRoutineBody `json:"routine_body"` - - RoutineDefinition string `json:"routine_definition"` - - RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` - - SchemaName string `json:"schema_name"` - - SecurityType CreateFunctionSecurityType `json:"security_type"` - - SpecificName string `json:"specific_name"` - - SqlDataAccess CreateFunctionSqlDataAccess `json:"sql_data_access"` - - SqlPath string `json:"sql_path,omitempty"` + CatalogName string `json:"catalog_name"` + Comment string `json:"comment,omitempty"` + DataType ColumnTypeName `json:"data_type"` + ExternalLanguage string `json:"external_language,omitempty"` + ExternalName string `json:"external_name,omitempty"` + FullDataType string `json:"full_data_type"` + InputParams FunctionParameterInfos `json:"input_params"` + IsDeterministic bool `json:"is_deterministic"` + IsNullCall bool `json:"is_null_call"` + Name string `json:"name"` + ParameterStyle CreateFunctionParameterStyle `json:"parameter_style"` + Properties string `json:"properties,omitempty"` + ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + RoutineBody CreateFunctionRoutineBody `json:"routine_body"` + RoutineDefinition string `json:"routine_definition"` + RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + SchemaName string `json:"schema_name"` + SecurityType CreateFunctionSecurityType `json:"security_type"` + SpecificName string `json:"specific_name"` + SqlDataAccess CreateFunctionSqlDataAccess `json:"sql_data_access"` + SqlPath string `json:"sql_path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1917,9 +1651,7 @@ func createMetastoreToPb(st *CreateMetastore) (*createMetastorePb, error) { } pb := &createMetastorePb{} pb.Name = st.Name - pb.Region = st.Region - pb.StorageRoot = st.StorageRoot pb.ForceSendFields = st.ForceSendFields @@ -1927,10 +1659,8 @@ func createMetastoreToPb(st *CreateMetastore) (*createMetastorePb, error) { } type createMetastorePb struct { - Name string `json:"name"` - - Region string `json:"region,omitempty"` - + Name string `json:"name"` + Region string `json:"region,omitempty"` StorageRoot string `json:"storage_root,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1963,9 +1693,7 @@ func createMetastoreAssignmentToPb(st *CreateMetastoreAssignment) (*createMetast } pb := &createMetastoreAssignmentPb{} pb.DefaultCatalogName = st.DefaultCatalogName - pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -1973,10 +1701,8 @@ func createMetastoreAssignmentToPb(st *CreateMetastoreAssignment) (*createMetast type createMetastoreAssignmentPb struct { DefaultCatalogName string `json:"default_catalog_name"` - - MetastoreId string `json:"metastore_id"` - - WorkspaceId int64 `json:"-" url:"-"` + MetastoreId string `json:"metastore_id"` + WorkspaceId int64 `json:"-" url:"-"` } func createMetastoreAssignmentFromPb(pb *createMetastoreAssignmentPb) (*CreateMetastoreAssignment, error) { @@ -1997,31 +1723,18 @@ func createMonitorToPb(st *CreateMonitor) (*createMonitorPb, error) { } pb := &createMonitorPb{} pb.AssetsDir = st.AssetsDir - pb.BaselineTableName = st.BaselineTableName - pb.CustomMetrics = st.CustomMetrics - pb.DataClassificationConfig = st.DataClassificationConfig - pb.InferenceLog = st.InferenceLog - pb.Notifications = st.Notifications - pb.OutputSchemaName = st.OutputSchemaName - pb.Schedule = st.Schedule - pb.SkipBuiltinDashboard = st.SkipBuiltinDashboard - pb.SlicingExprs = st.SlicingExprs - pb.Snapshot = st.Snapshot - pb.TableName = st.TableName - pb.TimeSeries = st.TimeSeries - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -2029,33 +1742,20 @@ func createMonitorToPb(st *CreateMonitor) (*createMonitorPb, error) { } type createMonitorPb struct { - AssetsDir string `json:"assets_dir"` - - BaselineTableName string `json:"baseline_table_name,omitempty"` - - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - + AssetsDir string `json:"assets_dir"` + BaselineTableName string `json:"baseline_table_name,omitempty"` + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - - Notifications *MonitorNotifications `json:"notifications,omitempty"` - - OutputSchemaName string `json:"output_schema_name"` - - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` - - SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` - - SlicingExprs []string `json:"slicing_exprs,omitempty"` - - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - - TableName string `json:"-" url:"-"` - - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` + OutputSchemaName string `json:"output_schema_name"` + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` + SlicingExprs []string `json:"slicing_exprs,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + TableName string `json:"-" url:"-"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2122,13 +1822,9 @@ func createRegisteredModelRequestToPb(st *CreateRegisteredModelRequest) (*create } pb := &createRegisteredModelRequestPb{} pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.Name = st.Name - pb.SchemaName = st.SchemaName - pb.StorageLocation = st.StorageLocation pb.ForceSendFields = st.ForceSendFields @@ -2136,14 +1832,10 @@ func createRegisteredModelRequestToPb(st *CreateRegisteredModelRequest) (*create } type createRegisteredModelRequestPb struct { - CatalogName string `json:"catalog_name"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - SchemaName string `json:"schema_name"` - + CatalogName string `json:"catalog_name"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + SchemaName string `json:"schema_name"` StorageLocation string `json:"storage_location,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2199,13 +1891,9 @@ func createSchemaToPb(st *CreateSchema) (*createSchemaPb, error) { } pb := &createSchemaPb{} pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.Name = st.Name - pb.Properties = st.Properties - pb.StorageRoot = st.StorageRoot pb.ForceSendFields = st.ForceSendFields @@ -2213,15 +1901,11 @@ func createSchemaToPb(st *CreateSchema) (*createSchemaPb, error) { } type createSchemaPb struct { - CatalogName string `json:"catalog_name"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - Properties map[string]string `json:"properties,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` + CatalogName string `json:"catalog_name"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + Properties map[string]string `json:"properties,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2255,21 +1939,13 @@ func createStorageCredentialToPb(st *CreateStorageCredential) (*createStorageCre } pb := &createStorageCredentialPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.CloudflareApiToken = st.CloudflareApiToken - pb.Comment = st.Comment - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.Name = st.Name - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation pb.ForceSendFields = st.ForceSendFields @@ -2277,23 +1953,15 @@ func createStorageCredentialToPb(st *CreateStorageCredential) (*createStorageCre } type createStorageCredentialPb struct { - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` - - Comment string `json:"comment,omitempty"` - + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + Comment string `json:"comment,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` - - Name string `json:"name"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` + Name string `json:"name"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2355,16 +2023,14 @@ func createTableConstraintToPb(st *CreateTableConstraint) (*createTableConstrain } pb := &createTableConstraintPb{} pb.Constraint = st.Constraint - pb.FullNameArg = st.FullNameArg return pb, nil } type createTableConstraintPb struct { - Constraint TableConstraint `json:"constraint"` - - FullNameArg string `json:"full_name_arg"` + Constraint TableConstraint `json:"constraint"` + FullNameArg string `json:"full_name_arg"` } func createTableConstraintFromPb(pb *createTableConstraintPb) (*CreateTableConstraint, error) { @@ -2384,15 +2050,10 @@ func createVolumeRequestContentToPb(st *CreateVolumeRequestContent) (*createVolu } pb := &createVolumeRequestContentPb{} pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.Name = st.Name - pb.SchemaName = st.SchemaName - pb.StorageLocation = st.StorageLocation - pb.VolumeType = st.VolumeType pb.ForceSendFields = st.ForceSendFields @@ -2400,17 +2061,12 @@ func createVolumeRequestContentToPb(st *CreateVolumeRequestContent) (*createVolu } type createVolumeRequestContentPb struct { - CatalogName string `json:"catalog_name"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - SchemaName string `json:"schema_name"` - - StorageLocation string `json:"storage_location,omitempty"` - - VolumeType VolumeType `json:"volume_type"` + CatalogName string `json:"catalog_name"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + SchemaName string `json:"schema_name"` + StorageLocation string `json:"storage_location,omitempty"` + VolumeType VolumeType `json:"volume_type"` ForceSendFields []string `json:"-" url:"-"` } @@ -2445,39 +2101,22 @@ func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { } pb := &credentialInfoPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.FullName = st.FullName - pb.Id = st.Id - pb.IsolationMode = st.IsolationMode - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.Purpose = st.Purpose - pb.ReadOnly = st.ReadOnly - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.UsedForManagedStorage = st.UsedForManagedStorage pb.ForceSendFields = st.ForceSendFields @@ -2485,41 +2124,24 @@ func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { } type credentialInfoPb struct { - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` - - FullName string `json:"full_name,omitempty"` - - Id string `json:"id,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - Purpose CredentialPurpose `json:"purpose,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + FullName string `json:"full_name,omitempty"` + Id string `json:"id,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + Purpose CredentialPurpose `json:"purpose,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2566,7 +2188,6 @@ func credentialValidationResultToPb(st *CredentialValidationResult) (*credential } pb := &credentialValidationResultPb{} pb.Message = st.Message - pb.Result = st.Result pb.ForceSendFields = st.ForceSendFields @@ -2574,9 +2195,8 @@ func credentialValidationResultToPb(st *CredentialValidationResult) (*credential } type credentialValidationResultPb struct { - Message string `json:"message,omitempty"` - - Result ValidateCredentialResult `json:"result,omitempty"` + Message string `json:"message,omitempty"` + Result ValidateCredentialResult `json:"result,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2607,13 +2227,9 @@ func databaseCatalogToPb(st *DatabaseCatalog) (*databaseCatalogPb, error) { } pb := &databaseCatalogPb{} pb.CreateDatabaseIfNotExists = st.CreateDatabaseIfNotExists - pb.DatabaseInstanceName = st.DatabaseInstanceName - pb.DatabaseName = st.DatabaseName - pb.Name = st.Name - pb.Uid = st.Uid pb.ForceSendFields = st.ForceSendFields @@ -2621,15 +2237,11 @@ func databaseCatalogToPb(st *DatabaseCatalog) (*databaseCatalogPb, error) { } type databaseCatalogPb struct { - CreateDatabaseIfNotExists bool `json:"create_database_if_not_exists,omitempty"` - - DatabaseInstanceName string `json:"database_instance_name"` - - DatabaseName string `json:"database_name"` - - Name string `json:"name"` - - Uid string `json:"uid,omitempty"` + CreateDatabaseIfNotExists bool `json:"create_database_if_not_exists,omitempty"` + DatabaseInstanceName string `json:"database_instance_name"` + DatabaseName string `json:"database_name"` + Name string `json:"name"` + Uid string `json:"uid,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2699,37 +2311,21 @@ func databaseInstanceToPb(st *DatabaseInstance) (*databaseInstancePb, error) { } pb := &databaseInstancePb{} pb.AdminPassword = st.AdminPassword - pb.AdminRolename = st.AdminRolename - pb.Capacity = st.Capacity - pb.ChildInstanceRefs = st.ChildInstanceRefs - pb.CreationTime = st.CreationTime - pb.Creator = st.Creator - pb.EnableReadableSecondaries = st.EnableReadableSecondaries - pb.Name = st.Name - pb.NodeCount = st.NodeCount - pb.ParentInstanceRef = st.ParentInstanceRef - pb.PgVersion = st.PgVersion - pb.ReadOnlyDns = st.ReadOnlyDns - pb.ReadWriteDns = st.ReadWriteDns - pb.RetentionWindowInDays = st.RetentionWindowInDays - pb.State = st.State - pb.Stopped = st.Stopped - pb.Uid = st.Uid pb.ForceSendFields = st.ForceSendFields @@ -2737,39 +2333,23 @@ func databaseInstanceToPb(st *DatabaseInstance) (*databaseInstancePb, error) { } type databaseInstancePb struct { - AdminPassword string `json:"admin_password,omitempty"` - - AdminRolename string `json:"admin_rolename,omitempty"` - - Capacity string `json:"capacity,omitempty"` - - ChildInstanceRefs []DatabaseInstanceRef `json:"child_instance_refs,omitempty"` - - CreationTime string `json:"creation_time,omitempty"` - - Creator string `json:"creator,omitempty"` - - EnableReadableSecondaries bool `json:"enable_readable_secondaries,omitempty"` - - Name string `json:"name"` - - NodeCount int `json:"node_count,omitempty"` - - ParentInstanceRef *DatabaseInstanceRef `json:"parent_instance_ref,omitempty"` - - PgVersion string `json:"pg_version,omitempty"` - - ReadOnlyDns string `json:"read_only_dns,omitempty"` - - ReadWriteDns string `json:"read_write_dns,omitempty"` - - RetentionWindowInDays int `json:"retention_window_in_days,omitempty"` - - State DatabaseInstanceState `json:"state,omitempty"` - - Stopped bool `json:"stopped,omitempty"` - - Uid string `json:"uid,omitempty"` + AdminPassword string `json:"admin_password,omitempty"` + AdminRolename string `json:"admin_rolename,omitempty"` + Capacity string `json:"capacity,omitempty"` + ChildInstanceRefs []DatabaseInstanceRef `json:"child_instance_refs,omitempty"` + CreationTime string `json:"creation_time,omitempty"` + Creator string `json:"creator,omitempty"` + EnableReadableSecondaries bool `json:"enable_readable_secondaries,omitempty"` + Name string `json:"name"` + NodeCount int `json:"node_count,omitempty"` + ParentInstanceRef *DatabaseInstanceRef `json:"parent_instance_ref,omitempty"` + PgVersion string `json:"pg_version,omitempty"` + ReadOnlyDns string `json:"read_only_dns,omitempty"` + ReadWriteDns string `json:"read_write_dns,omitempty"` + RetentionWindowInDays int `json:"retention_window_in_days,omitempty"` + State DatabaseInstanceState `json:"state,omitempty"` + Stopped bool `json:"stopped,omitempty"` + Uid string `json:"uid,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2815,11 +2395,8 @@ func databaseInstanceRefToPb(st *DatabaseInstanceRef) (*databaseInstanceRefPb, e } pb := &databaseInstanceRefPb{} pb.BranchTime = st.BranchTime - pb.Lsn = st.Lsn - pb.Name = st.Name - pb.Uid = st.Uid pb.ForceSendFields = st.ForceSendFields @@ -2828,12 +2405,9 @@ func databaseInstanceRefToPb(st *DatabaseInstanceRef) (*databaseInstanceRefPb, e type databaseInstanceRefPb struct { BranchTime string `json:"branch_time,omitempty"` - - Lsn string `json:"lsn,omitempty"` - - Name string `json:"name,omitempty"` - - Uid string `json:"uid,omitempty"` + Lsn string `json:"lsn,omitempty"` + Name string `json:"name,omitempty"` + Uid string `json:"uid,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2866,11 +2440,8 @@ func databaseTableToPb(st *DatabaseTable) (*databaseTablePb, error) { } pb := &databaseTablePb{} pb.DatabaseInstanceName = st.DatabaseInstanceName - pb.LogicalDatabaseName = st.LogicalDatabaseName - pb.Name = st.Name - pb.TableServingUrl = st.TableServingUrl pb.ForceSendFields = st.ForceSendFields @@ -2879,12 +2450,9 @@ func databaseTableToPb(st *DatabaseTable) (*databaseTablePb, error) { type databaseTablePb struct { DatabaseInstanceName string `json:"database_instance_name,omitempty"` - - LogicalDatabaseName string `json:"logical_database_name,omitempty"` - - Name string `json:"name"` - - TableServingUrl string `json:"table_serving_url,omitempty"` + LogicalDatabaseName string `json:"logical_database_name,omitempty"` + Name string `json:"name"` + TableServingUrl string `json:"table_serving_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2917,9 +2485,7 @@ func databricksGcpServiceAccountToPb(st *DatabricksGcpServiceAccount) (*databric } pb := &databricksGcpServiceAccountPb{} pb.CredentialId = st.CredentialId - pb.Email = st.Email - pb.PrivateKeyId = st.PrivateKeyId pb.ForceSendFields = st.ForceSendFields @@ -2928,9 +2494,7 @@ func databricksGcpServiceAccountToPb(st *DatabricksGcpServiceAccount) (*databric type databricksGcpServiceAccountPb struct { CredentialId string `json:"credential_id,omitempty"` - - Email string `json:"email,omitempty"` - + Email string `json:"email,omitempty"` PrivateKeyId string `json:"private_key_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2984,7 +2548,6 @@ func databricksGcpServiceAccountResponseToPb(st *DatabricksGcpServiceAccountResp } pb := &databricksGcpServiceAccountResponsePb{} pb.CredentialId = st.CredentialId - pb.Email = st.Email pb.ForceSendFields = st.ForceSendFields @@ -2993,8 +2556,7 @@ func databricksGcpServiceAccountResponseToPb(st *DatabricksGcpServiceAccountResp type databricksGcpServiceAccountResponsePb struct { CredentialId string `json:"credential_id,omitempty"` - - Email string `json:"email,omitempty"` + Email string `json:"email,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3025,7 +2587,6 @@ func deleteAccountMetastoreAssignmentRequestToPb(st *DeleteAccountMetastoreAssig } pb := &deleteAccountMetastoreAssignmentRequestPb{} pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -3033,8 +2594,7 @@ func deleteAccountMetastoreAssignmentRequestToPb(st *DeleteAccountMetastoreAssig type deleteAccountMetastoreAssignmentRequestPb struct { MetastoreId string `json:"-" url:"-"` - - WorkspaceId int64 `json:"-" url:"-"` + WorkspaceId int64 `json:"-" url:"-"` } func deleteAccountMetastoreAssignmentRequestFromPb(pb *deleteAccountMetastoreAssignmentRequestPb) (*DeleteAccountMetastoreAssignmentRequest, error) { @@ -3054,7 +2614,6 @@ func deleteAccountMetastoreRequestToPb(st *DeleteAccountMetastoreRequest) (*dele } pb := &deleteAccountMetastoreRequestPb{} pb.Force = st.Force - pb.MetastoreId = st.MetastoreId pb.ForceSendFields = st.ForceSendFields @@ -3062,8 +2621,7 @@ func deleteAccountMetastoreRequestToPb(st *DeleteAccountMetastoreRequest) (*dele } type deleteAccountMetastoreRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - + Force bool `json:"-" url:"force,omitempty"` MetastoreId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -3095,9 +2653,7 @@ func deleteAccountStorageCredentialRequestToPb(st *DeleteAccountStorageCredentia } pb := &deleteAccountStorageCredentialRequestPb{} pb.Force = st.Force - pb.MetastoreId = st.MetastoreId - pb.StorageCredentialName = st.StorageCredentialName pb.ForceSendFields = st.ForceSendFields @@ -3105,10 +2661,8 @@ func deleteAccountStorageCredentialRequestToPb(st *DeleteAccountStorageCredentia } type deleteAccountStorageCredentialRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - MetastoreId string `json:"-" url:"-"` - + Force bool `json:"-" url:"force,omitempty"` + MetastoreId string `json:"-" url:"-"` StorageCredentialName string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -3141,15 +2695,13 @@ func deleteAliasRequestToPb(st *DeleteAliasRequest) (*deleteAliasRequestPb, erro } pb := &deleteAliasRequestPb{} pb.Alias = st.Alias - pb.FullName = st.FullName return pb, nil } type deleteAliasRequestPb struct { - Alias string `json:"-" url:"-"` - + Alias string `json:"-" url:"-"` FullName string `json:"-" url:"-"` } @@ -3191,7 +2743,6 @@ func deleteCatalogRequestToPb(st *DeleteCatalogRequest) (*deleteCatalogRequestPb } pb := &deleteCatalogRequestPb{} pb.Force = st.Force - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3199,9 +2750,8 @@ func deleteCatalogRequestToPb(st *DeleteCatalogRequest) (*deleteCatalogRequestPb } type deleteCatalogRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Name string `json:"-" url:"-"` + Force bool `json:"-" url:"force,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -3256,7 +2806,6 @@ func deleteCredentialRequestToPb(st *DeleteCredentialRequest) (*deleteCredential } pb := &deleteCredentialRequestPb{} pb.Force = st.Force - pb.NameArg = st.NameArg pb.ForceSendFields = st.ForceSendFields @@ -3264,8 +2813,7 @@ func deleteCredentialRequestToPb(st *DeleteCredentialRequest) (*deleteCredential } type deleteCredentialRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - + Force bool `json:"-" url:"force,omitempty"` NameArg string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -3363,9 +2911,7 @@ func deleteDatabaseInstanceRequestToPb(st *DeleteDatabaseInstanceRequest) (*dele } pb := &deleteDatabaseInstanceRequestPb{} pb.Force = st.Force - pb.Name = st.Name - pb.Purge = st.Purge pb.ForceSendFields = st.ForceSendFields @@ -3373,11 +2919,9 @@ func deleteDatabaseInstanceRequestToPb(st *DeleteDatabaseInstanceRequest) (*dele } type deleteDatabaseInstanceRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Name string `json:"-" url:"-"` - - Purge bool `json:"-" url:"purge,omitempty"` + Force bool `json:"-" url:"force,omitempty"` + Name string `json:"-" url:"-"` + Purge bool `json:"-" url:"purge,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3475,7 +3019,6 @@ func deleteExternalLocationRequestToPb(st *DeleteExternalLocationRequest) (*dele } pb := &deleteExternalLocationRequestPb{} pb.Force = st.Force - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3483,9 +3026,8 @@ func deleteExternalLocationRequestToPb(st *DeleteExternalLocationRequest) (*dele } type deleteExternalLocationRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Name string `json:"-" url:"-"` + Force bool `json:"-" url:"force,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -3516,7 +3058,6 @@ func deleteFunctionRequestToPb(st *DeleteFunctionRequest) (*deleteFunctionReques } pb := &deleteFunctionRequestPb{} pb.Force = st.Force - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3524,9 +3065,8 @@ func deleteFunctionRequestToPb(st *DeleteFunctionRequest) (*deleteFunctionReques } type deleteFunctionRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Name string `json:"-" url:"-"` + Force bool `json:"-" url:"force,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -3557,7 +3097,6 @@ func deleteMetastoreRequestToPb(st *DeleteMetastoreRequest) (*deleteMetastoreReq } pb := &deleteMetastoreRequestPb{} pb.Force = st.Force - pb.Id = st.Id pb.ForceSendFields = st.ForceSendFields @@ -3565,9 +3104,8 @@ func deleteMetastoreRequestToPb(st *DeleteMetastoreRequest) (*deleteMetastoreReq } type deleteMetastoreRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Id string `json:"-" url:"-"` + Force bool `json:"-" url:"force,omitempty"` + Id string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -3598,7 +3136,6 @@ func deleteModelVersionRequestToPb(st *DeleteModelVersionRequest) (*deleteModelV } pb := &deleteModelVersionRequestPb{} pb.FullName = st.FullName - pb.Version = st.Version return pb, nil @@ -3606,8 +3143,7 @@ func deleteModelVersionRequestToPb(st *DeleteModelVersionRequest) (*deleteModelV type deleteModelVersionRequestPb struct { FullName string `json:"-" url:"-"` - - Version int `json:"-" url:"-"` + Version int `json:"-" url:"-"` } func deleteModelVersionRequestFromPb(pb *deleteModelVersionRequestPb) (*DeleteModelVersionRequest, error) { @@ -3720,7 +3256,6 @@ func deleteSchemaRequestToPb(st *DeleteSchemaRequest) (*deleteSchemaRequestPb, e } pb := &deleteSchemaRequestPb{} pb.Force = st.Force - pb.FullName = st.FullName pb.ForceSendFields = st.ForceSendFields @@ -3728,8 +3263,7 @@ func deleteSchemaRequestToPb(st *DeleteSchemaRequest) (*deleteSchemaRequestPb, e } type deleteSchemaRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - + Force bool `json:"-" url:"force,omitempty"` FullName string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -3761,7 +3295,6 @@ func deleteStorageCredentialRequestToPb(st *DeleteStorageCredentialRequest) (*de } pb := &deleteStorageCredentialRequestPb{} pb.Force = st.Force - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3769,9 +3302,8 @@ func deleteStorageCredentialRequestToPb(st *DeleteStorageCredentialRequest) (*de } type deleteStorageCredentialRequestPb struct { - Force bool `json:"-" url:"force,omitempty"` - - Name string `json:"-" url:"-"` + Force bool `json:"-" url:"force,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -3847,20 +3379,16 @@ func deleteTableConstraintRequestToPb(st *DeleteTableConstraintRequest) (*delete } pb := &deleteTableConstraintRequestPb{} pb.Cascade = st.Cascade - pb.ConstraintName = st.ConstraintName - pb.FullName = st.FullName return pb, nil } type deleteTableConstraintRequestPb struct { - Cascade bool `json:"-" url:"cascade"` - + Cascade bool `json:"-" url:"cascade"` ConstraintName string `json:"-" url:"constraint_name"` - - FullName string `json:"-" url:"-"` + FullName string `json:"-" url:"-"` } func deleteTableConstraintRequestFromPb(pb *deleteTableConstraintRequestPb) (*DeleteTableConstraintRequest, error) { @@ -3953,7 +3481,6 @@ func dependencyToPb(st *Dependency) (*dependencyPb, error) { } pb := &dependencyPb{} pb.Function = st.Function - pb.Table = st.Table return pb, nil @@ -3961,8 +3488,7 @@ func dependencyToPb(st *Dependency) (*dependencyPb, error) { type dependencyPb struct { Function *FunctionDependency `json:"function,omitempty"` - - Table *TableDependency `json:"table,omitempty"` + Table *TableDependency `json:"table,omitempty"` } func dependencyFromPb(pb *dependencyPb) (*Dependency, error) { @@ -4006,7 +3532,6 @@ func disableRequestToPb(st *DisableRequest) (*disableRequestPb, error) { } pb := &disableRequestPb{} pb.MetastoreId = st.MetastoreId - pb.SchemaName = st.SchemaName return pb, nil @@ -4014,8 +3539,7 @@ func disableRequestToPb(st *DisableRequest) (*disableRequestPb, error) { type disableRequestPb struct { MetastoreId string `json:"-" url:"-"` - - SchemaName string `json:"-" url:"-"` + SchemaName string `json:"-" url:"-"` } func disableRequestFromPb(pb *disableRequestPb) (*DisableRequest, error) { @@ -4080,9 +3604,7 @@ func effectivePredictiveOptimizationFlagToPb(st *EffectivePredictiveOptimization } pb := &effectivePredictiveOptimizationFlagPb{} pb.InheritedFromName = st.InheritedFromName - pb.InheritedFromType = st.InheritedFromType - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4090,11 +3612,9 @@ func effectivePredictiveOptimizationFlagToPb(st *EffectivePredictiveOptimization } type effectivePredictiveOptimizationFlagPb struct { - InheritedFromName string `json:"inherited_from_name,omitempty"` - + InheritedFromName string `json:"inherited_from_name,omitempty"` InheritedFromType EffectivePredictiveOptimizationFlagInheritedFromType `json:"inherited_from_type,omitempty"` - - Value EnablePredictiveOptimization `json:"value"` + Value EnablePredictiveOptimization `json:"value"` ForceSendFields []string `json:"-" url:"-"` } @@ -4126,9 +3646,7 @@ func effectivePrivilegeToPb(st *EffectivePrivilege) (*effectivePrivilegePb, erro } pb := &effectivePrivilegePb{} pb.InheritedFromName = st.InheritedFromName - pb.InheritedFromType = st.InheritedFromType - pb.Privilege = st.Privilege pb.ForceSendFields = st.ForceSendFields @@ -4136,11 +3654,9 @@ func effectivePrivilegeToPb(st *EffectivePrivilege) (*effectivePrivilegePb, erro } type effectivePrivilegePb struct { - InheritedFromName string `json:"inherited_from_name,omitempty"` - + InheritedFromName string `json:"inherited_from_name,omitempty"` InheritedFromType SecurableType `json:"inherited_from_type,omitempty"` - - Privilege Privilege `json:"privilege,omitempty"` + Privilege Privilege `json:"privilege,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4172,7 +3688,6 @@ func effectivePrivilegeAssignmentToPb(st *EffectivePrivilegeAssignment) (*effect } pb := &effectivePrivilegeAssignmentPb{} pb.Principal = st.Principal - pb.Privileges = st.Privileges pb.ForceSendFields = st.ForceSendFields @@ -4180,8 +3695,7 @@ func effectivePrivilegeAssignmentToPb(st *EffectivePrivilegeAssignment) (*effect } type effectivePrivilegeAssignmentPb struct { - Principal string `json:"principal,omitempty"` - + Principal string `json:"principal,omitempty"` Privileges []EffectivePrivilege `json:"privileges,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4213,9 +3727,7 @@ func enableRequestToPb(st *EnableRequest) (*enableRequestPb, error) { } pb := &enableRequestPb{} pb.CatalogName = st.CatalogName - pb.MetastoreId = st.MetastoreId - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -4224,10 +3736,8 @@ func enableRequestToPb(st *EnableRequest) (*enableRequestPb, error) { type enableRequestPb struct { CatalogName string `json:"catalog_name,omitempty"` - MetastoreId string `json:"-" url:"-"` - - SchemaName string `json:"-" url:"-"` + SchemaName string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -4328,39 +3838,22 @@ func externalLocationInfoToPb(st *ExternalLocationInfo) (*externalLocationInfoPb } pb := &externalLocationInfoPb{} pb.BrowseOnly = st.BrowseOnly - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.CredentialId = st.CredentialId - pb.CredentialName = st.CredentialName - pb.EnableFileEvents = st.EnableFileEvents - pb.EncryptionDetails = st.EncryptionDetails - pb.Fallback = st.Fallback - pb.FileEventQueue = st.FileEventQueue - pb.IsolationMode = st.IsolationMode - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.ReadOnly = st.ReadOnly - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -4368,41 +3861,24 @@ func externalLocationInfoToPb(st *ExternalLocationInfo) (*externalLocationInfoPb } type externalLocationInfoPb struct { - BrowseOnly bool `json:"browse_only,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - CredentialId string `json:"credential_id,omitempty"` - - CredentialName string `json:"credential_name,omitempty"` - - EnableFileEvents bool `json:"enable_file_events,omitempty"` - + BrowseOnly bool `json:"browse_only,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + CredentialId string `json:"credential_id,omitempty"` + CredentialName string `json:"credential_name,omitempty"` + EnableFileEvents bool `json:"enable_file_events,omitempty"` EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` - - Fallback bool `json:"fallback,omitempty"` - - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - Url string `json:"url,omitempty"` + Fallback bool `json:"fallback,omitempty"` + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4449,7 +3925,6 @@ func failedStatusToPb(st *FailedStatus) (*failedStatusPb, error) { } pb := &failedStatusPb{} pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion - pb.Timestamp = st.Timestamp pb.ForceSendFields = st.ForceSendFields @@ -4457,9 +3932,8 @@ func failedStatusToPb(st *FailedStatus) (*failedStatusPb, error) { } type failedStatusPb struct { - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - - Timestamp string `json:"timestamp,omitempty"` + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + Timestamp string `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4490,7 +3964,6 @@ func failoverDatabaseInstanceRequestToPb(st *FailoverDatabaseInstanceRequest) (* } pb := &failoverDatabaseInstanceRequestPb{} pb.FailoverTargetDatabaseInstanceName = st.FailoverTargetDatabaseInstanceName - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -4499,8 +3972,7 @@ func failoverDatabaseInstanceRequestToPb(st *FailoverDatabaseInstanceRequest) (* type failoverDatabaseInstanceRequestPb struct { FailoverTargetDatabaseInstanceName string `json:"failover_target_database_instance_name,omitempty"` - - Name string `json:"-" url:"-"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -4531,32 +4003,22 @@ func fileEventQueueToPb(st *FileEventQueue) (*fileEventQueuePb, error) { } pb := &fileEventQueuePb{} pb.ManagedAqs = st.ManagedAqs - pb.ManagedPubsub = st.ManagedPubsub - pb.ManagedSqs = st.ManagedSqs - pb.ProvidedAqs = st.ProvidedAqs - pb.ProvidedPubsub = st.ProvidedPubsub - pb.ProvidedSqs = st.ProvidedSqs return pb, nil } type fileEventQueuePb struct { - ManagedAqs *AzureQueueStorage `json:"managed_aqs,omitempty"` - - ManagedPubsub *GcpPubsub `json:"managed_pubsub,omitempty"` - - ManagedSqs *AwsSqsQueue `json:"managed_sqs,omitempty"` - - ProvidedAqs *AzureQueueStorage `json:"provided_aqs,omitempty"` - - ProvidedPubsub *GcpPubsub `json:"provided_pubsub,omitempty"` - - ProvidedSqs *AwsSqsQueue `json:"provided_sqs,omitempty"` + ManagedAqs *AzureQueueStorage `json:"managed_aqs,omitempty"` + ManagedPubsub *GcpPubsub `json:"managed_pubsub,omitempty"` + ManagedSqs *AwsSqsQueue `json:"managed_sqs,omitempty"` + ProvidedAqs *AzureQueueStorage `json:"provided_aqs,omitempty"` + ProvidedPubsub *GcpPubsub `json:"provided_pubsub,omitempty"` + ProvidedSqs *AwsSqsQueue `json:"provided_sqs,omitempty"` } func fileEventQueueFromPb(pb *fileEventQueuePb) (*FileEventQueue, error) { @@ -4616,24 +4078,18 @@ func foreignKeyConstraintToPb(st *ForeignKeyConstraint) (*foreignKeyConstraintPb } pb := &foreignKeyConstraintPb{} pb.ChildColumns = st.ChildColumns - pb.Name = st.Name - pb.ParentColumns = st.ParentColumns - pb.ParentTable = st.ParentTable return pb, nil } type foreignKeyConstraintPb struct { - ChildColumns []string `json:"child_columns"` - - Name string `json:"name"` - + ChildColumns []string `json:"child_columns"` + Name string `json:"name"` ParentColumns []string `json:"parent_columns"` - - ParentTable string `json:"parent_table"` + ParentTable string `json:"parent_table"` } func foreignKeyConstraintFromPb(pb *foreignKeyConstraintPb) (*ForeignKeyConstraint, error) { @@ -4679,63 +4135,34 @@ func functionInfoToPb(st *FunctionInfo) (*functionInfoPb, error) { } pb := &functionInfoPb{} pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DataType = st.DataType - pb.ExternalLanguage = st.ExternalLanguage - pb.ExternalName = st.ExternalName - pb.FullDataType = st.FullDataType - pb.FullName = st.FullName - pb.FunctionId = st.FunctionId - pb.InputParams = st.InputParams - pb.IsDeterministic = st.IsDeterministic - pb.IsNullCall = st.IsNullCall - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.ParameterStyle = st.ParameterStyle - pb.Properties = st.Properties - pb.ReturnParams = st.ReturnParams - pb.RoutineBody = st.RoutineBody - pb.RoutineDefinition = st.RoutineDefinition - pb.RoutineDependencies = st.RoutineDependencies - pb.SchemaName = st.SchemaName - pb.SecurityType = st.SecurityType - pb.SpecificName = st.SpecificName - pb.SqlDataAccess = st.SqlDataAccess - pb.SqlPath = st.SqlPath - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -4743,65 +4170,36 @@ func functionInfoToPb(st *FunctionInfo) (*functionInfoPb, error) { } type functionInfoPb struct { - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DataType ColumnTypeName `json:"data_type,omitempty"` - - ExternalLanguage string `json:"external_language,omitempty"` - - ExternalName string `json:"external_name,omitempty"` - - FullDataType string `json:"full_data_type,omitempty"` - - FullName string `json:"full_name,omitempty"` - - FunctionId string `json:"function_id,omitempty"` - - InputParams *FunctionParameterInfos `json:"input_params,omitempty"` - - IsDeterministic bool `json:"is_deterministic,omitempty"` - - IsNullCall bool `json:"is_null_call,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ParameterStyle FunctionInfoParameterStyle `json:"parameter_style,omitempty"` - - Properties string `json:"properties,omitempty"` - - ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` - - RoutineBody FunctionInfoRoutineBody `json:"routine_body,omitempty"` - - RoutineDefinition string `json:"routine_definition,omitempty"` - - RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - SecurityType FunctionInfoSecurityType `json:"security_type,omitempty"` - - SpecificName string `json:"specific_name,omitempty"` - - SqlDataAccess FunctionInfoSqlDataAccess `json:"sql_data_access,omitempty"` - - SqlPath string `json:"sql_path,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DataType ColumnTypeName `json:"data_type,omitempty"` + ExternalLanguage string `json:"external_language,omitempty"` + ExternalName string `json:"external_name,omitempty"` + FullDataType string `json:"full_data_type,omitempty"` + FullName string `json:"full_name,omitempty"` + FunctionId string `json:"function_id,omitempty"` + InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + IsDeterministic bool `json:"is_deterministic,omitempty"` + IsNullCall bool `json:"is_null_call,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + ParameterStyle FunctionInfoParameterStyle `json:"parameter_style,omitempty"` + Properties string `json:"properties,omitempty"` + ReturnParams *FunctionParameterInfos `json:"return_params,omitempty"` + RoutineBody FunctionInfoRoutineBody `json:"routine_body,omitempty"` + RoutineDefinition string `json:"routine_definition,omitempty"` + RoutineDependencies *DependencyList `json:"routine_dependencies,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + SecurityType FunctionInfoSecurityType `json:"security_type,omitempty"` + SpecificName string `json:"specific_name,omitempty"` + SqlDataAccess FunctionInfoSqlDataAccess `json:"sql_data_access,omitempty"` + SqlPath string `json:"sql_path,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4860,27 +4258,16 @@ func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInf } pb := &functionParameterInfoPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.ParameterDefault = st.ParameterDefault - pb.ParameterMode = st.ParameterMode - pb.ParameterType = st.ParameterType - pb.Position = st.Position - pb.TypeIntervalType = st.TypeIntervalType - pb.TypeJson = st.TypeJson - pb.TypeName = st.TypeName - pb.TypePrecision = st.TypePrecision - pb.TypeScale = st.TypeScale - pb.TypeText = st.TypeText pb.ForceSendFields = st.ForceSendFields @@ -4888,29 +4275,18 @@ func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInf } type functionParameterInfoPb struct { - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - ParameterDefault string `json:"parameter_default,omitempty"` - - ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` - - ParameterType FunctionParameterType `json:"parameter_type,omitempty"` - - Position int `json:"position"` - - TypeIntervalType string `json:"type_interval_type,omitempty"` - - TypeJson string `json:"type_json,omitempty"` - - TypeName ColumnTypeName `json:"type_name"` - - TypePrecision int `json:"type_precision,omitempty"` - - TypeScale int `json:"type_scale,omitempty"` - - TypeText string `json:"type_text"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + ParameterDefault string `json:"parameter_default,omitempty"` + ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + Position int `json:"position"` + TypeIntervalType string `json:"type_interval_type,omitempty"` + TypeJson string `json:"type_json,omitempty"` + TypeName ColumnTypeName `json:"type_name"` + TypePrecision int `json:"type_precision,omitempty"` + TypeScale int `json:"type_scale,omitempty"` + TypeText string `json:"type_text"` ForceSendFields []string `json:"-" url:"-"` } @@ -5011,7 +4387,6 @@ func gcpPubsubToPb(st *GcpPubsub) (*gcpPubsubPb, error) { } pb := &gcpPubsubPb{} pb.ManagedResourceId = st.ManagedResourceId - pb.SubscriptionName = st.SubscriptionName pb.ForceSendFields = st.ForceSendFields @@ -5020,8 +4395,7 @@ func gcpPubsubToPb(st *GcpPubsub) (*gcpPubsubPb, error) { type gcpPubsubPb struct { ManagedResourceId string `json:"managed_resource_id,omitempty"` - - SubscriptionName string `json:"subscription_name,omitempty"` + SubscriptionName string `json:"subscription_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5052,7 +4426,6 @@ func generateDatabaseCredentialRequestToPb(st *GenerateDatabaseCredentialRequest } pb := &generateDatabaseCredentialRequestPb{} pb.InstanceNames = st.InstanceNames - pb.RequestId = st.RequestId pb.ForceSendFields = st.ForceSendFields @@ -5061,8 +4434,7 @@ func generateDatabaseCredentialRequestToPb(st *GenerateDatabaseCredentialRequest type generateDatabaseCredentialRequestPb struct { InstanceNames []string `json:"instance_names,omitempty"` - - RequestId string `json:"request_id,omitempty"` + RequestId string `json:"request_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5141,20 +4513,16 @@ func generateTemporaryServiceCredentialRequestToPb(st *GenerateTemporaryServiceC } pb := &generateTemporaryServiceCredentialRequestPb{} pb.AzureOptions = st.AzureOptions - pb.CredentialName = st.CredentialName - pb.GcpOptions = st.GcpOptions return pb, nil } type generateTemporaryServiceCredentialRequestPb struct { - AzureOptions *GenerateTemporaryServiceCredentialAzureOptions `json:"azure_options,omitempty"` - - CredentialName string `json:"credential_name"` - - GcpOptions *GenerateTemporaryServiceCredentialGcpOptions `json:"gcp_options,omitempty"` + AzureOptions *GenerateTemporaryServiceCredentialAzureOptions `json:"azure_options,omitempty"` + CredentialName string `json:"credential_name"` + GcpOptions *GenerateTemporaryServiceCredentialGcpOptions `json:"gcp_options,omitempty"` } func generateTemporaryServiceCredentialRequestFromPb(pb *generateTemporaryServiceCredentialRequestPb) (*GenerateTemporaryServiceCredentialRequest, error) { @@ -5175,7 +4543,6 @@ func generateTemporaryTableCredentialRequestToPb(st *GenerateTemporaryTableCrede } pb := &generateTemporaryTableCredentialRequestPb{} pb.Operation = st.Operation - pb.TableId = st.TableId pb.ForceSendFields = st.ForceSendFields @@ -5184,8 +4551,7 @@ func generateTemporaryTableCredentialRequestToPb(st *GenerateTemporaryTableCrede type generateTemporaryTableCredentialRequestPb struct { Operation TableOperation `json:"operation,omitempty"` - - TableId string `json:"table_id,omitempty"` + TableId string `json:"table_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5216,17 +4582,11 @@ func generateTemporaryTableCredentialResponseToPb(st *GenerateTemporaryTableCred } pb := &generateTemporaryTableCredentialResponsePb{} pb.AwsTempCredentials = st.AwsTempCredentials - pb.AzureAad = st.AzureAad - pb.AzureUserDelegationSas = st.AzureUserDelegationSas - pb.ExpirationTime = st.ExpirationTime - pb.GcpOauthToken = st.GcpOauthToken - pb.R2TempCredentials = st.R2TempCredentials - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -5234,19 +4594,13 @@ func generateTemporaryTableCredentialResponseToPb(st *GenerateTemporaryTableCred } type generateTemporaryTableCredentialResponsePb struct { - AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` - - AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` - - AzureUserDelegationSas *AzureUserDelegationSas `json:"azure_user_delegation_sas,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` - - R2TempCredentials *R2Credentials `json:"r2_temp_credentials,omitempty"` - - Url string `json:"url,omitempty"` + AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + AzureUserDelegationSas *AzureUserDelegationSas `json:"azure_user_delegation_sas,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + R2TempCredentials *R2Credentials `json:"r2_temp_credentials,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5330,15 +4684,13 @@ func getAccountStorageCredentialRequestToPb(st *GetAccountStorageCredentialReque } pb := &getAccountStorageCredentialRequestPb{} pb.MetastoreId = st.MetastoreId - pb.StorageCredentialName = st.StorageCredentialName return pb, nil } type getAccountStorageCredentialRequestPb struct { - MetastoreId string `json:"-" url:"-"` - + MetastoreId string `json:"-" url:"-"` StorageCredentialName string `json:"-" url:"-"` } @@ -5383,11 +4735,8 @@ func getBindingsRequestToPb(st *GetBindingsRequest) (*getBindingsRequestPb, erro } pb := &getBindingsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.SecurableName = st.SecurableName - pb.SecurableType = st.SecurableType pb.ForceSendFields = st.ForceSendFields @@ -5395,12 +4744,9 @@ func getBindingsRequestToPb(st *GetBindingsRequest) (*getBindingsRequestPb, erro } type getBindingsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` SecurableName string `json:"-" url:"-"` - SecurableType string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -5434,9 +4780,7 @@ func getByAliasRequestToPb(st *GetByAliasRequest) (*getByAliasRequestPb, error) } pb := &getByAliasRequestPb{} pb.Alias = st.Alias - pb.FullName = st.FullName - pb.IncludeAliases = st.IncludeAliases pb.ForceSendFields = st.ForceSendFields @@ -5444,11 +4788,9 @@ func getByAliasRequestToPb(st *GetByAliasRequest) (*getByAliasRequestPb, error) } type getByAliasRequestPb struct { - Alias string `json:"-" url:"-"` - - FullName string `json:"-" url:"-"` - - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + Alias string `json:"-" url:"-"` + FullName string `json:"-" url:"-"` + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5480,7 +4822,6 @@ func getCatalogRequestToPb(st *GetCatalogRequest) (*getCatalogRequestPb, error) } pb := &getCatalogRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -5488,9 +4829,8 @@ func getCatalogRequestToPb(st *GetCatalogRequest) (*getCatalogRequestPb, error) } type getCatalogRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - Name string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -5665,9 +5005,7 @@ func getEffectiveRequestToPb(st *GetEffectiveRequest) (*getEffectiveRequestPb, e } pb := &getEffectiveRequestPb{} pb.FullName = st.FullName - pb.Principal = st.Principal - pb.SecurableType = st.SecurableType pb.ForceSendFields = st.ForceSendFields @@ -5675,10 +5013,8 @@ func getEffectiveRequestToPb(st *GetEffectiveRequest) (*getEffectiveRequestPb, e } type getEffectiveRequestPb struct { - FullName string `json:"-" url:"-"` - - Principal string `json:"-" url:"principal,omitempty"` - + FullName string `json:"-" url:"-"` + Principal string `json:"-" url:"principal,omitempty"` SecurableType SecurableType `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -5711,7 +5047,6 @@ func getExternalLocationRequestToPb(st *GetExternalLocationRequest) (*getExterna } pb := &getExternalLocationRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -5719,9 +5054,8 @@ func getExternalLocationRequestToPb(st *GetExternalLocationRequest) (*getExterna } type getExternalLocationRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - Name string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -5752,7 +5086,6 @@ func getFunctionRequestToPb(st *GetFunctionRequest) (*getFunctionRequestPb, erro } pb := &getFunctionRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -5760,9 +5093,8 @@ func getFunctionRequestToPb(st *GetFunctionRequest) (*getFunctionRequestPb, erro } type getFunctionRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - Name string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -5793,9 +5125,7 @@ func getGrantRequestToPb(st *GetGrantRequest) (*getGrantRequestPb, error) { } pb := &getGrantRequestPb{} pb.FullName = st.FullName - pb.Principal = st.Principal - pb.SecurableType = st.SecurableType pb.ForceSendFields = st.ForceSendFields @@ -5803,10 +5133,8 @@ func getGrantRequestToPb(st *GetGrantRequest) (*getGrantRequestPb, error) { } type getGrantRequestPb struct { - FullName string `json:"-" url:"-"` - - Principal string `json:"-" url:"principal,omitempty"` - + FullName string `json:"-" url:"-"` + Principal string `json:"-" url:"principal,omitempty"` SecurableType SecurableType `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -5863,41 +5191,23 @@ func getMetastoreSummaryResponseToPb(st *GetMetastoreSummaryResponse) (*getMetas } pb := &getMetastoreSummaryResponsePb{} pb.Cloud = st.Cloud - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DefaultDataAccessConfigId = st.DefaultDataAccessConfigId - pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName - pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds - pb.DeltaSharingScope = st.DeltaSharingScope - pb.ExternalAccessEnabled = st.ExternalAccessEnabled - pb.GlobalMetastoreId = st.GlobalMetastoreId - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.PrivilegeModelVersion = st.PrivilegeModelVersion - pb.Region = st.Region - pb.StorageRoot = st.StorageRoot - pb.StorageRootCredentialId = st.StorageRootCredentialId - pb.StorageRootCredentialName = st.StorageRootCredentialName - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -5905,43 +5215,25 @@ func getMetastoreSummaryResponseToPb(st *GetMetastoreSummaryResponse) (*getMetas } type getMetastoreSummaryResponsePb struct { - Cloud string `json:"cloud,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` - - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` - - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` - - DeltaSharingScope GetMetastoreSummaryResponseDeltaSharingScope `json:"delta_sharing_scope,omitempty"` - - ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` - - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` - - Region string `json:"region,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` - - StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Cloud string `json:"cloud,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + DeltaSharingScope GetMetastoreSummaryResponseDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + Region string `json:"region,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5989,11 +5281,8 @@ func getModelVersionRequestToPb(st *GetModelVersionRequest) (*getModelVersionReq } pb := &getModelVersionRequestPb{} pb.FullName = st.FullName - pb.IncludeAliases = st.IncludeAliases - pb.IncludeBrowse = st.IncludeBrowse - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -6001,13 +5290,10 @@ func getModelVersionRequestToPb(st *GetModelVersionRequest) (*getModelVersionReq } type getModelVersionRequestPb struct { - FullName string `json:"-" url:"-"` - - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - Version int `json:"-" url:"-"` + FullName string `json:"-" url:"-"` + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + Version int `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -6088,20 +5374,16 @@ func getQuotaRequestToPb(st *GetQuotaRequest) (*getQuotaRequestPb, error) { } pb := &getQuotaRequestPb{} pb.ParentFullName = st.ParentFullName - pb.ParentSecurableType = st.ParentSecurableType - pb.QuotaName = st.QuotaName return pb, nil } type getQuotaRequestPb struct { - ParentFullName string `json:"-" url:"-"` - + ParentFullName string `json:"-" url:"-"` ParentSecurableType string `json:"-" url:"-"` - - QuotaName string `json:"-" url:"-"` + QuotaName string `json:"-" url:"-"` } func getQuotaRequestFromPb(pb *getQuotaRequestPb) (*GetQuotaRequest, error) { @@ -6146,7 +5428,6 @@ func getRefreshRequestToPb(st *GetRefreshRequest) (*getRefreshRequestPb, error) } pb := &getRefreshRequestPb{} pb.RefreshId = st.RefreshId - pb.TableName = st.TableName return pb, nil @@ -6154,7 +5435,6 @@ func getRefreshRequestToPb(st *GetRefreshRequest) (*getRefreshRequestPb, error) type getRefreshRequestPb struct { RefreshId string `json:"-" url:"-"` - TableName string `json:"-" url:"-"` } @@ -6175,9 +5455,7 @@ func getRegisteredModelRequestToPb(st *GetRegisteredModelRequest) (*getRegistere } pb := &getRegisteredModelRequestPb{} pb.FullName = st.FullName - pb.IncludeAliases = st.IncludeAliases - pb.IncludeBrowse = st.IncludeBrowse pb.ForceSendFields = st.ForceSendFields @@ -6185,11 +5463,9 @@ func getRegisteredModelRequestToPb(st *GetRegisteredModelRequest) (*getRegistere } type getRegisteredModelRequestPb struct { - FullName string `json:"-" url:"-"` - - IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + FullName string `json:"-" url:"-"` + IncludeAliases bool `json:"-" url:"include_aliases,omitempty"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6221,7 +5497,6 @@ func getSchemaRequestToPb(st *GetSchemaRequest) (*getSchemaRequestPb, error) { } pb := &getSchemaRequestPb{} pb.FullName = st.FullName - pb.IncludeBrowse = st.IncludeBrowse pb.ForceSendFields = st.ForceSendFields @@ -6229,9 +5504,8 @@ func getSchemaRequestToPb(st *GetSchemaRequest) (*getSchemaRequestPb, error) { } type getSchemaRequestPb struct { - FullName string `json:"-" url:"-"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + FullName string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6310,11 +5584,8 @@ func getTableRequestToPb(st *GetTableRequest) (*getTableRequestPb, error) { } pb := &getTableRequestPb{} pb.FullName = st.FullName - pb.IncludeBrowse = st.IncludeBrowse - pb.IncludeDeltaMetadata = st.IncludeDeltaMetadata - pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities pb.ForceSendFields = st.ForceSendFields @@ -6322,13 +5593,10 @@ func getTableRequestToPb(st *GetTableRequest) (*getTableRequestPb, error) { } type getTableRequestPb struct { - FullName string `json:"-" url:"-"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` - - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + FullName string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6385,7 +5653,6 @@ func getWorkspaceBindingsResponseToPb(st *GetWorkspaceBindingsResponse) (*getWor } pb := &getWorkspaceBindingsResponsePb{} pb.Bindings = st.Bindings - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6393,9 +5660,8 @@ func getWorkspaceBindingsResponseToPb(st *GetWorkspaceBindingsResponse) (*getWor } type getWorkspaceBindingsResponsePb struct { - Bindings []WorkspaceBinding `json:"bindings,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Bindings []WorkspaceBinding `json:"bindings,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6522,9 +5788,7 @@ func listCatalogsRequestToPb(st *ListCatalogsRequest) (*listCatalogsRequestPb, e } pb := &listCatalogsRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6532,11 +5796,9 @@ func listCatalogsRequestToPb(st *ListCatalogsRequest) (*listCatalogsRequestPb, e } type listCatalogsRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6568,7 +5830,6 @@ func listCatalogsResponseToPb(st *ListCatalogsResponse) (*listCatalogsResponsePb } pb := &listCatalogsResponsePb{} pb.Catalogs = st.Catalogs - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6576,9 +5837,8 @@ func listCatalogsResponseToPb(st *ListCatalogsResponse) (*listCatalogsResponsePb } type listCatalogsResponsePb struct { - Catalogs []CatalogInfo `json:"catalogs,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Catalogs []CatalogInfo `json:"catalogs,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6609,7 +5869,6 @@ func listConnectionsRequestToPb(st *ListConnectionsRequest) (*listConnectionsReq } pb := &listConnectionsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6617,9 +5876,8 @@ func listConnectionsRequestToPb(st *ListConnectionsRequest) (*listConnectionsReq } type listConnectionsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6650,7 +5908,6 @@ func listConnectionsResponseToPb(st *ListConnectionsResponse) (*listConnectionsR } pb := &listConnectionsResponsePb{} pb.Connections = st.Connections - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6658,9 +5915,8 @@ func listConnectionsResponseToPb(st *ListConnectionsResponse) (*listConnectionsR } type listConnectionsResponsePb struct { - Connections []ConnectionInfo `json:"connections,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Connections []ConnectionInfo `json:"connections,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6691,9 +5947,7 @@ func listCredentialsRequestToPb(st *ListCredentialsRequest) (*listCredentialsReq } pb := &listCredentialsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.Purpose = st.Purpose pb.ForceSendFields = st.ForceSendFields @@ -6701,11 +5955,9 @@ func listCredentialsRequestToPb(st *ListCredentialsRequest) (*listCredentialsReq } type listCredentialsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6737,7 +5989,6 @@ func listCredentialsResponseToPb(st *ListCredentialsResponse) (*listCredentialsR } pb := &listCredentialsResponsePb{} pb.Credentials = st.Credentials - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6745,9 +5996,8 @@ func listCredentialsResponseToPb(st *ListCredentialsResponse) (*listCredentialsR } type listCredentialsResponsePb struct { - Credentials []CredentialInfo `json:"credentials,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Credentials []CredentialInfo `json:"credentials,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6778,7 +6028,6 @@ func listDatabaseInstancesRequestToPb(st *ListDatabaseInstancesRequest) (*listDa } pb := &listDatabaseInstancesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6786,8 +6035,7 @@ func listDatabaseInstancesRequestToPb(st *ListDatabaseInstancesRequest) (*listDa } type listDatabaseInstancesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6819,7 +6067,6 @@ func listDatabaseInstancesResponseToPb(st *ListDatabaseInstancesResponse) (*list } pb := &listDatabaseInstancesResponsePb{} pb.DatabaseInstances = st.DatabaseInstances - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6828,8 +6075,7 @@ func listDatabaseInstancesResponseToPb(st *ListDatabaseInstancesResponse) (*list type listDatabaseInstancesResponsePb struct { DatabaseInstances []DatabaseInstance `json:"database_instances,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6860,9 +6106,7 @@ func listExternalLocationsRequestToPb(st *ListExternalLocationsRequest) (*listEx } pb := &listExternalLocationsRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6870,11 +6114,9 @@ func listExternalLocationsRequestToPb(st *ListExternalLocationsRequest) (*listEx } type listExternalLocationsRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6906,7 +6148,6 @@ func listExternalLocationsResponseToPb(st *ListExternalLocationsResponse) (*list } pb := &listExternalLocationsResponsePb{} pb.ExternalLocations = st.ExternalLocations - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6915,8 +6156,7 @@ func listExternalLocationsResponseToPb(st *ListExternalLocationsResponse) (*list type listExternalLocationsResponsePb struct { ExternalLocations []ExternalLocationInfo `json:"external_locations,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6947,13 +6187,9 @@ func listFunctionsRequestToPb(st *ListFunctionsRequest) (*listFunctionsRequestPb } pb := &listFunctionsRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -6961,15 +6197,11 @@ func listFunctionsRequestToPb(st *ListFunctionsRequest) (*listFunctionsRequestPb } type listFunctionsRequestPb struct { - CatalogName string `json:"-" url:"catalog_name"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SchemaName string `json:"-" url:"schema_name"` + CatalogName string `json:"-" url:"catalog_name"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SchemaName string `json:"-" url:"schema_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -7003,7 +6235,6 @@ func listFunctionsResponseToPb(st *ListFunctionsResponse) (*listFunctionsRespons } pb := &listFunctionsResponsePb{} pb.Functions = st.Functions - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -7011,9 +6242,8 @@ func listFunctionsResponseToPb(st *ListFunctionsResponse) (*listFunctionsRespons } type listFunctionsResponsePb struct { - Functions []FunctionInfo `json:"functions,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Functions []FunctionInfo `json:"functions,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7068,11 +6298,8 @@ func listModelVersionsRequestToPb(st *ListModelVersionsRequest) (*listModelVersi } pb := &listModelVersionsRequestPb{} pb.FullName = st.FullName - pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -7080,13 +6307,10 @@ func listModelVersionsRequestToPb(st *ListModelVersionsRequest) (*listModelVersi } type listModelVersionsRequestPb struct { - FullName string `json:"-" url:"-"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + FullName string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7119,7 +6343,6 @@ func listModelVersionsResponseToPb(st *ListModelVersionsResponse) (*listModelVer } pb := &listModelVersionsResponsePb{} pb.ModelVersions = st.ModelVersions - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -7128,8 +6351,7 @@ func listModelVersionsResponseToPb(st *ListModelVersionsResponse) (*listModelVer type listModelVersionsResponsePb struct { ModelVersions []ModelVersionInfo `json:"model_versions,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7160,7 +6382,6 @@ func listQuotasRequestToPb(st *ListQuotasRequest) (*listQuotasRequestPb, error) } pb := &listQuotasRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -7168,9 +6389,8 @@ func listQuotasRequestToPb(st *ListQuotasRequest) (*listQuotasRequestPb, error) } type listQuotasRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7201,7 +6421,6 @@ func listQuotasResponseToPb(st *ListQuotasResponse) (*listQuotasResponsePb, erro } pb := &listQuotasResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Quotas = st.Quotas pb.ForceSendFields = st.ForceSendFields @@ -7209,9 +6428,8 @@ func listQuotasResponseToPb(st *ListQuotasResponse) (*listQuotasResponsePb, erro } type listQuotasResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Quotas []QuotaInfo `json:"quotas,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Quotas []QuotaInfo `json:"quotas,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7266,13 +6484,9 @@ func listRegisteredModelsRequestToPb(st *ListRegisteredModelsRequest) (*listRegi } pb := &listRegisteredModelsRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -7280,15 +6494,11 @@ func listRegisteredModelsRequestToPb(st *ListRegisteredModelsRequest) (*listRegi } type listRegisteredModelsRequestPb struct { - CatalogName string `json:"-" url:"catalog_name,omitempty"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SchemaName string `json:"-" url:"schema_name,omitempty"` + CatalogName string `json:"-" url:"catalog_name,omitempty"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SchemaName string `json:"-" url:"schema_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7322,7 +6532,6 @@ func listRegisteredModelsResponseToPb(st *ListRegisteredModelsResponse) (*listRe } pb := &listRegisteredModelsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.RegisteredModels = st.RegisteredModels pb.ForceSendFields = st.ForceSendFields @@ -7330,8 +6539,7 @@ func listRegisteredModelsResponseToPb(st *ListRegisteredModelsResponse) (*listRe } type listRegisteredModelsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` RegisteredModels []RegisteredModelInfo `json:"registered_models,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7363,11 +6571,8 @@ func listSchemasRequestToPb(st *ListSchemasRequest) (*listSchemasRequestPb, erro } pb := &listSchemasRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -7375,13 +6580,10 @@ func listSchemasRequestToPb(st *ListSchemasRequest) (*listSchemasRequestPb, erro } type listSchemasRequestPb struct { - CatalogName string `json:"-" url:"catalog_name"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + CatalogName string `json:"-" url:"catalog_name"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7414,7 +6616,6 @@ func listSchemasResponseToPb(st *ListSchemasResponse) (*listSchemasResponsePb, e } pb := &listSchemasResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Schemas = st.Schemas pb.ForceSendFields = st.ForceSendFields @@ -7422,9 +6623,8 @@ func listSchemasResponseToPb(st *ListSchemasResponse) (*listSchemasResponsePb, e } type listSchemasResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Schemas []SchemaInfo `json:"schemas,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Schemas []SchemaInfo `json:"schemas,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7455,7 +6655,6 @@ func listStorageCredentialsRequestToPb(st *ListStorageCredentialsRequest) (*list } pb := &listStorageCredentialsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -7463,9 +6662,8 @@ func listStorageCredentialsRequestToPb(st *ListStorageCredentialsRequest) (*list } type listStorageCredentialsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7496,7 +6694,6 @@ func listStorageCredentialsResponseToPb(st *ListStorageCredentialsResponse) (*li } pb := &listStorageCredentialsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.StorageCredentials = st.StorageCredentials pb.ForceSendFields = st.ForceSendFields @@ -7504,8 +6701,7 @@ func listStorageCredentialsResponseToPb(st *ListStorageCredentialsResponse) (*li } type listStorageCredentialsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7537,15 +6733,10 @@ func listSummariesRequestToPb(st *ListSummariesRequest) (*listSummariesRequestPb } pb := &listSummariesRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.SchemaNamePattern = st.SchemaNamePattern - pb.TableNamePattern = st.TableNamePattern pb.ForceSendFields = st.ForceSendFields @@ -7553,17 +6744,12 @@ func listSummariesRequestToPb(st *ListSummariesRequest) (*listSummariesRequestPb } type listSummariesRequestPb struct { - CatalogName string `json:"-" url:"catalog_name"` - - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SchemaNamePattern string `json:"-" url:"schema_name_pattern,omitempty"` - - TableNamePattern string `json:"-" url:"table_name_pattern,omitempty"` + CatalogName string `json:"-" url:"catalog_name"` + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SchemaNamePattern string `json:"-" url:"schema_name_pattern,omitempty"` + TableNamePattern string `json:"-" url:"table_name_pattern,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7598,9 +6784,7 @@ func listSystemSchemasRequestToPb(st *ListSystemSchemasRequest) (*listSystemSche } pb := &listSystemSchemasRequestPb{} pb.MaxResults = st.MaxResults - pb.MetastoreId = st.MetastoreId - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -7608,11 +6792,9 @@ func listSystemSchemasRequestToPb(st *ListSystemSchemasRequest) (*listSystemSche } type listSystemSchemasRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - + MaxResults int `json:"-" url:"max_results,omitempty"` MetastoreId string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7644,7 +6826,6 @@ func listSystemSchemasResponseToPb(st *ListSystemSchemasResponse) (*listSystemSc } pb := &listSystemSchemasResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Schemas = st.Schemas pb.ForceSendFields = st.ForceSendFields @@ -7652,9 +6833,8 @@ func listSystemSchemasResponseToPb(st *ListSystemSchemasResponse) (*listSystemSc } type listSystemSchemasResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Schemas []SystemSchemaInfo `json:"schemas,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Schemas []SystemSchemaInfo `json:"schemas,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7685,7 +6865,6 @@ func listTableSummariesResponseToPb(st *ListTableSummariesResponse) (*listTableS } pb := &listTableSummariesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Tables = st.Tables pb.ForceSendFields = st.ForceSendFields @@ -7693,9 +6872,8 @@ func listTableSummariesResponseToPb(st *ListTableSummariesResponse) (*listTableS } type listTableSummariesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Tables []TableSummary `json:"tables,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Tables []TableSummary `json:"tables,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7726,23 +6904,14 @@ func listTablesRequestToPb(st *ListTablesRequest) (*listTablesRequestPb, error) } pb := &listTablesRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeBrowse = st.IncludeBrowse - pb.IncludeDeltaMetadata = st.IncludeDeltaMetadata - pb.IncludeManifestCapabilities = st.IncludeManifestCapabilities - pb.MaxResults = st.MaxResults - pb.OmitColumns = st.OmitColumns - pb.OmitProperties = st.OmitProperties - pb.OmitUsername = st.OmitUsername - pb.PageToken = st.PageToken - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -7750,25 +6919,16 @@ func listTablesRequestToPb(st *ListTablesRequest) (*listTablesRequestPb, error) } type listTablesRequestPb struct { - CatalogName string `json:"-" url:"catalog_name"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` - - IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - OmitColumns bool `json:"-" url:"omit_columns,omitempty"` - - OmitProperties bool `json:"-" url:"omit_properties,omitempty"` - - OmitUsername bool `json:"-" url:"omit_username,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SchemaName string `json:"-" url:"schema_name"` + CatalogName string `json:"-" url:"catalog_name"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` + IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + OmitColumns bool `json:"-" url:"omit_columns,omitempty"` + OmitProperties bool `json:"-" url:"omit_properties,omitempty"` + OmitUsername bool `json:"-" url:"omit_username,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SchemaName string `json:"-" url:"schema_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -7807,7 +6967,6 @@ func listTablesResponseToPb(st *ListTablesResponse) (*listTablesResponsePb, erro } pb := &listTablesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Tables = st.Tables pb.ForceSendFields = st.ForceSendFields @@ -7815,9 +6974,8 @@ func listTablesResponseToPb(st *ListTablesResponse) (*listTablesResponsePb, erro } type listTablesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Tables []TableInfo `json:"tables,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Tables []TableInfo `json:"tables,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7848,13 +7006,9 @@ func listVolumesRequestToPb(st *ListVolumesRequest) (*listVolumesRequestPb, erro } pb := &listVolumesRequestPb{} pb.CatalogName = st.CatalogName - pb.IncludeBrowse = st.IncludeBrowse - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -7862,15 +7016,11 @@ func listVolumesRequestToPb(st *ListVolumesRequest) (*listVolumesRequestPb, erro } type listVolumesRequestPb struct { - CatalogName string `json:"-" url:"catalog_name"` - - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SchemaName string `json:"-" url:"schema_name"` + CatalogName string `json:"-" url:"catalog_name"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SchemaName string `json:"-" url:"schema_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -7904,7 +7054,6 @@ func listVolumesResponseContentToPb(st *ListVolumesResponseContent) (*listVolume } pb := &listVolumesResponseContentPb{} pb.NextPageToken = st.NextPageToken - pb.Volumes = st.Volumes pb.ForceSendFields = st.ForceSendFields @@ -7912,9 +7061,8 @@ func listVolumesResponseContentToPb(st *ListVolumesResponseContent) (*listVolume } type listVolumesResponseContentPb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Volumes []VolumeInfo `json:"volumes,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Volumes []VolumeInfo `json:"volumes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7945,9 +7093,7 @@ func metastoreAssignmentToPb(st *MetastoreAssignment) (*metastoreAssignmentPb, e } pb := &metastoreAssignmentPb{} pb.DefaultCatalogName = st.DefaultCatalogName - pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -7956,10 +7102,8 @@ func metastoreAssignmentToPb(st *MetastoreAssignment) (*metastoreAssignmentPb, e type metastoreAssignmentPb struct { DefaultCatalogName string `json:"default_catalog_name,omitempty"` - - MetastoreId string `json:"metastore_id"` - - WorkspaceId int64 `json:"workspace_id"` + MetastoreId string `json:"metastore_id"` + WorkspaceId int64 `json:"workspace_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -7991,41 +7135,23 @@ func metastoreInfoToPb(st *MetastoreInfo) (*metastoreInfoPb, error) { } pb := &metastoreInfoPb{} pb.Cloud = st.Cloud - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DefaultDataAccessConfigId = st.DefaultDataAccessConfigId - pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName - pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds - pb.DeltaSharingScope = st.DeltaSharingScope - pb.ExternalAccessEnabled = st.ExternalAccessEnabled - pb.GlobalMetastoreId = st.GlobalMetastoreId - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.PrivilegeModelVersion = st.PrivilegeModelVersion - pb.Region = st.Region - pb.StorageRoot = st.StorageRoot - pb.StorageRootCredentialId = st.StorageRootCredentialId - pb.StorageRootCredentialName = st.StorageRootCredentialName - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -8033,43 +7159,25 @@ func metastoreInfoToPb(st *MetastoreInfo) (*metastoreInfoPb, error) { } type metastoreInfoPb struct { - Cloud string `json:"cloud,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` - - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` - - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` - - DeltaSharingScope MetastoreInfoDeltaSharingScope `json:"delta_sharing_scope,omitempty"` - - ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` - - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` - - Region string `json:"region,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` - - StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Cloud string `json:"cloud,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DefaultDataAccessConfigId string `json:"default_data_access_config_id,omitempty"` + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + DeltaSharingScope MetastoreInfoDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + Region string `json:"region,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + StorageRootCredentialName string `json:"storage_root_credential_name,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8117,41 +7225,23 @@ func modelVersionInfoToPb(st *ModelVersionInfo) (*modelVersionInfoPb, error) { } pb := &modelVersionInfoPb{} pb.Aliases = st.Aliases - pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Id = st.Id - pb.MetastoreId = st.MetastoreId - pb.ModelName = st.ModelName - pb.ModelVersionDependencies = st.ModelVersionDependencies - pb.RunId = st.RunId - pb.RunWorkspaceId = st.RunWorkspaceId - pb.SchemaName = st.SchemaName - pb.Source = st.Source - pb.Status = st.Status - pb.StorageLocation = st.StorageLocation - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -8159,46 +7249,28 @@ func modelVersionInfoToPb(st *ModelVersionInfo) (*modelVersionInfoPb, error) { } type modelVersionInfoPb struct { - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + Id string `json:"id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + ModelName string `json:"model_name,omitempty"` + ModelVersionDependencies *DependencyList `json:"model_version_dependencies,omitempty"` + RunId string `json:"run_id,omitempty"` + RunWorkspaceId int `json:"run_workspace_id,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + Source string `json:"source,omitempty"` + Status ModelVersionInfoStatus `json:"status,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + Version int `json:"version,omitempty"` - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - Id string `json:"id,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - ModelName string `json:"model_name,omitempty"` - - ModelVersionDependencies *DependencyList `json:"model_version_dependencies,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunWorkspaceId int `json:"run_workspace_id,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - Source string `json:"source,omitempty"` - - Status ModelVersionInfoStatus `json:"status,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - Version int `json:"version,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} + ForceSendFields []string `json:"-" url:"-"` +} func modelVersionInfoFromPb(pb *modelVersionInfoPb) (*ModelVersionInfo, error) { if pb == nil { @@ -8243,20 +7315,16 @@ func monitorCronScheduleToPb(st *MonitorCronSchedule) (*monitorCronSchedulePb, e } pb := &monitorCronSchedulePb{} pb.PauseStatus = st.PauseStatus - pb.QuartzCronExpression = st.QuartzCronExpression - pb.TimezoneId = st.TimezoneId return pb, nil } type monitorCronSchedulePb struct { - PauseStatus MonitorCronSchedulePauseStatus `json:"pause_status,omitempty"` - - QuartzCronExpression string `json:"quartz_cron_expression"` - - TimezoneId string `json:"timezone_id"` + PauseStatus MonitorCronSchedulePauseStatus `json:"pause_status,omitempty"` + QuartzCronExpression string `json:"quartz_cron_expression"` + TimezoneId string `json:"timezone_id"` } func monitorCronScheduleFromPb(pb *monitorCronSchedulePb) (*MonitorCronSchedule, error) { @@ -8337,17 +7405,11 @@ func monitorInferenceLogToPb(st *MonitorInferenceLog) (*monitorInferenceLogPb, e } pb := &monitorInferenceLogPb{} pb.Granularities = st.Granularities - pb.LabelCol = st.LabelCol - pb.ModelIdCol = st.ModelIdCol - pb.PredictionCol = st.PredictionCol - pb.PredictionProbaCol = st.PredictionProbaCol - pb.ProblemType = st.ProblemType - pb.TimestampCol = st.TimestampCol pb.ForceSendFields = st.ForceSendFields @@ -8355,19 +7417,13 @@ func monitorInferenceLogToPb(st *MonitorInferenceLog) (*monitorInferenceLogPb, e } type monitorInferenceLogPb struct { - Granularities []string `json:"granularities"` - - LabelCol string `json:"label_col,omitempty"` - - ModelIdCol string `json:"model_id_col"` - - PredictionCol string `json:"prediction_col"` - - PredictionProbaCol string `json:"prediction_proba_col,omitempty"` - - ProblemType MonitorInferenceLogProblemType `json:"problem_type"` - - TimestampCol string `json:"timestamp_col"` + Granularities []string `json:"granularities"` + LabelCol string `json:"label_col,omitempty"` + ModelIdCol string `json:"model_id_col"` + PredictionCol string `json:"prediction_col"` + PredictionProbaCol string `json:"prediction_proba_col,omitempty"` + ProblemType MonitorInferenceLogProblemType `json:"problem_type"` + TimestampCol string `json:"timestamp_col"` ForceSendFields []string `json:"-" url:"-"` } @@ -8403,39 +7459,22 @@ func monitorInfoToPb(st *MonitorInfo) (*monitorInfoPb, error) { } pb := &monitorInfoPb{} pb.AssetsDir = st.AssetsDir - pb.BaselineTableName = st.BaselineTableName - pb.CustomMetrics = st.CustomMetrics - pb.DashboardId = st.DashboardId - pb.DataClassificationConfig = st.DataClassificationConfig - pb.DriftMetricsTableName = st.DriftMetricsTableName - pb.InferenceLog = st.InferenceLog - pb.LatestMonitorFailureMsg = st.LatestMonitorFailureMsg - pb.MonitorVersion = st.MonitorVersion - pb.Notifications = st.Notifications - pb.OutputSchemaName = st.OutputSchemaName - pb.ProfileMetricsTableName = st.ProfileMetricsTableName - pb.Schedule = st.Schedule - pb.SlicingExprs = st.SlicingExprs - pb.Snapshot = st.Snapshot - pb.Status = st.Status - pb.TableName = st.TableName - pb.TimeSeries = st.TimeSeries pb.ForceSendFields = st.ForceSendFields @@ -8443,41 +7482,24 @@ func monitorInfoToPb(st *MonitorInfo) (*monitorInfoPb, error) { } type monitorInfoPb struct { - AssetsDir string `json:"assets_dir,omitempty"` - - BaselineTableName string `json:"baseline_table_name,omitempty"` - - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - - DashboardId string `json:"dashboard_id,omitempty"` - + AssetsDir string `json:"assets_dir,omitempty"` + BaselineTableName string `json:"baseline_table_name,omitempty"` + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - - DriftMetricsTableName string `json:"drift_metrics_table_name"` - - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - - LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` - - MonitorVersion string `json:"monitor_version"` - - Notifications *MonitorNotifications `json:"notifications,omitempty"` - - OutputSchemaName string `json:"output_schema_name,omitempty"` - - ProfileMetricsTableName string `json:"profile_metrics_table_name"` - - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` - - SlicingExprs []string `json:"slicing_exprs,omitempty"` - - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - - Status MonitorInfoStatus `json:"status"` - - TableName string `json:"table_name"` - - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + DriftMetricsTableName string `json:"drift_metrics_table_name"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + MonitorVersion string `json:"monitor_version"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` + OutputSchemaName string `json:"output_schema_name,omitempty"` + ProfileMetricsTableName string `json:"profile_metrics_table_name"` + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + SlicingExprs []string `json:"slicing_exprs,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + Status MonitorInfoStatus `json:"status"` + TableName string `json:"table_name"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8524,28 +7546,20 @@ func monitorMetricToPb(st *MonitorMetric) (*monitorMetricPb, error) { } pb := &monitorMetricPb{} pb.Definition = st.Definition - pb.InputColumns = st.InputColumns - pb.Name = st.Name - pb.OutputDataType = st.OutputDataType - pb.Type = st.Type return pb, nil } type monitorMetricPb struct { - Definition string `json:"definition"` - - InputColumns []string `json:"input_columns"` - - Name string `json:"name"` - - OutputDataType string `json:"output_data_type"` - - Type MonitorMetricType `json:"type"` + Definition string `json:"definition"` + InputColumns []string `json:"input_columns"` + Name string `json:"name"` + OutputDataType string `json:"output_data_type"` + Type MonitorMetricType `json:"type"` } func monitorMetricFromPb(pb *monitorMetricPb) (*MonitorMetric, error) { @@ -8568,15 +7582,13 @@ func monitorNotificationsToPb(st *MonitorNotifications) (*monitorNotificationsPb } pb := &monitorNotificationsPb{} pb.OnFailure = st.OnFailure - pb.OnNewClassificationTagDetected = st.OnNewClassificationTagDetected return pb, nil } type monitorNotificationsPb struct { - OnFailure *MonitorDestination `json:"on_failure,omitempty"` - + OnFailure *MonitorDestination `json:"on_failure,omitempty"` OnNewClassificationTagDetected *MonitorDestination `json:"on_new_classification_tag_detected,omitempty"` } @@ -8597,15 +7609,10 @@ func monitorRefreshInfoToPb(st *MonitorRefreshInfo) (*monitorRefreshInfoPb, erro } pb := &monitorRefreshInfoPb{} pb.EndTimeMs = st.EndTimeMs - pb.Message = st.Message - pb.RefreshId = st.RefreshId - pb.StartTimeMs = st.StartTimeMs - pb.State = st.State - pb.Trigger = st.Trigger pb.ForceSendFields = st.ForceSendFields @@ -8613,17 +7620,12 @@ func monitorRefreshInfoToPb(st *MonitorRefreshInfo) (*monitorRefreshInfoPb, erro } type monitorRefreshInfoPb struct { - EndTimeMs int64 `json:"end_time_ms,omitempty"` - - Message string `json:"message,omitempty"` - - RefreshId int64 `json:"refresh_id"` - - StartTimeMs int64 `json:"start_time_ms"` - - State MonitorRefreshInfoState `json:"state"` - - Trigger MonitorRefreshInfoTrigger `json:"trigger,omitempty"` + EndTimeMs int64 `json:"end_time_ms,omitempty"` + Message string `json:"message,omitempty"` + RefreshId int64 `json:"refresh_id"` + StartTimeMs int64 `json:"start_time_ms"` + State MonitorRefreshInfoState `json:"state"` + Trigger MonitorRefreshInfoTrigger `json:"trigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8703,7 +7705,6 @@ func monitorTimeSeriesToPb(st *MonitorTimeSeries) (*monitorTimeSeriesPb, error) } pb := &monitorTimeSeriesPb{} pb.Granularities = st.Granularities - pb.TimestampCol = st.TimestampCol return pb, nil @@ -8711,8 +7712,7 @@ func monitorTimeSeriesToPb(st *MonitorTimeSeries) (*monitorTimeSeriesPb, error) type monitorTimeSeriesPb struct { Granularities []string `json:"granularities"` - - TimestampCol string `json:"timestamp_col"` + TimestampCol string `json:"timestamp_col"` } func monitorTimeSeriesFromPb(pb *monitorTimeSeriesPb) (*MonitorTimeSeries, error) { @@ -8756,7 +7756,6 @@ func newPipelineSpecToPb(st *NewPipelineSpec) (*newPipelineSpecPb, error) { } pb := &newPipelineSpecPb{} pb.StorageCatalog = st.StorageCatalog - pb.StorageSchema = st.StorageSchema pb.ForceSendFields = st.ForceSendFields @@ -8765,8 +7764,7 @@ func newPipelineSpecToPb(st *NewPipelineSpec) (*newPipelineSpecPb, error) { type newPipelineSpecPb struct { StorageCatalog string `json:"storage_catalog,omitempty"` - - StorageSchema string `json:"storage_schema,omitempty"` + StorageSchema string `json:"storage_schema,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8797,13 +7795,9 @@ func onlineTableToPb(st *OnlineTable) (*onlineTablePb, error) { } pb := &onlineTablePb{} pb.Name = st.Name - pb.Spec = st.Spec - pb.Status = st.Status - pb.TableServingUrl = st.TableServingUrl - pb.UnityCatalogProvisioningState = st.UnityCatalogProvisioningState pb.ForceSendFields = st.ForceSendFields @@ -8811,14 +7805,10 @@ func onlineTableToPb(st *OnlineTable) (*onlineTablePb, error) { } type onlineTablePb struct { - Name string `json:"name,omitempty"` - - Spec *OnlineTableSpec `json:"spec,omitempty"` - - Status *OnlineTableStatus `json:"status,omitempty"` - - TableServingUrl string `json:"table_serving_url,omitempty"` - + Name string `json:"name,omitempty"` + Spec *OnlineTableSpec `json:"spec,omitempty"` + Status *OnlineTableStatus `json:"status,omitempty"` + TableServingUrl string `json:"table_serving_url,omitempty"` UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -8853,17 +7843,11 @@ func onlineTableSpecToPb(st *OnlineTableSpec) (*onlineTableSpecPb, error) { } pb := &onlineTableSpecPb{} pb.PerformFullCopy = st.PerformFullCopy - pb.PipelineId = st.PipelineId - pb.PrimaryKeyColumns = st.PrimaryKeyColumns - pb.RunContinuously = st.RunContinuously - pb.RunTriggered = st.RunTriggered - pb.SourceTableFullName = st.SourceTableFullName - pb.TimeseriesKey = st.TimeseriesKey pb.ForceSendFields = st.ForceSendFields @@ -8871,19 +7855,13 @@ func onlineTableSpecToPb(st *OnlineTableSpec) (*onlineTableSpecPb, error) { } type onlineTableSpecPb struct { - PerformFullCopy bool `json:"perform_full_copy,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` - - RunContinuously *OnlineTableSpecContinuousSchedulingPolicy `json:"run_continuously,omitempty"` - - RunTriggered *OnlineTableSpecTriggeredSchedulingPolicy `json:"run_triggered,omitempty"` - - SourceTableFullName string `json:"source_table_full_name,omitempty"` - - TimeseriesKey string `json:"timeseries_key,omitempty"` + PerformFullCopy bool `json:"perform_full_copy,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + RunContinuously *OnlineTableSpecContinuousSchedulingPolicy `json:"run_continuously,omitempty"` + RunTriggered *OnlineTableSpecTriggeredSchedulingPolicy `json:"run_triggered,omitempty"` + SourceTableFullName string `json:"source_table_full_name,omitempty"` + TimeseriesKey string `json:"timeseries_key,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8961,15 +7939,10 @@ func onlineTableStatusToPb(st *OnlineTableStatus) (*onlineTableStatusPb, error) } pb := &onlineTableStatusPb{} pb.ContinuousUpdateStatus = st.ContinuousUpdateStatus - pb.DetailedState = st.DetailedState - pb.FailedStatus = st.FailedStatus - pb.Message = st.Message - pb.ProvisioningStatus = st.ProvisioningStatus - pb.TriggeredUpdateStatus = st.TriggeredUpdateStatus pb.ForceSendFields = st.ForceSendFields @@ -8978,16 +7951,11 @@ func onlineTableStatusToPb(st *OnlineTableStatus) (*onlineTableStatusPb, error) type onlineTableStatusPb struct { ContinuousUpdateStatus *ContinuousUpdateStatus `json:"continuous_update_status,omitempty"` - - DetailedState OnlineTableState `json:"detailed_state,omitempty"` - - FailedStatus *FailedStatus `json:"failed_status,omitempty"` - - Message string `json:"message,omitempty"` - - ProvisioningStatus *ProvisioningStatus `json:"provisioning_status,omitempty"` - - TriggeredUpdateStatus *TriggeredUpdateStatus `json:"triggered_update_status,omitempty"` + DetailedState OnlineTableState `json:"detailed_state,omitempty"` + FailedStatus *FailedStatus `json:"failed_status,omitempty"` + Message string `json:"message,omitempty"` + ProvisioningStatus *ProvisioningStatus `json:"provisioning_status,omitempty"` + TriggeredUpdateStatus *TriggeredUpdateStatus `json:"triggered_update_status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9022,9 +7990,7 @@ func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) } pb := &permissionsChangePb{} pb.Add = st.Add - pb.Principal = st.Principal - pb.Remove = st.Remove pb.ForceSendFields = st.ForceSendFields @@ -9032,11 +7998,9 @@ func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) } type permissionsChangePb struct { - Add []Privilege `json:"add,omitempty"` - - Principal string `json:"principal,omitempty"` - - Remove []Privilege `json:"remove,omitempty"` + Add []Privilege `json:"add,omitempty"` + Principal string `json:"principal,omitempty"` + Remove []Privilege `json:"remove,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9092,13 +8056,9 @@ func pipelineProgressToPb(st *PipelineProgress) (*pipelineProgressPb, error) { } pb := &pipelineProgressPb{} pb.EstimatedCompletionTimeSeconds = st.EstimatedCompletionTimeSeconds - pb.LatestVersionCurrentlyProcessing = st.LatestVersionCurrentlyProcessing - pb.SyncProgressCompletion = st.SyncProgressCompletion - pb.SyncedRowCount = st.SyncedRowCount - pb.TotalRowCount = st.TotalRowCount pb.ForceSendFields = st.ForceSendFields @@ -9106,15 +8066,11 @@ func pipelineProgressToPb(st *PipelineProgress) (*pipelineProgressPb, error) { } type pipelineProgressPb struct { - EstimatedCompletionTimeSeconds float64 `json:"estimated_completion_time_seconds,omitempty"` - - LatestVersionCurrentlyProcessing int64 `json:"latest_version_currently_processing,omitempty"` - - SyncProgressCompletion float64 `json:"sync_progress_completion,omitempty"` - - SyncedRowCount int64 `json:"synced_row_count,omitempty"` - - TotalRowCount int64 `json:"total_row_count,omitempty"` + EstimatedCompletionTimeSeconds float64 `json:"estimated_completion_time_seconds,omitempty"` + LatestVersionCurrentlyProcessing int64 `json:"latest_version_currently_processing,omitempty"` + SyncProgressCompletion float64 `json:"sync_progress_completion,omitempty"` + SyncedRowCount int64 `json:"synced_row_count,omitempty"` + TotalRowCount int64 `json:"total_row_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9148,19 +8104,15 @@ func primaryKeyConstraintToPb(st *PrimaryKeyConstraint) (*primaryKeyConstraintPb } pb := &primaryKeyConstraintPb{} pb.ChildColumns = st.ChildColumns - pb.Name = st.Name - pb.TimeseriesColumns = st.TimeseriesColumns return pb, nil } type primaryKeyConstraintPb struct { - ChildColumns []string `json:"child_columns"` - - Name string `json:"name"` - + ChildColumns []string `json:"child_columns"` + Name string `json:"name"` TimeseriesColumns []string `json:"timeseries_columns,omitempty"` } @@ -9182,7 +8134,6 @@ func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, e } pb := &privilegeAssignmentPb{} pb.Principal = st.Principal - pb.Privileges = st.Privileges pb.ForceSendFields = st.ForceSendFields @@ -9190,8 +8141,7 @@ func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, e } type privilegeAssignmentPb struct { - Principal string `json:"principal,omitempty"` - + Principal string `json:"principal,omitempty"` Privileges []Privilege `json:"privileges,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -9289,15 +8239,10 @@ func quotaInfoToPb(st *QuotaInfo) (*quotaInfoPb, error) { } pb := "aInfoPb{} pb.LastRefreshedAt = st.LastRefreshedAt - pb.ParentFullName = st.ParentFullName - pb.ParentSecurableType = st.ParentSecurableType - pb.QuotaCount = st.QuotaCount - pb.QuotaLimit = st.QuotaLimit - pb.QuotaName = st.QuotaName pb.ForceSendFields = st.ForceSendFields @@ -9305,17 +8250,12 @@ func quotaInfoToPb(st *QuotaInfo) (*quotaInfoPb, error) { } type quotaInfoPb struct { - LastRefreshedAt int64 `json:"last_refreshed_at,omitempty"` - - ParentFullName string `json:"parent_full_name,omitempty"` - + LastRefreshedAt int64 `json:"last_refreshed_at,omitempty"` + ParentFullName string `json:"parent_full_name,omitempty"` ParentSecurableType SecurableType `json:"parent_securable_type,omitempty"` - - QuotaCount int `json:"quota_count,omitempty"` - - QuotaLimit int `json:"quota_limit,omitempty"` - - QuotaName string `json:"quota_name,omitempty"` + QuotaCount int `json:"quota_count,omitempty"` + QuotaLimit int `json:"quota_limit,omitempty"` + QuotaName string `json:"quota_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9350,9 +8290,7 @@ func r2CredentialsToPb(st *R2Credentials) (*r2CredentialsPb, error) { } pb := &r2CredentialsPb{} pb.AccessKeyId = st.AccessKeyId - pb.SecretAccessKey = st.SecretAccessKey - pb.SessionToken = st.SessionToken pb.ForceSendFields = st.ForceSendFields @@ -9360,11 +8298,9 @@ func r2CredentialsToPb(st *R2Credentials) (*r2CredentialsPb, error) { } type r2CredentialsPb struct { - AccessKeyId string `json:"access_key_id,omitempty"` - + AccessKeyId string `json:"access_key_id,omitempty"` SecretAccessKey string `json:"secret_access_key,omitempty"` - - SessionToken string `json:"session_token,omitempty"` + SessionToken string `json:"session_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9396,7 +8332,6 @@ func readVolumeRequestToPb(st *ReadVolumeRequest) (*readVolumeRequestPb, error) } pb := &readVolumeRequestPb{} pb.IncludeBrowse = st.IncludeBrowse - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -9404,9 +8339,8 @@ func readVolumeRequestToPb(st *ReadVolumeRequest) (*readVolumeRequestPb, error) } type readVolumeRequestPb struct { - IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - - Name string `json:"-" url:"-"` + IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -9437,7 +8371,6 @@ func regenerateDashboardRequestToPb(st *RegenerateDashboardRequest) (*regenerate } pb := ®enerateDashboardRequestPb{} pb.TableName = st.TableName - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -9445,8 +8378,7 @@ func regenerateDashboardRequestToPb(st *RegenerateDashboardRequest) (*regenerate } type regenerateDashboardRequestPb struct { - TableName string `json:"-" url:"-"` - + TableName string `json:"-" url:"-"` WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -9478,7 +8410,6 @@ func regenerateDashboardResponseToPb(st *RegenerateDashboardResponse) (*regenera } pb := ®enerateDashboardResponsePb{} pb.DashboardId = st.DashboardId - pb.ParentFolder = st.ParentFolder pb.ForceSendFields = st.ForceSendFields @@ -9486,8 +8417,7 @@ func regenerateDashboardResponseToPb(st *RegenerateDashboardResponse) (*regenera } type regenerateDashboardResponsePb struct { - DashboardId string `json:"dashboard_id,omitempty"` - + DashboardId string `json:"dashboard_id,omitempty"` ParentFolder string `json:"parent_folder,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -9519,7 +8449,6 @@ func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb } pb := ®isteredModelAliasPb{} pb.AliasName = st.AliasName - pb.VersionNum = st.VersionNum pb.ForceSendFields = st.ForceSendFields @@ -9527,9 +8456,8 @@ func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb } type registeredModelAliasPb struct { - AliasName string `json:"alias_name,omitempty"` - - VersionNum int `json:"version_num,omitempty"` + AliasName string `json:"alias_name,omitempty"` + VersionNum int `json:"version_num,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9560,31 +8488,18 @@ func registeredModelInfoToPb(st *RegisteredModelInfo) (*registeredModelInfoPb, e } pb := ®isteredModelInfoPb{} pb.Aliases = st.Aliases - pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.FullName = st.FullName - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.SchemaName = st.SchemaName - pb.StorageLocation = st.StorageLocation - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -9592,33 +8507,20 @@ func registeredModelInfoToPb(st *RegisteredModelInfo) (*registeredModelInfoPb, e } type registeredModelInfoPb struct { - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` - - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - FullName string `json:"full_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9685,39 +8587,22 @@ func schemaInfoToPb(st *SchemaInfo) (*schemaInfoPb, error) { } pb := &schemaInfoPb{} pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.CatalogType = st.CatalogType - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag - pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization - pb.FullName = st.FullName - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.Properties = st.Properties - pb.SchemaId = st.SchemaId - pb.StorageLocation = st.StorageLocation - pb.StorageRoot = st.StorageRoot - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -9725,41 +8610,24 @@ func schemaInfoToPb(st *SchemaInfo) (*schemaInfoPb, error) { } type schemaInfoPb struct { - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - CatalogType string `json:"catalog_type,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + CatalogType string `json:"catalog_type,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` - - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` - - FullName string `json:"full_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` - - SchemaId string `json:"schema_id,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + SchemaId string `json:"schema_id,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9842,13 +8710,9 @@ func setArtifactAllowlistToPb(st *SetArtifactAllowlist) (*setArtifactAllowlistPb } pb := &setArtifactAllowlistPb{} pb.ArtifactMatchers = st.ArtifactMatchers - pb.ArtifactType = st.ArtifactType - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.MetastoreId = st.MetastoreId pb.ForceSendFields = st.ForceSendFields @@ -9857,14 +8721,10 @@ func setArtifactAllowlistToPb(st *SetArtifactAllowlist) (*setArtifactAllowlistPb type setArtifactAllowlistPb struct { ArtifactMatchers []ArtifactMatcher `json:"artifact_matchers"` - - ArtifactType ArtifactType `json:"-" url:"-"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` + ArtifactType ArtifactType `json:"-" url:"-"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9898,20 +8758,16 @@ func setRegisteredModelAliasRequestToPb(st *SetRegisteredModelAliasRequest) (*se } pb := &setRegisteredModelAliasRequestPb{} pb.Alias = st.Alias - pb.FullName = st.FullName - pb.VersionNum = st.VersionNum return pb, nil } type setRegisteredModelAliasRequestPb struct { - Alias string `json:"alias" url:"-"` - - FullName string `json:"full_name" url:"-"` - - VersionNum int `json:"version_num"` + Alias string `json:"alias" url:"-"` + FullName string `json:"full_name" url:"-"` + VersionNum int `json:"version_num"` } func setRegisteredModelAliasRequestFromPb(pb *setRegisteredModelAliasRequestPb) (*SetRegisteredModelAliasRequest, error) { @@ -9932,7 +8788,6 @@ func sseEncryptionDetailsToPb(st *SseEncryptionDetails) (*sseEncryptionDetailsPb } pb := &sseEncryptionDetailsPb{} pb.Algorithm = st.Algorithm - pb.AwsKmsKeyArn = st.AwsKmsKeyArn pb.ForceSendFields = st.ForceSendFields @@ -9940,9 +8795,8 @@ func sseEncryptionDetailsToPb(st *SseEncryptionDetails) (*sseEncryptionDetailsPb } type sseEncryptionDetailsPb struct { - Algorithm SseEncryptionDetailsAlgorithm `json:"algorithm,omitempty"` - - AwsKmsKeyArn string `json:"aws_kms_key_arn,omitempty"` + Algorithm SseEncryptionDetailsAlgorithm `json:"algorithm,omitempty"` + AwsKmsKeyArn string `json:"aws_kms_key_arn,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -9973,39 +8827,22 @@ func storageCredentialInfoToPb(st *StorageCredentialInfo) (*storageCredentialInf } pb := &storageCredentialInfoPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.CloudflareApiToken = st.CloudflareApiToken - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.FullName = st.FullName - pb.Id = st.Id - pb.IsolationMode = st.IsolationMode - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.ReadOnly = st.ReadOnly - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.UsedForManagedStorage = st.UsedForManagedStorage pb.ForceSendFields = st.ForceSendFields @@ -10013,41 +8850,24 @@ func storageCredentialInfoToPb(st *StorageCredentialInfo) (*storageCredentialInf } type storageCredentialInfoPb struct { - AwsIamRole *AwsIamRoleResponse `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - + AwsIamRole *AwsIamRoleResponse `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccountResponse `json:"databricks_gcp_service_account,omitempty"` - - FullName string `json:"full_name,omitempty"` - - Id string `json:"id,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + FullName string `json:"full_name,omitempty"` + Id string `json:"id,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10094,17 +8914,11 @@ func syncedDatabaseTableToPb(st *SyncedDatabaseTable) (*syncedDatabaseTablePb, e } pb := &syncedDatabaseTablePb{} pb.DataSynchronizationStatus = st.DataSynchronizationStatus - pb.DatabaseInstanceName = st.DatabaseInstanceName - pb.LogicalDatabaseName = st.LogicalDatabaseName - pb.Name = st.Name - pb.Spec = st.Spec - pb.TableServingUrl = st.TableServingUrl - pb.UnityCatalogProvisioningState = st.UnityCatalogProvisioningState pb.ForceSendFields = st.ForceSendFields @@ -10112,18 +8926,12 @@ func syncedDatabaseTableToPb(st *SyncedDatabaseTable) (*syncedDatabaseTablePb, e } type syncedDatabaseTablePb struct { - DataSynchronizationStatus *OnlineTableStatus `json:"data_synchronization_status,omitempty"` - - DatabaseInstanceName string `json:"database_instance_name,omitempty"` - - LogicalDatabaseName string `json:"logical_database_name,omitempty"` - - Name string `json:"name"` - - Spec *SyncedTableSpec `json:"spec,omitempty"` - - TableServingUrl string `json:"table_serving_url,omitempty"` - + DataSynchronizationStatus *OnlineTableStatus `json:"data_synchronization_status,omitempty"` + DatabaseInstanceName string `json:"database_instance_name,omitempty"` + LogicalDatabaseName string `json:"logical_database_name,omitempty"` + Name string `json:"name"` + Spec *SyncedTableSpec `json:"spec,omitempty"` + TableServingUrl string `json:"table_serving_url,omitempty"` UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -10160,17 +8968,11 @@ func syncedTableSpecToPb(st *SyncedTableSpec) (*syncedTableSpecPb, error) { } pb := &syncedTableSpecPb{} pb.CreateDatabaseObjectsIfMissing = st.CreateDatabaseObjectsIfMissing - pb.NewPipelineSpec = st.NewPipelineSpec - pb.PipelineId = st.PipelineId - pb.PrimaryKeyColumns = st.PrimaryKeyColumns - pb.SchedulingPolicy = st.SchedulingPolicy - pb.SourceTableFullName = st.SourceTableFullName - pb.TimeseriesKey = st.TimeseriesKey pb.ForceSendFields = st.ForceSendFields @@ -10178,19 +8980,13 @@ func syncedTableSpecToPb(st *SyncedTableSpec) (*syncedTableSpecPb, error) { } type syncedTableSpecPb struct { - CreateDatabaseObjectsIfMissing bool `json:"create_database_objects_if_missing,omitempty"` - - NewPipelineSpec *NewPipelineSpec `json:"new_pipeline_spec,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` - - SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` - - SourceTableFullName string `json:"source_table_full_name,omitempty"` - - TimeseriesKey string `json:"timeseries_key,omitempty"` + CreateDatabaseObjectsIfMissing bool `json:"create_database_objects_if_missing,omitempty"` + NewPipelineSpec *NewPipelineSpec `json:"new_pipeline_spec,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` + SourceTableFullName string `json:"source_table_full_name,omitempty"` + TimeseriesKey string `json:"timeseries_key,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10226,7 +9022,6 @@ func systemSchemaInfoToPb(st *SystemSchemaInfo) (*systemSchemaInfoPb, error) { } pb := &systemSchemaInfoPb{} pb.Schema = st.Schema - pb.State = st.State return pb, nil @@ -10234,8 +9029,7 @@ func systemSchemaInfoToPb(st *SystemSchemaInfo) (*systemSchemaInfoPb, error) { type systemSchemaInfoPb struct { Schema string `json:"schema"` - - State string `json:"state"` + State string `json:"state"` } func systemSchemaInfoFromPb(pb *systemSchemaInfoPb) (*SystemSchemaInfo, error) { @@ -10255,9 +9049,7 @@ func tableConstraintToPb(st *TableConstraint) (*tableConstraintPb, error) { } pb := &tableConstraintPb{} pb.ForeignKeyConstraint = st.ForeignKeyConstraint - pb.NamedTableConstraint = st.NamedTableConstraint - pb.PrimaryKeyConstraint = st.PrimaryKeyConstraint return pb, nil @@ -10265,9 +9057,7 @@ func tableConstraintToPb(st *TableConstraint) (*tableConstraintPb, error) { type tableConstraintPb struct { ForeignKeyConstraint *ForeignKeyConstraint `json:"foreign_key_constraint,omitempty"` - NamedTableConstraint *NamedTableConstraint `json:"named_table_constraint,omitempty"` - PrimaryKeyConstraint *PrimaryKeyConstraint `json:"primary_key_constraint,omitempty"` } @@ -10349,67 +9139,36 @@ func tableInfoToPb(st *TableInfo) (*tableInfoPb, error) { } pb := &tableInfoPb{} pb.AccessPoint = st.AccessPoint - pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.Columns = st.Columns - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DataAccessConfigurationId = st.DataAccessConfigurationId - pb.DataSourceFormat = st.DataSourceFormat - pb.DeletedAt = st.DeletedAt - pb.DeltaRuntimePropertiesKvpairs = st.DeltaRuntimePropertiesKvpairs - pb.EffectivePredictiveOptimizationFlag = st.EffectivePredictiveOptimizationFlag - pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization - pb.EncryptionDetails = st.EncryptionDetails - pb.FullName = st.FullName - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.PipelineId = st.PipelineId - pb.Properties = st.Properties - pb.RowFilter = st.RowFilter - pb.SchemaName = st.SchemaName - pb.SqlPath = st.SqlPath - pb.StorageCredentialName = st.StorageCredentialName - pb.StorageLocation = st.StorageLocation - pb.TableConstraints = st.TableConstraints - pb.TableId = st.TableId - pb.TableType = st.TableType - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.ViewDefinition = st.ViewDefinition - pb.ViewDependencies = st.ViewDependencies pb.ForceSendFields = st.ForceSendFields @@ -10417,69 +9176,38 @@ func tableInfoToPb(st *TableInfo) (*tableInfoPb, error) { } type tableInfoPb struct { - AccessPoint string `json:"access_point,omitempty"` - - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - Columns []ColumnInfo `json:"columns,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DataAccessConfigurationId string `json:"data_access_configuration_id,omitempty"` - - DataSourceFormat DataSourceFormat `json:"data_source_format,omitempty"` - - DeletedAt int64 `json:"deleted_at,omitempty"` - - DeltaRuntimePropertiesKvpairs *DeltaRuntimePropertiesKvPairs `json:"delta_runtime_properties_kvpairs,omitempty"` - + AccessPoint string `json:"access_point,omitempty"` + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Columns []ColumnInfo `json:"columns,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DataAccessConfigurationId string `json:"data_access_configuration_id,omitempty"` + DataSourceFormat DataSourceFormat `json:"data_source_format,omitempty"` + DeletedAt int64 `json:"deleted_at,omitempty"` + DeltaRuntimePropertiesKvpairs *DeltaRuntimePropertiesKvPairs `json:"delta_runtime_properties_kvpairs,omitempty"` EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` - - EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` - - EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` - - FullName string `json:"full_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` - - RowFilter *TableRowFilter `json:"row_filter,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - SqlPath string `json:"sql_path,omitempty"` - - StorageCredentialName string `json:"storage_credential_name,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - TableConstraints []TableConstraint `json:"table_constraints,omitempty"` - - TableId string `json:"table_id,omitempty"` - - TableType TableType `json:"table_type,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - ViewDefinition string `json:"view_definition,omitempty"` - - ViewDependencies *DependencyList `json:"view_dependencies,omitempty"` + EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` + EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + RowFilter *TableRowFilter `json:"row_filter,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + SqlPath string `json:"sql_path,omitempty"` + StorageCredentialName string `json:"storage_credential_name,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + TableConstraints []TableConstraint `json:"table_constraints,omitempty"` + TableId string `json:"table_id,omitempty"` + TableType TableType `json:"table_type,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + ViewDefinition string `json:"view_definition,omitempty"` + ViewDependencies *DependencyList `json:"view_dependencies,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10540,15 +9268,13 @@ func tableRowFilterToPb(st *TableRowFilter) (*tableRowFilterPb, error) { } pb := &tableRowFilterPb{} pb.FunctionName = st.FunctionName - pb.InputColumnNames = st.InputColumnNames return pb, nil } type tableRowFilterPb struct { - FunctionName string `json:"function_name"` - + FunctionName string `json:"function_name"` InputColumnNames []string `json:"input_column_names"` } @@ -10569,7 +9295,6 @@ func tableSummaryToPb(st *TableSummary) (*tableSummaryPb, error) { } pb := &tableSummaryPb{} pb.FullName = st.FullName - pb.TableType = st.TableType pb.ForceSendFields = st.ForceSendFields @@ -10577,8 +9302,7 @@ func tableSummaryToPb(st *TableSummary) (*tableSummaryPb, error) { } type tableSummaryPb struct { - FullName string `json:"full_name,omitempty"` - + FullName string `json:"full_name,omitempty"` TableType TableType `json:"table_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -10610,7 +9334,6 @@ func tagKeyValueToPb(st *TagKeyValue) (*tagKeyValuePb, error) { } pb := &tagKeyValuePb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -10618,8 +9341,7 @@ func tagKeyValueToPb(st *TagKeyValue) (*tagKeyValuePb, error) { } type tagKeyValuePb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -10651,11 +9373,8 @@ func temporaryCredentialsToPb(st *TemporaryCredentials) (*temporaryCredentialsPb } pb := &temporaryCredentialsPb{} pb.AwsTempCredentials = st.AwsTempCredentials - pb.AzureAad = st.AzureAad - pb.ExpirationTime = st.ExpirationTime - pb.GcpOauthToken = st.GcpOauthToken pb.ForceSendFields = st.ForceSendFields @@ -10663,13 +9382,10 @@ func temporaryCredentialsToPb(st *TemporaryCredentials) (*temporaryCredentialsPb } type temporaryCredentialsPb struct { - AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` - - AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` + AwsTempCredentials *AwsCredentials `json:"aws_temp_credentials,omitempty"` + AzureAad *AzureActiveDirectoryToken `json:"azure_aad,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + GcpOauthToken *GcpOauthToken `json:"gcp_oauth_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10702,9 +9418,7 @@ func triggeredUpdateStatusToPb(st *TriggeredUpdateStatus) (*triggeredUpdateStatu } pb := &triggeredUpdateStatusPb{} pb.LastProcessedCommitVersion = st.LastProcessedCommitVersion - pb.Timestamp = st.Timestamp - pb.TriggeredUpdateProgress = st.TriggeredUpdateProgress pb.ForceSendFields = st.ForceSendFields @@ -10712,11 +9426,9 @@ func triggeredUpdateStatusToPb(st *TriggeredUpdateStatus) (*triggeredUpdateStatu } type triggeredUpdateStatusPb struct { - LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - - Timestamp string `json:"timestamp,omitempty"` - - TriggeredUpdateProgress *PipelineProgress `json:"triggered_update_progress,omitempty"` + LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` + Timestamp string `json:"timestamp,omitempty"` + TriggeredUpdateProgress *PipelineProgress `json:"triggered_update_progress,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10748,7 +9460,6 @@ func unassignRequestToPb(st *UnassignRequest) (*unassignRequestPb, error) { } pb := &unassignRequestPb{} pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -10756,8 +9467,7 @@ func unassignRequestToPb(st *UnassignRequest) (*unassignRequestPb, error) { type unassignRequestPb struct { MetastoreId string `json:"-" url:"metastore_id"` - - WorkspaceId int64 `json:"-" url:"-"` + WorkspaceId int64 `json:"-" url:"-"` } func unassignRequestFromPb(pb *unassignRequestPb) (*UnassignRequest, error) { @@ -10819,19 +9529,12 @@ func updateCatalogToPb(st *UpdateCatalog) (*updateCatalogPb, error) { } pb := &updateCatalogPb{} pb.Comment = st.Comment - pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization - pb.IsolationMode = st.IsolationMode - pb.Name = st.Name - pb.NewName = st.NewName - pb.Options = st.Options - pb.Owner = st.Owner - pb.Properties = st.Properties pb.ForceSendFields = st.ForceSendFields @@ -10839,21 +9542,14 @@ func updateCatalogToPb(st *UpdateCatalog) (*updateCatalogPb, error) { } type updateCatalogPb struct { - Comment string `json:"comment,omitempty"` - + Comment string `json:"comment,omitempty"` EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` - - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Options map[string]string `json:"options,omitempty"` - - Owner string `json:"owner,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` + IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Options map[string]string `json:"options,omitempty"` + Owner string `json:"owner,omitempty"` + Properties map[string]string `json:"properties,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10914,11 +9610,8 @@ func updateConnectionToPb(st *UpdateConnection) (*updateConnectionPb, error) { } pb := &updateConnectionPb{} pb.Name = st.Name - pb.NewName = st.NewName - pb.Options = st.Options - pb.Owner = st.Owner pb.ForceSendFields = st.ForceSendFields @@ -10926,13 +9619,10 @@ func updateConnectionToPb(st *UpdateConnection) (*updateConnectionPb, error) { } type updateConnectionPb struct { - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` Options map[string]string `json:"options"` - - Owner string `json:"owner,omitempty"` + Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -10965,27 +9655,16 @@ func updateCredentialRequestToPb(st *UpdateCredentialRequest) (*updateCredential } pb := &updateCredentialRequestPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.Comment = st.Comment - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.Force = st.Force - pb.IsolationMode = st.IsolationMode - pb.NameArg = st.NameArg - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation pb.ForceSendFields = st.ForceSendFields @@ -10993,29 +9672,18 @@ func updateCredentialRequestToPb(st *UpdateCredentialRequest) (*updateCredential } type updateCredentialRequestPb struct { - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - Comment string `json:"comment,omitempty"` - + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + Comment string `json:"comment,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` - - Force bool `json:"force,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - NameArg string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` + Force bool `json:"force,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + NameArg string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11056,9 +9724,7 @@ func updateDatabaseInstanceRequestToPb(st *UpdateDatabaseInstanceRequest) (*upda } pb := &updateDatabaseInstanceRequestPb{} pb.DatabaseInstance = st.DatabaseInstance - pb.Name = st.Name - pb.UpdateMask = st.UpdateMask return pb, nil @@ -11066,10 +9732,8 @@ func updateDatabaseInstanceRequestToPb(st *UpdateDatabaseInstanceRequest) (*upda type updateDatabaseInstanceRequestPb struct { DatabaseInstance DatabaseInstance `json:"database_instance"` - - Name string `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask"` + Name string `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask"` } func updateDatabaseInstanceRequestFromPb(pb *updateDatabaseInstanceRequestPb) (*UpdateDatabaseInstanceRequest, error) { @@ -11090,31 +9754,18 @@ func updateExternalLocationToPb(st *UpdateExternalLocation) (*updateExternalLoca } pb := &updateExternalLocationPb{} pb.Comment = st.Comment - pb.CredentialName = st.CredentialName - pb.EnableFileEvents = st.EnableFileEvents - pb.EncryptionDetails = st.EncryptionDetails - pb.Fallback = st.Fallback - pb.FileEventQueue = st.FileEventQueue - pb.Force = st.Force - pb.IsolationMode = st.IsolationMode - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -11122,33 +9773,20 @@ func updateExternalLocationToPb(st *UpdateExternalLocation) (*updateExternalLoca } type updateExternalLocationPb struct { - Comment string `json:"comment,omitempty"` - - CredentialName string `json:"credential_name,omitempty"` - - EnableFileEvents bool `json:"enable_file_events,omitempty"` - + Comment string `json:"comment,omitempty"` + CredentialName string `json:"credential_name,omitempty"` + EnableFileEvents bool `json:"enable_file_events,omitempty"` EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` - - Fallback bool `json:"fallback,omitempty"` - - FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` - - Force bool `json:"force,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` - - Url string `json:"url,omitempty"` + Fallback bool `json:"fallback,omitempty"` + FileEventQueue *FileEventQueue `json:"file_event_queue,omitempty"` + Force bool `json:"force,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11191,7 +9829,6 @@ func updateFunctionToPb(st *UpdateFunction) (*updateFunctionPb, error) { } pb := &updateFunctionPb{} pb.Name = st.Name - pb.Owner = st.Owner pb.ForceSendFields = st.ForceSendFields @@ -11199,8 +9836,7 @@ func updateFunctionToPb(st *UpdateFunction) (*updateFunctionPb, error) { } type updateFunctionPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -11232,19 +9868,12 @@ func updateMetastoreToPb(st *UpdateMetastore) (*updateMetastorePb, error) { } pb := &updateMetastorePb{} pb.DeltaSharingOrganizationName = st.DeltaSharingOrganizationName - pb.DeltaSharingRecipientTokenLifetimeInSeconds = st.DeltaSharingRecipientTokenLifetimeInSeconds - pb.DeltaSharingScope = st.DeltaSharingScope - pb.Id = st.Id - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.PrivilegeModelVersion = st.PrivilegeModelVersion - pb.StorageRootCredentialId = st.StorageRootCredentialId pb.ForceSendFields = st.ForceSendFields @@ -11252,21 +9881,14 @@ func updateMetastoreToPb(st *UpdateMetastore) (*updateMetastorePb, error) { } type updateMetastorePb struct { - DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` - - DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` - - DeltaSharingScope UpdateMetastoreDeltaSharingScope `json:"delta_sharing_scope,omitempty"` - - Id string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` - - StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` + DeltaSharingOrganizationName string `json:"delta_sharing_organization_name,omitempty"` + DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` + DeltaSharingScope UpdateMetastoreDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + Id string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + PrivilegeModelVersion string `json:"privilege_model_version,omitempty"` + StorageRootCredentialId string `json:"storage_root_credential_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11303,9 +9925,7 @@ func updateMetastoreAssignmentToPb(st *UpdateMetastoreAssignment) (*updateMetast } pb := &updateMetastoreAssignmentPb{} pb.DefaultCatalogName = st.DefaultCatalogName - pb.MetastoreId = st.MetastoreId - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -11314,10 +9934,8 @@ func updateMetastoreAssignmentToPb(st *UpdateMetastoreAssignment) (*updateMetast type updateMetastoreAssignmentPb struct { DefaultCatalogName string `json:"default_catalog_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - WorkspaceId int64 `json:"-" url:"-"` + MetastoreId string `json:"metastore_id,omitempty"` + WorkspaceId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -11349,9 +9967,7 @@ func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelV } pb := &updateModelVersionRequestPb{} pb.Comment = st.Comment - pb.FullName = st.FullName - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -11359,11 +9975,9 @@ func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelV } type updateModelVersionRequestPb struct { - Comment string `json:"comment,omitempty"` - + Comment string `json:"comment,omitempty"` FullName string `json:"-" url:"-"` - - Version int `json:"-" url:"-"` + Version int `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -11395,27 +10009,16 @@ func updateMonitorToPb(st *UpdateMonitor) (*updateMonitorPb, error) { } pb := &updateMonitorPb{} pb.BaselineTableName = st.BaselineTableName - pb.CustomMetrics = st.CustomMetrics - pb.DashboardId = st.DashboardId - pb.DataClassificationConfig = st.DataClassificationConfig - pb.InferenceLog = st.InferenceLog - pb.Notifications = st.Notifications - pb.OutputSchemaName = st.OutputSchemaName - pb.Schedule = st.Schedule - pb.SlicingExprs = st.SlicingExprs - pb.Snapshot = st.Snapshot - pb.TableName = st.TableName - pb.TimeSeries = st.TimeSeries pb.ForceSendFields = st.ForceSendFields @@ -11423,29 +10026,18 @@ func updateMonitorToPb(st *UpdateMonitor) (*updateMonitorPb, error) { } type updateMonitorPb struct { - BaselineTableName string `json:"baseline_table_name,omitempty"` - - CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - - DashboardId string `json:"dashboard_id,omitempty"` - + BaselineTableName string `json:"baseline_table_name,omitempty"` + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - - InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - - Notifications *MonitorNotifications `json:"notifications,omitempty"` - - OutputSchemaName string `json:"output_schema_name"` - - Schedule *MonitorCronSchedule `json:"schedule,omitempty"` - - SlicingExprs []string `json:"slicing_exprs,omitempty"` - - Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - - TableName string `json:"-" url:"-"` - - TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` + OutputSchemaName string `json:"output_schema_name"` + Schedule *MonitorCronSchedule `json:"schedule,omitempty"` + SlicingExprs []string `json:"slicing_exprs,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + TableName string `json:"-" url:"-"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11486,20 +10078,16 @@ func updatePermissionsToPb(st *UpdatePermissions) (*updatePermissionsPb, error) } pb := &updatePermissionsPb{} pb.Changes = st.Changes - pb.FullName = st.FullName - pb.SecurableType = st.SecurableType return pb, nil } type updatePermissionsPb struct { - Changes []PermissionsChange `json:"changes,omitempty"` - - FullName string `json:"-" url:"-"` - - SecurableType SecurableType `json:"-" url:"-"` + Changes []PermissionsChange `json:"changes,omitempty"` + FullName string `json:"-" url:"-"` + SecurableType SecurableType `json:"-" url:"-"` } func updatePermissionsFromPb(pb *updatePermissionsPb) (*UpdatePermissions, error) { @@ -11520,11 +10108,8 @@ func updateRegisteredModelRequestToPb(st *UpdateRegisteredModelRequest) (*update } pb := &updateRegisteredModelRequestPb{} pb.Comment = st.Comment - pb.FullName = st.FullName - pb.NewName = st.NewName - pb.Owner = st.Owner pb.ForceSendFields = st.ForceSendFields @@ -11532,13 +10117,10 @@ func updateRegisteredModelRequestToPb(st *UpdateRegisteredModelRequest) (*update } type updateRegisteredModelRequestPb struct { - Comment string `json:"comment,omitempty"` - + Comment string `json:"comment,omitempty"` FullName string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11592,15 +10174,10 @@ func updateSchemaToPb(st *UpdateSchema) (*updateSchemaPb, error) { } pb := &updateSchemaPb{} pb.Comment = st.Comment - pb.EnablePredictiveOptimization = st.EnablePredictiveOptimization - pb.FullName = st.FullName - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.Properties = st.Properties pb.ForceSendFields = st.ForceSendFields @@ -11608,17 +10185,12 @@ func updateSchemaToPb(st *UpdateSchema) (*updateSchemaPb, error) { } type updateSchemaPb struct { - Comment string `json:"comment,omitempty"` - + Comment string `json:"comment,omitempty"` EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` - - FullName string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - Properties map[string]string `json:"properties,omitempty"` + FullName string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + Properties map[string]string `json:"properties,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11653,29 +10225,17 @@ func updateStorageCredentialToPb(st *UpdateStorageCredential) (*updateStorageCre } pb := &updateStorageCredentialPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.CloudflareApiToken = st.CloudflareApiToken - pb.Comment = st.Comment - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.Force = st.Force - pb.IsolationMode = st.IsolationMode - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.ReadOnly = st.ReadOnly - pb.SkipValidation = st.SkipValidation pb.ForceSendFields = st.ForceSendFields @@ -11683,31 +10243,19 @@ func updateStorageCredentialToPb(st *UpdateStorageCredential) (*updateStorageCre } type updateStorageCredentialPb struct { - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` - - Comment string `json:"comment,omitempty"` - + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` + Comment string `json:"comment,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` - - Force bool `json:"force,omitempty"` - - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` + Force bool `json:"force,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11749,7 +10297,6 @@ func updateTableRequestToPb(st *UpdateTableRequest) (*updateTableRequestPb, erro } pb := &updateTableRequestPb{} pb.FullName = st.FullName - pb.Owner = st.Owner pb.ForceSendFields = st.ForceSendFields @@ -11758,8 +10305,7 @@ func updateTableRequestToPb(st *UpdateTableRequest) (*updateTableRequestPb, erro type updateTableRequestPb struct { FullName string `json:"-" url:"-"` - - Owner string `json:"owner,omitempty"` + Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11790,11 +10336,8 @@ func updateVolumeRequestContentToPb(st *UpdateVolumeRequestContent) (*updateVolu } pb := &updateVolumeRequestContentPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner pb.ForceSendFields = st.ForceSendFields @@ -11803,12 +10346,9 @@ func updateVolumeRequestContentToPb(st *UpdateVolumeRequestContent) (*updateVolu type updateVolumeRequestContentPb struct { Comment string `json:"comment,omitempty"` - - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` + Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -11841,19 +10381,15 @@ func updateWorkspaceBindingsToPb(st *UpdateWorkspaceBindings) (*updateWorkspaceB } pb := &updateWorkspaceBindingsPb{} pb.AssignWorkspaces = st.AssignWorkspaces - pb.Name = st.Name - pb.UnassignWorkspaces = st.UnassignWorkspaces return pb, nil } type updateWorkspaceBindingsPb struct { - AssignWorkspaces []int64 `json:"assign_workspaces,omitempty"` - - Name string `json:"-" url:"-"` - + AssignWorkspaces []int64 `json:"assign_workspaces,omitempty"` + Name string `json:"-" url:"-"` UnassignWorkspaces []int64 `json:"unassign_workspaces,omitempty"` } @@ -11875,24 +10411,18 @@ func updateWorkspaceBindingsParametersToPb(st *UpdateWorkspaceBindingsParameters } pb := &updateWorkspaceBindingsParametersPb{} pb.Add = st.Add - pb.Remove = st.Remove - pb.SecurableName = st.SecurableName - pb.SecurableType = st.SecurableType return pb, nil } type updateWorkspaceBindingsParametersPb struct { - Add []WorkspaceBinding `json:"add,omitempty"` - - Remove []WorkspaceBinding `json:"remove,omitempty"` - - SecurableName string `json:"-" url:"-"` - - SecurableType string `json:"-" url:"-"` + Add []WorkspaceBinding `json:"add,omitempty"` + Remove []WorkspaceBinding `json:"remove,omitempty"` + SecurableName string `json:"-" url:"-"` + SecurableType string `json:"-" url:"-"` } func updateWorkspaceBindingsParametersFromPb(pb *updateWorkspaceBindingsParametersPb) (*UpdateWorkspaceBindingsParameters, error) { @@ -11938,19 +10468,12 @@ func validateCredentialRequestToPb(st *ValidateCredentialRequest) (*validateCred } pb := &validateCredentialRequestPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.CredentialName = st.CredentialName - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.ExternalLocationName = st.ExternalLocationName - pb.Purpose = st.Purpose - pb.ReadOnly = st.ReadOnly - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -11958,21 +10481,14 @@ func validateCredentialRequestToPb(st *ValidateCredentialRequest) (*validateCred } type validateCredentialRequestPb struct { - AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - - CredentialName string `json:"credential_name,omitempty"` - + AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + CredentialName string `json:"credential_name,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` - - ExternalLocationName string `json:"external_location_name,omitempty"` - - Purpose CredentialPurpose `json:"purpose,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - Url string `json:"url,omitempty"` + ExternalLocationName string `json:"external_location_name,omitempty"` + Purpose CredentialPurpose `json:"purpose,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -12009,7 +10525,6 @@ func validateCredentialResponseToPb(st *ValidateCredentialResponse) (*validateCr } pb := &validateCredentialResponsePb{} pb.IsDir = st.IsDir - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -12017,8 +10532,7 @@ func validateCredentialResponseToPb(st *ValidateCredentialResponse) (*validateCr } type validateCredentialResponsePb struct { - IsDir bool `json:"isDir,omitempty"` - + IsDir bool `json:"isDir,omitempty"` Results []CredentialValidationResult `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -12050,21 +10564,13 @@ func validateStorageCredentialToPb(st *ValidateStorageCredential) (*validateStor } pb := &validateStorageCredentialPb{} pb.AwsIamRole = st.AwsIamRole - pb.AzureManagedIdentity = st.AzureManagedIdentity - pb.AzureServicePrincipal = st.AzureServicePrincipal - pb.CloudflareApiToken = st.CloudflareApiToken - pb.DatabricksGcpServiceAccount = st.DatabricksGcpServiceAccount - pb.ExternalLocationName = st.ExternalLocationName - pb.ReadOnly = st.ReadOnly - pb.StorageCredentialName = st.StorageCredentialName - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -12072,23 +10578,15 @@ func validateStorageCredentialToPb(st *ValidateStorageCredential) (*validateStor } type validateStorageCredentialPb struct { - AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` - - AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` - - AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` - - CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` - + AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` + CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` - - ExternalLocationName string `json:"external_location_name,omitempty"` - - ReadOnly bool `json:"read_only,omitempty"` - - StorageCredentialName string `json:"storage_credential_name,omitempty"` - - Url string `json:"url,omitempty"` + ExternalLocationName string `json:"external_location_name,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + StorageCredentialName string `json:"storage_credential_name,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -12126,7 +10624,6 @@ func validateStorageCredentialResponseToPb(st *ValidateStorageCredentialResponse } pb := &validateStorageCredentialResponsePb{} pb.IsDir = st.IsDir - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -12134,8 +10631,7 @@ func validateStorageCredentialResponseToPb(st *ValidateStorageCredentialResponse } type validateStorageCredentialResponsePb struct { - IsDir bool `json:"isDir,omitempty"` - + IsDir bool `json:"isDir,omitempty"` Results []ValidationResult `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -12167,9 +10663,7 @@ func validationResultToPb(st *ValidationResult) (*validationResultPb, error) { } pb := &validationResultPb{} pb.Message = st.Message - pb.Operation = st.Operation - pb.Result = st.Result pb.ForceSendFields = st.ForceSendFields @@ -12177,11 +10671,9 @@ func validationResultToPb(st *ValidationResult) (*validationResultPb, error) { } type validationResultPb struct { - Message string `json:"message,omitempty"` - + Message string `json:"message,omitempty"` Operation ValidationResultOperation `json:"operation,omitempty"` - - Result ValidationResultResult `json:"result,omitempty"` + Result ValidationResultResult `json:"result,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -12213,37 +10705,21 @@ func volumeInfoToPb(st *VolumeInfo) (*volumeInfoPb, error) { } pb := &volumeInfoPb{} pb.AccessPoint = st.AccessPoint - pb.BrowseOnly = st.BrowseOnly - pb.CatalogName = st.CatalogName - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.EncryptionDetails = st.EncryptionDetails - pb.FullName = st.FullName - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.SchemaName = st.SchemaName - pb.StorageLocation = st.StorageLocation - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.VolumeId = st.VolumeId - pb.VolumeType = st.VolumeType pb.ForceSendFields = st.ForceSendFields @@ -12251,39 +10727,23 @@ func volumeInfoToPb(st *VolumeInfo) (*volumeInfoPb, error) { } type volumeInfoPb struct { - AccessPoint string `json:"access_point,omitempty"` - - BrowseOnly bool `json:"browse_only,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - + AccessPoint string `json:"access_point,omitempty"` + BrowseOnly bool `json:"browse_only,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` - - FullName string `json:"full_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - VolumeId string `json:"volume_id,omitempty"` - - VolumeType VolumeType `json:"volume_type,omitempty"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + VolumeId string `json:"volume_id,omitempty"` + VolumeType VolumeType `json:"volume_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -12329,7 +10789,6 @@ func workspaceBindingToPb(st *WorkspaceBinding) (*workspaceBindingPb, error) { } pb := &workspaceBindingPb{} pb.BindingType = st.BindingType - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -12337,8 +10796,7 @@ func workspaceBindingToPb(st *WorkspaceBinding) (*workspaceBindingPb, error) { type workspaceBindingPb struct { BindingType WorkspaceBindingBindingType `json:"binding_type,omitempty"` - - WorkspaceId int64 `json:"workspace_id"` + WorkspaceId int64 `json:"workspace_id"` } func workspaceBindingFromPb(pb *workspaceBindingPb) (*WorkspaceBinding, error) { @@ -12351,3 +10809,57 @@ func workspaceBindingFromPb(pb *workspaceBindingPb) (*WorkspaceBinding, error) { return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/catalog/model.go b/service/catalog/model.go index c4c03aab0..300319338 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -5,8 +5,6 @@ package catalog import ( "encoding/json" "fmt" - "strings" - "time" ) type AccountsCreateMetastore struct { @@ -13449,57 +13447,3 @@ func (f *WorkspaceBindingBindingType) Set(v string) error { func (f *WorkspaceBindingBindingType) Type() string { return "WorkspaceBindingBindingType" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/cleanrooms/internal.go b/service/cleanrooms/internal.go index 44e2592b9..d5f7b0994 100755 --- a/service/cleanrooms/internal.go +++ b/service/cleanrooms/internal.go @@ -3,6 +3,10 @@ package cleanrooms import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/jobs" @@ -16,23 +20,14 @@ func cleanRoomToPb(st *CleanRoom) (*cleanRoomPb, error) { } pb := &cleanRoomPb{} pb.AccessRestricted = st.AccessRestricted - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.LocalCollaboratorAlias = st.LocalCollaboratorAlias - pb.Name = st.Name - pb.OutputCatalog = st.OutputCatalog - pb.Owner = st.Owner - pb.RemoteDetailedInfo = st.RemoteDetailedInfo - pb.Status = st.Status - pb.UpdatedAt = st.UpdatedAt pb.ForceSendFields = st.ForceSendFields @@ -40,25 +35,16 @@ func cleanRoomToPb(st *CleanRoom) (*cleanRoomPb, error) { } type cleanRoomPb struct { - AccessRestricted CleanRoomAccessRestricted `json:"access_restricted,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - LocalCollaboratorAlias string `json:"local_collaborator_alias,omitempty"` - - Name string `json:"name,omitempty"` - - OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` - - Owner string `json:"owner,omitempty"` - - RemoteDetailedInfo *CleanRoomRemoteDetail `json:"remote_detailed_info,omitempty"` - - Status CleanRoomStatusEnum `json:"status,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` + AccessRestricted CleanRoomAccessRestricted `json:"access_restricted,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + LocalCollaboratorAlias string `json:"local_collaborator_alias,omitempty"` + Name string `json:"name,omitempty"` + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` + Owner string `json:"owner,omitempty"` + RemoteDetailedInfo *CleanRoomRemoteDetail `json:"remote_detailed_info,omitempty"` + Status CleanRoomStatusEnum `json:"status,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -97,29 +83,17 @@ func cleanRoomAssetToPb(st *CleanRoomAsset) (*cleanRoomAssetPb, error) { } pb := &cleanRoomAssetPb{} pb.AddedAt = st.AddedAt - pb.AssetType = st.AssetType - pb.ForeignTable = st.ForeignTable - pb.ForeignTableLocalDetails = st.ForeignTableLocalDetails - pb.Name = st.Name - pb.Notebook = st.Notebook - pb.OwnerCollaboratorAlias = st.OwnerCollaboratorAlias - pb.Status = st.Status - pb.Table = st.Table - pb.TableLocalDetails = st.TableLocalDetails - pb.View = st.View - pb.ViewLocalDetails = st.ViewLocalDetails - pb.VolumeLocalDetails = st.VolumeLocalDetails pb.ForceSendFields = st.ForceSendFields @@ -127,31 +101,19 @@ func cleanRoomAssetToPb(st *CleanRoomAsset) (*cleanRoomAssetPb, error) { } type cleanRoomAssetPb struct { - AddedAt int64 `json:"added_at,omitempty"` - - AssetType CleanRoomAssetAssetType `json:"asset_type,omitempty"` - - ForeignTable *CleanRoomAssetForeignTable `json:"foreign_table,omitempty"` - + AddedAt int64 `json:"added_at,omitempty"` + AssetType CleanRoomAssetAssetType `json:"asset_type,omitempty"` + ForeignTable *CleanRoomAssetForeignTable `json:"foreign_table,omitempty"` ForeignTableLocalDetails *CleanRoomAssetForeignTableLocalDetails `json:"foreign_table_local_details,omitempty"` - - Name string `json:"name,omitempty"` - - Notebook *CleanRoomAssetNotebook `json:"notebook,omitempty"` - - OwnerCollaboratorAlias string `json:"owner_collaborator_alias,omitempty"` - - Status CleanRoomAssetStatusEnum `json:"status,omitempty"` - - Table *CleanRoomAssetTable `json:"table,omitempty"` - - TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` - - View *CleanRoomAssetView `json:"view,omitempty"` - - ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` - - VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails `json:"volume_local_details,omitempty"` + Name string `json:"name,omitempty"` + Notebook *CleanRoomAssetNotebook `json:"notebook,omitempty"` + OwnerCollaboratorAlias string `json:"owner_collaborator_alias,omitempty"` + Status CleanRoomAssetStatusEnum `json:"status,omitempty"` + Table *CleanRoomAssetTable `json:"table,omitempty"` + TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` + View *CleanRoomAssetView `json:"view,omitempty"` + ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` + VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails `json:"volume_local_details,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -253,13 +215,9 @@ func cleanRoomAssetNotebookToPb(st *CleanRoomAssetNotebook) (*cleanRoomAssetNote } pb := &cleanRoomAssetNotebookPb{} pb.Etag = st.Etag - pb.NotebookContent = st.NotebookContent - pb.ReviewState = st.ReviewState - pb.Reviews = st.Reviews - pb.RunnerCollaboratorAliases = st.RunnerCollaboratorAliases pb.ForceSendFields = st.ForceSendFields @@ -267,15 +225,11 @@ func cleanRoomAssetNotebookToPb(st *CleanRoomAssetNotebook) (*cleanRoomAssetNote } type cleanRoomAssetNotebookPb struct { - Etag string `json:"etag,omitempty"` - - NotebookContent string `json:"notebook_content,omitempty"` - - ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` - - Reviews []CleanRoomNotebookReview `json:"reviews,omitempty"` - - RunnerCollaboratorAliases []string `json:"runner_collaborator_aliases,omitempty"` + Etag string `json:"etag,omitempty"` + NotebookContent string `json:"notebook_content,omitempty"` + ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + Reviews []CleanRoomNotebookReview `json:"reviews,omitempty"` + RunnerCollaboratorAliases []string `json:"runner_collaborator_aliases,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -333,7 +287,6 @@ func cleanRoomAssetTableLocalDetailsToPb(st *CleanRoomAssetTableLocalDetails) (* } pb := &cleanRoomAssetTableLocalDetailsPb{} pb.LocalName = st.LocalName - pb.Partitions = st.Partitions pb.ForceSendFields = st.ForceSendFields @@ -341,8 +294,7 @@ func cleanRoomAssetTableLocalDetailsToPb(st *CleanRoomAssetTableLocalDetails) (* } type cleanRoomAssetTableLocalDetailsPb struct { - LocalName string `json:"local_name,omitempty"` - + LocalName string `json:"local_name,omitempty"` Partitions []sharing.Partition `json:"partitions,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -470,15 +422,10 @@ func cleanRoomCollaboratorToPb(st *CleanRoomCollaborator) (*cleanRoomCollaborato } pb := &cleanRoomCollaboratorPb{} pb.CollaboratorAlias = st.CollaboratorAlias - pb.DisplayName = st.DisplayName - pb.GlobalMetastoreId = st.GlobalMetastoreId - pb.InviteRecipientEmail = st.InviteRecipientEmail - pb.InviteRecipientWorkspaceId = st.InviteRecipientWorkspaceId - pb.OrganizationName = st.OrganizationName pb.ForceSendFields = st.ForceSendFields @@ -486,17 +433,12 @@ func cleanRoomCollaboratorToPb(st *CleanRoomCollaborator) (*cleanRoomCollaborato } type cleanRoomCollaboratorPb struct { - CollaboratorAlias string `json:"collaborator_alias"` - - DisplayName string `json:"display_name,omitempty"` - - GlobalMetastoreId string `json:"global_metastore_id,omitempty"` - - InviteRecipientEmail string `json:"invite_recipient_email,omitempty"` - - InviteRecipientWorkspaceId int64 `json:"invite_recipient_workspace_id,omitempty"` - - OrganizationName string `json:"organization_name,omitempty"` + CollaboratorAlias string `json:"collaborator_alias"` + DisplayName string `json:"display_name,omitempty"` + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + InviteRecipientEmail string `json:"invite_recipient_email,omitempty"` + InviteRecipientWorkspaceId int64 `json:"invite_recipient_workspace_id,omitempty"` + OrganizationName string `json:"organization_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -531,13 +473,9 @@ func cleanRoomNotebookReviewToPb(st *CleanRoomNotebookReview) (*cleanRoomNoteboo } pb := &cleanRoomNotebookReviewPb{} pb.Comment = st.Comment - pb.CreatedAtMillis = st.CreatedAtMillis - pb.ReviewState = st.ReviewState - pb.ReviewSubReason = st.ReviewSubReason - pb.ReviewerCollaboratorAlias = st.ReviewerCollaboratorAlias pb.ForceSendFields = st.ForceSendFields @@ -545,15 +483,11 @@ func cleanRoomNotebookReviewToPb(st *CleanRoomNotebookReview) (*cleanRoomNoteboo } type cleanRoomNotebookReviewPb struct { - Comment string `json:"comment,omitempty"` - - CreatedAtMillis int64 `json:"created_at_millis,omitempty"` - - ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` - - ReviewSubReason CleanRoomNotebookReviewNotebookReviewSubReason `json:"review_sub_reason,omitempty"` - - ReviewerCollaboratorAlias string `json:"reviewer_collaborator_alias,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAtMillis int64 `json:"created_at_millis,omitempty"` + ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` + ReviewSubReason CleanRoomNotebookReviewNotebookReviewSubReason `json:"review_sub_reason,omitempty"` + ReviewerCollaboratorAlias string `json:"reviewer_collaborator_alias,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -587,21 +521,13 @@ func cleanRoomNotebookTaskRunToPb(st *CleanRoomNotebookTaskRun) (*cleanRoomNoteb } pb := &cleanRoomNotebookTaskRunPb{} pb.CollaboratorJobRunInfo = st.CollaboratorJobRunInfo - pb.NotebookEtag = st.NotebookEtag - pb.NotebookJobRunState = st.NotebookJobRunState - pb.NotebookName = st.NotebookName - pb.NotebookUpdatedAt = st.NotebookUpdatedAt - pb.OutputSchemaExpirationTime = st.OutputSchemaExpirationTime - pb.OutputSchemaName = st.OutputSchemaName - pb.RunDuration = st.RunDuration - pb.StartTime = st.StartTime pb.ForceSendFields = st.ForceSendFields @@ -609,23 +535,15 @@ func cleanRoomNotebookTaskRunToPb(st *CleanRoomNotebookTaskRun) (*cleanRoomNoteb } type cleanRoomNotebookTaskRunPb struct { - CollaboratorJobRunInfo *CollaboratorJobRunInfo `json:"collaborator_job_run_info,omitempty"` - - NotebookEtag string `json:"notebook_etag,omitempty"` - - NotebookJobRunState *jobs.CleanRoomTaskRunState `json:"notebook_job_run_state,omitempty"` - - NotebookName string `json:"notebook_name,omitempty"` - - NotebookUpdatedAt int64 `json:"notebook_updated_at,omitempty"` - - OutputSchemaExpirationTime int64 `json:"output_schema_expiration_time,omitempty"` - - OutputSchemaName string `json:"output_schema_name,omitempty"` - - RunDuration int64 `json:"run_duration,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` + CollaboratorJobRunInfo *CollaboratorJobRunInfo `json:"collaborator_job_run_info,omitempty"` + NotebookEtag string `json:"notebook_etag,omitempty"` + NotebookJobRunState *jobs.CleanRoomTaskRunState `json:"notebook_job_run_state,omitempty"` + NotebookName string `json:"notebook_name,omitempty"` + NotebookUpdatedAt int64 `json:"notebook_updated_at,omitempty"` + OutputSchemaExpirationTime int64 `json:"output_schema_expiration_time,omitempty"` + OutputSchemaName string `json:"output_schema_name,omitempty"` + RunDuration int64 `json:"run_duration,omitempty"` + StartTime int64 `json:"start_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -663,7 +581,6 @@ func cleanRoomOutputCatalogToPb(st *CleanRoomOutputCatalog) (*cleanRoomOutputCat } pb := &cleanRoomOutputCatalogPb{} pb.CatalogName = st.CatalogName - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -671,9 +588,8 @@ func cleanRoomOutputCatalogToPb(st *CleanRoomOutputCatalog) (*cleanRoomOutputCat } type cleanRoomOutputCatalogPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - Status CleanRoomOutputCatalogOutputCatalogStatus `json:"status,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Status CleanRoomOutputCatalogOutputCatalogStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -704,17 +620,11 @@ func cleanRoomRemoteDetailToPb(st *CleanRoomRemoteDetail) (*cleanRoomRemoteDetai } pb := &cleanRoomRemoteDetailPb{} pb.CentralCleanRoomId = st.CentralCleanRoomId - pb.CloudVendor = st.CloudVendor - pb.Collaborators = st.Collaborators - pb.ComplianceSecurityProfile = st.ComplianceSecurityProfile - pb.Creator = st.Creator - pb.EgressNetworkPolicy = st.EgressNetworkPolicy - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -722,19 +632,13 @@ func cleanRoomRemoteDetailToPb(st *CleanRoomRemoteDetail) (*cleanRoomRemoteDetai } type cleanRoomRemoteDetailPb struct { - CentralCleanRoomId string `json:"central_clean_room_id,omitempty"` - - CloudVendor string `json:"cloud_vendor,omitempty"` - - Collaborators []CleanRoomCollaborator `json:"collaborators,omitempty"` - - ComplianceSecurityProfile *ComplianceSecurityProfile `json:"compliance_security_profile,omitempty"` - - Creator *CleanRoomCollaborator `json:"creator,omitempty"` - - EgressNetworkPolicy *settings.EgressNetworkPolicy `json:"egress_network_policy,omitempty"` - - Region string `json:"region,omitempty"` + CentralCleanRoomId string `json:"central_clean_room_id,omitempty"` + CloudVendor string `json:"cloud_vendor,omitempty"` + Collaborators []CleanRoomCollaborator `json:"collaborators,omitempty"` + ComplianceSecurityProfile *ComplianceSecurityProfile `json:"compliance_security_profile,omitempty"` + Creator *CleanRoomCollaborator `json:"creator,omitempty"` + EgressNetworkPolicy *settings.EgressNetworkPolicy `json:"egress_network_policy,omitempty"` + Region string `json:"region,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -770,13 +674,9 @@ func collaboratorJobRunInfoToPb(st *CollaboratorJobRunInfo) (*collaboratorJobRun } pb := &collaboratorJobRunInfoPb{} pb.CollaboratorAlias = st.CollaboratorAlias - pb.CollaboratorJobId = st.CollaboratorJobId - pb.CollaboratorJobRunId = st.CollaboratorJobRunId - pb.CollaboratorTaskRunId = st.CollaboratorTaskRunId - pb.CollaboratorWorkspaceId = st.CollaboratorWorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -784,15 +684,11 @@ func collaboratorJobRunInfoToPb(st *CollaboratorJobRunInfo) (*collaboratorJobRun } type collaboratorJobRunInfoPb struct { - CollaboratorAlias string `json:"collaborator_alias,omitempty"` - - CollaboratorJobId int64 `json:"collaborator_job_id,omitempty"` - - CollaboratorJobRunId int64 `json:"collaborator_job_run_id,omitempty"` - - CollaboratorTaskRunId int64 `json:"collaborator_task_run_id,omitempty"` - - CollaboratorWorkspaceId int64 `json:"collaborator_workspace_id,omitempty"` + CollaboratorAlias string `json:"collaborator_alias,omitempty"` + CollaboratorJobId int64 `json:"collaborator_job_id,omitempty"` + CollaboratorJobRunId int64 `json:"collaborator_job_run_id,omitempty"` + CollaboratorTaskRunId int64 `json:"collaborator_task_run_id,omitempty"` + CollaboratorWorkspaceId int64 `json:"collaborator_workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -826,7 +722,6 @@ func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSe } pb := &complianceSecurityProfilePb{} pb.ComplianceStandards = st.ComplianceStandards - pb.IsEnabled = st.IsEnabled pb.ForceSendFields = st.ForceSendFields @@ -835,8 +730,7 @@ func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSe type complianceSecurityProfilePb struct { ComplianceStandards []settings.ComplianceStandard `json:"compliance_standards,omitempty"` - - IsEnabled bool `json:"is_enabled,omitempty"` + IsEnabled bool `json:"is_enabled,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -867,16 +761,14 @@ func createCleanRoomAssetRequestToPb(st *CreateCleanRoomAssetRequest) (*createCl } pb := &createCleanRoomAssetRequestPb{} pb.Asset = st.Asset - pb.CleanRoomName = st.CleanRoomName return pb, nil } type createCleanRoomAssetRequestPb struct { - Asset CleanRoomAsset `json:"asset"` - - CleanRoomName string `json:"-" url:"-"` + Asset CleanRoomAsset `json:"asset"` + CleanRoomName string `json:"-" url:"-"` } func createCleanRoomAssetRequestFromPb(pb *createCleanRoomAssetRequestPb) (*CreateCleanRoomAssetRequest, error) { @@ -896,15 +788,13 @@ func createCleanRoomOutputCatalogRequestToPb(st *CreateCleanRoomOutputCatalogReq } pb := &createCleanRoomOutputCatalogRequestPb{} pb.CleanRoomName = st.CleanRoomName - pb.OutputCatalog = st.OutputCatalog return pb, nil } type createCleanRoomOutputCatalogRequestPb struct { - CleanRoomName string `json:"-" url:"-"` - + CleanRoomName string `json:"-" url:"-"` OutputCatalog CleanRoomOutputCatalog `json:"output_catalog"` } @@ -973,20 +863,16 @@ func deleteCleanRoomAssetRequestToPb(st *DeleteCleanRoomAssetRequest) (*deleteCl } pb := &deleteCleanRoomAssetRequestPb{} pb.AssetFullName = st.AssetFullName - pb.AssetType = st.AssetType - pb.CleanRoomName = st.CleanRoomName return pb, nil } type deleteCleanRoomAssetRequestPb struct { - AssetFullName string `json:"-" url:"-"` - - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` - - CleanRoomName string `json:"-" url:"-"` + AssetFullName string `json:"-" url:"-"` + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + CleanRoomName string `json:"-" url:"-"` } func deleteCleanRoomAssetRequestFromPb(pb *deleteCleanRoomAssetRequestPb) (*DeleteCleanRoomAssetRequest, error) { @@ -1073,20 +959,16 @@ func getCleanRoomAssetRequestToPb(st *GetCleanRoomAssetRequest) (*getCleanRoomAs } pb := &getCleanRoomAssetRequestPb{} pb.AssetFullName = st.AssetFullName - pb.AssetType = st.AssetType - pb.CleanRoomName = st.CleanRoomName return pb, nil } type getCleanRoomAssetRequestPb struct { - AssetFullName string `json:"-" url:"-"` - - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` - - CleanRoomName string `json:"-" url:"-"` + AssetFullName string `json:"-" url:"-"` + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + CleanRoomName string `json:"-" url:"-"` } func getCleanRoomAssetRequestFromPb(pb *getCleanRoomAssetRequestPb) (*GetCleanRoomAssetRequest, error) { @@ -1131,7 +1013,6 @@ func listCleanRoomAssetsRequestToPb(st *ListCleanRoomAssetsRequest) (*listCleanR } pb := &listCleanRoomAssetsRequestPb{} pb.CleanRoomName = st.CleanRoomName - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1140,8 +1021,7 @@ func listCleanRoomAssetsRequestToPb(st *ListCleanRoomAssetsRequest) (*listCleanR type listCleanRoomAssetsRequestPb struct { CleanRoomName string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1172,7 +1052,6 @@ func listCleanRoomAssetsResponseToPb(st *ListCleanRoomAssetsResponse) (*listClea } pb := &listCleanRoomAssetsResponsePb{} pb.Assets = st.Assets - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1180,9 +1059,8 @@ func listCleanRoomAssetsResponseToPb(st *ListCleanRoomAssetsResponse) (*listClea } type listCleanRoomAssetsResponsePb struct { - Assets []CleanRoomAsset `json:"assets,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Assets []CleanRoomAsset `json:"assets,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1213,11 +1091,8 @@ func listCleanRoomNotebookTaskRunsRequestToPb(st *ListCleanRoomNotebookTaskRunsR } pb := &listCleanRoomNotebookTaskRunsRequestPb{} pb.CleanRoomName = st.CleanRoomName - pb.NotebookName = st.NotebookName - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1226,12 +1101,9 @@ func listCleanRoomNotebookTaskRunsRequestToPb(st *ListCleanRoomNotebookTaskRunsR type listCleanRoomNotebookTaskRunsRequestPb struct { CleanRoomName string `json:"-" url:"-"` - - NotebookName string `json:"-" url:"notebook_name,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + NotebookName string `json:"-" url:"notebook_name,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1264,7 +1136,6 @@ func listCleanRoomNotebookTaskRunsResponseToPb(st *ListCleanRoomNotebookTaskRuns } pb := &listCleanRoomNotebookTaskRunsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Runs = st.Runs pb.ForceSendFields = st.ForceSendFields @@ -1272,9 +1143,8 @@ func listCleanRoomNotebookTaskRunsResponseToPb(st *ListCleanRoomNotebookTaskRuns } type listCleanRoomNotebookTaskRunsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Runs []CleanRoomNotebookTaskRun `json:"runs,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Runs []CleanRoomNotebookTaskRun `json:"runs,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1305,7 +1175,6 @@ func listCleanRoomsRequestToPb(st *ListCleanRoomsRequest) (*listCleanRoomsReques } pb := &listCleanRoomsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1313,8 +1182,7 @@ func listCleanRoomsRequestToPb(st *ListCleanRoomsRequest) (*listCleanRoomsReques } type listCleanRoomsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1346,7 +1214,6 @@ func listCleanRoomsResponseToPb(st *ListCleanRoomsResponse) (*listCleanRoomsResp } pb := &listCleanRoomsResponsePb{} pb.CleanRooms = st.CleanRooms - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1354,9 +1221,8 @@ func listCleanRoomsResponseToPb(st *ListCleanRoomsResponse) (*listCleanRoomsResp } type listCleanRoomsResponsePb struct { - CleanRooms []CleanRoom `json:"clean_rooms,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + CleanRooms []CleanRoom `json:"clean_rooms,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1387,24 +1253,18 @@ func updateCleanRoomAssetRequestToPb(st *UpdateCleanRoomAssetRequest) (*updateCl } pb := &updateCleanRoomAssetRequestPb{} pb.Asset = st.Asset - pb.AssetType = st.AssetType - pb.CleanRoomName = st.CleanRoomName - pb.Name = st.Name return pb, nil } type updateCleanRoomAssetRequestPb struct { - Asset CleanRoomAsset `json:"asset"` - - AssetType CleanRoomAssetAssetType `json:"-" url:"-"` - - CleanRoomName string `json:"-" url:"-"` - - Name string `json:"-" url:"-"` + Asset CleanRoomAsset `json:"asset"` + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + CleanRoomName string `json:"-" url:"-"` + Name string `json:"-" url:"-"` } func updateCleanRoomAssetRequestFromPb(pb *updateCleanRoomAssetRequestPb) (*UpdateCleanRoomAssetRequest, error) { @@ -1426,7 +1286,6 @@ func updateCleanRoomRequestToPb(st *UpdateCleanRoomRequest) (*updateCleanRoomReq } pb := &updateCleanRoomRequestPb{} pb.CleanRoom = st.CleanRoom - pb.Name = st.Name return pb, nil @@ -1434,8 +1293,7 @@ func updateCleanRoomRequestToPb(st *UpdateCleanRoomRequest) (*updateCleanRoomReq type updateCleanRoomRequestPb struct { CleanRoom *CleanRoom `json:"clean_room,omitempty"` - - Name string `json:"-" url:"-"` + Name string `json:"-" url:"-"` } func updateCleanRoomRequestFromPb(pb *updateCleanRoomRequestPb) (*UpdateCleanRoomRequest, error) { @@ -1448,3 +1306,57 @@ func updateCleanRoomRequestFromPb(pb *updateCleanRoomRequestPb) (*UpdateCleanRoo return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index 0dad474ef..d13248d97 100755 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -5,8 +5,6 @@ package cleanrooms import ( "encoding/json" "fmt" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/jobs" @@ -1654,57 +1652,3 @@ func (st UpdateCleanRoomRequest) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/compute/internal.go b/service/compute/internal.go index 180c967b7..230b701e0 100755 --- a/service/compute/internal.go +++ b/service/compute/internal.go @@ -3,6 +3,10 @@ package compute import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,11 +16,8 @@ func addInstanceProfileToPb(st *AddInstanceProfile) (*addInstanceProfilePb, erro } pb := &addInstanceProfilePb{} pb.IamRoleArn = st.IamRoleArn - pb.InstanceProfileArn = st.InstanceProfileArn - pb.IsMetaInstanceProfile = st.IsMetaInstanceProfile - pb.SkipValidation = st.SkipValidation pb.ForceSendFields = st.ForceSendFields @@ -24,13 +25,10 @@ func addInstanceProfileToPb(st *AddInstanceProfile) (*addInstanceProfilePb, erro } type addInstanceProfilePb struct { - IamRoleArn string `json:"iam_role_arn,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn"` - - IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` - - SkipValidation bool `json:"skip_validation,omitempty"` + IamRoleArn string `json:"iam_role_arn,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn"` + IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -108,7 +106,6 @@ func autoScaleToPb(st *AutoScale) (*autoScalePb, error) { } pb := &autoScalePb{} pb.MaxWorkers = st.MaxWorkers - pb.MinWorkers = st.MinWorkers pb.ForceSendFields = st.ForceSendFields @@ -117,7 +114,6 @@ func autoScaleToPb(st *AutoScale) (*autoScalePb, error) { type autoScalePb struct { MaxWorkers int `json:"max_workers,omitempty"` - MinWorkers int `json:"min_workers,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -149,23 +145,14 @@ func awsAttributesToPb(st *AwsAttributes) (*awsAttributesPb, error) { } pb := &awsAttributesPb{} pb.Availability = st.Availability - pb.EbsVolumeCount = st.EbsVolumeCount - pb.EbsVolumeIops = st.EbsVolumeIops - pb.EbsVolumeSize = st.EbsVolumeSize - pb.EbsVolumeThroughput = st.EbsVolumeThroughput - pb.EbsVolumeType = st.EbsVolumeType - pb.FirstOnDemand = st.FirstOnDemand - pb.InstanceProfileArn = st.InstanceProfileArn - pb.SpotBidPricePercent = st.SpotBidPricePercent - pb.ZoneId = st.ZoneId pb.ForceSendFields = st.ForceSendFields @@ -173,25 +160,16 @@ func awsAttributesToPb(st *AwsAttributes) (*awsAttributesPb, error) { } type awsAttributesPb struct { - Availability AwsAvailability `json:"availability,omitempty"` - - EbsVolumeCount int `json:"ebs_volume_count,omitempty"` - - EbsVolumeIops int `json:"ebs_volume_iops,omitempty"` - - EbsVolumeSize int `json:"ebs_volume_size,omitempty"` - - EbsVolumeThroughput int `json:"ebs_volume_throughput,omitempty"` - - EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` - - FirstOnDemand int `json:"first_on_demand,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` - - ZoneId string `json:"zone_id,omitempty"` + Availability AwsAvailability `json:"availability,omitempty"` + EbsVolumeCount int `json:"ebs_volume_count,omitempty"` + EbsVolumeIops int `json:"ebs_volume_iops,omitempty"` + EbsVolumeSize int `json:"ebs_volume_size,omitempty"` + EbsVolumeThroughput int `json:"ebs_volume_throughput,omitempty"` + EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` + FirstOnDemand int `json:"first_on_demand,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + ZoneId string `json:"zone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -230,11 +208,8 @@ func azureAttributesToPb(st *AzureAttributes) (*azureAttributesPb, error) { } pb := &azureAttributesPb{} pb.Availability = st.Availability - pb.FirstOnDemand = st.FirstOnDemand - pb.LogAnalyticsInfo = st.LogAnalyticsInfo - pb.SpotBidMaxPrice = st.SpotBidMaxPrice pb.ForceSendFields = st.ForceSendFields @@ -242,13 +217,10 @@ func azureAttributesToPb(st *AzureAttributes) (*azureAttributesPb, error) { } type azureAttributesPb struct { - Availability AzureAvailability `json:"availability,omitempty"` - - FirstOnDemand int `json:"first_on_demand,omitempty"` - + Availability AzureAvailability `json:"availability,omitempty"` + FirstOnDemand int `json:"first_on_demand,omitempty"` LogAnalyticsInfo *LogAnalyticsInfo `json:"log_analytics_info,omitempty"` - - SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -281,9 +253,7 @@ func cancelCommandToPb(st *CancelCommand) (*cancelCommandPb, error) { } pb := &cancelCommandPb{} pb.ClusterId = st.ClusterId - pb.CommandId = st.CommandId - pb.ContextId = st.ContextId pb.ForceSendFields = st.ForceSendFields @@ -292,9 +262,7 @@ func cancelCommandToPb(st *CancelCommand) (*cancelCommandPb, error) { type cancelCommandPb struct { ClusterId string `json:"clusterId,omitempty"` - CommandId string `json:"commandId,omitempty"` - ContextId string `json:"contextId,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -348,15 +316,13 @@ func changeClusterOwnerToPb(st *ChangeClusterOwner) (*changeClusterOwnerPb, erro } pb := &changeClusterOwnerPb{} pb.ClusterId = st.ClusterId - pb.OwnerUsername = st.OwnerUsername return pb, nil } type changeClusterOwnerPb struct { - ClusterId string `json:"cluster_id"` - + ClusterId string `json:"cluster_id"` OwnerUsername string `json:"owner_username"` } @@ -398,7 +364,6 @@ func clientsTypesToPb(st *ClientsTypes) (*clientsTypesPb, error) { } pb := &clientsTypesPb{} pb.Jobs = st.Jobs - pb.Notebooks = st.Notebooks pb.ForceSendFields = st.ForceSendFields @@ -406,8 +371,7 @@ func clientsTypesToPb(st *ClientsTypes) (*clientsTypesPb, error) { } type clientsTypesPb struct { - Jobs bool `json:"jobs,omitempty"` - + Jobs bool `json:"jobs,omitempty"` Notebooks bool `json:"notebooks,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -487,11 +451,8 @@ func clusterAccessControlRequestToPb(st *ClusterAccessControlRequest) (*clusterA } pb := &clusterAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -499,13 +460,10 @@ func clusterAccessControlRequestToPb(st *ClusterAccessControlRequest) (*clusterA } type clusterAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -538,13 +496,9 @@ func clusterAccessControlResponseToPb(st *ClusterAccessControlResponse) (*cluste } pb := &clusterAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -552,15 +506,11 @@ func clusterAccessControlResponseToPb(st *ClusterAccessControlResponse) (*cluste } type clusterAccessControlResponsePb struct { - AllPermissions []ClusterPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []ClusterPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -594,57 +544,31 @@ func clusterAttributesToPb(st *ClusterAttributes) (*clusterAttributesPb, error) } pb := &clusterAttributesPb{} pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterName = st.ClusterName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DockerImage = st.DockerImage - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.Kind = st.Kind - pb.NodeTypeId = st.NodeTypeId - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.SshPublicKeys = st.SshPublicKeys - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -652,59 +576,33 @@ func clusterAttributesToPb(st *ClusterAttributes) (*clusterAttributesPb, error) } type clusterAttributesPb struct { - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` - - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + Kind Kind `json:"kind,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -760,9 +658,7 @@ func clusterComplianceToPb(st *ClusterCompliance) (*clusterCompliancePb, error) } pb := &clusterCompliancePb{} pb.ClusterId = st.ClusterId - pb.IsCompliant = st.IsCompliant - pb.Violations = st.Violations pb.ForceSendFields = st.ForceSendFields @@ -770,11 +666,9 @@ func clusterComplianceToPb(st *ClusterCompliance) (*clusterCompliancePb, error) } type clusterCompliancePb struct { - ClusterId string `json:"cluster_id"` - - IsCompliant bool `json:"is_compliant,omitempty"` - - Violations map[string]string `json:"violations,omitempty"` + ClusterId string `json:"cluster_id"` + IsCompliant bool `json:"is_compliant,omitempty"` + Violations map[string]string `json:"violations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -806,99 +700,52 @@ func clusterDetailsToPb(st *ClusterDetails) (*clusterDetailsPb, error) { } pb := &clusterDetailsPb{} pb.Autoscale = st.Autoscale - pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterCores = st.ClusterCores - pb.ClusterId = st.ClusterId - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterLogStatus = st.ClusterLogStatus - pb.ClusterMemoryMb = st.ClusterMemoryMb - pb.ClusterName = st.ClusterName - pb.ClusterSource = st.ClusterSource - pb.CreatorUserName = st.CreatorUserName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DefaultTags = st.DefaultTags - pb.DockerImage = st.DockerImage - pb.Driver = st.Driver - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.Executors = st.Executors - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.JdbcPort = st.JdbcPort - pb.Kind = st.Kind - pb.LastRestartedTime = st.LastRestartedTime - pb.LastStateLossTime = st.LastStateLossTime - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkContextId = st.SparkContextId - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.Spec = st.Spec - pb.SshPublicKeys = st.SshPublicKeys - pb.StartTime = st.StartTime - pb.State = st.State - pb.StateMessage = st.StateMessage - pb.TerminatedTime = st.TerminatedTime - pb.TerminationReason = st.TerminationReason - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -906,101 +753,54 @@ func clusterDetailsToPb(st *ClusterDetails) (*clusterDetailsPb, error) { } type clusterDetailsPb struct { - Autoscale *AutoScale `json:"autoscale,omitempty"` - - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterCores float64 `json:"cluster_cores,omitempty"` - - ClusterId string `json:"cluster_id,omitempty"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterLogStatus *LogSyncStatus `json:"cluster_log_status,omitempty"` - - ClusterMemoryMb int64 `json:"cluster_memory_mb,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - ClusterSource ClusterSource `json:"cluster_source,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DefaultTags map[string]string `json:"default_tags,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - Driver *SparkNode `json:"driver,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - Executors []SparkNode `json:"executors,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - JdbcPort int `json:"jdbc_port,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - LastRestartedTime int64 `json:"last_restarted_time,omitempty"` - - LastStateLossTime int64 `json:"last_state_loss_time,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkContextId int64 `json:"spark_context_id,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version,omitempty"` - - Spec *ClusterSpec `json:"spec,omitempty"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - State State `json:"state,omitempty"` - - StateMessage string `json:"state_message,omitempty"` - - TerminatedTime int64 `json:"terminated_time,omitempty"` - - TerminationReason *TerminationReason `json:"termination_reason,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` - - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + ClusterCores float64 `json:"cluster_cores,omitempty"` + ClusterId string `json:"cluster_id,omitempty"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterLogStatus *LogSyncStatus `json:"cluster_log_status,omitempty"` + ClusterMemoryMb int64 `json:"cluster_memory_mb,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + ClusterSource ClusterSource `json:"cluster_source,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DefaultTags map[string]string `json:"default_tags,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + Driver *SparkNode `json:"driver,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + Executors []SparkNode `json:"executors,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + JdbcPort int `json:"jdbc_port,omitempty"` + Kind Kind `json:"kind,omitempty"` + LastRestartedTime int64 `json:"last_restarted_time,omitempty"` + LastStateLossTime int64 `json:"last_state_loss_time,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkContextId int64 `json:"spark_context_id,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version,omitempty"` + Spec *ClusterSpec `json:"spec,omitempty"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + State State `json:"state,omitempty"` + StateMessage string `json:"state_message,omitempty"` + TerminatedTime int64 `json:"terminated_time,omitempty"` + TerminationReason *TerminationReason `json:"termination_reason,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1077,13 +877,9 @@ func clusterEventToPb(st *ClusterEvent) (*clusterEventPb, error) { } pb := &clusterEventPb{} pb.ClusterId = st.ClusterId - pb.DataPlaneEventDetails = st.DataPlaneEventDetails - pb.Details = st.Details - pb.Timestamp = st.Timestamp - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -1091,15 +887,11 @@ func clusterEventToPb(st *ClusterEvent) (*clusterEventPb, error) { } type clusterEventPb struct { - ClusterId string `json:"cluster_id"` - + ClusterId string `json:"cluster_id"` DataPlaneEventDetails *DataPlaneEventDetails `json:"data_plane_event_details,omitempty"` - - Details *EventDetails `json:"details,omitempty"` - - Timestamp int64 `json:"timestamp,omitempty"` - - Type EventType `json:"type,omitempty"` + Details *EventDetails `json:"details,omitempty"` + Timestamp int64 `json:"timestamp,omitempty"` + Type EventType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1133,7 +925,6 @@ func clusterLibraryStatusesToPb(st *ClusterLibraryStatuses) (*clusterLibraryStat } pb := &clusterLibraryStatusesPb{} pb.ClusterId = st.ClusterId - pb.LibraryStatuses = st.LibraryStatuses pb.ForceSendFields = st.ForceSendFields @@ -1141,8 +932,7 @@ func clusterLibraryStatusesToPb(st *ClusterLibraryStatuses) (*clusterLibraryStat } type clusterLibraryStatusesPb struct { - ClusterId string `json:"cluster_id,omitempty"` - + ClusterId string `json:"cluster_id,omitempty"` LibraryStatuses []LibraryFullStatus `json:"library_statuses,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1174,19 +964,15 @@ func clusterLogConfToPb(st *ClusterLogConf) (*clusterLogConfPb, error) { } pb := &clusterLogConfPb{} pb.Dbfs = st.Dbfs - pb.S3 = st.S3 - pb.Volumes = st.Volumes return pb, nil } type clusterLogConfPb struct { - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` - - S3 *S3StorageInfo `json:"s3,omitempty"` - + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + S3 *S3StorageInfo `json:"s3,omitempty"` Volumes *VolumesStorageInfo `json:"volumes,omitempty"` } @@ -1208,9 +994,7 @@ func clusterPermissionToPb(st *ClusterPermission) (*clusterPermissionPb, error) } pb := &clusterPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -1218,11 +1002,9 @@ func clusterPermissionToPb(st *ClusterPermission) (*clusterPermissionPb, error) } type clusterPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1254,9 +1036,7 @@ func clusterPermissionsToPb(st *ClusterPermissions) (*clusterPermissionsPb, erro } pb := &clusterPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -1265,10 +1045,8 @@ func clusterPermissionsToPb(st *ClusterPermissions) (*clusterPermissionsPb, erro type clusterPermissionsPb struct { AccessControlList []ClusterAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1300,7 +1078,6 @@ func clusterPermissionsDescriptionToPb(st *ClusterPermissionsDescription) (*clus } pb := &clusterPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -1308,8 +1085,7 @@ func clusterPermissionsDescriptionToPb(st *ClusterPermissionsDescription) (*clus } type clusterPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel ClusterPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1341,7 +1117,6 @@ func clusterPermissionsRequestToPb(st *ClusterPermissionsRequest) (*clusterPermi } pb := &clusterPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.ClusterId = st.ClusterId return pb, nil @@ -1349,8 +1124,7 @@ func clusterPermissionsRequestToPb(st *ClusterPermissionsRequest) (*clusterPermi type clusterPermissionsRequestPb struct { AccessControlList []ClusterAccessControlRequest `json:"access_control_list,omitempty"` - - ClusterId string `json:"-" url:"-"` + ClusterId string `json:"-" url:"-"` } func clusterPermissionsRequestFromPb(pb *clusterPermissionsRequestPb) (*ClusterPermissionsRequest, error) { @@ -1370,11 +1144,8 @@ func clusterPolicyAccessControlRequestToPb(st *ClusterPolicyAccessControlRequest } pb := &clusterPolicyAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1382,13 +1153,10 @@ func clusterPolicyAccessControlRequestToPb(st *ClusterPolicyAccessControlRequest } type clusterPolicyAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1421,13 +1189,9 @@ func clusterPolicyAccessControlResponseToPb(st *ClusterPolicyAccessControlRespon } pb := &clusterPolicyAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1435,15 +1199,11 @@ func clusterPolicyAccessControlResponseToPb(st *ClusterPolicyAccessControlRespon } type clusterPolicyAccessControlResponsePb struct { - AllPermissions []ClusterPolicyPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []ClusterPolicyPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1477,9 +1237,7 @@ func clusterPolicyPermissionToPb(st *ClusterPolicyPermission) (*clusterPolicyPer } pb := &clusterPolicyPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -1487,11 +1245,9 @@ func clusterPolicyPermissionToPb(st *ClusterPolicyPermission) (*clusterPolicyPer } type clusterPolicyPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1523,9 +1279,7 @@ func clusterPolicyPermissionsToPb(st *ClusterPolicyPermissions) (*clusterPolicyP } pb := &clusterPolicyPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -1534,10 +1288,8 @@ func clusterPolicyPermissionsToPb(st *ClusterPolicyPermissions) (*clusterPolicyP type clusterPolicyPermissionsPb struct { AccessControlList []ClusterPolicyAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1569,7 +1321,6 @@ func clusterPolicyPermissionsDescriptionToPb(st *ClusterPolicyPermissionsDescrip } pb := &clusterPolicyPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -1577,8 +1328,7 @@ func clusterPolicyPermissionsDescriptionToPb(st *ClusterPolicyPermissionsDescrip } type clusterPolicyPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel ClusterPolicyPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1610,7 +1360,6 @@ func clusterPolicyPermissionsRequestToPb(st *ClusterPolicyPermissionsRequest) (* } pb := &clusterPolicyPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.ClusterPolicyId = st.ClusterPolicyId return pb, nil @@ -1618,8 +1367,7 @@ func clusterPolicyPermissionsRequestToPb(st *ClusterPolicyPermissionsRequest) (* type clusterPolicyPermissionsRequestPb struct { AccessControlList []ClusterPolicyAccessControlRequest `json:"access_control_list,omitempty"` - - ClusterPolicyId string `json:"-" url:"-"` + ClusterPolicyId string `json:"-" url:"-"` } func clusterPolicyPermissionsRequestFromPb(pb *clusterPolicyPermissionsRequestPb) (*ClusterPolicyPermissionsRequest, error) { @@ -1639,9 +1387,7 @@ func clusterSettingsChangeToPb(st *ClusterSettingsChange) (*clusterSettingsChang } pb := &clusterSettingsChangePb{} pb.Field = st.Field - pb.NewValue = st.NewValue - pb.PreviousValue = st.PreviousValue pb.ForceSendFields = st.ForceSendFields @@ -1649,10 +1395,8 @@ func clusterSettingsChangeToPb(st *ClusterSettingsChange) (*clusterSettingsChang } type clusterSettingsChangePb struct { - Field string `json:"field,omitempty"` - - NewValue string `json:"new_value,omitempty"` - + Field string `json:"field,omitempty"` + NewValue string `json:"new_value,omitempty"` PreviousValue string `json:"previous_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1685,7 +1429,6 @@ func clusterSizeToPb(st *ClusterSize) (*clusterSizePb, error) { } pb := &clusterSizePb{} pb.Autoscale = st.Autoscale - pb.NumWorkers = st.NumWorkers pb.ForceSendFields = st.ForceSendFields @@ -1693,9 +1436,8 @@ func clusterSizeToPb(st *ClusterSize) (*clusterSizePb, error) { } type clusterSizePb struct { - Autoscale *AutoScale `json:"autoscale,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1726,63 +1468,34 @@ func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { } pb := &clusterSpecPb{} pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues - pb.Autoscale = st.Autoscale - pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterName = st.ClusterName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DockerImage = st.DockerImage - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.Kind = st.Kind - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.SshPublicKeys = st.SshPublicKeys - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -1790,65 +1503,36 @@ func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { } type clusterSpecPb struct { - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` - - Autoscale *AutoScale `json:"autoscale,omitempty"` - - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version,omitempty"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` - - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + Kind Kind `json:"kind,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version,omitempty"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1931,11 +1615,8 @@ func commandToPb(st *Command) (*commandPb, error) { } pb := &commandPb{} pb.ClusterId = st.ClusterId - pb.Command = st.Command - pb.ContextId = st.ContextId - pb.Language = st.Language pb.ForceSendFields = st.ForceSendFields @@ -1943,13 +1624,10 @@ func commandToPb(st *Command) (*commandPb, error) { } type commandPb struct { - ClusterId string `json:"clusterId,omitempty"` - - Command string `json:"command,omitempty"` - - ContextId string `json:"contextId,omitempty"` - - Language Language `json:"language,omitempty"` + ClusterId string `json:"clusterId,omitempty"` + Command string `json:"command,omitempty"` + ContextId string `json:"contextId,omitempty"` + Language Language `json:"language,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1982,9 +1660,7 @@ func commandStatusRequestToPb(st *CommandStatusRequest) (*commandStatusRequestPb } pb := &commandStatusRequestPb{} pb.ClusterId = st.ClusterId - pb.CommandId = st.CommandId - pb.ContextId = st.ContextId return pb, nil @@ -1992,9 +1668,7 @@ func commandStatusRequestToPb(st *CommandStatusRequest) (*commandStatusRequestPb type commandStatusRequestPb struct { ClusterId string `json:"-" url:"clusterId"` - CommandId string `json:"-" url:"commandId"` - ContextId string `json:"-" url:"contextId"` } @@ -2016,9 +1690,7 @@ func commandStatusResponseToPb(st *CommandStatusResponse) (*commandStatusRespons } pb := &commandStatusResponsePb{} pb.Id = st.Id - pb.Results = st.Results - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -2026,11 +1698,9 @@ func commandStatusResponseToPb(st *CommandStatusResponse) (*commandStatusRespons } type commandStatusResponsePb struct { - Id string `json:"id,omitempty"` - - Results *Results `json:"results,omitempty"` - - Status CommandStatus `json:"status,omitempty"` + Id string `json:"id,omitempty"` + Results *Results `json:"results,omitempty"` + Status CommandStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2062,7 +1732,6 @@ func contextStatusRequestToPb(st *ContextStatusRequest) (*contextStatusRequestPb } pb := &contextStatusRequestPb{} pb.ClusterId = st.ClusterId - pb.ContextId = st.ContextId return pb, nil @@ -2070,7 +1739,6 @@ func contextStatusRequestToPb(st *ContextStatusRequest) (*contextStatusRequestPb type contextStatusRequestPb struct { ClusterId string `json:"-" url:"clusterId"` - ContextId string `json:"-" url:"contextId"` } @@ -2091,7 +1759,6 @@ func contextStatusResponseToPb(st *ContextStatusResponse) (*contextStatusRespons } pb := &contextStatusResponsePb{} pb.Id = st.Id - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -2099,8 +1766,7 @@ func contextStatusResponseToPb(st *ContextStatusResponse) (*contextStatusRespons } type contextStatusResponsePb struct { - Id string `json:"id,omitempty"` - + Id string `json:"id,omitempty"` Status ContextStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2132,133 +1798,73 @@ func createClusterToPb(st *CreateCluster) (*createClusterPb, error) { } pb := &createClusterPb{} pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues - pb.Autoscale = st.Autoscale - pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.CloneFrom = st.CloneFrom - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterName = st.ClusterName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DockerImage = st.DockerImage - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.Kind = st.Kind - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.SshPublicKeys = st.SshPublicKeys - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType - pb.ForceSendFields = st.ForceSendFields - return pb, nil -} - -type createClusterPb struct { - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` - - Autoscale *AutoScale `json:"autoscale,omitempty"` - - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - CloneFrom *CloneCluster `json:"clone_from,omitempty"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + pb.ForceSendFields = st.ForceSendFields + return pb, nil +} - WorkloadType *WorkloadType `json:"workload_type,omitempty"` +type createClusterPb struct { + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + CloneFrom *CloneCluster `json:"clone_from,omitempty"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + Kind Kind `json:"kind,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2354,7 +1960,6 @@ func createContextToPb(st *CreateContext) (*createContextPb, error) { } pb := &createContextPb{} pb.ClusterId = st.ClusterId - pb.Language = st.Language pb.ForceSendFields = st.ForceSendFields @@ -2362,9 +1967,8 @@ func createContextToPb(st *CreateContext) (*createContextPb, error) { } type createContextPb struct { - ClusterId string `json:"clusterId,omitempty"` - - Language Language `json:"language,omitempty"` + ClusterId string `json:"clusterId,omitempty"` + Language Language `json:"language,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2395,31 +1999,18 @@ func createInstancePoolToPb(st *CreateInstancePool) (*createInstancePoolPb, erro } pb := &createInstancePoolPb{} pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.CustomTags = st.CustomTags - pb.DiskSpec = st.DiskSpec - pb.EnableElasticDisk = st.EnableElasticDisk - pb.GcpAttributes = st.GcpAttributes - pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes - pb.InstancePoolName = st.InstancePoolName - pb.MaxCapacity = st.MaxCapacity - pb.MinIdleInstances = st.MinIdleInstances - pb.NodeTypeFlexibility = st.NodeTypeFlexibility - pb.NodeTypeId = st.NodeTypeId - pb.PreloadedDockerImages = st.PreloadedDockerImages - pb.PreloadedSparkVersions = st.PreloadedSparkVersions pb.ForceSendFields = st.ForceSendFields @@ -2427,33 +2018,20 @@ func createInstancePoolToPb(st *CreateInstancePool) (*createInstancePoolPb, erro } type createInstancePoolPb struct { - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` - - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` - - InstancePoolName string `json:"instance_pool_name"` - - MaxCapacity int `json:"max_capacity,omitempty"` - - MinIdleInstances int `json:"min_idle_instances,omitempty"` - - NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` - - NodeTypeId string `json:"node_type_id"` - - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` - - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + InstancePoolName string `json:"instance_pool_name"` + MaxCapacity int `json:"max_capacity,omitempty"` + MinIdleInstances int `json:"min_idle_instances,omitempty"` + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + NodeTypeId string `json:"node_type_id"` + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2532,17 +2110,11 @@ func createPolicyToPb(st *CreatePolicy) (*createPolicyPb, error) { } pb := &createPolicyPb{} pb.Definition = st.Definition - pb.Description = st.Description - pb.Libraries = st.Libraries - pb.MaxClustersPerUser = st.MaxClustersPerUser - pb.Name = st.Name - pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides - pb.PolicyFamilyId = st.PolicyFamilyId pb.ForceSendFields = st.ForceSendFields @@ -2550,19 +2122,13 @@ func createPolicyToPb(st *CreatePolicy) (*createPolicyPb, error) { } type createPolicyPb struct { - Definition string `json:"definition,omitempty"` - - Description string `json:"description,omitempty"` - - Libraries []Library `json:"libraries,omitempty"` - - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` - - Name string `json:"name,omitempty"` - - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` - - PolicyFamilyId string `json:"policy_family_id,omitempty"` + Definition string `json:"definition,omitempty"` + Description string `json:"description,omitempty"` + Libraries []Library `json:"libraries,omitempty"` + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + Name string `json:"name,omitempty"` + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + PolicyFamilyId string `json:"policy_family_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2706,7 +2272,6 @@ func customPolicyTagToPb(st *CustomPolicyTag) (*customPolicyTagPb, error) { } pb := &customPolicyTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -2714,8 +2279,7 @@ func customPolicyTagToPb(st *CustomPolicyTag) (*customPolicyTagPb, error) { } type customPolicyTagPb struct { - Key string `json:"key"` - + Key string `json:"key"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2747,11 +2311,8 @@ func dataPlaneEventDetailsToPb(st *DataPlaneEventDetails) (*dataPlaneEventDetail } pb := &dataPlaneEventDetailsPb{} pb.EventType = st.EventType - pb.ExecutorFailures = st.ExecutorFailures - pb.HostId = st.HostId - pb.Timestamp = st.Timestamp pb.ForceSendFields = st.ForceSendFields @@ -2759,13 +2320,10 @@ func dataPlaneEventDetailsToPb(st *DataPlaneEventDetails) (*dataPlaneEventDetail } type dataPlaneEventDetailsPb struct { - EventType DataPlaneEventDetailsEventType `json:"event_type,omitempty"` - - ExecutorFailures int `json:"executor_failures,omitempty"` - - HostId string `json:"host_id,omitempty"` - - Timestamp int64 `json:"timestamp,omitempty"` + EventType DataPlaneEventDetailsEventType `json:"event_type,omitempty"` + ExecutorFailures int `json:"executor_failures,omitempty"` + HostId string `json:"host_id,omitempty"` + Timestamp int64 `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3002,7 +2560,6 @@ func destroyContextToPb(st *DestroyContext) (*destroyContextPb, error) { } pb := &destroyContextPb{} pb.ClusterId = st.ClusterId - pb.ContextId = st.ContextId return pb, nil @@ -3010,7 +2567,6 @@ func destroyContextToPb(st *DestroyContext) (*destroyContextPb, error) { type destroyContextPb struct { ClusterId string `json:"clusterId"` - ContextId string `json:"contextId"` } @@ -3052,13 +2608,9 @@ func diskSpecToPb(st *DiskSpec) (*diskSpecPb, error) { } pb := &diskSpecPb{} pb.DiskCount = st.DiskCount - pb.DiskIops = st.DiskIops - pb.DiskSize = st.DiskSize - pb.DiskThroughput = st.DiskThroughput - pb.DiskType = st.DiskType pb.ForceSendFields = st.ForceSendFields @@ -3066,15 +2618,11 @@ func diskSpecToPb(st *DiskSpec) (*diskSpecPb, error) { } type diskSpecPb struct { - DiskCount int `json:"disk_count,omitempty"` - - DiskIops int `json:"disk_iops,omitempty"` - - DiskSize int `json:"disk_size,omitempty"` - - DiskThroughput int `json:"disk_throughput,omitempty"` - - DiskType *DiskType `json:"disk_type,omitempty"` + DiskCount int `json:"disk_count,omitempty"` + DiskIops int `json:"disk_iops,omitempty"` + DiskSize int `json:"disk_size,omitempty"` + DiskThroughput int `json:"disk_throughput,omitempty"` + DiskType *DiskType `json:"disk_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3108,7 +2656,6 @@ func diskTypeToPb(st *DiskType) (*diskTypePb, error) { } pb := &diskTypePb{} pb.AzureDiskVolumeType = st.AzureDiskVolumeType - pb.EbsVolumeType = st.EbsVolumeType return pb, nil @@ -3116,8 +2663,7 @@ func diskTypeToPb(st *DiskType) (*diskTypePb, error) { type diskTypePb struct { AzureDiskVolumeType DiskTypeAzureDiskVolumeType `json:"azure_disk_volume_type,omitempty"` - - EbsVolumeType DiskTypeEbsVolumeType `json:"ebs_volume_type,omitempty"` + EbsVolumeType DiskTypeEbsVolumeType `json:"ebs_volume_type,omitempty"` } func diskTypeFromPb(pb *diskTypePb) (*DiskType, error) { @@ -3137,7 +2683,6 @@ func dockerBasicAuthToPb(st *DockerBasicAuth) (*dockerBasicAuthPb, error) { } pb := &dockerBasicAuthPb{} pb.Password = st.Password - pb.Username = st.Username pb.ForceSendFields = st.ForceSendFields @@ -3146,7 +2691,6 @@ func dockerBasicAuthToPb(st *DockerBasicAuth) (*dockerBasicAuthPb, error) { type dockerBasicAuthPb struct { Password string `json:"password,omitempty"` - Username string `json:"username,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3178,7 +2722,6 @@ func dockerImageToPb(st *DockerImage) (*dockerImagePb, error) { } pb := &dockerImagePb{} pb.BasicAuth = st.BasicAuth - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -3187,8 +2730,7 @@ func dockerImageToPb(st *DockerImage) (*dockerImagePb, error) { type dockerImagePb struct { BasicAuth *DockerBasicAuth `json:"basic_auth,omitempty"` - - Url string `json:"url,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3219,65 +2761,35 @@ func editClusterToPb(st *EditCluster) (*editClusterPb, error) { } pb := &editClusterPb{} pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues - pb.Autoscale = st.Autoscale - pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterId = st.ClusterId - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterName = st.ClusterName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DockerImage = st.DockerImage - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.Kind = st.Kind - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.SshPublicKeys = st.SshPublicKeys - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -3285,67 +2797,37 @@ func editClusterToPb(st *EditCluster) (*editClusterPb, error) { } type editClusterPb struct { - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` - - Autoscale *AutoScale `json:"autoscale,omitempty"` - - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterId string `json:"cluster_id"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` - - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + ClusterId string `json:"cluster_id"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + Kind Kind `json:"kind,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3426,19 +2908,12 @@ func editInstancePoolToPb(st *EditInstancePool) (*editInstancePoolPb, error) { } pb := &editInstancePoolPb{} pb.CustomTags = st.CustomTags - pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes - pb.InstancePoolId = st.InstancePoolId - pb.InstancePoolName = st.InstancePoolName - pb.MaxCapacity = st.MaxCapacity - pb.MinIdleInstances = st.MinIdleInstances - pb.NodeTypeFlexibility = st.NodeTypeFlexibility - pb.NodeTypeId = st.NodeTypeId pb.ForceSendFields = st.ForceSendFields @@ -3446,21 +2921,14 @@ func editInstancePoolToPb(st *EditInstancePool) (*editInstancePoolPb, error) { } type editInstancePoolPb struct { - CustomTags map[string]string `json:"custom_tags,omitempty"` - - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` - - InstancePoolId string `json:"instance_pool_id"` - - InstancePoolName string `json:"instance_pool_name"` - - MaxCapacity int `json:"max_capacity,omitempty"` - - MinIdleInstances int `json:"min_idle_instances,omitempty"` - - NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` - - NodeTypeId string `json:"node_type_id"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + InstancePoolId string `json:"instance_pool_id"` + InstancePoolName string `json:"instance_pool_name"` + MaxCapacity int `json:"max_capacity,omitempty"` + MinIdleInstances int `json:"min_idle_instances,omitempty"` + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + NodeTypeId string `json:"node_type_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -3518,19 +2986,12 @@ func editPolicyToPb(st *EditPolicy) (*editPolicyPb, error) { } pb := &editPolicyPb{} pb.Definition = st.Definition - pb.Description = st.Description - pb.Libraries = st.Libraries - pb.MaxClustersPerUser = st.MaxClustersPerUser - pb.Name = st.Name - pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides - pb.PolicyFamilyId = st.PolicyFamilyId - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -3538,21 +2999,14 @@ func editPolicyToPb(st *EditPolicy) (*editPolicyPb, error) { } type editPolicyPb struct { - Definition string `json:"definition,omitempty"` - - Description string `json:"description,omitempty"` - - Libraries []Library `json:"libraries,omitempty"` - - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` - - Name string `json:"name,omitempty"` - - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` - - PolicyFamilyId string `json:"policy_family_id,omitempty"` - - PolicyId string `json:"policy_id"` + Definition string `json:"definition,omitempty"` + Description string `json:"description,omitempty"` + Libraries []Library `json:"libraries,omitempty"` + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + Name string `json:"name,omitempty"` + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + PolicyFamilyId string `json:"policy_family_id,omitempty"` + PolicyId string `json:"policy_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -3631,7 +3085,6 @@ func enforceClusterComplianceRequestToPb(st *EnforceClusterComplianceRequest) (* } pb := &enforceClusterComplianceRequestPb{} pb.ClusterId = st.ClusterId - pb.ValidateOnly = st.ValidateOnly pb.ForceSendFields = st.ForceSendFields @@ -3639,9 +3092,8 @@ func enforceClusterComplianceRequestToPb(st *EnforceClusterComplianceRequest) (* } type enforceClusterComplianceRequestPb struct { - ClusterId string `json:"cluster_id"` - - ValidateOnly bool `json:"validate_only,omitempty"` + ClusterId string `json:"cluster_id"` + ValidateOnly bool `json:"validate_only,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3672,7 +3124,6 @@ func enforceClusterComplianceResponseToPb(st *EnforceClusterComplianceResponse) } pb := &enforceClusterComplianceResponsePb{} pb.Changes = st.Changes - pb.HasChanges = st.HasChanges pb.ForceSendFields = st.ForceSendFields @@ -3680,9 +3131,8 @@ func enforceClusterComplianceResponseToPb(st *EnforceClusterComplianceResponse) } type enforceClusterComplianceResponsePb struct { - Changes []ClusterSettingsChange `json:"changes,omitempty"` - - HasChanges bool `json:"has_changes,omitempty"` + Changes []ClusterSettingsChange `json:"changes,omitempty"` + HasChanges bool `json:"has_changes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3713,11 +3163,8 @@ func environmentToPb(st *Environment) (*environmentPb, error) { } pb := &environmentPb{} pb.Client = st.Client - pb.Dependencies = st.Dependencies - pb.EnvironmentVersion = st.EnvironmentVersion - pb.JarDependencies = st.JarDependencies pb.ForceSendFields = st.ForceSendFields @@ -3725,13 +3172,10 @@ func environmentToPb(st *Environment) (*environmentPb, error) { } type environmentPb struct { - Client string `json:"client"` - - Dependencies []string `json:"dependencies,omitempty"` - - EnvironmentVersion string `json:"environment_version,omitempty"` - - JarDependencies []string `json:"jar_dependencies,omitempty"` + Client string `json:"client"` + Dependencies []string `json:"dependencies,omitempty"` + EnvironmentVersion string `json:"environment_version,omitempty"` + JarDependencies []string `json:"jar_dependencies,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3764,43 +3208,24 @@ func eventDetailsToPb(st *EventDetails) (*eventDetailsPb, error) { } pb := &eventDetailsPb{} pb.Attributes = st.Attributes - pb.Cause = st.Cause - pb.ClusterSize = st.ClusterSize - pb.CurrentNumVcpus = st.CurrentNumVcpus - pb.CurrentNumWorkers = st.CurrentNumWorkers - pb.DidNotExpandReason = st.DidNotExpandReason - pb.DiskSize = st.DiskSize - pb.DriverStateMessage = st.DriverStateMessage - pb.EnableTerminationForNodeBlocklisted = st.EnableTerminationForNodeBlocklisted - pb.FreeSpace = st.FreeSpace - pb.InitScripts = st.InitScripts - pb.InstanceId = st.InstanceId - pb.JobRunName = st.JobRunName - pb.PreviousAttributes = st.PreviousAttributes - pb.PreviousClusterSize = st.PreviousClusterSize - pb.PreviousDiskSize = st.PreviousDiskSize - pb.Reason = st.Reason - pb.TargetNumVcpus = st.TargetNumVcpus - pb.TargetNumWorkers = st.TargetNumWorkers - pb.User = st.User pb.ForceSendFields = st.ForceSendFields @@ -3808,45 +3233,26 @@ func eventDetailsToPb(st *EventDetails) (*eventDetailsPb, error) { } type eventDetailsPb struct { - Attributes *ClusterAttributes `json:"attributes,omitempty"` - - Cause EventDetailsCause `json:"cause,omitempty"` - - ClusterSize *ClusterSize `json:"cluster_size,omitempty"` - - CurrentNumVcpus int `json:"current_num_vcpus,omitempty"` - - CurrentNumWorkers int `json:"current_num_workers,omitempty"` - - DidNotExpandReason string `json:"did_not_expand_reason,omitempty"` - - DiskSize int64 `json:"disk_size,omitempty"` - - DriverStateMessage string `json:"driver_state_message,omitempty"` - - EnableTerminationForNodeBlocklisted bool `json:"enable_termination_for_node_blocklisted,omitempty"` - - FreeSpace int64 `json:"free_space,omitempty"` - - InitScripts *InitScriptEventDetails `json:"init_scripts,omitempty"` - - InstanceId string `json:"instance_id,omitempty"` - - JobRunName string `json:"job_run_name,omitempty"` - - PreviousAttributes *ClusterAttributes `json:"previous_attributes,omitempty"` - - PreviousClusterSize *ClusterSize `json:"previous_cluster_size,omitempty"` - - PreviousDiskSize int64 `json:"previous_disk_size,omitempty"` - - Reason *TerminationReason `json:"reason,omitempty"` - - TargetNumVcpus int `json:"target_num_vcpus,omitempty"` - - TargetNumWorkers int `json:"target_num_workers,omitempty"` - - User string `json:"user,omitempty"` + Attributes *ClusterAttributes `json:"attributes,omitempty"` + Cause EventDetailsCause `json:"cause,omitempty"` + ClusterSize *ClusterSize `json:"cluster_size,omitempty"` + CurrentNumVcpus int `json:"current_num_vcpus,omitempty"` + CurrentNumWorkers int `json:"current_num_workers,omitempty"` + DidNotExpandReason string `json:"did_not_expand_reason,omitempty"` + DiskSize int64 `json:"disk_size,omitempty"` + DriverStateMessage string `json:"driver_state_message,omitempty"` + EnableTerminationForNodeBlocklisted bool `json:"enable_termination_for_node_blocklisted,omitempty"` + FreeSpace int64 `json:"free_space,omitempty"` + InitScripts *InitScriptEventDetails `json:"init_scripts,omitempty"` + InstanceId string `json:"instance_id,omitempty"` + JobRunName string `json:"job_run_name,omitempty"` + PreviousAttributes *ClusterAttributes `json:"previous_attributes,omitempty"` + PreviousClusterSize *ClusterSize `json:"previous_cluster_size,omitempty"` + PreviousDiskSize int64 `json:"previous_disk_size,omitempty"` + Reason *TerminationReason `json:"reason,omitempty"` + TargetNumVcpus int `json:"target_num_vcpus,omitempty"` + TargetNumWorkers int `json:"target_num_workers,omitempty"` + User string `json:"user,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3895,15 +3301,10 @@ func gcpAttributesToPb(st *GcpAttributes) (*gcpAttributesPb, error) { } pb := &gcpAttributesPb{} pb.Availability = st.Availability - pb.BootDiskSize = st.BootDiskSize - pb.GoogleServiceAccount = st.GoogleServiceAccount - pb.LocalSsdCount = st.LocalSsdCount - pb.UsePreemptibleExecutors = st.UsePreemptibleExecutors - pb.ZoneId = st.ZoneId pb.ForceSendFields = st.ForceSendFields @@ -3911,17 +3312,12 @@ func gcpAttributesToPb(st *GcpAttributes) (*gcpAttributesPb, error) { } type gcpAttributesPb struct { - Availability GcpAvailability `json:"availability,omitempty"` - - BootDiskSize int `json:"boot_disk_size,omitempty"` - - GoogleServiceAccount string `json:"google_service_account,omitempty"` - - LocalSsdCount int `json:"local_ssd_count,omitempty"` - - UsePreemptibleExecutors bool `json:"use_preemptible_executors,omitempty"` - - ZoneId string `json:"zone_id,omitempty"` + Availability GcpAvailability `json:"availability,omitempty"` + BootDiskSize int `json:"boot_disk_size,omitempty"` + GoogleServiceAccount string `json:"google_service_account,omitempty"` + LocalSsdCount int `json:"local_ssd_count,omitempty"` + UsePreemptibleExecutors bool `json:"use_preemptible_executors,omitempty"` + ZoneId string `json:"zone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4004,7 +3400,6 @@ func getClusterComplianceResponseToPb(st *GetClusterComplianceResponse) (*getClu } pb := &getClusterComplianceResponsePb{} pb.IsCompliant = st.IsCompliant - pb.Violations = st.Violations pb.ForceSendFields = st.ForceSendFields @@ -4012,9 +3407,8 @@ func getClusterComplianceResponseToPb(st *GetClusterComplianceResponse) (*getClu } type getClusterComplianceResponsePb struct { - IsCompliant bool `json:"is_compliant,omitempty"` - - Violations map[string]string `json:"violations,omitempty"` + IsCompliant bool `json:"is_compliant,omitempty"` + Violations map[string]string `json:"violations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4237,21 +3631,13 @@ func getEventsToPb(st *GetEvents) (*getEventsPb, error) { } pb := &getEventsPb{} pb.ClusterId = st.ClusterId - pb.EndTime = st.EndTime - pb.EventTypes = st.EventTypes - pb.Limit = st.Limit - pb.Offset = st.Offset - pb.Order = st.Order - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.StartTime = st.StartTime pb.ForceSendFields = st.ForceSendFields @@ -4259,23 +3645,15 @@ func getEventsToPb(st *GetEvents) (*getEventsPb, error) { } type getEventsPb struct { - ClusterId string `json:"cluster_id"` - - EndTime int64 `json:"end_time,omitempty"` - - EventTypes []EventType `json:"event_types,omitempty"` - - Limit int64 `json:"limit,omitempty"` - - Offset int64 `json:"offset,omitempty"` - - Order GetEventsOrder `json:"order,omitempty"` - - PageSize int `json:"page_size,omitempty"` - - PageToken string `json:"page_token,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` + ClusterId string `json:"cluster_id"` + EndTime int64 `json:"end_time,omitempty"` + EventTypes []EventType `json:"event_types,omitempty"` + Limit int64 `json:"limit,omitempty"` + Offset int64 `json:"offset,omitempty"` + Order GetEventsOrder `json:"order,omitempty"` + PageSize int `json:"page_size,omitempty"` + PageToken string `json:"page_token,omitempty"` + StartTime int64 `json:"start_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4313,29 +3691,21 @@ func getEventsResponseToPb(st *GetEventsResponse) (*getEventsResponsePb, error) } pb := &getEventsResponsePb{} pb.Events = st.Events - pb.NextPage = st.NextPage - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken - pb.TotalCount = st.TotalCount pb.ForceSendFields = st.ForceSendFields - return pb, nil -} - -type getEventsResponsePb struct { - Events []ClusterEvent `json:"events,omitempty"` - - NextPage *GetEvents `json:"next_page,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + return pb, nil +} - TotalCount int64 `json:"total_count,omitempty"` +type getEventsResponsePb struct { + Events []ClusterEvent `json:"events,omitempty"` + NextPage *GetEvents `json:"next_page,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` + TotalCount int64 `json:"total_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4393,41 +3763,23 @@ func getInstancePoolToPb(st *GetInstancePool) (*getInstancePoolPb, error) { } pb := &getInstancePoolPb{} pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.CustomTags = st.CustomTags - pb.DefaultTags = st.DefaultTags - pb.DiskSpec = st.DiskSpec - pb.EnableElasticDisk = st.EnableElasticDisk - pb.GcpAttributes = st.GcpAttributes - pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes - pb.InstancePoolId = st.InstancePoolId - pb.InstancePoolName = st.InstancePoolName - pb.MaxCapacity = st.MaxCapacity - pb.MinIdleInstances = st.MinIdleInstances - pb.NodeTypeFlexibility = st.NodeTypeFlexibility - pb.NodeTypeId = st.NodeTypeId - pb.PreloadedDockerImages = st.PreloadedDockerImages - pb.PreloadedSparkVersions = st.PreloadedSparkVersions - pb.State = st.State - pb.Stats = st.Stats - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -4435,43 +3787,25 @@ func getInstancePoolToPb(st *GetInstancePool) (*getInstancePoolPb, error) { } type getInstancePoolPb struct { - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DefaultTags map[string]string `json:"default_tags,omitempty"` - - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` - - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` - - InstancePoolId string `json:"instance_pool_id"` - - InstancePoolName string `json:"instance_pool_name,omitempty"` - - MaxCapacity int `json:"max_capacity,omitempty"` - - MinIdleInstances int `json:"min_idle_instances,omitempty"` - - NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` - - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` - - State InstancePoolState `json:"state,omitempty"` - - Stats *InstancePoolStats `json:"stats,omitempty"` - - Status *InstancePoolStatus `json:"status,omitempty"` + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DefaultTags map[string]string `json:"default_tags,omitempty"` + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + InstancePoolId string `json:"instance_pool_id"` + InstancePoolName string `json:"instance_pool_name,omitempty"` + MaxCapacity int `json:"max_capacity,omitempty"` + MinIdleInstances int `json:"min_idle_instances,omitempty"` + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + State InstancePoolState `json:"state,omitempty"` + Stats *InstancePoolStats `json:"stats,omitempty"` + Status *InstancePoolStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4615,7 +3949,6 @@ func getPolicyFamilyRequestToPb(st *GetPolicyFamilyRequest) (*getPolicyFamilyReq } pb := &getPolicyFamilyRequestPb{} pb.PolicyFamilyId = st.PolicyFamilyId - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -4624,8 +3957,7 @@ func getPolicyFamilyRequestToPb(st *GetPolicyFamilyRequest) (*getPolicyFamilyReq type getPolicyFamilyRequestPb struct { PolicyFamilyId string `json:"-" url:"-"` - - Version int64 `json:"-" url:"version,omitempty"` + Version int64 `json:"-" url:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4680,11 +4012,8 @@ func globalInitScriptCreateRequestToPb(st *GlobalInitScriptCreateRequest) (*glob } pb := &globalInitScriptCreateRequestPb{} pb.Enabled = st.Enabled - pb.Name = st.Name - pb.Position = st.Position - pb.Script = st.Script pb.ForceSendFields = st.ForceSendFields @@ -4692,13 +4021,10 @@ func globalInitScriptCreateRequestToPb(st *GlobalInitScriptCreateRequest) (*glob } type globalInitScriptCreateRequestPb struct { - Enabled bool `json:"enabled,omitempty"` - - Name string `json:"name"` - - Position int `json:"position,omitempty"` - - Script string `json:"script"` + Enabled bool `json:"enabled,omitempty"` + Name string `json:"name"` + Position int `json:"position,omitempty"` + Script string `json:"script"` ForceSendFields []string `json:"-" url:"-"` } @@ -4731,19 +4057,12 @@ func globalInitScriptDetailsToPb(st *GlobalInitScriptDetails) (*globalInitScript } pb := &globalInitScriptDetailsPb{} pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Enabled = st.Enabled - pb.Name = st.Name - pb.Position = st.Position - pb.ScriptId = st.ScriptId - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -4751,20 +4070,13 @@ func globalInitScriptDetailsToPb(st *GlobalInitScriptDetails) (*globalInitScript } type globalInitScriptDetailsPb struct { - CreatedAt int `json:"created_at,omitempty"` - + CreatedAt int `json:"created_at,omitempty"` CreatedBy string `json:"created_by,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - Name string `json:"name,omitempty"` - - Position int `json:"position,omitempty"` - - ScriptId string `json:"script_id,omitempty"` - - UpdatedAt int `json:"updated_at,omitempty"` - + Enabled bool `json:"enabled,omitempty"` + Name string `json:"name,omitempty"` + Position int `json:"position,omitempty"` + ScriptId string `json:"script_id,omitempty"` + UpdatedAt int `json:"updated_at,omitempty"` UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4802,21 +4114,13 @@ func globalInitScriptDetailsWithContentToPb(st *GlobalInitScriptDetailsWithConte } pb := &globalInitScriptDetailsWithContentPb{} pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Enabled = st.Enabled - pb.Name = st.Name - pb.Position = st.Position - pb.Script = st.Script - pb.ScriptId = st.ScriptId - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -4824,22 +4128,14 @@ func globalInitScriptDetailsWithContentToPb(st *GlobalInitScriptDetailsWithConte } type globalInitScriptDetailsWithContentPb struct { - CreatedAt int `json:"created_at,omitempty"` - + CreatedAt int `json:"created_at,omitempty"` CreatedBy string `json:"created_by,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - Name string `json:"name,omitempty"` - - Position int `json:"position,omitempty"` - - Script string `json:"script,omitempty"` - - ScriptId string `json:"script_id,omitempty"` - - UpdatedAt int `json:"updated_at,omitempty"` - + Enabled bool `json:"enabled,omitempty"` + Name string `json:"name,omitempty"` + Position int `json:"position,omitempty"` + Script string `json:"script,omitempty"` + ScriptId string `json:"script_id,omitempty"` + UpdatedAt int `json:"updated_at,omitempty"` UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4878,13 +4174,9 @@ func globalInitScriptUpdateRequestToPb(st *GlobalInitScriptUpdateRequest) (*glob } pb := &globalInitScriptUpdateRequestPb{} pb.Enabled = st.Enabled - pb.Name = st.Name - pb.Position = st.Position - pb.Script = st.Script - pb.ScriptId = st.ScriptId pb.ForceSendFields = st.ForceSendFields @@ -4892,14 +4184,10 @@ func globalInitScriptUpdateRequestToPb(st *GlobalInitScriptUpdateRequest) (*glob } type globalInitScriptUpdateRequestPb struct { - Enabled bool `json:"enabled,omitempty"` - - Name string `json:"name"` - - Position int `json:"position,omitempty"` - - Script string `json:"script"` - + Enabled bool `json:"enabled,omitempty"` + Name string `json:"name"` + Position int `json:"position,omitempty"` + Script string `json:"script"` ScriptId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -4934,9 +4222,7 @@ func initScriptEventDetailsToPb(st *InitScriptEventDetails) (*initScriptEventDet } pb := &initScriptEventDetailsPb{} pb.Cluster = st.Cluster - pb.Global = st.Global - pb.ReportedForNode = st.ReportedForNode pb.ForceSendFields = st.ForceSendFields @@ -4944,11 +4230,9 @@ func initScriptEventDetailsToPb(st *InitScriptEventDetails) (*initScriptEventDet } type initScriptEventDetailsPb struct { - Cluster []InitScriptInfoAndExecutionDetails `json:"cluster,omitempty"` - - Global []InitScriptInfoAndExecutionDetails `json:"global,omitempty"` - - ReportedForNode string `json:"reported_for_node,omitempty"` + Cluster []InitScriptInfoAndExecutionDetails `json:"cluster,omitempty"` + Global []InitScriptInfoAndExecutionDetails `json:"global,omitempty"` + ReportedForNode string `json:"reported_for_node,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4980,35 +4264,23 @@ func initScriptInfoToPb(st *InitScriptInfo) (*initScriptInfoPb, error) { } pb := &initScriptInfoPb{} pb.Abfss = st.Abfss - pb.Dbfs = st.Dbfs - pb.File = st.File - pb.Gcs = st.Gcs - pb.S3 = st.S3 - pb.Volumes = st.Volumes - pb.Workspace = st.Workspace return pb, nil } type initScriptInfoPb struct { - Abfss *Adlsgen2Info `json:"abfss,omitempty"` - - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` - - File *LocalFileInfo `json:"file,omitempty"` - - Gcs *GcsStorageInfo `json:"gcs,omitempty"` - - S3 *S3StorageInfo `json:"s3,omitempty"` - - Volumes *VolumesStorageInfo `json:"volumes,omitempty"` - + Abfss *Adlsgen2Info `json:"abfss,omitempty"` + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + File *LocalFileInfo `json:"file,omitempty"` + Gcs *GcsStorageInfo `json:"gcs,omitempty"` + S3 *S3StorageInfo `json:"s3,omitempty"` + Volumes *VolumesStorageInfo `json:"volumes,omitempty"` Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` } @@ -5034,23 +4306,14 @@ func initScriptInfoAndExecutionDetailsToPb(st *InitScriptInfoAndExecutionDetails } pb := &initScriptInfoAndExecutionDetailsPb{} pb.Abfss = st.Abfss - pb.Dbfs = st.Dbfs - pb.ErrorMessage = st.ErrorMessage - pb.ExecutionDurationSeconds = st.ExecutionDurationSeconds - pb.File = st.File - pb.Gcs = st.Gcs - pb.S3 = st.S3 - pb.Status = st.Status - pb.Volumes = st.Volumes - pb.Workspace = st.Workspace pb.ForceSendFields = st.ForceSendFields @@ -5058,25 +4321,16 @@ func initScriptInfoAndExecutionDetailsToPb(st *InitScriptInfoAndExecutionDetails } type initScriptInfoAndExecutionDetailsPb struct { - Abfss *Adlsgen2Info `json:"abfss,omitempty"` - - Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` - - ErrorMessage string `json:"error_message,omitempty"` - - ExecutionDurationSeconds int `json:"execution_duration_seconds,omitempty"` - - File *LocalFileInfo `json:"file,omitempty"` - - Gcs *GcsStorageInfo `json:"gcs,omitempty"` - - S3 *S3StorageInfo `json:"s3,omitempty"` - - Status InitScriptExecutionDetailsInitScriptExecutionStatus `json:"status,omitempty"` - - Volumes *VolumesStorageInfo `json:"volumes,omitempty"` - - Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` + Abfss *Adlsgen2Info `json:"abfss,omitempty"` + Dbfs *DbfsStorageInfo `json:"dbfs,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` + ExecutionDurationSeconds int `json:"execution_duration_seconds,omitempty"` + File *LocalFileInfo `json:"file,omitempty"` + Gcs *GcsStorageInfo `json:"gcs,omitempty"` + S3 *S3StorageInfo `json:"s3,omitempty"` + Status InitScriptExecutionDetailsInitScriptExecutionStatus `json:"status,omitempty"` + Volumes *VolumesStorageInfo `json:"volumes,omitempty"` + Workspace *WorkspaceStorageInfo `json:"workspace,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5115,15 +4369,13 @@ func installLibrariesToPb(st *InstallLibraries) (*installLibrariesPb, error) { } pb := &installLibrariesPb{} pb.ClusterId = st.ClusterId - pb.Libraries = st.Libraries return pb, nil } type installLibrariesPb struct { - ClusterId string `json:"cluster_id"` - + ClusterId string `json:"cluster_id"` Libraries []Library `json:"libraries"` } @@ -5165,11 +4417,8 @@ func instancePoolAccessControlRequestToPb(st *InstancePoolAccessControlRequest) } pb := &instancePoolAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5177,13 +4426,10 @@ func instancePoolAccessControlRequestToPb(st *InstancePoolAccessControlRequest) } type instancePoolAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5216,13 +4462,9 @@ func instancePoolAccessControlResponseToPb(st *InstancePoolAccessControlResponse } pb := &instancePoolAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5230,15 +4472,11 @@ func instancePoolAccessControlResponseToPb(st *InstancePoolAccessControlResponse } type instancePoolAccessControlResponsePb struct { - AllPermissions []InstancePoolPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []InstancePoolPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5272,41 +4510,23 @@ func instancePoolAndStatsToPb(st *InstancePoolAndStats) (*instancePoolAndStatsPb } pb := &instancePoolAndStatsPb{} pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.CustomTags = st.CustomTags - pb.DefaultTags = st.DefaultTags - pb.DiskSpec = st.DiskSpec - pb.EnableElasticDisk = st.EnableElasticDisk - pb.GcpAttributes = st.GcpAttributes - pb.IdleInstanceAutoterminationMinutes = st.IdleInstanceAutoterminationMinutes - pb.InstancePoolId = st.InstancePoolId - pb.InstancePoolName = st.InstancePoolName - pb.MaxCapacity = st.MaxCapacity - pb.MinIdleInstances = st.MinIdleInstances - pb.NodeTypeFlexibility = st.NodeTypeFlexibility - pb.NodeTypeId = st.NodeTypeId - pb.PreloadedDockerImages = st.PreloadedDockerImages - pb.PreloadedSparkVersions = st.PreloadedSparkVersions - pb.State = st.State - pb.Stats = st.Stats - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -5314,43 +4534,25 @@ func instancePoolAndStatsToPb(st *InstancePoolAndStats) (*instancePoolAndStatsPb } type instancePoolAndStatsPb struct { - AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DefaultTags map[string]string `json:"default_tags,omitempty"` - - DiskSpec *DiskSpec `json:"disk_spec,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` - - IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - InstancePoolName string `json:"instance_pool_name,omitempty"` - - MaxCapacity int `json:"max_capacity,omitempty"` - - MinIdleInstances int `json:"min_idle_instances,omitempty"` - - NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` - - PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` - - State InstancePoolState `json:"state,omitempty"` - - Stats *InstancePoolStats `json:"stats,omitempty"` - - Status *InstancePoolStatus `json:"status,omitempty"` + AwsAttributes *InstancePoolAwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *InstancePoolAzureAttributes `json:"azure_attributes,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DefaultTags map[string]string `json:"default_tags,omitempty"` + DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + GcpAttributes *InstancePoolGcpAttributes `json:"gcp_attributes,omitempty"` + IdleInstanceAutoterminationMinutes int `json:"idle_instance_autotermination_minutes,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + InstancePoolName string `json:"instance_pool_name,omitempty"` + MaxCapacity int `json:"max_capacity,omitempty"` + MinIdleInstances int `json:"min_idle_instances,omitempty"` + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + PreloadedDockerImages []DockerImage `json:"preloaded_docker_images,omitempty"` + PreloadedSparkVersions []string `json:"preloaded_spark_versions,omitempty"` + State InstancePoolState `json:"state,omitempty"` + Stats *InstancePoolStats `json:"stats,omitempty"` + Status *InstancePoolStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5398,9 +4600,7 @@ func instancePoolAwsAttributesToPb(st *InstancePoolAwsAttributes) (*instancePool } pb := &instancePoolAwsAttributesPb{} pb.Availability = st.Availability - pb.SpotBidPricePercent = st.SpotBidPricePercent - pb.ZoneId = st.ZoneId pb.ForceSendFields = st.ForceSendFields @@ -5408,11 +4608,9 @@ func instancePoolAwsAttributesToPb(st *InstancePoolAwsAttributes) (*instancePool } type instancePoolAwsAttributesPb struct { - Availability InstancePoolAwsAttributesAvailability `json:"availability,omitempty"` - - SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` - - ZoneId string `json:"zone_id,omitempty"` + Availability InstancePoolAwsAttributesAvailability `json:"availability,omitempty"` + SpotBidPricePercent int `json:"spot_bid_price_percent,omitempty"` + ZoneId string `json:"zone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5444,7 +4642,6 @@ func instancePoolAzureAttributesToPb(st *InstancePoolAzureAttributes) (*instance } pb := &instancePoolAzureAttributesPb{} pb.Availability = st.Availability - pb.SpotBidMaxPrice = st.SpotBidMaxPrice pb.ForceSendFields = st.ForceSendFields @@ -5452,9 +4649,8 @@ func instancePoolAzureAttributesToPb(st *InstancePoolAzureAttributes) (*instance } type instancePoolAzureAttributesPb struct { - Availability InstancePoolAzureAttributesAvailability `json:"availability,omitempty"` - - SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` + Availability InstancePoolAzureAttributesAvailability `json:"availability,omitempty"` + SpotBidMaxPrice float64 `json:"spot_bid_max_price,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5485,9 +4681,7 @@ func instancePoolGcpAttributesToPb(st *InstancePoolGcpAttributes) (*instancePool } pb := &instancePoolGcpAttributesPb{} pb.GcpAvailability = st.GcpAvailability - pb.LocalSsdCount = st.LocalSsdCount - pb.ZoneId = st.ZoneId pb.ForceSendFields = st.ForceSendFields @@ -5496,10 +4690,8 @@ func instancePoolGcpAttributesToPb(st *InstancePoolGcpAttributes) (*instancePool type instancePoolGcpAttributesPb struct { GcpAvailability GcpAvailability `json:"gcp_availability,omitempty"` - - LocalSsdCount int `json:"local_ssd_count,omitempty"` - - ZoneId string `json:"zone_id,omitempty"` + LocalSsdCount int `json:"local_ssd_count,omitempty"` + ZoneId string `json:"zone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5531,9 +4723,7 @@ func instancePoolPermissionToPb(st *InstancePoolPermission) (*instancePoolPermis } pb := &instancePoolPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5541,11 +4731,9 @@ func instancePoolPermissionToPb(st *InstancePoolPermission) (*instancePoolPermis } type instancePoolPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5577,9 +4765,7 @@ func instancePoolPermissionsToPb(st *InstancePoolPermissions) (*instancePoolPerm } pb := &instancePoolPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -5588,10 +4774,8 @@ func instancePoolPermissionsToPb(st *InstancePoolPermissions) (*instancePoolPerm type instancePoolPermissionsPb struct { AccessControlList []InstancePoolAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5623,7 +4807,6 @@ func instancePoolPermissionsDescriptionToPb(st *InstancePoolPermissionsDescripti } pb := &instancePoolPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5631,8 +4814,7 @@ func instancePoolPermissionsDescriptionToPb(st *InstancePoolPermissionsDescripti } type instancePoolPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel InstancePoolPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5664,7 +4846,6 @@ func instancePoolPermissionsRequestToPb(st *InstancePoolPermissionsRequest) (*in } pb := &instancePoolPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.InstancePoolId = st.InstancePoolId return pb, nil @@ -5672,8 +4853,7 @@ func instancePoolPermissionsRequestToPb(st *InstancePoolPermissionsRequest) (*in type instancePoolPermissionsRequestPb struct { AccessControlList []InstancePoolAccessControlRequest `json:"access_control_list,omitempty"` - - InstancePoolId string `json:"-" url:"-"` + InstancePoolId string `json:"-" url:"-"` } func instancePoolPermissionsRequestFromPb(pb *instancePoolPermissionsRequestPb) (*InstancePoolPermissionsRequest, error) { @@ -5693,11 +4873,8 @@ func instancePoolStatsToPb(st *InstancePoolStats) (*instancePoolStatsPb, error) } pb := &instancePoolStatsPb{} pb.IdleCount = st.IdleCount - pb.PendingIdleCount = st.PendingIdleCount - pb.PendingUsedCount = st.PendingUsedCount - pb.UsedCount = st.UsedCount pb.ForceSendFields = st.ForceSendFields @@ -5705,13 +4882,10 @@ func instancePoolStatsToPb(st *InstancePoolStats) (*instancePoolStatsPb, error) } type instancePoolStatsPb struct { - IdleCount int `json:"idle_count,omitempty"` - + IdleCount int `json:"idle_count,omitempty"` PendingIdleCount int `json:"pending_idle_count,omitempty"` - PendingUsedCount int `json:"pending_used_count,omitempty"` - - UsedCount int `json:"used_count,omitempty"` + UsedCount int `json:"used_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5768,9 +4942,7 @@ func instanceProfileToPb(st *InstanceProfile) (*instanceProfilePb, error) { } pb := &instanceProfilePb{} pb.IamRoleArn = st.IamRoleArn - pb.InstanceProfileArn = st.InstanceProfileArn - pb.IsMetaInstanceProfile = st.IsMetaInstanceProfile pb.ForceSendFields = st.ForceSendFields @@ -5778,11 +4950,9 @@ func instanceProfileToPb(st *InstanceProfile) (*instanceProfilePb, error) { } type instanceProfilePb struct { - IamRoleArn string `json:"iam_role_arn,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn"` - - IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` + IamRoleArn string `json:"iam_role_arn,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn"` + IsMetaInstanceProfile bool `json:"is_meta_instance_profile,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5814,17 +4984,11 @@ func libraryToPb(st *Library) (*libraryPb, error) { } pb := &libraryPb{} pb.Cran = st.Cran - pb.Egg = st.Egg - pb.Jar = st.Jar - pb.Maven = st.Maven - pb.Pypi = st.Pypi - pb.Requirements = st.Requirements - pb.Whl = st.Whl pb.ForceSendFields = st.ForceSendFields @@ -5832,19 +4996,13 @@ func libraryToPb(st *Library) (*libraryPb, error) { } type libraryPb struct { - Cran *RCranLibrary `json:"cran,omitempty"` - - Egg string `json:"egg,omitempty"` - - Jar string `json:"jar,omitempty"` - - Maven *MavenLibrary `json:"maven,omitempty"` - - Pypi *PythonPyPiLibrary `json:"pypi,omitempty"` - - Requirements string `json:"requirements,omitempty"` - - Whl string `json:"whl,omitempty"` + Cran *RCranLibrary `json:"cran,omitempty"` + Egg string `json:"egg,omitempty"` + Jar string `json:"jar,omitempty"` + Maven *MavenLibrary `json:"maven,omitempty"` + Pypi *PythonPyPiLibrary `json:"pypi,omitempty"` + Requirements string `json:"requirements,omitempty"` + Whl string `json:"whl,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5880,11 +5038,8 @@ func libraryFullStatusToPb(st *LibraryFullStatus) (*libraryFullStatusPb, error) } pb := &libraryFullStatusPb{} pb.IsLibraryForAllClusters = st.IsLibraryForAllClusters - pb.Library = st.Library - pb.Messages = st.Messages - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -5892,13 +5047,10 @@ func libraryFullStatusToPb(st *LibraryFullStatus) (*libraryFullStatusPb, error) } type libraryFullStatusPb struct { - IsLibraryForAllClusters bool `json:"is_library_for_all_clusters,omitempty"` - - Library *Library `json:"library,omitempty"` - - Messages []string `json:"messages,omitempty"` - - Status LibraryInstallStatus `json:"status,omitempty"` + IsLibraryForAllClusters bool `json:"is_library_for_all_clusters,omitempty"` + Library *Library `json:"library,omitempty"` + Messages []string `json:"messages,omitempty"` + Status LibraryInstallStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5955,7 +5107,6 @@ func listAvailableZonesResponseToPb(st *ListAvailableZonesResponse) (*listAvaila } pb := &listAvailableZonesResponsePb{} pb.DefaultZone = st.DefaultZone - pb.Zones = st.Zones pb.ForceSendFields = st.ForceSendFields @@ -5963,9 +5114,8 @@ func listAvailableZonesResponseToPb(st *ListAvailableZonesResponse) (*listAvaila } type listAvailableZonesResponsePb struct { - DefaultZone string `json:"default_zone,omitempty"` - - Zones []string `json:"zones,omitempty"` + DefaultZone string `json:"default_zone,omitempty"` + Zones []string `json:"zones,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5996,9 +5146,7 @@ func listClusterCompliancesRequestToPb(st *ListClusterCompliancesRequest) (*list } pb := &listClusterCompliancesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -6006,11 +5154,9 @@ func listClusterCompliancesRequestToPb(st *ListClusterCompliancesRequest) (*list } type listClusterCompliancesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` - - PolicyId string `json:"-" url:"policy_id"` + PolicyId string `json:"-" url:"policy_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -6042,9 +5188,7 @@ func listClusterCompliancesResponseToPb(st *ListClusterCompliancesResponse) (*li } pb := &listClusterCompliancesResponsePb{} pb.Clusters = st.Clusters - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken pb.ForceSendFields = st.ForceSendFields @@ -6052,11 +5196,9 @@ func listClusterCompliancesResponseToPb(st *ListClusterCompliancesResponse) (*li } type listClusterCompliancesResponsePb struct { - Clusters []ClusterCompliance `json:"clusters,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + Clusters []ClusterCompliance `json:"clusters,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6088,7 +5230,6 @@ func listClusterPoliciesRequestToPb(st *ListClusterPoliciesRequest) (*listCluste } pb := &listClusterPoliciesRequestPb{} pb.SortColumn = st.SortColumn - pb.SortOrder = st.SortOrder return pb, nil @@ -6096,8 +5237,7 @@ func listClusterPoliciesRequestToPb(st *ListClusterPoliciesRequest) (*listCluste type listClusterPoliciesRequestPb struct { SortColumn ListSortColumn `json:"-" url:"sort_column,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sort_order,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sort_order,omitempty"` } func listClusterPoliciesRequestFromPb(pb *listClusterPoliciesRequestPb) (*ListClusterPoliciesRequest, error) { @@ -6117,11 +5257,8 @@ func listClustersFilterByToPb(st *ListClustersFilterBy) (*listClustersFilterByPb } pb := &listClustersFilterByPb{} pb.ClusterSources = st.ClusterSources - pb.ClusterStates = st.ClusterStates - pb.IsPinned = st.IsPinned - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -6130,12 +5267,9 @@ func listClustersFilterByToPb(st *ListClustersFilterBy) (*listClustersFilterByPb type listClustersFilterByPb struct { ClusterSources []ClusterSource `json:"cluster_sources,omitempty" url:"cluster_sources,omitempty"` - - ClusterStates []State `json:"cluster_states,omitempty" url:"cluster_states,omitempty"` - - IsPinned bool `json:"is_pinned,omitempty" url:"is_pinned,omitempty"` - - PolicyId string `json:"policy_id,omitempty" url:"policy_id,omitempty"` + ClusterStates []State `json:"cluster_states,omitempty" url:"cluster_states,omitempty"` + IsPinned bool `json:"is_pinned,omitempty" url:"is_pinned,omitempty"` + PolicyId string `json:"policy_id,omitempty" url:"policy_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6168,11 +5302,8 @@ func listClustersRequestToPb(st *ListClustersRequest) (*listClustersRequestPb, e } pb := &listClustersRequestPb{} pb.FilterBy = st.FilterBy - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.SortBy = st.SortBy pb.ForceSendFields = st.ForceSendFields @@ -6180,13 +5311,10 @@ func listClustersRequestToPb(st *ListClustersRequest) (*listClustersRequestPb, e } type listClustersRequestPb struct { - FilterBy *ListClustersFilterBy `json:"-" url:"filter_by,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - SortBy *ListClustersSortBy `json:"-" url:"sort_by,omitempty"` + FilterBy *ListClustersFilterBy `json:"-" url:"filter_by,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + SortBy *ListClustersSortBy `json:"-" url:"sort_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6219,9 +5347,7 @@ func listClustersResponseToPb(st *ListClustersResponse) (*listClustersResponsePb } pb := &listClustersResponsePb{} pb.Clusters = st.Clusters - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken pb.ForceSendFields = st.ForceSendFields @@ -6229,11 +5355,9 @@ func listClustersResponseToPb(st *ListClustersResponse) (*listClustersResponsePb } type listClustersResponsePb struct { - Clusters []ClusterDetails `json:"clusters,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + Clusters []ClusterDetails `json:"clusters,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6265,7 +5389,6 @@ func listClustersSortByToPb(st *ListClustersSortBy) (*listClustersSortByPb, erro } pb := &listClustersSortByPb{} pb.Direction = st.Direction - pb.Field = st.Field return pb, nil @@ -6273,8 +5396,7 @@ func listClustersSortByToPb(st *ListClustersSortBy) (*listClustersSortByPb, erro type listClustersSortByPb struct { Direction ListClustersSortByDirection `json:"direction,omitempty" url:"direction,omitempty"` - - Field ListClustersSortByField `json:"field,omitempty" url:"field,omitempty"` + Field ListClustersSortByField `json:"field,omitempty" url:"field,omitempty"` } func listClustersSortByFromPb(pb *listClustersSortByPb) (*ListClustersSortBy, error) { @@ -6414,7 +5536,6 @@ func listPolicyFamiliesRequestToPb(st *ListPolicyFamiliesRequest) (*listPolicyFa } pb := &listPolicyFamiliesRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6422,9 +5543,8 @@ func listPolicyFamiliesRequestToPb(st *ListPolicyFamiliesRequest) (*listPolicyFa } type listPolicyFamiliesRequestPb struct { - MaxResults int64 `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int64 `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6455,7 +5575,6 @@ func listPolicyFamiliesResponseToPb(st *ListPolicyFamiliesResponse) (*listPolicy } pb := &listPolicyFamiliesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.PolicyFamilies = st.PolicyFamilies pb.ForceSendFields = st.ForceSendFields @@ -6463,8 +5582,7 @@ func listPolicyFamiliesResponseToPb(st *ListPolicyFamiliesResponse) (*listPolicy } type listPolicyFamiliesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` PolicyFamilies []PolicyFamily `json:"policy_families,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6520,7 +5638,6 @@ func logAnalyticsInfoToPb(st *LogAnalyticsInfo) (*logAnalyticsInfoPb, error) { } pb := &logAnalyticsInfoPb{} pb.LogAnalyticsPrimaryKey = st.LogAnalyticsPrimaryKey - pb.LogAnalyticsWorkspaceId = st.LogAnalyticsWorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -6528,8 +5645,7 @@ func logAnalyticsInfoToPb(st *LogAnalyticsInfo) (*logAnalyticsInfoPb, error) { } type logAnalyticsInfoPb struct { - LogAnalyticsPrimaryKey string `json:"log_analytics_primary_key,omitempty"` - + LogAnalyticsPrimaryKey string `json:"log_analytics_primary_key,omitempty"` LogAnalyticsWorkspaceId string `json:"log_analytics_workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6561,7 +5677,6 @@ func logSyncStatusToPb(st *LogSyncStatus) (*logSyncStatusPb, error) { } pb := &logSyncStatusPb{} pb.LastAttempted = st.LastAttempted - pb.LastException = st.LastException pb.ForceSendFields = st.ForceSendFields @@ -6569,8 +5684,7 @@ func logSyncStatusToPb(st *LogSyncStatus) (*logSyncStatusPb, error) { } type logSyncStatusPb struct { - LastAttempted int64 `json:"last_attempted,omitempty"` - + LastAttempted int64 `json:"last_attempted,omitempty"` LastException string `json:"last_exception,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6620,9 +5734,7 @@ func mavenLibraryToPb(st *MavenLibrary) (*mavenLibraryPb, error) { } pb := &mavenLibraryPb{} pb.Coordinates = st.Coordinates - pb.Exclusions = st.Exclusions - pb.Repo = st.Repo pb.ForceSendFields = st.ForceSendFields @@ -6630,11 +5742,9 @@ func mavenLibraryToPb(st *MavenLibrary) (*mavenLibraryPb, error) { } type mavenLibraryPb struct { - Coordinates string `json:"coordinates"` - - Exclusions []string `json:"exclusions,omitempty"` - - Repo string `json:"repo,omitempty"` + Coordinates string `json:"coordinates"` + Exclusions []string `json:"exclusions,omitempty"` + Repo string `json:"repo,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6666,13 +5776,9 @@ func nodeInstanceTypeToPb(st *NodeInstanceType) (*nodeInstanceTypePb, error) { } pb := &nodeInstanceTypePb{} pb.InstanceTypeId = st.InstanceTypeId - pb.LocalDiskSizeGb = st.LocalDiskSizeGb - pb.LocalDisks = st.LocalDisks - pb.LocalNvmeDiskSizeGb = st.LocalNvmeDiskSizeGb - pb.LocalNvmeDisks = st.LocalNvmeDisks pb.ForceSendFields = st.ForceSendFields @@ -6680,15 +5786,11 @@ func nodeInstanceTypeToPb(st *NodeInstanceType) (*nodeInstanceTypePb, error) { } type nodeInstanceTypePb struct { - InstanceTypeId string `json:"instance_type_id"` - - LocalDiskSizeGb int `json:"local_disk_size_gb,omitempty"` - - LocalDisks int `json:"local_disks,omitempty"` - - LocalNvmeDiskSizeGb int `json:"local_nvme_disk_size_gb,omitempty"` - - LocalNvmeDisks int `json:"local_nvme_disks,omitempty"` + InstanceTypeId string `json:"instance_type_id"` + LocalDiskSizeGb int `json:"local_disk_size_gb,omitempty"` + LocalDisks int `json:"local_disks,omitempty"` + LocalNvmeDiskSizeGb int `json:"local_nvme_disk_size_gb,omitempty"` + LocalNvmeDisks int `json:"local_nvme_disks,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6722,43 +5824,24 @@ func nodeTypeToPb(st *NodeType) (*nodeTypePb, error) { } pb := &nodeTypePb{} pb.Category = st.Category - pb.Description = st.Description - pb.DisplayOrder = st.DisplayOrder - pb.InstanceTypeId = st.InstanceTypeId - pb.IsDeprecated = st.IsDeprecated - pb.IsEncryptedInTransit = st.IsEncryptedInTransit - pb.IsGraviton = st.IsGraviton - pb.IsHidden = st.IsHidden - pb.IsIoCacheEnabled = st.IsIoCacheEnabled - pb.MemoryMb = st.MemoryMb - pb.NodeInfo = st.NodeInfo - pb.NodeInstanceType = st.NodeInstanceType - pb.NodeTypeId = st.NodeTypeId - pb.NumCores = st.NumCores - pb.NumGpus = st.NumGpus - pb.PhotonDriverCapable = st.PhotonDriverCapable - pb.PhotonWorkerCapable = st.PhotonWorkerCapable - pb.SupportClusterTags = st.SupportClusterTags - pb.SupportEbsVolumes = st.SupportEbsVolumes - pb.SupportPortForwarding = st.SupportPortForwarding pb.ForceSendFields = st.ForceSendFields @@ -6766,45 +5849,26 @@ func nodeTypeToPb(st *NodeType) (*nodeTypePb, error) { } type nodeTypePb struct { - Category string `json:"category"` - - Description string `json:"description"` - - DisplayOrder int `json:"display_order,omitempty"` - - InstanceTypeId string `json:"instance_type_id"` - - IsDeprecated bool `json:"is_deprecated,omitempty"` - - IsEncryptedInTransit bool `json:"is_encrypted_in_transit,omitempty"` - - IsGraviton bool `json:"is_graviton,omitempty"` - - IsHidden bool `json:"is_hidden,omitempty"` - - IsIoCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` - - MemoryMb int `json:"memory_mb"` - - NodeInfo *CloudProviderNodeInfo `json:"node_info,omitempty"` - - NodeInstanceType *NodeInstanceType `json:"node_instance_type,omitempty"` - - NodeTypeId string `json:"node_type_id"` - - NumCores float64 `json:"num_cores"` - - NumGpus int `json:"num_gpus,omitempty"` - - PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` - - PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` - - SupportClusterTags bool `json:"support_cluster_tags,omitempty"` - - SupportEbsVolumes bool `json:"support_ebs_volumes,omitempty"` - - SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` + Category string `json:"category"` + Description string `json:"description"` + DisplayOrder int `json:"display_order,omitempty"` + InstanceTypeId string `json:"instance_type_id"` + IsDeprecated bool `json:"is_deprecated,omitempty"` + IsEncryptedInTransit bool `json:"is_encrypted_in_transit,omitempty"` + IsGraviton bool `json:"is_graviton,omitempty"` + IsHidden bool `json:"is_hidden,omitempty"` + IsIoCacheEnabled bool `json:"is_io_cache_enabled,omitempty"` + MemoryMb int `json:"memory_mb"` + NodeInfo *CloudProviderNodeInfo `json:"node_info,omitempty"` + NodeInstanceType *NodeInstanceType `json:"node_instance_type,omitempty"` + NodeTypeId string `json:"node_type_id"` + NumCores float64 `json:"num_cores"` + NumGpus int `json:"num_gpus,omitempty"` + PhotonDriverCapable bool `json:"photon_driver_capable,omitempty"` + PhotonWorkerCapable bool `json:"photon_worker_capable,omitempty"` + SupportClusterTags bool `json:"support_cluster_tags,omitempty"` + SupportEbsVolumes bool `json:"support_ebs_volumes,omitempty"` + SupportPortForwarding bool `json:"support_port_forwarding,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6874,7 +5938,6 @@ func pendingInstanceErrorToPb(st *PendingInstanceError) (*pendingInstanceErrorPb } pb := &pendingInstanceErrorPb{} pb.InstanceId = st.InstanceId - pb.Message = st.Message pb.ForceSendFields = st.ForceSendFields @@ -6883,8 +5946,7 @@ func pendingInstanceErrorToPb(st *PendingInstanceError) (*pendingInstanceErrorPb type pendingInstanceErrorPb struct { InstanceId string `json:"instance_id,omitempty"` - - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7005,25 +6067,15 @@ func policyToPb(st *Policy) (*policyPb, error) { } pb := &policyPb{} pb.CreatedAtTimestamp = st.CreatedAtTimestamp - pb.CreatorUserName = st.CreatorUserName - pb.Definition = st.Definition - pb.Description = st.Description - pb.IsDefault = st.IsDefault - pb.Libraries = st.Libraries - pb.MaxClustersPerUser = st.MaxClustersPerUser - pb.Name = st.Name - pb.PolicyFamilyDefinitionOverrides = st.PolicyFamilyDefinitionOverrides - pb.PolicyFamilyId = st.PolicyFamilyId - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -7031,27 +6083,17 @@ func policyToPb(st *Policy) (*policyPb, error) { } type policyPb struct { - CreatedAtTimestamp int64 `json:"created_at_timestamp,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - Definition string `json:"definition,omitempty"` - - Description string `json:"description,omitempty"` - - IsDefault bool `json:"is_default,omitempty"` - - Libraries []Library `json:"libraries,omitempty"` - - MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` - - Name string `json:"name,omitempty"` - - PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` - - PolicyFamilyId string `json:"policy_family_id,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` + CreatedAtTimestamp int64 `json:"created_at_timestamp,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + Definition string `json:"definition,omitempty"` + Description string `json:"description,omitempty"` + IsDefault bool `json:"is_default,omitempty"` + Libraries []Library `json:"libraries,omitempty"` + MaxClustersPerUser int64 `json:"max_clusters_per_user,omitempty"` + Name string `json:"name,omitempty"` + PolicyFamilyDefinitionOverrides string `json:"policy_family_definition_overrides,omitempty"` + PolicyFamilyId string `json:"policy_family_id,omitempty"` + PolicyId string `json:"policy_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7091,11 +6133,8 @@ func policyFamilyToPb(st *PolicyFamily) (*policyFamilyPb, error) { } pb := &policyFamilyPb{} pb.Definition = st.Definition - pb.Description = st.Description - pb.Name = st.Name - pb.PolicyFamilyId = st.PolicyFamilyId pb.ForceSendFields = st.ForceSendFields @@ -7103,12 +6142,9 @@ func policyFamilyToPb(st *PolicyFamily) (*policyFamilyPb, error) { } type policyFamilyPb struct { - Definition string `json:"definition,omitempty"` - - Description string `json:"description,omitempty"` - - Name string `json:"name,omitempty"` - + Definition string `json:"definition,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` PolicyFamilyId string `json:"policy_family_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7142,7 +6178,6 @@ func pythonPyPiLibraryToPb(st *PythonPyPiLibrary) (*pythonPyPiLibraryPb, error) } pb := &pythonPyPiLibraryPb{} pb.Package = st.Package - pb.Repo = st.Repo pb.ForceSendFields = st.ForceSendFields @@ -7151,8 +6186,7 @@ func pythonPyPiLibraryToPb(st *PythonPyPiLibrary) (*pythonPyPiLibraryPb, error) type pythonPyPiLibraryPb struct { Package string `json:"package"` - - Repo string `json:"repo,omitempty"` + Repo string `json:"repo,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7183,7 +6217,6 @@ func rCranLibraryToPb(st *RCranLibrary) (*rCranLibraryPb, error) { } pb := &rCranLibraryPb{} pb.Package = st.Package - pb.Repo = st.Repo pb.ForceSendFields = st.ForceSendFields @@ -7192,8 +6225,7 @@ func rCranLibraryToPb(st *RCranLibrary) (*rCranLibraryPb, error) { type rCranLibraryPb struct { Package string `json:"package"` - - Repo string `json:"repo,omitempty"` + Repo string `json:"repo,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7269,9 +6301,7 @@ func resizeClusterToPb(st *ResizeCluster) (*resizeClusterPb, error) { } pb := &resizeClusterPb{} pb.Autoscale = st.Autoscale - pb.ClusterId = st.ClusterId - pb.NumWorkers = st.NumWorkers pb.ForceSendFields = st.ForceSendFields @@ -7279,11 +6309,9 @@ func resizeClusterToPb(st *ResizeCluster) (*resizeClusterPb, error) { } type resizeClusterPb struct { - Autoscale *AutoScale `json:"autoscale,omitempty"` - - ClusterId string `json:"cluster_id"` - - NumWorkers int `json:"num_workers,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + ClusterId string `json:"cluster_id"` + NumWorkers int `json:"num_workers,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7336,7 +6364,6 @@ func restartClusterToPb(st *RestartCluster) (*restartClusterPb, error) { } pb := &restartClusterPb{} pb.ClusterId = st.ClusterId - pb.RestartUser = st.RestartUser pb.ForceSendFields = st.ForceSendFields @@ -7344,8 +6371,7 @@ func restartClusterToPb(st *RestartCluster) (*restartClusterPb, error) { } type restartClusterPb struct { - ClusterId string `json:"cluster_id"` - + ClusterId string `json:"cluster_id"` RestartUser string `json:"restart_user,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7398,23 +6424,14 @@ func resultsToPb(st *Results) (*resultsPb, error) { } pb := &resultsPb{} pb.Cause = st.Cause - pb.Data = st.Data - pb.FileName = st.FileName - pb.FileNames = st.FileNames - pb.IsJsonSchema = st.IsJsonSchema - pb.Pos = st.Pos - pb.ResultType = st.ResultType - pb.Schema = st.Schema - pb.Summary = st.Summary - pb.Truncated = st.Truncated pb.ForceSendFields = st.ForceSendFields @@ -7422,25 +6439,16 @@ func resultsToPb(st *Results) (*resultsPb, error) { } type resultsPb struct { - Cause string `json:"cause,omitempty"` - - Data any `json:"data,omitempty"` - - FileName string `json:"fileName,omitempty"` - - FileNames []string `json:"fileNames,omitempty"` - - IsJsonSchema bool `json:"isJsonSchema,omitempty"` - - Pos int `json:"pos,omitempty"` - - ResultType ResultType `json:"resultType,omitempty"` - - Schema []map[string]any `json:"schema,omitempty"` - - Summary string `json:"summary,omitempty"` - - Truncated bool `json:"truncated,omitempty"` + Cause string `json:"cause,omitempty"` + Data any `json:"data,omitempty"` + FileName string `json:"fileName,omitempty"` + FileNames []string `json:"fileNames,omitempty"` + IsJsonSchema bool `json:"isJsonSchema,omitempty"` + Pos int `json:"pos,omitempty"` + ResultType ResultType `json:"resultType,omitempty"` + Schema []map[string]any `json:"schema,omitempty"` + Summary string `json:"summary,omitempty"` + Truncated bool `json:"truncated,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7479,17 +6487,11 @@ func s3StorageInfoToPb(st *S3StorageInfo) (*s3StorageInfoPb, error) { } pb := &s3StorageInfoPb{} pb.CannedAcl = st.CannedAcl - pb.Destination = st.Destination - pb.EnableEncryption = st.EnableEncryption - pb.EncryptionType = st.EncryptionType - pb.Endpoint = st.Endpoint - pb.KmsKey = st.KmsKey - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -7497,19 +6499,13 @@ func s3StorageInfoToPb(st *S3StorageInfo) (*s3StorageInfoPb, error) { } type s3StorageInfoPb struct { - CannedAcl string `json:"canned_acl,omitempty"` - - Destination string `json:"destination"` - - EnableEncryption bool `json:"enable_encryption,omitempty"` - - EncryptionType string `json:"encryption_type,omitempty"` - - Endpoint string `json:"endpoint,omitempty"` - - KmsKey string `json:"kms_key,omitempty"` - - Region string `json:"region,omitempty"` + CannedAcl string `json:"canned_acl,omitempty"` + Destination string `json:"destination"` + EnableEncryption bool `json:"enable_encryption,omitempty"` + EncryptionType string `json:"encryption_type,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + KmsKey string `json:"kms_key,omitempty"` + Region string `json:"region,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7545,17 +6541,11 @@ func sparkNodeToPb(st *SparkNode) (*sparkNodePb, error) { } pb := &sparkNodePb{} pb.HostPrivateIp = st.HostPrivateIp - pb.InstanceId = st.InstanceId - pb.NodeAwsAttributes = st.NodeAwsAttributes - pb.NodeId = st.NodeId - pb.PrivateIp = st.PrivateIp - pb.PublicDns = st.PublicDns - pb.StartTimestamp = st.StartTimestamp pb.ForceSendFields = st.ForceSendFields @@ -7563,19 +6553,13 @@ func sparkNodeToPb(st *SparkNode) (*sparkNodePb, error) { } type sparkNodePb struct { - HostPrivateIp string `json:"host_private_ip,omitempty"` - - InstanceId string `json:"instance_id,omitempty"` - + HostPrivateIp string `json:"host_private_ip,omitempty"` + InstanceId string `json:"instance_id,omitempty"` NodeAwsAttributes *SparkNodeAwsAttributes `json:"node_aws_attributes,omitempty"` - - NodeId string `json:"node_id,omitempty"` - - PrivateIp string `json:"private_ip,omitempty"` - - PublicDns string `json:"public_dns,omitempty"` - - StartTimestamp int64 `json:"start_timestamp,omitempty"` + NodeId string `json:"node_id,omitempty"` + PrivateIp string `json:"private_ip,omitempty"` + PublicDns string `json:"public_dns,omitempty"` + StartTimestamp int64 `json:"start_timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7647,7 +6631,6 @@ func sparkVersionToPb(st *SparkVersion) (*sparkVersionPb, error) { } pb := &sparkVersionPb{} pb.Key = st.Key - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -7655,8 +6638,7 @@ func sparkVersionToPb(st *SparkVersion) (*sparkVersionPb, error) { } type sparkVersionPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7733,20 +6715,16 @@ func terminationReasonToPb(st *TerminationReason) (*terminationReasonPb, error) } pb := &terminationReasonPb{} pb.Code = st.Code - pb.Parameters = st.Parameters - pb.Type = st.Type return pb, nil } type terminationReasonPb struct { - Code TerminationReasonCode `json:"code,omitempty"` - - Parameters map[string]string `json:"parameters,omitempty"` - - Type TerminationReasonType `json:"type,omitempty"` + Code TerminationReasonCode `json:"code,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + Type TerminationReasonType `json:"type,omitempty"` } func terminationReasonFromPb(pb *terminationReasonPb) (*TerminationReason, error) { @@ -7767,15 +6745,13 @@ func uninstallLibrariesToPb(st *UninstallLibraries) (*uninstallLibrariesPb, erro } pb := &uninstallLibrariesPb{} pb.ClusterId = st.ClusterId - pb.Libraries = st.Libraries return pb, nil } type uninstallLibrariesPb struct { - ClusterId string `json:"cluster_id"` - + ClusterId string `json:"cluster_id"` Libraries []Library `json:"libraries"` } @@ -7862,20 +6838,16 @@ func updateClusterToPb(st *UpdateCluster) (*updateClusterPb, error) { } pb := &updateClusterPb{} pb.Cluster = st.Cluster - pb.ClusterId = st.ClusterId - pb.UpdateMask = st.UpdateMask return pb, nil } type updateClusterPb struct { - Cluster *UpdateClusterResource `json:"cluster,omitempty"` - - ClusterId string `json:"cluster_id"` - - UpdateMask string `json:"update_mask"` + Cluster *UpdateClusterResource `json:"cluster,omitempty"` + ClusterId string `json:"cluster_id"` + UpdateMask string `json:"update_mask"` } func updateClusterFromPb(pb *updateClusterPb) (*UpdateCluster, error) { @@ -7896,61 +6868,33 @@ func updateClusterResourceToPb(st *UpdateClusterResource) (*updateClusterResourc } pb := &updateClusterResourcePb{} pb.Autoscale = st.Autoscale - pb.AutoterminationMinutes = st.AutoterminationMinutes - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterLogConf = st.ClusterLogConf - pb.ClusterName = st.ClusterName - pb.CustomTags = st.CustomTags - pb.DataSecurityMode = st.DataSecurityMode - pb.DockerImage = st.DockerImage - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableElasticDisk = st.EnableElasticDisk - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.IsSingleNode = st.IsSingleNode - pb.Kind = st.Kind - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.RuntimeEngine = st.RuntimeEngine - pb.SingleUserName = st.SingleUserName - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SparkVersion = st.SparkVersion - pb.SshPublicKeys = st.SshPublicKeys - pb.UseMlRuntime = st.UseMlRuntime - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -7958,63 +6902,35 @@ func updateClusterResourceToPb(st *UpdateClusterResource) (*updateClusterResourc } type updateClusterResourcePb struct { - Autoscale *AutoScale `json:"autoscale,omitempty"` - - AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` - - AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` - - ClusterName string `json:"cluster_name,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` - - DockerImage *DockerImage `json:"docker_image,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - IsSingleNode bool `json:"is_single_node,omitempty"` - - Kind Kind `json:"kind,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` - - SingleUserName string `json:"single_user_name,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SparkVersion string `json:"spark_version,omitempty"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` - - UseMlRuntime bool `json:"use_ml_runtime,omitempty"` - - WorkloadType *WorkloadType `json:"workload_type,omitempty"` + Autoscale *AutoScale `json:"autoscale,omitempty"` + AutoterminationMinutes int `json:"autotermination_minutes,omitempty"` + AwsAttributes *AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + ClusterLogConf *ClusterLogConf `json:"cluster_log_conf,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` + DockerImage *DockerImage `json:"docker_image,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableElasticDisk bool `json:"enable_elastic_disk,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + IsSingleNode bool `json:"is_single_node,omitempty"` + Kind Kind `json:"kind,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + RuntimeEngine RuntimeEngine `json:"runtime_engine,omitempty"` + SingleUserName string `json:"single_user_name,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SparkVersion string `json:"spark_version,omitempty"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + UseMlRuntime bool `json:"use_ml_runtime,omitempty"` + WorkloadType *WorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8179,3 +7095,57 @@ func workspaceStorageInfoFromPb(pb *workspaceStorageInfoPb) (*WorkspaceStorageIn return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/compute/model.go b/service/compute/model.go index 9533374c3..9afbf4919 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -5,8 +5,6 @@ package compute import ( "encoding/json" "fmt" - "strings" - "time" ) type AddInstanceProfile struct { @@ -10390,57 +10388,3 @@ func (st WorkspaceStorageInfo) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/dashboards/internal.go b/service/dashboards/internal.go index 6060016e7..a82d90a98 100755 --- a/service/dashboards/internal.go +++ b/service/dashboards/internal.go @@ -3,6 +3,10 @@ package dashboards import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/sql" ) @@ -13,11 +17,8 @@ func authorizationDetailsToPb(st *AuthorizationDetails) (*authorizationDetailsPb } pb := &authorizationDetailsPb{} pb.GrantRules = st.GrantRules - pb.ResourceLegacyAclPath = st.ResourceLegacyAclPath - pb.ResourceName = st.ResourceName - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -25,13 +26,10 @@ func authorizationDetailsToPb(st *AuthorizationDetails) (*authorizationDetailsPb } type authorizationDetailsPb struct { - GrantRules []AuthorizationDetailsGrantRule `json:"grant_rules,omitempty"` - - ResourceLegacyAclPath string `json:"resource_legacy_acl_path,omitempty"` - - ResourceName string `json:"resource_name,omitempty"` - - Type string `json:"type,omitempty"` + GrantRules []AuthorizationDetailsGrantRule `json:"grant_rules,omitempty"` + ResourceLegacyAclPath string `json:"resource_legacy_acl_path,omitempty"` + ResourceName string `json:"resource_name,omitempty"` + Type string `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -100,20 +98,16 @@ func cancelPublishedQueryExecutionRequestToPb(st *CancelPublishedQueryExecutionR } pb := &cancelPublishedQueryExecutionRequestPb{} pb.DashboardName = st.DashboardName - pb.DashboardRevisionId = st.DashboardRevisionId - pb.Tokens = st.Tokens return pb, nil } type cancelPublishedQueryExecutionRequestPb struct { - DashboardName string `json:"-" url:"dashboard_name"` - - DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` - - Tokens []string `json:"-" url:"tokens,omitempty"` + DashboardName string `json:"-" url:"dashboard_name"` + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + Tokens []string `json:"-" url:"tokens,omitempty"` } func cancelPublishedQueryExecutionRequestFromPb(pb *cancelPublishedQueryExecutionRequestPb) (*CancelPublishedQueryExecutionRequest, error) { @@ -158,9 +152,7 @@ func cancelQueryExecutionResponseStatusToPb(st *CancelQueryExecutionResponseStat } pb := &cancelQueryExecutionResponseStatusPb{} pb.DataToken = st.DataToken - pb.Pending = st.Pending - pb.Success = st.Success return pb, nil @@ -168,10 +160,8 @@ func cancelQueryExecutionResponseStatusToPb(st *CancelQueryExecutionResponseStat type cancelQueryExecutionResponseStatusPb struct { DataToken string `json:"data_token"` - - Pending *Empty `json:"pending,omitempty"` - - Success *Empty `json:"success,omitempty"` + Pending *Empty `json:"pending,omitempty"` + Success *Empty `json:"success,omitempty"` } func cancelQueryExecutionResponseStatusFromPb(pb *cancelQueryExecutionResponseStatusPb) (*CancelQueryExecutionResponseStatus, error) { @@ -216,16 +206,14 @@ func createScheduleRequestToPb(st *CreateScheduleRequest) (*createScheduleReques } pb := &createScheduleRequestPb{} pb.DashboardId = st.DashboardId - pb.Schedule = st.Schedule return pb, nil } type createScheduleRequestPb struct { - DashboardId string `json:"-" url:"-"` - - Schedule Schedule `json:"schedule"` + DashboardId string `json:"-" url:"-"` + Schedule Schedule `json:"schedule"` } func createScheduleRequestFromPb(pb *createScheduleRequestPb) (*CreateScheduleRequest, error) { @@ -245,19 +233,15 @@ func createSubscriptionRequestToPb(st *CreateSubscriptionRequest) (*createSubscr } pb := &createSubscriptionRequestPb{} pb.DashboardId = st.DashboardId - pb.ScheduleId = st.ScheduleId - pb.Subscription = st.Subscription return pb, nil } type createSubscriptionRequestPb struct { - DashboardId string `json:"-" url:"-"` - - ScheduleId string `json:"-" url:"-"` - + DashboardId string `json:"-" url:"-"` + ScheduleId string `json:"-" url:"-"` Subscription Subscription `json:"subscription"` } @@ -279,7 +263,6 @@ func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { } pb := &cronSchedulePb{} pb.QuartzCronExpression = st.QuartzCronExpression - pb.TimezoneId = st.TimezoneId return pb, nil @@ -287,8 +270,7 @@ func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { type cronSchedulePb struct { QuartzCronExpression string `json:"quartz_cron_expression"` - - TimezoneId string `json:"timezone_id"` + TimezoneId string `json:"timezone_id"` } func cronScheduleFromPb(pb *cronSchedulePb) (*CronSchedule, error) { @@ -308,23 +290,14 @@ func dashboardToPb(st *Dashboard) (*dashboardPb, error) { } pb := &dashboardPb{} pb.CreateTime = st.CreateTime - pb.DashboardId = st.DashboardId - pb.DisplayName = st.DisplayName - pb.Etag = st.Etag - pb.LifecycleState = st.LifecycleState - pb.ParentPath = st.ParentPath - pb.Path = st.Path - pb.SerializedDashboard = st.SerializedDashboard - pb.UpdateTime = st.UpdateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -332,25 +305,16 @@ func dashboardToPb(st *Dashboard) (*dashboardPb, error) { } type dashboardPb struct { - CreateTime string `json:"create_time,omitempty"` - - DashboardId string `json:"dashboard_id,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Etag string `json:"etag,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - Path string `json:"path,omitempty"` - - SerializedDashboard string `json:"serialized_dashboard,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + CreateTime string `json:"create_time,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Etag string `json:"etag,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + Path string `json:"path,omitempty"` + SerializedDashboard string `json:"serialized_dashboard,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -389,9 +353,7 @@ func deleteScheduleRequestToPb(st *DeleteScheduleRequest) (*deleteScheduleReques } pb := &deleteScheduleRequestPb{} pb.DashboardId = st.DashboardId - pb.Etag = st.Etag - pb.ScheduleId = st.ScheduleId pb.ForceSendFields = st.ForceSendFields @@ -400,10 +362,8 @@ func deleteScheduleRequestToPb(st *DeleteScheduleRequest) (*deleteScheduleReques type deleteScheduleRequestPb struct { DashboardId string `json:"-" url:"-"` - - Etag string `json:"-" url:"etag,omitempty"` - - ScheduleId string `json:"-" url:"-"` + Etag string `json:"-" url:"etag,omitempty"` + ScheduleId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -456,11 +416,8 @@ func deleteSubscriptionRequestToPb(st *DeleteSubscriptionRequest) (*deleteSubscr } pb := &deleteSubscriptionRequestPb{} pb.DashboardId = st.DashboardId - pb.Etag = st.Etag - pb.ScheduleId = st.ScheduleId - pb.SubscriptionId = st.SubscriptionId pb.ForceSendFields = st.ForceSendFields @@ -468,12 +425,9 @@ func deleteSubscriptionRequestToPb(st *DeleteSubscriptionRequest) (*deleteSubscr } type deleteSubscriptionRequestPb struct { - DashboardId string `json:"-" url:"-"` - - Etag string `json:"-" url:"etag,omitempty"` - - ScheduleId string `json:"-" url:"-"` - + DashboardId string `json:"-" url:"-"` + Etag string `json:"-" url:"etag,omitempty"` + ScheduleId string `json:"-" url:"-"` SubscriptionId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -549,9 +503,7 @@ func executePublishedDashboardQueryRequestToPb(st *ExecutePublishedDashboardQuer } pb := &executePublishedDashboardQueryRequestPb{} pb.DashboardName = st.DashboardName - pb.DashboardRevisionId = st.DashboardRevisionId - pb.OverrideWarehouseId = st.OverrideWarehouseId pb.ForceSendFields = st.ForceSendFields @@ -559,10 +511,8 @@ func executePublishedDashboardQueryRequestToPb(st *ExecutePublishedDashboardQuer } type executePublishedDashboardQueryRequestPb struct { - DashboardName string `json:"dashboard_name"` - + DashboardName string `json:"dashboard_name"` DashboardRevisionId string `json:"dashboard_revision_id"` - OverrideWarehouseId string `json:"override_warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -616,9 +566,7 @@ func genieAttachmentToPb(st *GenieAttachment) (*genieAttachmentPb, error) { } pb := &genieAttachmentPb{} pb.AttachmentId = st.AttachmentId - pb.Query = st.Query - pb.Text = st.Text pb.ForceSendFields = st.ForceSendFields @@ -626,11 +574,9 @@ func genieAttachmentToPb(st *GenieAttachment) (*genieAttachmentPb, error) { } type genieAttachmentPb struct { - AttachmentId string `json:"attachment_id,omitempty"` - - Query *GenieQueryAttachment `json:"query,omitempty"` - - Text *TextAttachment `json:"text,omitempty"` + AttachmentId string `json:"attachment_id,omitempty"` + Query *GenieQueryAttachment `json:"query,omitempty"` + Text *TextAttachment `json:"text,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -662,17 +608,11 @@ func genieConversationToPb(st *GenieConversation) (*genieConversationPb, error) } pb := &genieConversationPb{} pb.ConversationId = st.ConversationId - pb.CreatedTimestamp = st.CreatedTimestamp - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.SpaceId = st.SpaceId - pb.Title = st.Title - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -680,19 +620,13 @@ func genieConversationToPb(st *GenieConversation) (*genieConversationPb, error) } type genieConversationPb struct { - ConversationId string `json:"conversation_id"` - - CreatedTimestamp int64 `json:"created_timestamp,omitempty"` - - Id string `json:"id"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - SpaceId string `json:"space_id"` - - Title string `json:"title"` - - UserId int `json:"user_id"` + ConversationId string `json:"conversation_id"` + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + Id string `json:"id"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + SpaceId string `json:"space_id"` + Title string `json:"title"` + UserId int `json:"user_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -728,20 +662,16 @@ func genieCreateConversationMessageRequestToPb(st *GenieCreateConversationMessag } pb := &genieCreateConversationMessageRequestPb{} pb.Content = st.Content - pb.ConversationId = st.ConversationId - pb.SpaceId = st.SpaceId return pb, nil } type genieCreateConversationMessageRequestPb struct { - Content string `json:"content"` - + Content string `json:"content"` ConversationId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieCreateConversationMessageRequestFromPb(pb *genieCreateConversationMessageRequestPb) (*GenieCreateConversationMessageRequest, error) { @@ -762,24 +692,18 @@ func genieExecuteMessageAttachmentQueryRequestToPb(st *GenieExecuteMessageAttach } pb := &genieExecuteMessageAttachmentQueryRequestPb{} pb.AttachmentId = st.AttachmentId - pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil } type genieExecuteMessageAttachmentQueryRequestPb struct { - AttachmentId string `json:"-" url:"-"` - + AttachmentId string `json:"-" url:"-"` ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieExecuteMessageAttachmentQueryRequestFromPb(pb *genieExecuteMessageAttachmentQueryRequestPb) (*GenieExecuteMessageAttachmentQueryRequest, error) { @@ -801,9 +725,7 @@ func genieExecuteMessageQueryRequestToPb(st *GenieExecuteMessageQueryRequest) (* } pb := &genieExecuteMessageQueryRequestPb{} pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil @@ -811,10 +733,8 @@ func genieExecuteMessageQueryRequestToPb(st *GenieExecuteMessageQueryRequest) (* type genieExecuteMessageQueryRequestPb struct { ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieExecuteMessageQueryRequestFromPb(pb *genieExecuteMessageQueryRequestPb) (*GenieExecuteMessageQueryRequest, error) { @@ -835,24 +755,18 @@ func genieGenerateDownloadFullQueryResultRequestToPb(st *GenieGenerateDownloadFu } pb := &genieGenerateDownloadFullQueryResultRequestPb{} pb.AttachmentId = st.AttachmentId - pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil } type genieGenerateDownloadFullQueryResultRequestPb struct { - AttachmentId string `json:"-" url:"-"` - + AttachmentId string `json:"-" url:"-"` ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGenerateDownloadFullQueryResultRequestFromPb(pb *genieGenerateDownloadFullQueryResultRequestPb) (*GenieGenerateDownloadFullQueryResultRequest, error) { @@ -910,9 +824,7 @@ func genieGetConversationMessageRequestToPb(st *GenieGetConversationMessageReque } pb := &genieGetConversationMessageRequestPb{} pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil @@ -920,10 +832,8 @@ func genieGetConversationMessageRequestToPb(st *GenieGetConversationMessageReque type genieGetConversationMessageRequestPb struct { ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGetConversationMessageRequestFromPb(pb *genieGetConversationMessageRequestPb) (*GenieGetConversationMessageRequest, error) { @@ -944,28 +854,20 @@ func genieGetDownloadFullQueryResultRequestToPb(st *GenieGetDownloadFullQueryRes } pb := &genieGetDownloadFullQueryResultRequestPb{} pb.AttachmentId = st.AttachmentId - pb.ConversationId = st.ConversationId - pb.DownloadId = st.DownloadId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil } type genieGetDownloadFullQueryResultRequestPb struct { - AttachmentId string `json:"-" url:"-"` - + AttachmentId string `json:"-" url:"-"` ConversationId string `json:"-" url:"-"` - - DownloadId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + DownloadId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGetDownloadFullQueryResultRequestFromPb(pb *genieGetDownloadFullQueryResultRequestPb) (*GenieGetDownloadFullQueryResultRequest, error) { @@ -1012,24 +914,18 @@ func genieGetMessageAttachmentQueryResultRequestToPb(st *GenieGetMessageAttachme } pb := &genieGetMessageAttachmentQueryResultRequestPb{} pb.AttachmentId = st.AttachmentId - pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil } type genieGetMessageAttachmentQueryResultRequestPb struct { - AttachmentId string `json:"-" url:"-"` - + AttachmentId string `json:"-" url:"-"` ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGetMessageAttachmentQueryResultRequestFromPb(pb *genieGetMessageAttachmentQueryResultRequestPb) (*GenieGetMessageAttachmentQueryResultRequest, error) { @@ -1051,9 +947,7 @@ func genieGetMessageQueryResultRequestToPb(st *GenieGetMessageQueryResultRequest } pb := &genieGetMessageQueryResultRequestPb{} pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil @@ -1061,10 +955,8 @@ func genieGetMessageQueryResultRequestToPb(st *GenieGetMessageQueryResultRequest type genieGetMessageQueryResultRequestPb struct { ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGetMessageQueryResultRequestFromPb(pb *genieGetMessageQueryResultRequestPb) (*GenieGetMessageQueryResultRequest, error) { @@ -1109,24 +1001,18 @@ func genieGetQueryResultByAttachmentRequestToPb(st *GenieGetQueryResultByAttachm } pb := &genieGetQueryResultByAttachmentRequestPb{} pb.AttachmentId = st.AttachmentId - pb.ConversationId = st.ConversationId - pb.MessageId = st.MessageId - pb.SpaceId = st.SpaceId return pb, nil } type genieGetQueryResultByAttachmentRequestPb struct { - AttachmentId string `json:"-" url:"-"` - + AttachmentId string `json:"-" url:"-"` ConversationId string `json:"-" url:"-"` - - MessageId string `json:"-" url:"-"` - - SpaceId string `json:"-" url:"-"` + MessageId string `json:"-" url:"-"` + SpaceId string `json:"-" url:"-"` } func genieGetQueryResultByAttachmentRequestFromPb(pb *genieGetQueryResultByAttachmentRequestPb) (*GenieGetQueryResultByAttachmentRequest, error) { @@ -1172,27 +1058,16 @@ func genieMessageToPb(st *GenieMessage) (*genieMessagePb, error) { } pb := &genieMessagePb{} pb.Attachments = st.Attachments - pb.Content = st.Content - pb.ConversationId = st.ConversationId - pb.CreatedTimestamp = st.CreatedTimestamp - pb.Error = st.Error - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.MessageId = st.MessageId - pb.QueryResult = st.QueryResult - pb.SpaceId = st.SpaceId - pb.Status = st.Status - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -1200,29 +1075,18 @@ func genieMessageToPb(st *GenieMessage) (*genieMessagePb, error) { } type genieMessagePb struct { - Attachments []GenieAttachment `json:"attachments,omitempty"` - - Content string `json:"content"` - - ConversationId string `json:"conversation_id"` - - CreatedTimestamp int64 `json:"created_timestamp,omitempty"` - - Error *MessageError `json:"error,omitempty"` - - Id string `json:"id"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - MessageId string `json:"message_id"` - - QueryResult *Result `json:"query_result,omitempty"` - - SpaceId string `json:"space_id"` - - Status MessageStatus `json:"status,omitempty"` - - UserId int64 `json:"user_id,omitempty"` + Attachments []GenieAttachment `json:"attachments,omitempty"` + Content string `json:"content"` + ConversationId string `json:"conversation_id"` + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + Error *MessageError `json:"error,omitempty"` + Id string `json:"id"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + MessageId string `json:"message_id"` + QueryResult *Result `json:"query_result,omitempty"` + SpaceId string `json:"space_id"` + Status MessageStatus `json:"status,omitempty"` + UserId int64 `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1263,17 +1127,11 @@ func genieQueryAttachmentToPb(st *GenieQueryAttachment) (*genieQueryAttachmentPb } pb := &genieQueryAttachmentPb{} pb.Description = st.Description - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.Query = st.Query - pb.QueryResultMetadata = st.QueryResultMetadata - pb.StatementId = st.StatementId - pb.Title = st.Title pb.ForceSendFields = st.ForceSendFields @@ -1281,19 +1139,13 @@ func genieQueryAttachmentToPb(st *GenieQueryAttachment) (*genieQueryAttachmentPb } type genieQueryAttachmentPb struct { - Description string `json:"description,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - Query string `json:"query,omitempty"` - - QueryResultMetadata *GenieResultMetadata `json:"query_result_metadata,omitempty"` - - StatementId string `json:"statement_id,omitempty"` - - Title string `json:"title,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Query string `json:"query,omitempty"` + QueryResultMetadata *GenieResultMetadata `json:"query_result_metadata,omitempty"` + StatementId string `json:"statement_id,omitempty"` + Title string `json:"title,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1329,7 +1181,6 @@ func genieResultMetadataToPb(st *GenieResultMetadata) (*genieResultMetadataPb, e } pb := &genieResultMetadataPb{} pb.IsTruncated = st.IsTruncated - pb.RowCount = st.RowCount pb.ForceSendFields = st.ForceSendFields @@ -1337,9 +1188,8 @@ func genieResultMetadataToPb(st *GenieResultMetadata) (*genieResultMetadataPb, e } type genieResultMetadataPb struct { - IsTruncated bool `json:"is_truncated,omitempty"` - - RowCount int64 `json:"row_count,omitempty"` + IsTruncated bool `json:"is_truncated,omitempty"` + RowCount int64 `json:"row_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1370,9 +1220,7 @@ func genieSpaceToPb(st *GenieSpace) (*genieSpacePb, error) { } pb := &genieSpacePb{} pb.Description = st.Description - pb.SpaceId = st.SpaceId - pb.Title = st.Title pb.ForceSendFields = st.ForceSendFields @@ -1381,10 +1229,8 @@ func genieSpaceToPb(st *GenieSpace) (*genieSpacePb, error) { type genieSpacePb struct { Description string `json:"description,omitempty"` - - SpaceId string `json:"space_id"` - - Title string `json:"title"` + SpaceId string `json:"space_id"` + Title string `json:"title"` ForceSendFields []string `json:"-" url:"-"` } @@ -1416,7 +1262,6 @@ func genieStartConversationMessageRequestToPb(st *GenieStartConversationMessageR } pb := &genieStartConversationMessageRequestPb{} pb.Content = st.Content - pb.SpaceId = st.SpaceId return pb, nil @@ -1424,7 +1269,6 @@ func genieStartConversationMessageRequestToPb(st *GenieStartConversationMessageR type genieStartConversationMessageRequestPb struct { Content string `json:"content"` - SpaceId string `json:"-" url:"-"` } @@ -1445,24 +1289,18 @@ func genieStartConversationResponseToPb(st *GenieStartConversationResponse) (*ge } pb := &genieStartConversationResponsePb{} pb.Conversation = st.Conversation - pb.ConversationId = st.ConversationId - pb.Message = st.Message - pb.MessageId = st.MessageId return pb, nil } type genieStartConversationResponsePb struct { - Conversation *GenieConversation `json:"conversation,omitempty"` - - ConversationId string `json:"conversation_id"` - - Message *GenieMessage `json:"message,omitempty"` - - MessageId string `json:"message_id"` + Conversation *GenieConversation `json:"conversation,omitempty"` + ConversationId string `json:"conversation_id"` + Message *GenieMessage `json:"message,omitempty"` + MessageId string `json:"message_id"` } func genieStartConversationResponseFromPb(pb *genieStartConversationResponsePb) (*GenieStartConversationResponse, error) { @@ -1577,9 +1415,7 @@ func getPublishedDashboardTokenInfoRequestToPb(st *GetPublishedDashboardTokenInf } pb := &getPublishedDashboardTokenInfoRequestPb{} pb.DashboardId = st.DashboardId - pb.ExternalValue = st.ExternalValue - pb.ExternalViewerId = st.ExternalViewerId pb.ForceSendFields = st.ForceSendFields @@ -1587,10 +1423,8 @@ func getPublishedDashboardTokenInfoRequestToPb(st *GetPublishedDashboardTokenInf } type getPublishedDashboardTokenInfoRequestPb struct { - DashboardId string `json:"-" url:"-"` - - ExternalValue string `json:"-" url:"external_value,omitempty"` - + DashboardId string `json:"-" url:"-"` + ExternalValue string `json:"-" url:"external_value,omitempty"` ExternalViewerId string `json:"-" url:"external_viewer_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1623,9 +1457,7 @@ func getPublishedDashboardTokenInfoResponseToPb(st *GetPublishedDashboardTokenIn } pb := &getPublishedDashboardTokenInfoResponsePb{} pb.AuthorizationDetails = st.AuthorizationDetails - pb.CustomClaim = st.CustomClaim - pb.Scope = st.Scope pb.ForceSendFields = st.ForceSendFields @@ -1634,10 +1466,8 @@ func getPublishedDashboardTokenInfoResponseToPb(st *GetPublishedDashboardTokenIn type getPublishedDashboardTokenInfoResponsePb struct { AuthorizationDetails []AuthorizationDetails `json:"authorization_details,omitempty"` - - CustomClaim string `json:"custom_claim,omitempty"` - - Scope string `json:"scope,omitempty"` + CustomClaim string `json:"custom_claim,omitempty"` + Scope string `json:"scope,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1669,7 +1499,6 @@ func getScheduleRequestToPb(st *GetScheduleRequest) (*getScheduleRequestPb, erro } pb := &getScheduleRequestPb{} pb.DashboardId = st.DashboardId - pb.ScheduleId = st.ScheduleId return pb, nil @@ -1677,8 +1506,7 @@ func getScheduleRequestToPb(st *GetScheduleRequest) (*getScheduleRequestPb, erro type getScheduleRequestPb struct { DashboardId string `json:"-" url:"-"` - - ScheduleId string `json:"-" url:"-"` + ScheduleId string `json:"-" url:"-"` } func getScheduleRequestFromPb(pb *getScheduleRequestPb) (*GetScheduleRequest, error) { @@ -1698,19 +1526,15 @@ func getSubscriptionRequestToPb(st *GetSubscriptionRequest) (*getSubscriptionReq } pb := &getSubscriptionRequestPb{} pb.DashboardId = st.DashboardId - pb.ScheduleId = st.ScheduleId - pb.SubscriptionId = st.SubscriptionId return pb, nil } type getSubscriptionRequestPb struct { - DashboardId string `json:"-" url:"-"` - - ScheduleId string `json:"-" url:"-"` - + DashboardId string `json:"-" url:"-"` + ScheduleId string `json:"-" url:"-"` SubscriptionId string `json:"-" url:"-"` } @@ -1732,11 +1556,8 @@ func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsReques } pb := &listDashboardsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.ShowTrashed = st.ShowTrashed - pb.View = st.View pb.ForceSendFields = st.ForceSendFields @@ -1744,13 +1565,10 @@ func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsReques } type listDashboardsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ShowTrashed bool `json:"-" url:"show_trashed,omitempty"` - - View DashboardView `json:"-" url:"view,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ShowTrashed bool `json:"-" url:"show_trashed,omitempty"` + View DashboardView `json:"-" url:"view,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1783,7 +1601,6 @@ func listDashboardsResponseToPb(st *ListDashboardsResponse) (*listDashboardsResp } pb := &listDashboardsResponsePb{} pb.Dashboards = st.Dashboards - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1791,9 +1608,8 @@ func listDashboardsResponseToPb(st *ListDashboardsResponse) (*listDashboardsResp } type listDashboardsResponsePb struct { - Dashboards []Dashboard `json:"dashboards,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Dashboards []Dashboard `json:"dashboards,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1824,9 +1640,7 @@ func listSchedulesRequestToPb(st *ListSchedulesRequest) (*listSchedulesRequestPb } pb := &listSchedulesRequestPb{} pb.DashboardId = st.DashboardId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1835,10 +1649,8 @@ func listSchedulesRequestToPb(st *ListSchedulesRequest) (*listSchedulesRequestPb type listSchedulesRequestPb struct { DashboardId string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1870,7 +1682,6 @@ func listSchedulesResponseToPb(st *ListSchedulesResponse) (*listSchedulesRespons } pb := &listSchedulesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Schedules = st.Schedules pb.ForceSendFields = st.ForceSendFields @@ -1878,9 +1689,8 @@ func listSchedulesResponseToPb(st *ListSchedulesResponse) (*listSchedulesRespons } type listSchedulesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Schedules []Schedule `json:"schedules,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Schedules []Schedule `json:"schedules,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1911,11 +1721,8 @@ func listSubscriptionsRequestToPb(st *ListSubscriptionsRequest) (*listSubscripti } pb := &listSubscriptionsRequestPb{} pb.DashboardId = st.DashboardId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.ScheduleId = st.ScheduleId pb.ForceSendFields = st.ForceSendFields @@ -1924,12 +1731,9 @@ func listSubscriptionsRequestToPb(st *ListSubscriptionsRequest) (*listSubscripti type listSubscriptionsRequestPb struct { DashboardId string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ScheduleId string `json:"-" url:"-"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ScheduleId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1962,7 +1766,6 @@ func listSubscriptionsResponseToPb(st *ListSubscriptionsResponse) (*listSubscrip } pb := &listSubscriptionsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Subscriptions = st.Subscriptions pb.ForceSendFields = st.ForceSendFields @@ -1970,8 +1773,7 @@ func listSubscriptionsResponseToPb(st *ListSubscriptionsResponse) (*listSubscrip } type listSubscriptionsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` Subscriptions []Subscription `json:"subscriptions,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2003,7 +1805,6 @@ func messageErrorToPb(st *MessageError) (*messageErrorPb, error) { } pb := &messageErrorPb{} pb.Error = st.Error - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -2011,9 +1812,8 @@ func messageErrorToPb(st *MessageError) (*messageErrorPb, error) { } type messageErrorPb struct { - Error string `json:"error,omitempty"` - - Type MessageErrorType `json:"type,omitempty"` + Error string `json:"error,omitempty"` + Type MessageErrorType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2044,11 +1844,8 @@ func migrateDashboardRequestToPb(st *MigrateDashboardRequest) (*migrateDashboard } pb := &migrateDashboardRequestPb{} pb.DisplayName = st.DisplayName - pb.ParentPath = st.ParentPath - pb.SourceDashboardId = st.SourceDashboardId - pb.UpdateParameterSyntax = st.UpdateParameterSyntax pb.ForceSendFields = st.ForceSendFields @@ -2056,13 +1853,10 @@ func migrateDashboardRequestToPb(st *MigrateDashboardRequest) (*migrateDashboard } type migrateDashboardRequestPb struct { - DisplayName string `json:"display_name,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - SourceDashboardId string `json:"source_dashboard_id"` - - UpdateParameterSyntax bool `json:"update_parameter_syntax,omitempty"` + DisplayName string `json:"display_name,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + SourceDashboardId string `json:"source_dashboard_id"` + UpdateParameterSyntax bool `json:"update_parameter_syntax,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2119,20 +1913,16 @@ func pollPublishedQueryStatusRequestToPb(st *PollPublishedQueryStatusRequest) (* } pb := &pollPublishedQueryStatusRequestPb{} pb.DashboardName = st.DashboardName - pb.DashboardRevisionId = st.DashboardRevisionId - pb.Tokens = st.Tokens return pb, nil } type pollPublishedQueryStatusRequestPb struct { - DashboardName string `json:"-" url:"dashboard_name"` - - DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` - - Tokens []string `json:"-" url:"tokens,omitempty"` + DashboardName string `json:"-" url:"dashboard_name"` + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + Tokens []string `json:"-" url:"tokens,omitempty"` } func pollPublishedQueryStatusRequestFromPb(pb *pollPublishedQueryStatusRequestPb) (*PollPublishedQueryStatusRequest, error) { @@ -2201,9 +1991,7 @@ func publishRequestToPb(st *PublishRequest) (*publishRequestPb, error) { } pb := &publishRequestPb{} pb.DashboardId = st.DashboardId - pb.EmbedCredentials = st.EmbedCredentials - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -2211,11 +1999,9 @@ func publishRequestToPb(st *PublishRequest) (*publishRequestPb, error) { } type publishRequestPb struct { - DashboardId string `json:"-" url:"-"` - - EmbedCredentials bool `json:"embed_credentials,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + DashboardId string `json:"-" url:"-"` + EmbedCredentials bool `json:"embed_credentials,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2247,11 +2033,8 @@ func publishedDashboardToPb(st *PublishedDashboard) (*publishedDashboardPb, erro } pb := &publishedDashboardPb{} pb.DisplayName = st.DisplayName - pb.EmbedCredentials = st.EmbedCredentials - pb.RevisionCreateTime = st.RevisionCreateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -2259,13 +2042,10 @@ func publishedDashboardToPb(st *PublishedDashboard) (*publishedDashboardPb, erro } type publishedDashboardPb struct { - DisplayName string `json:"display_name,omitempty"` - - EmbedCredentials bool `json:"embed_credentials,omitempty"` - + DisplayName string `json:"display_name,omitempty"` + EmbedCredentials bool `json:"embed_credentials,omitempty"` RevisionCreateTime string `json:"revision_create_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2298,13 +2078,9 @@ func queryResponseStatusToPb(st *QueryResponseStatus) (*queryResponseStatusPb, e } pb := &queryResponseStatusPb{} pb.Canceled = st.Canceled - pb.Closed = st.Closed - pb.Pending = st.Pending - pb.StatementId = st.StatementId - pb.Success = st.Success pb.ForceSendFields = st.ForceSendFields @@ -2312,15 +2088,11 @@ func queryResponseStatusToPb(st *QueryResponseStatus) (*queryResponseStatusPb, e } type queryResponseStatusPb struct { - Canceled *Empty `json:"canceled,omitempty"` - - Closed *Empty `json:"closed,omitempty"` - - Pending *PendingStatus `json:"pending,omitempty"` - - StatementId string `json:"statement_id,omitempty"` - - Success *SuccessStatus `json:"success,omitempty"` + Canceled *Empty `json:"canceled,omitempty"` + Closed *Empty `json:"closed,omitempty"` + Pending *PendingStatus `json:"pending,omitempty"` + StatementId string `json:"statement_id,omitempty"` + Success *SuccessStatus `json:"success,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2354,9 +2126,7 @@ func resultToPb(st *Result) (*resultPb, error) { } pb := &resultPb{} pb.IsTruncated = st.IsTruncated - pb.RowCount = st.RowCount - pb.StatementId = st.StatementId pb.ForceSendFields = st.ForceSendFields @@ -2364,10 +2134,8 @@ func resultToPb(st *Result) (*resultPb, error) { } type resultPb struct { - IsTruncated bool `json:"is_truncated,omitempty"` - - RowCount int64 `json:"row_count,omitempty"` - + IsTruncated bool `json:"is_truncated,omitempty"` + RowCount int64 `json:"row_count,omitempty"` StatementId string `json:"statement_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2400,21 +2168,13 @@ func scheduleToPb(st *Schedule) (*schedulePb, error) { } pb := &schedulePb{} pb.CreateTime = st.CreateTime - pb.CronSchedule = st.CronSchedule - pb.DashboardId = st.DashboardId - pb.DisplayName = st.DisplayName - pb.Etag = st.Etag - pb.PauseStatus = st.PauseStatus - pb.ScheduleId = st.ScheduleId - pb.UpdateTime = st.UpdateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -2422,23 +2182,15 @@ func scheduleToPb(st *Schedule) (*schedulePb, error) { } type schedulePb struct { - CreateTime string `json:"create_time,omitempty"` - - CronSchedule CronSchedule `json:"cron_schedule"` - - DashboardId string `json:"dashboard_id,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Etag string `json:"etag,omitempty"` - - PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` - - ScheduleId string `json:"schedule_id,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CronSchedule CronSchedule `json:"cron_schedule"` + DashboardId string `json:"dashboard_id,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Etag string `json:"etag,omitempty"` + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + ScheduleId string `json:"schedule_id,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2476,7 +2228,6 @@ func subscriberToPb(st *Subscriber) (*subscriberPb, error) { } pb := &subscriberPb{} pb.DestinationSubscriber = st.DestinationSubscriber - pb.UserSubscriber = st.UserSubscriber return pb, nil @@ -2484,8 +2235,7 @@ func subscriberToPb(st *Subscriber) (*subscriberPb, error) { type subscriberPb struct { DestinationSubscriber *SubscriptionSubscriberDestination `json:"destination_subscriber,omitempty"` - - UserSubscriber *SubscriptionSubscriberUser `json:"user_subscriber,omitempty"` + UserSubscriber *SubscriptionSubscriberUser `json:"user_subscriber,omitempty"` } func subscriberFromPb(pb *subscriberPb) (*Subscriber, error) { @@ -2505,19 +2255,12 @@ func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { } pb := &subscriptionPb{} pb.CreateTime = st.CreateTime - pb.CreatedByUserId = st.CreatedByUserId - pb.DashboardId = st.DashboardId - pb.Etag = st.Etag - pb.ScheduleId = st.ScheduleId - pb.Subscriber = st.Subscriber - pb.SubscriptionId = st.SubscriptionId - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -2525,21 +2268,14 @@ func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { } type subscriptionPb struct { - CreateTime string `json:"create_time,omitempty"` - - CreatedByUserId int64 `json:"created_by_user_id,omitempty"` - - DashboardId string `json:"dashboard_id,omitempty"` - - Etag string `json:"etag,omitempty"` - - ScheduleId string `json:"schedule_id,omitempty"` - - Subscriber Subscriber `json:"subscriber"` - - SubscriptionId string `json:"subscription_id,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CreatedByUserId int64 `json:"created_by_user_id,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` + Etag string `json:"etag,omitempty"` + ScheduleId string `json:"schedule_id,omitempty"` + Subscriber Subscriber `json:"subscriber"` + SubscriptionId string `json:"subscription_id,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2624,7 +2360,6 @@ func successStatusToPb(st *SuccessStatus) (*successStatusPb, error) { } pb := &successStatusPb{} pb.DataToken = st.DataToken - pb.Truncated = st.Truncated pb.ForceSendFields = st.ForceSendFields @@ -2633,8 +2368,7 @@ func successStatusToPb(st *SuccessStatus) (*successStatusPb, error) { type successStatusPb struct { DataToken string `json:"data_token"` - - Truncated bool `json:"truncated,omitempty"` + Truncated bool `json:"truncated,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2665,7 +2399,6 @@ func textAttachmentToPb(st *TextAttachment) (*textAttachmentPb, error) { } pb := &textAttachmentPb{} pb.Content = st.Content - pb.Id = st.Id pb.ForceSendFields = st.ForceSendFields @@ -2674,8 +2407,7 @@ func textAttachmentToPb(st *TextAttachment) (*textAttachmentPb, error) { type textAttachmentPb struct { Content string `json:"content,omitempty"` - - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2796,16 +2528,14 @@ func updateDashboardRequestToPb(st *UpdateDashboardRequest) (*updateDashboardReq } pb := &updateDashboardRequestPb{} pb.Dashboard = st.Dashboard - pb.DashboardId = st.DashboardId return pb, nil } type updateDashboardRequestPb struct { - Dashboard Dashboard `json:"dashboard"` - - DashboardId string `json:"-" url:"-"` + Dashboard Dashboard `json:"dashboard"` + DashboardId string `json:"-" url:"-"` } func updateDashboardRequestFromPb(pb *updateDashboardRequestPb) (*UpdateDashboardRequest, error) { @@ -2825,20 +2555,16 @@ func updateScheduleRequestToPb(st *UpdateScheduleRequest) (*updateScheduleReques } pb := &updateScheduleRequestPb{} pb.DashboardId = st.DashboardId - pb.Schedule = st.Schedule - pb.ScheduleId = st.ScheduleId return pb, nil } type updateScheduleRequestPb struct { - DashboardId string `json:"-" url:"-"` - - Schedule Schedule `json:"schedule"` - - ScheduleId string `json:"-" url:"-"` + DashboardId string `json:"-" url:"-"` + Schedule Schedule `json:"schedule"` + ScheduleId string `json:"-" url:"-"` } func updateScheduleRequestFromPb(pb *updateScheduleRequestPb) (*UpdateScheduleRequest, error) { @@ -2852,3 +2578,57 @@ func updateScheduleRequestFromPb(pb *updateScheduleRequestPb) (*UpdateScheduleRe return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/dashboards/model.go b/service/dashboards/model.go index f8aaa3b9c..15acd168e 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -5,8 +5,6 @@ package dashboards import ( "encoding/json" "fmt" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/sql" ) @@ -3214,57 +3212,3 @@ func (st UpdateScheduleRequest) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/files/internal.go b/service/files/internal.go index ff0b76937..6e823e61d 100755 --- a/service/files/internal.go +++ b/service/files/internal.go @@ -3,7 +3,10 @@ package files import ( + "fmt" "io" + "strings" + "time" "github.com/databricks/databricks-sdk-go/marshal" ) @@ -14,16 +17,14 @@ func addBlockToPb(st *AddBlock) (*addBlockPb, error) { } pb := &addBlockPb{} pb.Data = st.Data - pb.Handle = st.Handle return pb, nil } type addBlockPb struct { - Data string `json:"data"` - - Handle int64 `json:"handle"` + Data string `json:"data"` + Handle int64 `json:"handle"` } func addBlockFromPb(pb *addBlockPb) (*AddBlock, error) { @@ -109,7 +110,6 @@ func createToPb(st *Create) (*createPb, error) { } pb := &createPb{} pb.Overwrite = st.Overwrite - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -117,9 +117,8 @@ func createToPb(st *Create) (*createPb, error) { } type createPb struct { - Overwrite bool `json:"overwrite,omitempty"` - - Path string `json:"path"` + Overwrite bool `json:"overwrite,omitempty"` + Path string `json:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -231,7 +230,6 @@ func deleteToPb(st *Delete) (*deletePb, error) { } pb := &deletePb{} pb.Path = st.Path - pb.Recursive = st.Recursive pb.ForceSendFields = st.ForceSendFields @@ -239,9 +237,8 @@ func deleteToPb(st *Delete) (*deletePb, error) { } type deletePb struct { - Path string `json:"path"` - - Recursive bool `json:"recursive,omitempty"` + Path string `json:"path"` + Recursive bool `json:"recursive,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -362,13 +359,9 @@ func directoryEntryToPb(st *DirectoryEntry) (*directoryEntryPb, error) { } pb := &directoryEntryPb{} pb.FileSize = st.FileSize - pb.IsDirectory = st.IsDirectory - pb.LastModified = st.LastModified - pb.Name = st.Name - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -376,15 +369,11 @@ func directoryEntryToPb(st *DirectoryEntry) (*directoryEntryPb, error) { } type directoryEntryPb struct { - FileSize int64 `json:"file_size,omitempty"` - - IsDirectory bool `json:"is_directory,omitempty"` - - LastModified int64 `json:"last_modified,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + IsDirectory bool `json:"is_directory,omitempty"` + LastModified int64 `json:"last_modified,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -442,11 +431,8 @@ func downloadResponseToPb(st *DownloadResponse) (*downloadResponsePb, error) { } pb := &downloadResponsePb{} pb.ContentLength = st.ContentLength - pb.ContentType = st.ContentType - pb.Contents = st.Contents - pb.LastModified = st.LastModified pb.ForceSendFields = st.ForceSendFields @@ -454,13 +440,10 @@ func downloadResponseToPb(st *DownloadResponse) (*downloadResponsePb, error) { } type downloadResponsePb struct { - ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` - - ContentType string `json:"-" url:"-" header:"content-type,omitempty"` - - Contents io.ReadCloser `json:"-"` - - LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + Contents io.ReadCloser `json:"-"` + LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -493,11 +476,8 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } pb := &fileInfoPb{} pb.FileSize = st.FileSize - pb.IsDir = st.IsDir - pb.ModificationTime = st.ModificationTime - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -505,13 +485,10 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } type fileInfoPb struct { - FileSize int64 `json:"file_size,omitempty"` - - IsDir bool `json:"is_dir,omitempty"` - - ModificationTime int64 `json:"modification_time,omitempty"` - - Path string `json:"path,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + IsDir bool `json:"is_dir,omitempty"` + ModificationTime int64 `json:"modification_time,omitempty"` + Path string `json:"path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -613,9 +590,7 @@ func getMetadataResponseToPb(st *GetMetadataResponse) (*getMetadataResponsePb, e } pb := &getMetadataResponsePb{} pb.ContentLength = st.ContentLength - pb.ContentType = st.ContentType - pb.LastModified = st.LastModified pb.ForceSendFields = st.ForceSendFields @@ -623,11 +598,9 @@ func getMetadataResponseToPb(st *GetMetadataResponse) (*getMetadataResponsePb, e } type getMetadataResponsePb struct { - ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` - - ContentType string `json:"-" url:"-" header:"content-type,omitempty"` - - LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` + ContentLength int64 `json:"-" url:"-" header:"content-length,omitempty"` + ContentType string `json:"-" url:"-" header:"content-type,omitempty"` + LastModified string `json:"-" url:"-" header:"last-modified,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -707,9 +680,7 @@ func listDirectoryContentsRequestToPb(st *ListDirectoryContentsRequest) (*listDi } pb := &listDirectoryContentsRequestPb{} pb.DirectoryPath = st.DirectoryPath - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -718,10 +689,8 @@ func listDirectoryContentsRequestToPb(st *ListDirectoryContentsRequest) (*listDi type listDirectoryContentsRequestPb struct { DirectoryPath string `json:"-" url:"-"` - - PageSize int64 `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageSize int64 `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -753,7 +722,6 @@ func listDirectoryResponseToPb(st *ListDirectoryResponse) (*listDirectoryRespons } pb := &listDirectoryResponsePb{} pb.Contents = st.Contents - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -761,9 +729,8 @@ func listDirectoryResponseToPb(st *ListDirectoryResponse) (*listDirectoryRespons } type listDirectoryResponsePb struct { - Contents []DirectoryEntry `json:"contents,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Contents []DirectoryEntry `json:"contents,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -863,7 +830,6 @@ func moveToPb(st *Move) (*movePb, error) { } pb := &movePb{} pb.DestinationPath = st.DestinationPath - pb.SourcePath = st.SourcePath return pb, nil @@ -871,8 +837,7 @@ func moveToPb(st *Move) (*movePb, error) { type movePb struct { DestinationPath string `json:"destination_path"` - - SourcePath string `json:"source_path"` + SourcePath string `json:"source_path"` } func moveFromPb(pb *movePb) (*Move, error) { @@ -913,9 +878,7 @@ func putToPb(st *Put) (*putPb, error) { } pb := &putPb{} pb.Contents = st.Contents - pb.Overwrite = st.Overwrite - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -923,11 +886,9 @@ func putToPb(st *Put) (*putPb, error) { } type putPb struct { - Contents string `json:"contents,omitempty"` - - Overwrite bool `json:"overwrite,omitempty"` - - Path string `json:"path"` + Contents string `json:"contents,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Path string `json:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -980,9 +941,7 @@ func readDbfsRequestToPb(st *ReadDbfsRequest) (*readDbfsRequestPb, error) { } pb := &readDbfsRequestPb{} pb.Length = st.Length - pb.Offset = st.Offset - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -990,11 +949,9 @@ func readDbfsRequestToPb(st *ReadDbfsRequest) (*readDbfsRequestPb, error) { } type readDbfsRequestPb struct { - Length int64 `json:"-" url:"length,omitempty"` - - Offset int64 `json:"-" url:"offset,omitempty"` - - Path string `json:"-" url:"path"` + Length int64 `json:"-" url:"length,omitempty"` + Offset int64 `json:"-" url:"offset,omitempty"` + Path string `json:"-" url:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -1026,7 +983,6 @@ func readResponseToPb(st *ReadResponse) (*readResponsePb, error) { } pb := &readResponsePb{} pb.BytesRead = st.BytesRead - pb.Data = st.Data pb.ForceSendFields = st.ForceSendFields @@ -1034,9 +990,8 @@ func readResponseToPb(st *ReadResponse) (*readResponsePb, error) { } type readResponsePb struct { - BytesRead int64 `json:"bytes_read,omitempty"` - - Data string `json:"data,omitempty"` + BytesRead int64 `json:"bytes_read,omitempty"` + Data string `json:"data,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1067,9 +1022,7 @@ func uploadRequestToPb(st *UploadRequest) (*uploadRequestPb, error) { } pb := &uploadRequestPb{} pb.Contents = st.Contents - pb.FilePath = st.FilePath - pb.Overwrite = st.Overwrite pb.ForceSendFields = st.ForceSendFields @@ -1077,11 +1030,9 @@ func uploadRequestToPb(st *UploadRequest) (*uploadRequestPb, error) { } type uploadRequestPb struct { - Contents io.ReadCloser `json:"-"` - - FilePath string `json:"-" url:"-"` - - Overwrite bool `json:"-" url:"overwrite,omitempty"` + Contents io.ReadCloser `json:"-"` + FilePath string `json:"-" url:"-"` + Overwrite bool `json:"-" url:"overwrite,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1127,3 +1078,57 @@ func uploadResponseFromPb(pb *uploadResponsePb) (*UploadResponse, error) { return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/files/model.go b/service/files/model.go index 6196bd786..01eb3ca27 100755 --- a/service/files/model.go +++ b/service/files/model.go @@ -6,8 +6,6 @@ import ( "encoding/json" "fmt" "io" - "strings" - "time" ) type AddBlock struct { @@ -1240,57 +1238,3 @@ func (st UploadResponse) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/iam/internal.go b/service/iam/internal.go index c952aba6c..17ab733c3 100755 --- a/service/iam/internal.go +++ b/service/iam/internal.go @@ -3,6 +3,10 @@ package iam import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,11 +16,8 @@ func accessControlRequestToPb(st *AccessControlRequest) (*accessControlRequestPb } pb := &accessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -24,13 +25,10 @@ func accessControlRequestToPb(st *AccessControlRequest) (*accessControlRequestPb } type accessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -63,13 +61,9 @@ func accessControlResponseToPb(st *AccessControlResponse) (*accessControlRespons } pb := &accessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -77,15 +71,11 @@ func accessControlResponseToPb(st *AccessControlResponse) (*accessControlRespons } type accessControlResponsePb struct { - AllPermissions []Permission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []Permission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -155,32 +145,22 @@ func checkPolicyRequestToPb(st *CheckPolicyRequest) (*checkPolicyRequestPb, erro } pb := &checkPolicyRequestPb{} pb.Actor = st.Actor - pb.AuthzIdentity = st.AuthzIdentity - pb.ConsistencyToken = st.ConsistencyToken - pb.Permission = st.Permission - pb.Resource = st.Resource - pb.ResourceInfo = st.ResourceInfo return pb, nil } type checkPolicyRequestPb struct { - Actor Actor `json:"-" url:"actor"` - - AuthzIdentity RequestAuthzIdentity `json:"-" url:"authz_identity"` - - ConsistencyToken ConsistencyToken `json:"-" url:"consistency_token"` - - Permission string `json:"-" url:"permission"` - - Resource string `json:"-" url:"resource"` - - ResourceInfo *ResourceInfo `json:"-" url:"resource_info,omitempty"` + Actor Actor `json:"-" url:"actor"` + AuthzIdentity RequestAuthzIdentity `json:"-" url:"authz_identity"` + ConsistencyToken ConsistencyToken `json:"-" url:"consistency_token"` + Permission string `json:"-" url:"permission"` + Resource string `json:"-" url:"resource"` + ResourceInfo *ResourceInfo `json:"-" url:"resource_info,omitempty"` } func checkPolicyRequestFromPb(pb *checkPolicyRequestPb) (*CheckPolicyRequest, error) { @@ -204,7 +184,6 @@ func checkPolicyResponseToPb(st *CheckPolicyResponse) (*checkPolicyResponsePb, e } pb := &checkPolicyResponsePb{} pb.ConsistencyToken = st.ConsistencyToken - pb.IsPermitted = st.IsPermitted pb.ForceSendFields = st.ForceSendFields @@ -213,8 +192,7 @@ func checkPolicyResponseToPb(st *CheckPolicyResponse) (*checkPolicyResponsePb, e type checkPolicyResponsePb struct { ConsistencyToken ConsistencyToken `json:"consistency_token"` - - IsPermitted bool `json:"is_permitted,omitempty"` + IsPermitted bool `json:"is_permitted,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -245,13 +223,9 @@ func complexValueToPb(st *ComplexValue) (*complexValuePb, error) { } pb := &complexValuePb{} pb.Display = st.Display - pb.Primary = st.Primary - pb.Ref = st.Ref - pb.Type = st.Type - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -260,14 +234,10 @@ func complexValueToPb(st *ComplexValue) (*complexValuePb, error) { type complexValuePb struct { Display string `json:"display,omitempty"` - - Primary bool `json:"primary,omitempty"` - - Ref string `json:"$ref,omitempty"` - - Type string `json:"type,omitempty"` - - Value string `json:"value,omitempty"` + Primary bool `json:"primary,omitempty"` + Ref string `json:"$ref,omitempty"` + Type string `json:"type,omitempty"` + Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -490,7 +460,6 @@ func deleteWorkspaceAssignmentRequestToPb(st *DeleteWorkspaceAssignmentRequest) } pb := &deleteWorkspaceAssignmentRequestPb{} pb.PrincipalId = st.PrincipalId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -498,7 +467,6 @@ func deleteWorkspaceAssignmentRequestToPb(st *DeleteWorkspaceAssignmentRequest) type deleteWorkspaceAssignmentRequestPb struct { PrincipalId int64 `json:"-" url:"-"` - WorkspaceId int64 `json:"-" url:"-"` } @@ -588,19 +556,12 @@ func getAccountUserRequestToPb(st *GetAccountUserRequest) (*getAccountUserReques } pb := &getAccountUserRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.Id = st.Id - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -608,21 +569,14 @@ func getAccountUserRequestToPb(st *GetAccountUserRequest) (*getAccountUserReques } type getAccountUserRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - Id string `json:"-" url:"-"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + Id string `json:"-" url:"-"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -755,15 +709,13 @@ func getPermissionLevelsRequestToPb(st *GetPermissionLevelsRequest) (*getPermiss } pb := &getPermissionLevelsRequestPb{} pb.RequestObjectId = st.RequestObjectId - pb.RequestObjectType = st.RequestObjectType return pb, nil } type getPermissionLevelsRequestPb struct { - RequestObjectId string `json:"-" url:"-"` - + RequestObjectId string `json:"-" url:"-"` RequestObjectType string `json:"-" url:"-"` } @@ -808,15 +760,13 @@ func getPermissionRequestToPb(st *GetPermissionRequest) (*getPermissionRequestPb } pb := &getPermissionRequestPb{} pb.RequestObjectId = st.RequestObjectId - pb.RequestObjectType = st.RequestObjectType return pb, nil } type getPermissionRequestPb struct { - RequestObjectId string `json:"-" url:"-"` - + RequestObjectId string `json:"-" url:"-"` RequestObjectType string `json:"-" url:"-"` } @@ -837,7 +787,6 @@ func getRuleSetRequestToPb(st *GetRuleSetRequest) (*getRuleSetRequestPb, error) } pb := &getRuleSetRequestPb{} pb.Etag = st.Etag - pb.Name = st.Name return pb, nil @@ -845,7 +794,6 @@ func getRuleSetRequestToPb(st *GetRuleSetRequest) (*getRuleSetRequestPb, error) type getRuleSetRequestPb struct { Etag string `json:"-" url:"etag"` - Name string `json:"-" url:"name"` } @@ -890,19 +838,12 @@ func getUserRequestToPb(st *GetUserRequest) (*getUserRequestPb, error) { } pb := &getUserRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.Id = st.Id - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -910,21 +851,14 @@ func getUserRequestToPb(st *GetUserRequest) (*getUserRequestPb, error) { } type getUserRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - Id string `json:"-" url:"-"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + Id string `json:"-" url:"-"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder GetSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -985,7 +919,6 @@ func grantRuleToPb(st *GrantRule) (*grantRulePb, error) { } pb := &grantRulePb{} pb.Principals = st.Principals - pb.Role = st.Role return pb, nil @@ -993,8 +926,7 @@ func grantRuleToPb(st *GrantRule) (*grantRulePb, error) { type grantRulePb struct { Principals []string `json:"principals,omitempty"` - - Role string `json:"role"` + Role string `json:"role"` } func grantRuleFromPb(pb *grantRulePb) (*GrantRule, error) { @@ -1014,21 +946,13 @@ func groupToPb(st *Group) (*groupPb, error) { } pb := &groupPb{} pb.DisplayName = st.DisplayName - pb.Entitlements = st.Entitlements - pb.ExternalId = st.ExternalId - pb.Groups = st.Groups - pb.Id = st.Id - pb.Members = st.Members - pb.Meta = st.Meta - pb.Roles = st.Roles - pb.Schemas = st.Schemas pb.ForceSendFields = st.ForceSendFields @@ -1036,23 +960,15 @@ func groupToPb(st *Group) (*groupPb, error) { } type groupPb struct { - DisplayName string `json:"displayName,omitempty"` - + DisplayName string `json:"displayName,omitempty"` Entitlements []ComplexValue `json:"entitlements,omitempty"` - - ExternalId string `json:"externalId,omitempty"` - - Groups []ComplexValue `json:"groups,omitempty"` - - Id string `json:"id,omitempty" url:"-"` - - Members []ComplexValue `json:"members,omitempty"` - - Meta *ResourceMeta `json:"meta,omitempty"` - - Roles []ComplexValue `json:"roles,omitempty"` - - Schemas []GroupSchema `json:"schemas,omitempty"` + ExternalId string `json:"externalId,omitempty"` + Groups []ComplexValue `json:"groups,omitempty"` + Id string `json:"id,omitempty" url:"-"` + Members []ComplexValue `json:"members,omitempty"` + Meta *ResourceMeta `json:"meta,omitempty"` + Roles []ComplexValue `json:"roles,omitempty"` + Schemas []GroupSchema `json:"schemas,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1090,17 +1006,11 @@ func listAccountGroupsRequestToPb(st *ListAccountGroupsRequest) (*listAccountGro } pb := &listAccountGroupsRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1108,19 +1018,13 @@ func listAccountGroupsRequestToPb(st *ListAccountGroupsRequest) (*listAccountGro } type listAccountGroupsRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1156,17 +1060,11 @@ func listAccountServicePrincipalsRequestToPb(st *ListAccountServicePrincipalsReq } pb := &listAccountServicePrincipalsRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1174,19 +1072,13 @@ func listAccountServicePrincipalsRequestToPb(st *ListAccountServicePrincipalsReq } type listAccountServicePrincipalsRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1222,17 +1114,11 @@ func listAccountUsersRequestToPb(st *ListAccountUsersRequest) (*listAccountUsers } pb := &listAccountUsersRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1240,19 +1126,13 @@ func listAccountUsersRequestToPb(st *ListAccountUsersRequest) (*listAccountUsers } type listAccountUsersRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1288,17 +1168,11 @@ func listGroupsRequestToPb(st *ListGroupsRequest) (*listGroupsRequestPb, error) } pb := &listGroupsRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1306,19 +1180,13 @@ func listGroupsRequestToPb(st *ListGroupsRequest) (*listGroupsRequestPb, error) } type listGroupsRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1354,13 +1222,9 @@ func listGroupsResponseToPb(st *ListGroupsResponse) (*listGroupsResponsePb, erro } pb := &listGroupsResponsePb{} pb.ItemsPerPage = st.ItemsPerPage - pb.Resources = st.Resources - pb.Schemas = st.Schemas - pb.StartIndex = st.StartIndex - pb.TotalResults = st.TotalResults pb.ForceSendFields = st.ForceSendFields @@ -1368,15 +1232,11 @@ func listGroupsResponseToPb(st *ListGroupsResponse) (*listGroupsResponsePb, erro } type listGroupsResponsePb struct { - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` - - Resources []Group `json:"Resources,omitempty"` - - Schemas []ListResponseSchema `json:"schemas,omitempty"` - - StartIndex int64 `json:"startIndex,omitempty"` - - TotalResults int64 `json:"totalResults,omitempty"` + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + Resources []Group `json:"Resources,omitempty"` + Schemas []ListResponseSchema `json:"schemas,omitempty"` + StartIndex int64 `json:"startIndex,omitempty"` + TotalResults int64 `json:"totalResults,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1410,13 +1270,9 @@ func listServicePrincipalResponseToPb(st *ListServicePrincipalResponse) (*listSe } pb := &listServicePrincipalResponsePb{} pb.ItemsPerPage = st.ItemsPerPage - pb.Resources = st.Resources - pb.Schemas = st.Schemas - pb.StartIndex = st.StartIndex - pb.TotalResults = st.TotalResults pb.ForceSendFields = st.ForceSendFields @@ -1424,15 +1280,11 @@ func listServicePrincipalResponseToPb(st *ListServicePrincipalResponse) (*listSe } type listServicePrincipalResponsePb struct { - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` - - Resources []ServicePrincipal `json:"Resources,omitempty"` - - Schemas []ListResponseSchema `json:"schemas,omitempty"` - - StartIndex int64 `json:"startIndex,omitempty"` - - TotalResults int64 `json:"totalResults,omitempty"` + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + Resources []ServicePrincipal `json:"Resources,omitempty"` + Schemas []ListResponseSchema `json:"schemas,omitempty"` + StartIndex int64 `json:"startIndex,omitempty"` + TotalResults int64 `json:"totalResults,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1466,17 +1318,11 @@ func listServicePrincipalsRequestToPb(st *ListServicePrincipalsRequest) (*listSe } pb := &listServicePrincipalsRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1484,19 +1330,13 @@ func listServicePrincipalsRequestToPb(st *ListServicePrincipalsRequest) (*listSe } type listServicePrincipalsRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1532,17 +1372,11 @@ func listUsersRequestToPb(st *ListUsersRequest) (*listUsersRequestPb, error) { } pb := &listUsersRequestPb{} pb.Attributes = st.Attributes - pb.Count = st.Count - pb.ExcludedAttributes = st.ExcludedAttributes - pb.Filter = st.Filter - pb.SortBy = st.SortBy - pb.SortOrder = st.SortOrder - pb.StartIndex = st.StartIndex pb.ForceSendFields = st.ForceSendFields @@ -1550,19 +1384,13 @@ func listUsersRequestToPb(st *ListUsersRequest) (*listUsersRequestPb, error) { } type listUsersRequestPb struct { - Attributes string `json:"-" url:"attributes,omitempty"` - - Count int64 `json:"-" url:"count,omitempty"` - - ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` - - Filter string `json:"-" url:"filter,omitempty"` - - SortBy string `json:"-" url:"sortBy,omitempty"` - - SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` - - StartIndex int64 `json:"-" url:"startIndex,omitempty"` + Attributes string `json:"-" url:"attributes,omitempty"` + Count int64 `json:"-" url:"count,omitempty"` + ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + SortBy string `json:"-" url:"sortBy,omitempty"` + SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"` + StartIndex int64 `json:"-" url:"startIndex,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1598,13 +1426,9 @@ func listUsersResponseToPb(st *ListUsersResponse) (*listUsersResponsePb, error) } pb := &listUsersResponsePb{} pb.ItemsPerPage = st.ItemsPerPage - pb.Resources = st.Resources - pb.Schemas = st.Schemas - pb.StartIndex = st.StartIndex - pb.TotalResults = st.TotalResults pb.ForceSendFields = st.ForceSendFields @@ -1612,15 +1436,11 @@ func listUsersResponseToPb(st *ListUsersResponse) (*listUsersResponsePb, error) } type listUsersResponsePb struct { - ItemsPerPage int64 `json:"itemsPerPage,omitempty"` - - Resources []User `json:"Resources,omitempty"` - - Schemas []ListResponseSchema `json:"schemas,omitempty"` - - StartIndex int64 `json:"startIndex,omitempty"` - - TotalResults int64 `json:"totalResults,omitempty"` + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + Resources []User `json:"Resources,omitempty"` + Schemas []ListResponseSchema `json:"schemas,omitempty"` + StartIndex int64 `json:"startIndex,omitempty"` + TotalResults int64 `json:"totalResults,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1678,11 +1498,8 @@ func migratePermissionsRequestToPb(st *MigratePermissionsRequest) (*migratePermi } pb := &migratePermissionsRequestPb{} pb.FromWorkspaceGroupName = st.FromWorkspaceGroupName - pb.Size = st.Size - pb.ToAccountGroupName = st.ToAccountGroupName - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -1691,12 +1508,9 @@ func migratePermissionsRequestToPb(st *MigratePermissionsRequest) (*migratePermi type migratePermissionsRequestPb struct { FromWorkspaceGroupName string `json:"from_workspace_group_name"` - - Size int `json:"size,omitempty"` - - ToAccountGroupName string `json:"to_account_group_name"` - - WorkspaceId int64 `json:"workspace_id"` + Size int `json:"size,omitempty"` + ToAccountGroupName string `json:"to_account_group_name"` + WorkspaceId int64 `json:"workspace_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -1765,7 +1579,6 @@ func nameToPb(st *Name) (*namePb, error) { } pb := &namePb{} pb.FamilyName = st.FamilyName - pb.GivenName = st.GivenName pb.ForceSendFields = st.ForceSendFields @@ -1774,8 +1587,7 @@ func nameToPb(st *Name) (*namePb, error) { type namePb struct { FamilyName string `json:"familyName,omitempty"` - - GivenName string `json:"givenName,omitempty"` + GivenName string `json:"givenName,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1806,9 +1618,7 @@ func objectPermissionsToPb(st *ObjectPermissions) (*objectPermissionsPb, error) } pb := &objectPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -1817,10 +1627,8 @@ func objectPermissionsToPb(st *ObjectPermissions) (*objectPermissionsPb, error) type objectPermissionsPb struct { AccessControlList []AccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1852,20 +1660,16 @@ func partialUpdateToPb(st *PartialUpdate) (*partialUpdatePb, error) { } pb := &partialUpdatePb{} pb.Id = st.Id - pb.Operations = st.Operations - pb.Schemas = st.Schemas return pb, nil } type partialUpdatePb struct { - Id string `json:"-" url:"-"` - - Operations []Patch `json:"Operations,omitempty"` - - Schemas []PatchSchema `json:"schemas,omitempty"` + Id string `json:"-" url:"-"` + Operations []Patch `json:"Operations,omitempty"` + Schemas []PatchSchema `json:"schemas,omitempty"` } func partialUpdateFromPb(pb *partialUpdatePb) (*PartialUpdate, error) { @@ -1886,11 +1690,8 @@ func passwordAccessControlRequestToPb(st *PasswordAccessControlRequest) (*passwo } pb := &passwordAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1898,13 +1699,10 @@ func passwordAccessControlRequestToPb(st *PasswordAccessControlRequest) (*passwo } type passwordAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1937,13 +1735,9 @@ func passwordAccessControlResponseToPb(st *PasswordAccessControlResponse) (*pass } pb := &passwordAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1951,15 +1745,11 @@ func passwordAccessControlResponseToPb(st *PasswordAccessControlResponse) (*pass } type passwordAccessControlResponsePb struct { - AllPermissions []PasswordPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []PasswordPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1993,9 +1783,7 @@ func passwordPermissionToPb(st *PasswordPermission) (*passwordPermissionPb, erro } pb := &passwordPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2003,11 +1791,9 @@ func passwordPermissionToPb(st *PasswordPermission) (*passwordPermissionPb, erro } type passwordPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2039,9 +1825,7 @@ func passwordPermissionsToPb(st *PasswordPermissions) (*passwordPermissionsPb, e } pb := &passwordPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2050,10 +1834,8 @@ func passwordPermissionsToPb(st *PasswordPermissions) (*passwordPermissionsPb, e type passwordPermissionsPb struct { AccessControlList []PasswordAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2085,7 +1867,6 @@ func passwordPermissionsDescriptionToPb(st *PasswordPermissionsDescription) (*pa } pb := &passwordPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2093,8 +1874,7 @@ func passwordPermissionsDescriptionToPb(st *PasswordPermissionsDescription) (*pa } type passwordPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2150,9 +1930,7 @@ func patchToPb(st *Patch) (*patchPb, error) { } pb := &patchPb{} pb.Op = st.Op - pb.Path = st.Path - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -2160,11 +1938,9 @@ func patchToPb(st *Patch) (*patchPb, error) { } type patchPb struct { - Op PatchOp `json:"op,omitempty"` - - Path string `json:"path,omitempty"` - - Value any `json:"value,omitempty"` + Op PatchOp `json:"op,omitempty"` + Path string `json:"path,omitempty"` + Value any `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2217,9 +1993,7 @@ func permissionToPb(st *Permission) (*permissionPb, error) { } pb := &permissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2227,11 +2001,9 @@ func permissionToPb(st *Permission) (*permissionPb, error) { } type permissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2263,9 +2035,7 @@ func permissionAssignmentToPb(st *PermissionAssignment) (*permissionAssignmentPb } pb := &permissionAssignmentPb{} pb.Error = st.Error - pb.Permissions = st.Permissions - pb.Principal = st.Principal pb.ForceSendFields = st.ForceSendFields @@ -2273,11 +2043,9 @@ func permissionAssignmentToPb(st *PermissionAssignment) (*permissionAssignmentPb } type permissionAssignmentPb struct { - Error string `json:"error,omitempty"` - + Error string `json:"error,omitempty"` Permissions []WorkspacePermission `json:"permissions,omitempty"` - - Principal *PrincipalOutput `json:"principal,omitempty"` + Principal *PrincipalOutput `json:"principal,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2333,7 +2101,6 @@ func permissionOutputToPb(st *PermissionOutput) (*permissionOutputPb, error) { } pb := &permissionOutputPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2341,8 +2108,7 @@ func permissionOutputToPb(st *PermissionOutput) (*permissionOutputPb, error) { } type permissionOutputPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel WorkspacePermission `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2374,7 +2140,6 @@ func permissionsDescriptionToPb(st *PermissionsDescription) (*permissionsDescrip } pb := &permissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2382,8 +2147,7 @@ func permissionsDescriptionToPb(st *PermissionsDescription) (*permissionsDescrip } type permissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel PermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2415,13 +2179,9 @@ func principalOutputToPb(st *PrincipalOutput) (*principalOutputPb, error) { } pb := &principalOutputPb{} pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.PrincipalId = st.PrincipalId - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2429,15 +2189,11 @@ func principalOutputToPb(st *PrincipalOutput) (*principalOutputPb, error) { } type principalOutputPb struct { - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - PrincipalId int64 `json:"principal_id,omitempty"` - + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PrincipalId int64 `json:"principal_id,omitempty"` ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2471,9 +2227,7 @@ func resourceInfoToPb(st *ResourceInfo) (*resourceInfoPb, error) { } pb := &resourceInfoPb{} pb.Id = st.Id - pb.LegacyAclPath = st.LegacyAclPath - pb.ParentResourceInfo = st.ParentResourceInfo pb.ForceSendFields = st.ForceSendFields @@ -2481,10 +2235,8 @@ func resourceInfoToPb(st *ResourceInfo) (*resourceInfoPb, error) { } type resourceInfoPb struct { - Id string `json:"id" url:"id"` - - LegacyAclPath string `json:"legacy_acl_path,omitempty" url:"legacy_acl_path,omitempty"` - + Id string `json:"id" url:"id"` + LegacyAclPath string `json:"legacy_acl_path,omitempty" url:"legacy_acl_path,omitempty"` ParentResourceInfo *ResourceInfo `json:"parent_resource_info,omitempty" url:"parent_resource_info,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2577,20 +2329,16 @@ func ruleSetResponseToPb(st *RuleSetResponse) (*ruleSetResponsePb, error) { } pb := &ruleSetResponsePb{} pb.Etag = st.Etag - pb.GrantRules = st.GrantRules - pb.Name = st.Name return pb, nil } type ruleSetResponsePb struct { - Etag string `json:"etag"` - + Etag string `json:"etag"` GrantRules []GrantRule `json:"grant_rules,omitempty"` - - Name string `json:"name"` + Name string `json:"name"` } func ruleSetResponseFromPb(pb *ruleSetResponsePb) (*RuleSetResponse, error) { @@ -2611,20 +2359,16 @@ func ruleSetUpdateRequestToPb(st *RuleSetUpdateRequest) (*ruleSetUpdateRequestPb } pb := &ruleSetUpdateRequestPb{} pb.Etag = st.Etag - pb.GrantRules = st.GrantRules - pb.Name = st.Name return pb, nil } type ruleSetUpdateRequestPb struct { - Etag string `json:"etag"` - + Etag string `json:"etag"` GrantRules []GrantRule `json:"grant_rules,omitempty"` - - Name string `json:"name"` + Name string `json:"name"` } func ruleSetUpdateRequestFromPb(pb *ruleSetUpdateRequestPb) (*RuleSetUpdateRequest, error) { @@ -2645,21 +2389,13 @@ func servicePrincipalToPb(st *ServicePrincipal) (*servicePrincipalPb, error) { } pb := &servicePrincipalPb{} pb.Active = st.Active - pb.ApplicationId = st.ApplicationId - pb.DisplayName = st.DisplayName - pb.Entitlements = st.Entitlements - pb.ExternalId = st.ExternalId - pb.Groups = st.Groups - pb.Id = st.Id - pb.Roles = st.Roles - pb.Schemas = st.Schemas pb.ForceSendFields = st.ForceSendFields @@ -2667,23 +2403,15 @@ func servicePrincipalToPb(st *ServicePrincipal) (*servicePrincipalPb, error) { } type servicePrincipalPb struct { - Active bool `json:"active,omitempty"` - - ApplicationId string `json:"applicationId,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - Entitlements []ComplexValue `json:"entitlements,omitempty"` - - ExternalId string `json:"externalId,omitempty"` - - Groups []ComplexValue `json:"groups,omitempty"` - - Id string `json:"id,omitempty" url:"-"` - - Roles []ComplexValue `json:"roles,omitempty"` - - Schemas []ServicePrincipalSchema `json:"schemas,omitempty"` + Active bool `json:"active,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Entitlements []ComplexValue `json:"entitlements,omitempty"` + ExternalId string `json:"externalId,omitempty"` + Groups []ComplexValue `json:"groups,omitempty"` + Id string `json:"id,omitempty" url:"-"` + Roles []ComplexValue `json:"roles,omitempty"` + Schemas []ServicePrincipalSchema `json:"schemas,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2721,9 +2449,7 @@ func setObjectPermissionsToPb(st *SetObjectPermissions) (*setObjectPermissionsPb } pb := &setObjectPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.RequestObjectId = st.RequestObjectId - pb.RequestObjectType = st.RequestObjectType return pb, nil @@ -2731,10 +2457,8 @@ func setObjectPermissionsToPb(st *SetObjectPermissions) (*setObjectPermissionsPb type setObjectPermissionsPb struct { AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` - - RequestObjectId string `json:"-" url:"-"` - - RequestObjectType string `json:"-" url:"-"` + RequestObjectId string `json:"-" url:"-"` + RequestObjectType string `json:"-" url:"-"` } func setObjectPermissionsFromPb(pb *setObjectPermissionsPb) (*SetObjectPermissions, error) { @@ -2755,9 +2479,7 @@ func updateObjectPermissionsToPb(st *UpdateObjectPermissions) (*updateObjectPerm } pb := &updateObjectPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.RequestObjectId = st.RequestObjectId - pb.RequestObjectType = st.RequestObjectType return pb, nil @@ -2765,10 +2487,8 @@ func updateObjectPermissionsToPb(st *UpdateObjectPermissions) (*updateObjectPerm type updateObjectPermissionsPb struct { AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` - - RequestObjectId string `json:"-" url:"-"` - - RequestObjectType string `json:"-" url:"-"` + RequestObjectId string `json:"-" url:"-"` + RequestObjectType string `json:"-" url:"-"` } func updateObjectPermissionsFromPb(pb *updateObjectPermissionsPb) (*UpdateObjectPermissions, error) { @@ -2810,15 +2530,13 @@ func updateRuleSetRequestToPb(st *UpdateRuleSetRequest) (*updateRuleSetRequestPb } pb := &updateRuleSetRequestPb{} pb.Name = st.Name - pb.RuleSet = st.RuleSet return pb, nil } type updateRuleSetRequestPb struct { - Name string `json:"name"` - + Name string `json:"name"` RuleSet RuleSetUpdateRequest `json:"rule_set"` } @@ -2839,9 +2557,7 @@ func updateWorkspaceAssignmentsToPb(st *UpdateWorkspaceAssignments) (*updateWork } pb := &updateWorkspaceAssignmentsPb{} pb.Permissions = st.Permissions - pb.PrincipalId = st.PrincipalId - pb.WorkspaceId = st.WorkspaceId return pb, nil @@ -2849,10 +2565,8 @@ func updateWorkspaceAssignmentsToPb(st *UpdateWorkspaceAssignments) (*updateWork type updateWorkspaceAssignmentsPb struct { Permissions []WorkspacePermission `json:"permissions,omitempty"` - - PrincipalId int64 `json:"-" url:"-"` - - WorkspaceId int64 `json:"-" url:"-"` + PrincipalId int64 `json:"-" url:"-"` + WorkspaceId int64 `json:"-" url:"-"` } func updateWorkspaceAssignmentsFromPb(pb *updateWorkspaceAssignmentsPb) (*UpdateWorkspaceAssignments, error) { @@ -2873,25 +2587,15 @@ func userToPb(st *User) (*userPb, error) { } pb := &userPb{} pb.Active = st.Active - pb.DisplayName = st.DisplayName - pb.Emails = st.Emails - pb.Entitlements = st.Entitlements - pb.ExternalId = st.ExternalId - pb.Groups = st.Groups - pb.Id = st.Id - pb.Name = st.Name - pb.Roles = st.Roles - pb.Schemas = st.Schemas - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2899,27 +2603,17 @@ func userToPb(st *User) (*userPb, error) { } type userPb struct { - Active bool `json:"active,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - Emails []ComplexValue `json:"emails,omitempty"` - + Active bool `json:"active,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Emails []ComplexValue `json:"emails,omitempty"` Entitlements []ComplexValue `json:"entitlements,omitempty"` - - ExternalId string `json:"externalId,omitempty"` - - Groups []ComplexValue `json:"groups,omitempty"` - - Id string `json:"id,omitempty" url:"-"` - - Name *Name `json:"name,omitempty"` - - Roles []ComplexValue `json:"roles,omitempty"` - - Schemas []UserSchema `json:"schemas,omitempty"` - - UserName string `json:"userName,omitempty"` + ExternalId string `json:"externalId,omitempty"` + Groups []ComplexValue `json:"groups,omitempty"` + Id string `json:"id,omitempty" url:"-"` + Name *Name `json:"name,omitempty"` + Roles []ComplexValue `json:"roles,omitempty"` + Schemas []UserSchema `json:"schemas,omitempty"` + UserName string `json:"userName,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2976,3 +2670,57 @@ func workspacePermissionsFromPb(pb *workspacePermissionsPb) (*WorkspacePermissio return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/iam/model.go b/service/iam/model.go index 62e93b5d9..bfe992226 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -5,8 +5,6 @@ package iam import ( "encoding/json" "fmt" - "strings" - "time" ) type AccessControlRequest struct { @@ -3360,57 +3358,3 @@ func (st WorkspacePermissions) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/jobs/internal.go b/service/jobs/internal.go index bc9919f8a..9efaccf35 100755 --- a/service/jobs/internal.go +++ b/service/jobs/internal.go @@ -3,6 +3,10 @@ package jobs import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" ) @@ -13,15 +17,10 @@ func baseJobToPb(st *BaseJob) (*baseJobPb, error) { } pb := &baseJobPb{} pb.CreatedTime = st.CreatedTime - pb.CreatorUserName = st.CreatorUserName - pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId - pb.HasMore = st.HasMore - pb.JobId = st.JobId - pb.Settings = st.Settings pb.ForceSendFields = st.ForceSendFields @@ -29,17 +28,12 @@ func baseJobToPb(st *BaseJob) (*baseJobPb, error) { } type baseJobPb struct { - CreatedTime int64 `json:"created_time,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` - - HasMore bool `json:"has_more,omitempty"` - - JobId int64 `json:"job_id,omitempty"` - - Settings *JobSettings `json:"settings,omitempty"` + CreatedTime int64 `json:"created_time,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + HasMore bool `json:"has_more,omitempty"` + JobId int64 `json:"job_id,omitempty"` + Settings *JobSettings `json:"settings,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -74,69 +68,37 @@ func baseRunToPb(st *BaseRun) (*baseRunPb, error) { } pb := &baseRunPb{} pb.AttemptNumber = st.AttemptNumber - pb.CleanupDuration = st.CleanupDuration - pb.ClusterInstance = st.ClusterInstance - pb.ClusterSpec = st.ClusterSpec - pb.CreatorUserName = st.CreatorUserName - pb.Description = st.Description - pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget - pb.EndTime = st.EndTime - pb.ExecutionDuration = st.ExecutionDuration - pb.GitSource = st.GitSource - pb.HasMore = st.HasMore - pb.JobClusters = st.JobClusters - pb.JobId = st.JobId - pb.JobParameters = st.JobParameters - pb.JobRunId = st.JobRunId - pb.NumberInJob = st.NumberInJob - pb.OriginalAttemptRunId = st.OriginalAttemptRunId - pb.OverridingParameters = st.OverridingParameters - pb.QueueDuration = st.QueueDuration - pb.RepairHistory = st.RepairHistory - pb.RunDuration = st.RunDuration - pb.RunId = st.RunId - pb.RunName = st.RunName - pb.RunPageUrl = st.RunPageUrl - pb.RunType = st.RunType - pb.Schedule = st.Schedule - pb.SetupDuration = st.SetupDuration - pb.StartTime = st.StartTime - pb.State = st.State - pb.Status = st.Status - pb.Tasks = st.Tasks - pb.Trigger = st.Trigger - pb.TriggerInfo = st.TriggerInfo pb.ForceSendFields = st.ForceSendFields @@ -144,71 +106,39 @@ func baseRunToPb(st *BaseRun) (*baseRunPb, error) { } type baseRunPb struct { - AttemptNumber int `json:"attempt_number,omitempty"` - - CleanupDuration int64 `json:"cleanup_duration,omitempty"` - - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` - - ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - Description string `json:"description,omitempty"` - - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` - - EndTime int64 `json:"end_time,omitempty"` - - ExecutionDuration int64 `json:"execution_duration,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - HasMore bool `json:"has_more,omitempty"` - - JobClusters []JobCluster `json:"job_clusters,omitempty"` - - JobId int64 `json:"job_id,omitempty"` - - JobParameters []JobParameter `json:"job_parameters,omitempty"` - - JobRunId int64 `json:"job_run_id,omitempty"` - - NumberInJob int64 `json:"number_in_job,omitempty"` - - OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` - - OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` - - QueueDuration int64 `json:"queue_duration,omitempty"` - - RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` - - RunDuration int64 `json:"run_duration,omitempty"` - - RunId int64 `json:"run_id,omitempty"` - - RunName string `json:"run_name,omitempty"` - - RunPageUrl string `json:"run_page_url,omitempty"` - - RunType RunType `json:"run_type,omitempty"` - - Schedule *CronSchedule `json:"schedule,omitempty"` - - SetupDuration int64 `json:"setup_duration,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - State *RunState `json:"state,omitempty"` - - Status *RunStatus `json:"status,omitempty"` - - Tasks []RunTask `json:"tasks,omitempty"` - - Trigger TriggerType `json:"trigger,omitempty"` - - TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + AttemptNumber int `json:"attempt_number,omitempty"` + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + Description string `json:"description,omitempty"` + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + ExecutionDuration int64 `json:"execution_duration,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + HasMore bool `json:"has_more,omitempty"` + JobClusters []JobCluster `json:"job_clusters,omitempty"` + JobId int64 `json:"job_id,omitempty"` + JobParameters []JobParameter `json:"job_parameters,omitempty"` + JobRunId int64 `json:"job_run_id,omitempty"` + NumberInJob int64 `json:"number_in_job,omitempty"` + OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + QueueDuration int64 `json:"queue_duration,omitempty"` + RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + RunDuration int64 `json:"run_duration,omitempty"` + RunId int64 `json:"run_id,omitempty"` + RunName string `json:"run_name,omitempty"` + RunPageUrl string `json:"run_page_url,omitempty"` + RunType RunType `json:"run_type,omitempty"` + Schedule *CronSchedule `json:"schedule,omitempty"` + SetupDuration int64 `json:"setup_duration,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + State *RunState `json:"state,omitempty"` + Status *RunStatus `json:"status,omitempty"` + Tasks []RunTask `json:"tasks,omitempty"` + Trigger TriggerType `json:"trigger,omitempty"` + TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -270,7 +200,6 @@ func cancelAllRunsToPb(st *CancelAllRuns) (*cancelAllRunsPb, error) { } pb := &cancelAllRunsPb{} pb.AllQueuedRuns = st.AllQueuedRuns - pb.JobId = st.JobId pb.ForceSendFields = st.ForceSendFields @@ -278,9 +207,8 @@ func cancelAllRunsToPb(st *CancelAllRuns) (*cancelAllRunsPb, error) { } type cancelAllRunsPb struct { - AllQueuedRuns bool `json:"all_queued_runs,omitempty"` - - JobId int64 `json:"job_id,omitempty"` + AllQueuedRuns bool `json:"all_queued_runs,omitempty"` + JobId int64 `json:"job_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -377,7 +305,6 @@ func cleanRoomTaskRunStateToPb(st *CleanRoomTaskRunState) (*cleanRoomTaskRunStat } pb := &cleanRoomTaskRunStatePb{} pb.LifeCycleState = st.LifeCycleState - pb.ResultState = st.ResultState return pb, nil @@ -385,8 +312,7 @@ func cleanRoomTaskRunStateToPb(st *CleanRoomTaskRunState) (*cleanRoomTaskRunStat type cleanRoomTaskRunStatePb struct { LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` - - ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` + ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` } func cleanRoomTaskRunStateFromPb(pb *cleanRoomTaskRunStatePb) (*CleanRoomTaskRunState, error) { @@ -406,11 +332,8 @@ func cleanRoomsNotebookTaskToPb(st *CleanRoomsNotebookTask) (*cleanRoomsNotebook } pb := &cleanRoomsNotebookTaskPb{} pb.CleanRoomName = st.CleanRoomName - pb.Etag = st.Etag - pb.NotebookBaseParameters = st.NotebookBaseParameters - pb.NotebookName = st.NotebookName pb.ForceSendFields = st.ForceSendFields @@ -418,13 +341,10 @@ func cleanRoomsNotebookTaskToPb(st *CleanRoomsNotebookTask) (*cleanRoomsNotebook } type cleanRoomsNotebookTaskPb struct { - CleanRoomName string `json:"clean_room_name"` - - Etag string `json:"etag,omitempty"` - + CleanRoomName string `json:"clean_room_name"` + Etag string `json:"etag,omitempty"` NotebookBaseParameters map[string]string `json:"notebook_base_parameters,omitempty"` - - NotebookName string `json:"notebook_name"` + NotebookName string `json:"notebook_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -457,9 +377,7 @@ func cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputToPb(st *CleanRoomsNotebo } pb := &cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb{} pb.CleanRoomJobRunState = st.CleanRoomJobRunState - pb.NotebookOutput = st.NotebookOutput - pb.OutputSchemaInfo = st.OutputSchemaInfo return pb, nil @@ -467,10 +385,8 @@ func cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputToPb(st *CleanRoomsNotebo type cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb struct { CleanRoomJobRunState *CleanRoomTaskRunState `json:"clean_room_job_run_state,omitempty"` - - NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` - - OutputSchemaInfo *OutputSchemaInfo `json:"output_schema_info,omitempty"` + NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + OutputSchemaInfo *OutputSchemaInfo `json:"output_schema_info,omitempty"` } func cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputFromPb(pb *cleanRoomsNotebookTaskCleanRoomsNotebookTaskOutputPb) (*CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput, error) { @@ -491,7 +407,6 @@ func clusterInstanceToPb(st *ClusterInstance) (*clusterInstancePb, error) { } pb := &clusterInstancePb{} pb.ClusterId = st.ClusterId - pb.SparkContextId = st.SparkContextId pb.ForceSendFields = st.ForceSendFields @@ -499,8 +414,7 @@ func clusterInstanceToPb(st *ClusterInstance) (*clusterInstancePb, error) { } type clusterInstancePb struct { - ClusterId string `json:"cluster_id,omitempty"` - + ClusterId string `json:"cluster_id,omitempty"` SparkContextId string `json:"spark_context_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -532,11 +446,8 @@ func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { } pb := &clusterSpecPb{} pb.ExistingClusterId = st.ExistingClusterId - pb.JobClusterKey = st.JobClusterKey - pb.Libraries = st.Libraries - pb.NewCluster = st.NewCluster pb.ForceSendFields = st.ForceSendFields @@ -544,13 +455,10 @@ func clusterSpecToPb(st *ClusterSpec) (*clusterSpecPb, error) { } type clusterSpecPb struct { - ExistingClusterId string `json:"existing_cluster_id,omitempty"` - - JobClusterKey string `json:"job_cluster_key,omitempty"` - - Libraries []compute.Library `json:"libraries,omitempty"` - - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + JobClusterKey string `json:"job_cluster_key,omitempty"` + Libraries []compute.Library `json:"libraries,omitempty"` + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -583,9 +491,7 @@ func computeConfigToPb(st *ComputeConfig) (*computeConfigPb, error) { } pb := &computeConfigPb{} pb.GpuNodePoolId = st.GpuNodePoolId - pb.GpuType = st.GpuType - pb.NumGpus = st.NumGpus pb.ForceSendFields = st.ForceSendFields @@ -594,10 +500,8 @@ func computeConfigToPb(st *ComputeConfig) (*computeConfigPb, error) { type computeConfigPb struct { GpuNodePoolId string `json:"gpu_node_pool_id,omitempty"` - - GpuType string `json:"gpu_type,omitempty"` - - NumGpus int `json:"num_gpus"` + GpuType string `json:"gpu_type,omitempty"` + NumGpus int `json:"num_gpus"` ForceSendFields []string `json:"-" url:"-"` } @@ -629,20 +533,16 @@ func conditionTaskToPb(st *ConditionTask) (*conditionTaskPb, error) { } pb := &conditionTaskPb{} pb.Left = st.Left - pb.Op = st.Op - pb.Right = st.Right return pb, nil } type conditionTaskPb struct { - Left string `json:"left"` - - Op ConditionTaskOp `json:"op"` - - Right string `json:"right"` + Left string `json:"left"` + Op ConditionTaskOp `json:"op"` + Right string `json:"right"` } func conditionTaskFromPb(pb *conditionTaskPb) (*ConditionTask, error) { @@ -687,53 +587,29 @@ func createJobToPb(st *CreateJob) (*createJobPb, error) { } pb := &createJobPb{} pb.AccessControlList = st.AccessControlList - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Continuous = st.Continuous - pb.Deployment = st.Deployment - pb.Description = st.Description - pb.EditMode = st.EditMode - pb.EmailNotifications = st.EmailNotifications - pb.Environments = st.Environments - pb.Format = st.Format - pb.GitSource = st.GitSource - pb.Health = st.Health - pb.JobClusters = st.JobClusters - pb.MaxConcurrentRuns = st.MaxConcurrentRuns - pb.Name = st.Name - pb.NotificationSettings = st.NotificationSettings - pb.Parameters = st.Parameters - pb.PerformanceTarget = st.PerformanceTarget - pb.Queue = st.Queue - pb.RunAs = st.RunAs - pb.Schedule = st.Schedule - pb.Tags = st.Tags - pb.Tasks = st.Tasks - pb.TimeoutSeconds = st.TimeoutSeconds - pb.Trigger = st.Trigger - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -741,55 +617,31 @@ func createJobToPb(st *CreateJob) (*createJobPb, error) { } type createJobPb struct { - AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Continuous *Continuous `json:"continuous,omitempty"` - - Deployment *JobDeployment `json:"deployment,omitempty"` - - Description string `json:"description,omitempty"` - - EditMode JobEditMode `json:"edit_mode,omitempty"` - - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - - Environments []JobEnvironment `json:"environments,omitempty"` - - Format Format `json:"format,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - Health *JobsHealthRules `json:"health,omitempty"` - - JobClusters []JobCluster `json:"job_clusters,omitempty"` - - MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` - - Name string `json:"name,omitempty"` - - NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` - - Parameters []JobParameterDefinition `json:"parameters,omitempty"` - - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` - - Queue *QueueSettings `json:"queue,omitempty"` - - RunAs *JobRunAs `json:"run_as,omitempty"` - - Schedule *CronSchedule `json:"schedule,omitempty"` - - Tags map[string]string `json:"tags,omitempty"` - - Tasks []Task `json:"tasks,omitempty"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - Trigger *TriggerSettings `json:"trigger,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Continuous *Continuous `json:"continuous,omitempty"` + Deployment *JobDeployment `json:"deployment,omitempty"` + Description string `json:"description,omitempty"` + EditMode JobEditMode `json:"edit_mode,omitempty"` + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + Environments []JobEnvironment `json:"environments,omitempty"` + Format Format `json:"format,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + Health *JobsHealthRules `json:"health,omitempty"` + JobClusters []JobCluster `json:"job_clusters,omitempty"` + MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + Name string `json:"name,omitempty"` + NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + Parameters []JobParameterDefinition `json:"parameters,omitempty"` + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + Queue *QueueSettings `json:"queue,omitempty"` + RunAs *JobRunAs `json:"run_as,omitempty"` + Schedule *CronSchedule `json:"schedule,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Tasks []Task `json:"tasks,omitempty"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + Trigger *TriggerSettings `json:"trigger,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -879,20 +731,16 @@ func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { } pb := &cronSchedulePb{} pb.PauseStatus = st.PauseStatus - pb.QuartzCronExpression = st.QuartzCronExpression - pb.TimezoneId = st.TimezoneId return pb, nil } type cronSchedulePb struct { - PauseStatus PauseStatus `json:"pause_status,omitempty"` - - QuartzCronExpression string `json:"quartz_cron_expression"` - - TimezoneId string `json:"timezone_id"` + PauseStatus PauseStatus `json:"pause_status,omitempty"` + QuartzCronExpression string `json:"quartz_cron_expression"` + TimezoneId string `json:"timezone_id"` } func cronScheduleFromPb(pb *cronSchedulePb) (*CronSchedule, error) { @@ -913,7 +761,6 @@ func dashboardPageSnapshotToPb(st *DashboardPageSnapshot) (*dashboardPageSnapsho } pb := &dashboardPageSnapshotPb{} pb.PageDisplayName = st.PageDisplayName - pb.WidgetErrorDetails = st.WidgetErrorDetails pb.ForceSendFields = st.ForceSendFields @@ -921,8 +768,7 @@ func dashboardPageSnapshotToPb(st *DashboardPageSnapshot) (*dashboardPageSnapsho } type dashboardPageSnapshotPb struct { - PageDisplayName string `json:"page_display_name,omitempty"` - + PageDisplayName string `json:"page_display_name,omitempty"` WidgetErrorDetails []WidgetErrorDetail `json:"widget_error_details,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -954,9 +800,7 @@ func dashboardTaskToPb(st *DashboardTask) (*dashboardTaskPb, error) { } pb := &dashboardTaskPb{} pb.DashboardId = st.DashboardId - pb.Subscription = st.Subscription - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -964,11 +808,9 @@ func dashboardTaskToPb(st *DashboardTask) (*dashboardTaskPb, error) { } type dashboardTaskPb struct { - DashboardId string `json:"dashboard_id,omitempty"` - + DashboardId string `json:"dashboard_id,omitempty"` Subscription *Subscription `json:"subscription,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1024,7 +866,6 @@ func dbtOutputToPb(st *DbtOutput) (*dbtOutputPb, error) { } pb := &dbtOutputPb{} pb.ArtifactsHeaders = st.ArtifactsHeaders - pb.ArtifactsLink = st.ArtifactsLink pb.ForceSendFields = st.ForceSendFields @@ -1033,8 +874,7 @@ func dbtOutputToPb(st *DbtOutput) (*dbtOutputPb, error) { type dbtOutputPb struct { ArtifactsHeaders map[string]string `json:"artifacts_headers,omitempty"` - - ArtifactsLink string `json:"artifacts_link,omitempty"` + ArtifactsLink string `json:"artifacts_link,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1065,17 +905,11 @@ func dbtTaskToPb(st *DbtTask) (*dbtTaskPb, error) { } pb := &dbtTaskPb{} pb.Catalog = st.Catalog - pb.Commands = st.Commands - pb.ProfilesDirectory = st.ProfilesDirectory - pb.ProjectDirectory = st.ProjectDirectory - pb.Schema = st.Schema - pb.Source = st.Source - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -1083,19 +917,13 @@ func dbtTaskToPb(st *DbtTask) (*dbtTaskPb, error) { } type dbtTaskPb struct { - Catalog string `json:"catalog,omitempty"` - - Commands []string `json:"commands"` - - ProfilesDirectory string `json:"profiles_directory,omitempty"` - - ProjectDirectory string `json:"project_directory,omitempty"` - - Schema string `json:"schema,omitempty"` - - Source Source `json:"source,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + Catalog string `json:"catalog,omitempty"` + Commands []string `json:"commands"` + ProfilesDirectory string `json:"profiles_directory,omitempty"` + ProjectDirectory string `json:"project_directory,omitempty"` + Schema string `json:"schema,omitempty"` + Source Source `json:"source,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1221,9 +1049,7 @@ func enforcePolicyComplianceForJobResponseJobClusterSettingsChangeToPb(st *Enfor } pb := &enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb{} pb.Field = st.Field - pb.NewValue = st.NewValue - pb.PreviousValue = st.PreviousValue pb.ForceSendFields = st.ForceSendFields @@ -1231,10 +1057,8 @@ func enforcePolicyComplianceForJobResponseJobClusterSettingsChangeToPb(st *Enfor } type enforcePolicyComplianceForJobResponseJobClusterSettingsChangePb struct { - Field string `json:"field,omitempty"` - - NewValue string `json:"new_value,omitempty"` - + Field string `json:"field,omitempty"` + NewValue string `json:"new_value,omitempty"` PreviousValue string `json:"previous_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1267,7 +1091,6 @@ func enforcePolicyComplianceRequestToPb(st *EnforcePolicyComplianceRequest) (*en } pb := &enforcePolicyComplianceRequestPb{} pb.JobId = st.JobId - pb.ValidateOnly = st.ValidateOnly pb.ForceSendFields = st.ForceSendFields @@ -1275,9 +1098,8 @@ func enforcePolicyComplianceRequestToPb(st *EnforcePolicyComplianceRequest) (*en } type enforcePolicyComplianceRequestPb struct { - JobId int64 `json:"job_id"` - - ValidateOnly bool `json:"validate_only,omitempty"` + JobId int64 `json:"job_id"` + ValidateOnly bool `json:"validate_only,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1308,9 +1130,7 @@ func enforcePolicyComplianceResponseToPb(st *EnforcePolicyComplianceResponse) (* } pb := &enforcePolicyComplianceResponsePb{} pb.HasChanges = st.HasChanges - pb.JobClusterChanges = st.JobClusterChanges - pb.Settings = st.Settings pb.ForceSendFields = st.ForceSendFields @@ -1318,11 +1138,9 @@ func enforcePolicyComplianceResponseToPb(st *EnforcePolicyComplianceResponse) (* } type enforcePolicyComplianceResponsePb struct { - HasChanges bool `json:"has_changes,omitempty"` - + HasChanges bool `json:"has_changes,omitempty"` JobClusterChanges []EnforcePolicyComplianceForJobResponseJobClusterSettingsChange `json:"job_cluster_changes,omitempty"` - - Settings *JobSettings `json:"settings,omitempty"` + Settings *JobSettings `json:"settings,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1378,15 +1196,13 @@ func exportRunRequestToPb(st *ExportRunRequest) (*exportRunRequestPb, error) { } pb := &exportRunRequestPb{} pb.RunId = st.RunId - pb.ViewsToExport = st.ViewsToExport return pb, nil } type exportRunRequestPb struct { - RunId int64 `json:"-" url:"run_id"` - + RunId int64 `json:"-" url:"run_id"` ViewsToExport ViewsToExport `json:"-" url:"views_to_export,omitempty"` } @@ -1407,9 +1223,7 @@ func fileArrivalTriggerConfigurationToPb(st *FileArrivalTriggerConfiguration) (* } pb := &fileArrivalTriggerConfigurationPb{} pb.MinTimeBetweenTriggersSeconds = st.MinTimeBetweenTriggersSeconds - pb.Url = st.Url - pb.WaitAfterLastChangeSeconds = st.WaitAfterLastChangeSeconds pb.ForceSendFields = st.ForceSendFields @@ -1417,11 +1231,9 @@ func fileArrivalTriggerConfigurationToPb(st *FileArrivalTriggerConfiguration) (* } type fileArrivalTriggerConfigurationPb struct { - MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` - - Url string `json:"url"` - - WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + Url string `json:"url"` + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1453,7 +1265,6 @@ func forEachStatsToPb(st *ForEachStats) (*forEachStatsPb, error) { } pb := &forEachStatsPb{} pb.ErrorMessageStats = st.ErrorMessageStats - pb.TaskRunStats = st.TaskRunStats return pb, nil @@ -1461,8 +1272,7 @@ func forEachStatsToPb(st *ForEachStats) (*forEachStatsPb, error) { type forEachStatsPb struct { ErrorMessageStats []ForEachTaskErrorMessageStats `json:"error_message_stats,omitempty"` - - TaskRunStats *ForEachTaskTaskRunStats `json:"task_run_stats,omitempty"` + TaskRunStats *ForEachTaskTaskRunStats `json:"task_run_stats,omitempty"` } func forEachStatsFromPb(pb *forEachStatsPb) (*ForEachStats, error) { @@ -1482,9 +1292,7 @@ func forEachTaskToPb(st *ForEachTask) (*forEachTaskPb, error) { } pb := &forEachTaskPb{} pb.Concurrency = st.Concurrency - pb.Inputs = st.Inputs - pb.Task = st.Task pb.ForceSendFields = st.ForceSendFields @@ -1492,11 +1300,9 @@ func forEachTaskToPb(st *ForEachTask) (*forEachTaskPb, error) { } type forEachTaskPb struct { - Concurrency int `json:"concurrency,omitempty"` - - Inputs string `json:"inputs"` - - Task Task `json:"task"` + Concurrency int `json:"concurrency,omitempty"` + Inputs string `json:"inputs"` + Task Task `json:"task"` ForceSendFields []string `json:"-" url:"-"` } @@ -1528,9 +1334,7 @@ func forEachTaskErrorMessageStatsToPb(st *ForEachTaskErrorMessageStats) (*forEac } pb := &forEachTaskErrorMessageStatsPb{} pb.Count = st.Count - pb.ErrorMessage = st.ErrorMessage - pb.TerminationCategory = st.TerminationCategory pb.ForceSendFields = st.ForceSendFields @@ -1538,10 +1342,8 @@ func forEachTaskErrorMessageStatsToPb(st *ForEachTaskErrorMessageStats) (*forEac } type forEachTaskErrorMessageStatsPb struct { - Count int `json:"count,omitempty"` - - ErrorMessage string `json:"error_message,omitempty"` - + Count int `json:"count,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` TerminationCategory string `json:"termination_category,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1574,15 +1376,10 @@ func forEachTaskTaskRunStatsToPb(st *ForEachTaskTaskRunStats) (*forEachTaskTaskR } pb := &forEachTaskTaskRunStatsPb{} pb.ActiveIterations = st.ActiveIterations - pb.CompletedIterations = st.CompletedIterations - pb.FailedIterations = st.FailedIterations - pb.ScheduledIterations = st.ScheduledIterations - pb.SucceededIterations = st.SucceededIterations - pb.TotalIterations = st.TotalIterations pb.ForceSendFields = st.ForceSendFields @@ -1590,17 +1387,12 @@ func forEachTaskTaskRunStatsToPb(st *ForEachTaskTaskRunStats) (*forEachTaskTaskR } type forEachTaskTaskRunStatsPb struct { - ActiveIterations int `json:"active_iterations,omitempty"` - + ActiveIterations int `json:"active_iterations,omitempty"` CompletedIterations int `json:"completed_iterations,omitempty"` - - FailedIterations int `json:"failed_iterations,omitempty"` - + FailedIterations int `json:"failed_iterations,omitempty"` ScheduledIterations int `json:"scheduled_iterations,omitempty"` - SucceededIterations int `json:"succeeded_iterations,omitempty"` - - TotalIterations int `json:"total_iterations,omitempty"` + TotalIterations int `json:"total_iterations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1635,19 +1427,12 @@ func genAiComputeTaskToPb(st *GenAiComputeTask) (*genAiComputeTaskPb, error) { } pb := &genAiComputeTaskPb{} pb.Command = st.Command - pb.Compute = st.Compute - pb.DlRuntimeImage = st.DlRuntimeImage - pb.MlflowExperimentName = st.MlflowExperimentName - pb.Source = st.Source - pb.TrainingScriptPath = st.TrainingScriptPath - pb.YamlParameters = st.YamlParameters - pb.YamlParametersFilePath = st.YamlParametersFilePath pb.ForceSendFields = st.ForceSendFields @@ -1655,21 +1440,14 @@ func genAiComputeTaskToPb(st *GenAiComputeTask) (*genAiComputeTaskPb, error) { } type genAiComputeTaskPb struct { - Command string `json:"command,omitempty"` - - Compute *ComputeConfig `json:"compute,omitempty"` - - DlRuntimeImage string `json:"dl_runtime_image"` - - MlflowExperimentName string `json:"mlflow_experiment_name,omitempty"` - - Source Source `json:"source,omitempty"` - - TrainingScriptPath string `json:"training_script_path,omitempty"` - - YamlParameters string `json:"yaml_parameters,omitempty"` - - YamlParametersFilePath string `json:"yaml_parameters_file_path,omitempty"` + Command string `json:"command,omitempty"` + Compute *ComputeConfig `json:"compute,omitempty"` + DlRuntimeImage string `json:"dl_runtime_image"` + MlflowExperimentName string `json:"mlflow_experiment_name,omitempty"` + Source Source `json:"source,omitempty"` + TrainingScriptPath string `json:"training_script_path,omitempty"` + YamlParameters string `json:"yaml_parameters,omitempty"` + YamlParametersFilePath string `json:"yaml_parameters_file_path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1778,7 +1556,6 @@ func getJobRequestToPb(st *GetJobRequest) (*getJobRequestPb, error) { } pb := &getJobRequestPb{} pb.JobId = st.JobId - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1786,8 +1563,7 @@ func getJobRequestToPb(st *GetJobRequest) (*getJobRequestPb, error) { } type getJobRequestPb struct { - JobId int64 `json:"-" url:"job_id"` - + JobId int64 `json:"-" url:"job_id"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1843,7 +1619,6 @@ func getPolicyComplianceResponseToPb(st *GetPolicyComplianceResponse) (*getPolic } pb := &getPolicyComplianceResponsePb{} pb.IsCompliant = st.IsCompliant - pb.Violations = st.Violations pb.ForceSendFields = st.ForceSendFields @@ -1851,9 +1626,8 @@ func getPolicyComplianceResponseToPb(st *GetPolicyComplianceResponse) (*getPolic } type getPolicyComplianceResponsePb struct { - IsCompliant bool `json:"is_compliant,omitempty"` - - Violations map[string]string `json:"violations,omitempty"` + IsCompliant bool `json:"is_compliant,omitempty"` + Violations map[string]string `json:"violations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1908,11 +1682,8 @@ func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { } pb := &getRunRequestPb{} pb.IncludeHistory = st.IncludeHistory - pb.IncludeResolvedValues = st.IncludeResolvedValues - pb.PageToken = st.PageToken - pb.RunId = st.RunId pb.ForceSendFields = st.ForceSendFields @@ -1920,13 +1691,10 @@ func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { } type getRunRequestPb struct { - IncludeHistory bool `json:"-" url:"include_history,omitempty"` - - IncludeResolvedValues bool `json:"-" url:"include_resolved_values,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - RunId int64 `json:"-" url:"run_id"` + IncludeHistory bool `json:"-" url:"include_history,omitempty"` + IncludeResolvedValues bool `json:"-" url:"include_resolved_values,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + RunId int64 `json:"-" url:"run_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -1995,17 +1763,11 @@ func gitSourceToPb(st *GitSource) (*gitSourcePb, error) { } pb := &gitSourcePb{} pb.GitBranch = st.GitBranch - pb.GitCommit = st.GitCommit - pb.GitProvider = st.GitProvider - pb.GitSnapshot = st.GitSnapshot - pb.GitTag = st.GitTag - pb.GitUrl = st.GitUrl - pb.JobSource = st.JobSource pb.ForceSendFields = st.ForceSendFields @@ -2013,19 +1775,13 @@ func gitSourceToPb(st *GitSource) (*gitSourcePb, error) { } type gitSourcePb struct { - GitBranch string `json:"git_branch,omitempty"` - - GitCommit string `json:"git_commit,omitempty"` - - GitProvider GitProvider `json:"git_provider"` - + GitBranch string `json:"git_branch,omitempty"` + GitCommit string `json:"git_commit,omitempty"` + GitProvider GitProvider `json:"git_provider"` GitSnapshot *GitSnapshot `json:"git_snapshot,omitempty"` - - GitTag string `json:"git_tag,omitempty"` - - GitUrl string `json:"git_url"` - - JobSource *JobSource `json:"job_source,omitempty"` + GitTag string `json:"git_tag,omitempty"` + GitUrl string `json:"git_url"` + JobSource *JobSource `json:"job_source,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2061,19 +1817,12 @@ func jobToPb(st *Job) (*jobPb, error) { } pb := &jobPb{} pb.CreatedTime = st.CreatedTime - pb.CreatorUserName = st.CreatorUserName - pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId - pb.HasMore = st.HasMore - pb.JobId = st.JobId - pb.NextPageToken = st.NextPageToken - pb.RunAsUserName = st.RunAsUserName - pb.Settings = st.Settings pb.ForceSendFields = st.ForceSendFields @@ -2081,21 +1830,14 @@ func jobToPb(st *Job) (*jobPb, error) { } type jobPb struct { - CreatedTime int64 `json:"created_time,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` - - HasMore bool `json:"has_more,omitempty"` - - JobId int64 `json:"job_id,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - RunAsUserName string `json:"run_as_user_name,omitempty"` - - Settings *JobSettings `json:"settings,omitempty"` + CreatedTime int64 `json:"created_time,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + HasMore bool `json:"has_more,omitempty"` + JobId int64 `json:"job_id,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + RunAsUserName string `json:"run_as_user_name,omitempty"` + Settings *JobSettings `json:"settings,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2132,11 +1874,8 @@ func jobAccessControlRequestToPb(st *JobAccessControlRequest) (*jobAccessControl } pb := &jobAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2144,13 +1883,10 @@ func jobAccessControlRequestToPb(st *JobAccessControlRequest) (*jobAccessControl } type jobAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2183,13 +1919,9 @@ func jobAccessControlResponseToPb(st *JobAccessControlResponse) (*jobAccessContr } pb := &jobAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2197,15 +1929,11 @@ func jobAccessControlResponseToPb(st *JobAccessControlResponse) (*jobAccessContr } type jobAccessControlResponsePb struct { - AllPermissions []JobPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []JobPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2239,16 +1967,14 @@ func jobClusterToPb(st *JobCluster) (*jobClusterPb, error) { } pb := &jobClusterPb{} pb.JobClusterKey = st.JobClusterKey - pb.NewCluster = st.NewCluster return pb, nil } type jobClusterPb struct { - JobClusterKey string `json:"job_cluster_key"` - - NewCluster compute.ClusterSpec `json:"new_cluster"` + JobClusterKey string `json:"job_cluster_key"` + NewCluster compute.ClusterSpec `json:"new_cluster"` } func jobClusterFromPb(pb *jobClusterPb) (*JobCluster, error) { @@ -2268,9 +1994,7 @@ func jobComplianceToPb(st *JobCompliance) (*jobCompliancePb, error) { } pb := &jobCompliancePb{} pb.IsCompliant = st.IsCompliant - pb.JobId = st.JobId - pb.Violations = st.Violations pb.ForceSendFields = st.ForceSendFields @@ -2278,11 +2002,9 @@ func jobComplianceToPb(st *JobCompliance) (*jobCompliancePb, error) { } type jobCompliancePb struct { - IsCompliant bool `json:"is_compliant,omitempty"` - - JobId int64 `json:"job_id"` - - Violations map[string]string `json:"violations,omitempty"` + IsCompliant bool `json:"is_compliant,omitempty"` + JobId int64 `json:"job_id"` + Violations map[string]string `json:"violations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2314,7 +2036,6 @@ func jobDeploymentToPb(st *JobDeployment) (*jobDeploymentPb, error) { } pb := &jobDeploymentPb{} pb.Kind = st.Kind - pb.MetadataFilePath = st.MetadataFilePath pb.ForceSendFields = st.ForceSendFields @@ -2322,9 +2043,8 @@ func jobDeploymentToPb(st *JobDeployment) (*jobDeploymentPb, error) { } type jobDeploymentPb struct { - Kind JobDeploymentKind `json:"kind"` - - MetadataFilePath string `json:"metadata_file_path,omitempty"` + Kind JobDeploymentKind `json:"kind"` + MetadataFilePath string `json:"metadata_file_path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2355,15 +2075,10 @@ func jobEmailNotificationsToPb(st *JobEmailNotifications) (*jobEmailNotification } pb := &jobEmailNotificationsPb{} pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns - pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded - pb.OnFailure = st.OnFailure - pb.OnStart = st.OnStart - pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded - pb.OnSuccess = st.OnSuccess pb.ForceSendFields = st.ForceSendFields @@ -2371,17 +2086,12 @@ func jobEmailNotificationsToPb(st *JobEmailNotifications) (*jobEmailNotification } type jobEmailNotificationsPb struct { - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` - + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` - - OnFailure []string `json:"on_failure,omitempty"` - - OnStart []string `json:"on_start,omitempty"` - - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` - - OnSuccess []string `json:"on_success,omitempty"` + OnFailure []string `json:"on_failure,omitempty"` + OnStart []string `json:"on_start,omitempty"` + OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + OnSuccess []string `json:"on_success,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2416,16 +2126,14 @@ func jobEnvironmentToPb(st *JobEnvironment) (*jobEnvironmentPb, error) { } pb := &jobEnvironmentPb{} pb.EnvironmentKey = st.EnvironmentKey - pb.Spec = st.Spec return pb, nil } type jobEnvironmentPb struct { - EnvironmentKey string `json:"environment_key"` - - Spec *compute.Environment `json:"spec,omitempty"` + EnvironmentKey string `json:"environment_key"` + Spec *compute.Environment `json:"spec,omitempty"` } func jobEnvironmentFromPb(pb *jobEnvironmentPb) (*JobEnvironment, error) { @@ -2445,7 +2153,6 @@ func jobNotificationSettingsToPb(st *JobNotificationSettings) (*jobNotificationS } pb := &jobNotificationSettingsPb{} pb.NoAlertForCanceledRuns = st.NoAlertForCanceledRuns - pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns pb.ForceSendFields = st.ForceSendFields @@ -2454,8 +2161,7 @@ func jobNotificationSettingsToPb(st *JobNotificationSettings) (*jobNotificationS type jobNotificationSettingsPb struct { NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` - - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2486,9 +2192,7 @@ func jobParameterToPb(st *JobParameter) (*jobParameterPb, error) { } pb := &jobParameterPb{} pb.Default = st.Default - pb.Name = st.Name - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -2497,10 +2201,8 @@ func jobParameterToPb(st *JobParameter) (*jobParameterPb, error) { type jobParameterPb struct { Default string `json:"default,omitempty"` - - Name string `json:"name,omitempty"` - - Value string `json:"value,omitempty"` + Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2532,7 +2234,6 @@ func jobParameterDefinitionToPb(st *JobParameterDefinition) (*jobParameterDefini } pb := &jobParameterDefinitionPb{} pb.Default = st.Default - pb.Name = st.Name return pb, nil @@ -2540,8 +2241,7 @@ func jobParameterDefinitionToPb(st *JobParameterDefinition) (*jobParameterDefini type jobParameterDefinitionPb struct { Default string `json:"default"` - - Name string `json:"name"` + Name string `json:"name"` } func jobParameterDefinitionFromPb(pb *jobParameterDefinitionPb) (*JobParameterDefinition, error) { @@ -2561,9 +2261,7 @@ func jobPermissionToPb(st *JobPermission) (*jobPermissionPb, error) { } pb := &jobPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2571,11 +2269,9 @@ func jobPermissionToPb(st *JobPermission) (*jobPermissionPb, error) { } type jobPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2607,9 +2303,7 @@ func jobPermissionsToPb(st *JobPermissions) (*jobPermissionsPb, error) { } pb := &jobPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2618,10 +2312,8 @@ func jobPermissionsToPb(st *JobPermissions) (*jobPermissionsPb, error) { type jobPermissionsPb struct { AccessControlList []JobAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2653,7 +2345,6 @@ func jobPermissionsDescriptionToPb(st *JobPermissionsDescription) (*jobPermissio } pb := &jobPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2661,8 +2352,7 @@ func jobPermissionsDescriptionToPb(st *JobPermissionsDescription) (*jobPermissio } type jobPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2694,7 +2384,6 @@ func jobPermissionsRequestToPb(st *JobPermissionsRequest) (*jobPermissionsReques } pb := &jobPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.JobId = st.JobId return pb, nil @@ -2702,8 +2391,7 @@ func jobPermissionsRequestToPb(st *JobPermissionsRequest) (*jobPermissionsReques type jobPermissionsRequestPb struct { AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` - - JobId string `json:"-" url:"-"` + JobId string `json:"-" url:"-"` } func jobPermissionsRequestFromPb(pb *jobPermissionsRequestPb) (*JobPermissionsRequest, error) { @@ -2723,7 +2411,6 @@ func jobRunAsToPb(st *JobRunAs) (*jobRunAsPb, error) { } pb := &jobRunAsPb{} pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2732,8 +2419,7 @@ func jobRunAsToPb(st *JobRunAs) (*jobRunAsPb, error) { type jobRunAsPb struct { ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2764,51 +2450,28 @@ func jobSettingsToPb(st *JobSettings) (*jobSettingsPb, error) { } pb := &jobSettingsPb{} pb.BudgetPolicyId = st.BudgetPolicyId - pb.Continuous = st.Continuous - pb.Deployment = st.Deployment - pb.Description = st.Description - pb.EditMode = st.EditMode - pb.EmailNotifications = st.EmailNotifications - pb.Environments = st.Environments - pb.Format = st.Format - pb.GitSource = st.GitSource - pb.Health = st.Health - pb.JobClusters = st.JobClusters - pb.MaxConcurrentRuns = st.MaxConcurrentRuns - pb.Name = st.Name - pb.NotificationSettings = st.NotificationSettings - pb.Parameters = st.Parameters - pb.PerformanceTarget = st.PerformanceTarget - pb.Queue = st.Queue - pb.RunAs = st.RunAs - pb.Schedule = st.Schedule - pb.Tags = st.Tags - pb.Tasks = st.Tasks - pb.TimeoutSeconds = st.TimeoutSeconds - pb.Trigger = st.Trigger - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -2816,53 +2479,30 @@ func jobSettingsToPb(st *JobSettings) (*jobSettingsPb, error) { } type jobSettingsPb struct { - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Continuous *Continuous `json:"continuous,omitempty"` - - Deployment *JobDeployment `json:"deployment,omitempty"` - - Description string `json:"description,omitempty"` - - EditMode JobEditMode `json:"edit_mode,omitempty"` - - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - - Environments []JobEnvironment `json:"environments,omitempty"` - - Format Format `json:"format,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - Health *JobsHealthRules `json:"health,omitempty"` - - JobClusters []JobCluster `json:"job_clusters,omitempty"` - - MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` - - Name string `json:"name,omitempty"` - + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Continuous *Continuous `json:"continuous,omitempty"` + Deployment *JobDeployment `json:"deployment,omitempty"` + Description string `json:"description,omitempty"` + EditMode JobEditMode `json:"edit_mode,omitempty"` + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + Environments []JobEnvironment `json:"environments,omitempty"` + Format Format `json:"format,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + Health *JobsHealthRules `json:"health,omitempty"` + JobClusters []JobCluster `json:"job_clusters,omitempty"` + MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"` + Name string `json:"name,omitempty"` NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` - - Parameters []JobParameterDefinition `json:"parameters,omitempty"` - - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` - - Queue *QueueSettings `json:"queue,omitempty"` - - RunAs *JobRunAs `json:"run_as,omitempty"` - - Schedule *CronSchedule `json:"schedule,omitempty"` - - Tags map[string]string `json:"tags,omitempty"` - - Tasks []Task `json:"tasks,omitempty"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - Trigger *TriggerSettings `json:"trigger,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + Parameters []JobParameterDefinition `json:"parameters,omitempty"` + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + Queue *QueueSettings `json:"queue,omitempty"` + RunAs *JobRunAs `json:"run_as,omitempty"` + Schedule *CronSchedule `json:"schedule,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Tasks []Task `json:"tasks,omitempty"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + Trigger *TriggerSettings `json:"trigger,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2915,20 +2555,16 @@ func jobSourceToPb(st *JobSource) (*jobSourcePb, error) { } pb := &jobSourcePb{} pb.DirtyState = st.DirtyState - pb.ImportFromGitBranch = st.ImportFromGitBranch - pb.JobConfigPath = st.JobConfigPath return pb, nil } type jobSourcePb struct { - DirtyState JobSourceDirtyState `json:"dirty_state,omitempty"` - - ImportFromGitBranch string `json:"import_from_git_branch"` - - JobConfigPath string `json:"job_config_path"` + DirtyState JobSourceDirtyState `json:"dirty_state,omitempty"` + ImportFromGitBranch string `json:"import_from_git_branch"` + JobConfigPath string `json:"job_config_path"` } func jobSourceFromPb(pb *jobSourcePb) (*JobSource, error) { @@ -2949,20 +2585,16 @@ func jobsHealthRuleToPb(st *JobsHealthRule) (*jobsHealthRulePb, error) { } pb := &jobsHealthRulePb{} pb.Metric = st.Metric - pb.Op = st.Op - pb.Value = st.Value return pb, nil } type jobsHealthRulePb struct { - Metric JobsHealthMetric `json:"metric"` - - Op JobsHealthOperator `json:"op"` - - Value int64 `json:"value"` + Metric JobsHealthMetric `json:"metric"` + Op JobsHealthOperator `json:"op"` + Value int64 `json:"value"` } func jobsHealthRuleFromPb(pb *jobsHealthRulePb) (*JobsHealthRule, error) { @@ -3007,9 +2639,7 @@ func listJobComplianceForPolicyResponseToPb(st *ListJobComplianceForPolicyRespon } pb := &listJobComplianceForPolicyResponsePb{} pb.Jobs = st.Jobs - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken pb.ForceSendFields = st.ForceSendFields @@ -3017,11 +2647,9 @@ func listJobComplianceForPolicyResponseToPb(st *ListJobComplianceForPolicyRespon } type listJobComplianceForPolicyResponsePb struct { - Jobs []JobCompliance `json:"jobs,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + Jobs []JobCompliance `json:"jobs,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3053,9 +2681,7 @@ func listJobComplianceRequestToPb(st *ListJobComplianceRequest) (*listJobComplia } pb := &listJobComplianceRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -3063,11 +2689,9 @@ func listJobComplianceRequestToPb(st *ListJobComplianceRequest) (*listJobComplia } type listJobComplianceRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` - - PolicyId string `json:"-" url:"policy_id"` + PolicyId string `json:"-" url:"policy_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -3099,13 +2723,9 @@ func listJobsRequestToPb(st *ListJobsRequest) (*listJobsRequestPb, error) { } pb := &listJobsRequestPb{} pb.ExpandTasks = st.ExpandTasks - pb.Limit = st.Limit - pb.Name = st.Name - pb.Offset = st.Offset - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -3113,15 +2733,11 @@ func listJobsRequestToPb(st *ListJobsRequest) (*listJobsRequestPb, error) { } type listJobsRequestPb struct { - ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` - - Limit int `json:"-" url:"limit,omitempty"` - - Name string `json:"-" url:"name,omitempty"` - - Offset int `json:"-" url:"offset,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + Limit int `json:"-" url:"limit,omitempty"` + Name string `json:"-" url:"name,omitempty"` + Offset int `json:"-" url:"offset,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3155,11 +2771,8 @@ func listJobsResponseToPb(st *ListJobsResponse) (*listJobsResponsePb, error) { } pb := &listJobsResponsePb{} pb.HasMore = st.HasMore - pb.Jobs = st.Jobs - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken pb.ForceSendFields = st.ForceSendFields @@ -3167,13 +2780,10 @@ func listJobsResponseToPb(st *ListJobsResponse) (*listJobsResponsePb, error) { } type listJobsResponsePb struct { - HasMore bool `json:"has_more,omitempty"` - - Jobs []BaseJob `json:"jobs,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + HasMore bool `json:"has_more,omitempty"` + Jobs []BaseJob `json:"jobs,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3206,23 +2816,14 @@ func listRunsRequestToPb(st *ListRunsRequest) (*listRunsRequestPb, error) { } pb := &listRunsRequestPb{} pb.ActiveOnly = st.ActiveOnly - pb.CompletedOnly = st.CompletedOnly - pb.ExpandTasks = st.ExpandTasks - pb.JobId = st.JobId - pb.Limit = st.Limit - pb.Offset = st.Offset - pb.PageToken = st.PageToken - pb.RunType = st.RunType - pb.StartTimeFrom = st.StartTimeFrom - pb.StartTimeTo = st.StartTimeTo pb.ForceSendFields = st.ForceSendFields @@ -3230,25 +2831,16 @@ func listRunsRequestToPb(st *ListRunsRequest) (*listRunsRequestPb, error) { } type listRunsRequestPb struct { - ActiveOnly bool `json:"-" url:"active_only,omitempty"` - - CompletedOnly bool `json:"-" url:"completed_only,omitempty"` - - ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` - - JobId int64 `json:"-" url:"job_id,omitempty"` - - Limit int `json:"-" url:"limit,omitempty"` - - Offset int `json:"-" url:"offset,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - RunType RunType `json:"-" url:"run_type,omitempty"` - - StartTimeFrom int64 `json:"-" url:"start_time_from,omitempty"` - - StartTimeTo int64 `json:"-" url:"start_time_to,omitempty"` + ActiveOnly bool `json:"-" url:"active_only,omitempty"` + CompletedOnly bool `json:"-" url:"completed_only,omitempty"` + ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"` + JobId int64 `json:"-" url:"job_id,omitempty"` + Limit int `json:"-" url:"limit,omitempty"` + Offset int `json:"-" url:"offset,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + RunType RunType `json:"-" url:"run_type,omitempty"` + StartTimeFrom int64 `json:"-" url:"start_time_from,omitempty"` + StartTimeTo int64 `json:"-" url:"start_time_to,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3287,11 +2879,8 @@ func listRunsResponseToPb(st *ListRunsResponse) (*listRunsResponsePb, error) { } pb := &listRunsResponsePb{} pb.HasMore = st.HasMore - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken - pb.Runs = st.Runs pb.ForceSendFields = st.ForceSendFields @@ -3299,13 +2888,10 @@ func listRunsResponseToPb(st *ListRunsResponse) (*listRunsResponsePb, error) { } type listRunsResponsePb struct { - HasMore bool `json:"has_more,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` - - Runs []BaseRun `json:"runs,omitempty"` + HasMore bool `json:"has_more,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` + Runs []BaseRun `json:"runs,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3338,7 +2924,6 @@ func notebookOutputToPb(st *NotebookOutput) (*notebookOutputPb, error) { } pb := ¬ebookOutputPb{} pb.Result = st.Result - pb.Truncated = st.Truncated pb.ForceSendFields = st.ForceSendFields @@ -3346,9 +2931,8 @@ func notebookOutputToPb(st *NotebookOutput) (*notebookOutputPb, error) { } type notebookOutputPb struct { - Result string `json:"result,omitempty"` - - Truncated bool `json:"truncated,omitempty"` + Result string `json:"result,omitempty"` + Truncated bool `json:"truncated,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3379,11 +2963,8 @@ func notebookTaskToPb(st *NotebookTask) (*notebookTaskPb, error) { } pb := ¬ebookTaskPb{} pb.BaseParameters = st.BaseParameters - pb.NotebookPath = st.NotebookPath - pb.Source = st.Source - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -3392,12 +2973,9 @@ func notebookTaskToPb(st *NotebookTask) (*notebookTaskPb, error) { type notebookTaskPb struct { BaseParameters map[string]string `json:"base_parameters,omitempty"` - - NotebookPath string `json:"notebook_path"` - - Source Source `json:"source,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + NotebookPath string `json:"notebook_path"` + Source Source `json:"source,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3430,9 +3008,7 @@ func outputSchemaInfoToPb(st *OutputSchemaInfo) (*outputSchemaInfoPb, error) { } pb := &outputSchemaInfoPb{} pb.CatalogName = st.CatalogName - pb.ExpirationTime = st.ExpirationTime - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -3440,11 +3016,9 @@ func outputSchemaInfoToPb(st *OutputSchemaInfo) (*outputSchemaInfoPb, error) { } type outputSchemaInfoPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + SchemaName string `json:"schema_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3476,16 +3050,14 @@ func periodicTriggerConfigurationToPb(st *PeriodicTriggerConfiguration) (*period } pb := &periodicTriggerConfigurationPb{} pb.Interval = st.Interval - pb.Unit = st.Unit return pb, nil } type periodicTriggerConfigurationPb struct { - Interval int `json:"interval"` - - Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` + Interval int `json:"interval"` + Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` } func periodicTriggerConfigurationFromPb(pb *periodicTriggerConfigurationPb) (*PeriodicTriggerConfiguration, error) { @@ -3541,7 +3113,6 @@ func pipelineTaskToPb(st *PipelineTask) (*pipelineTaskPb, error) { } pb := &pipelineTaskPb{} pb.FullRefresh = st.FullRefresh - pb.PipelineId = st.PipelineId pb.ForceSendFields = st.ForceSendFields @@ -3549,9 +3120,8 @@ func pipelineTaskToPb(st *PipelineTask) (*pipelineTaskPb, error) { } type pipelineTaskPb struct { - FullRefresh bool `json:"full_refresh,omitempty"` - - PipelineId string `json:"pipeline_id"` + FullRefresh bool `json:"full_refresh,omitempty"` + PipelineId string `json:"pipeline_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -3582,13 +3152,9 @@ func powerBiModelToPb(st *PowerBiModel) (*powerBiModelPb, error) { } pb := &powerBiModelPb{} pb.AuthenticationMethod = st.AuthenticationMethod - pb.ModelName = st.ModelName - pb.OverwriteExisting = st.OverwriteExisting - pb.StorageMode = st.StorageMode - pb.WorkspaceName = st.WorkspaceName pb.ForceSendFields = st.ForceSendFields @@ -3597,14 +3163,10 @@ func powerBiModelToPb(st *PowerBiModel) (*powerBiModelPb, error) { type powerBiModelPb struct { AuthenticationMethod AuthenticationMethod `json:"authentication_method,omitempty"` - - ModelName string `json:"model_name,omitempty"` - - OverwriteExisting bool `json:"overwrite_existing,omitempty"` - - StorageMode StorageMode `json:"storage_mode,omitempty"` - - WorkspaceName string `json:"workspace_name,omitempty"` + ModelName string `json:"model_name,omitempty"` + OverwriteExisting bool `json:"overwrite_existing,omitempty"` + StorageMode StorageMode `json:"storage_mode,omitempty"` + WorkspaceName string `json:"workspace_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3638,11 +3200,8 @@ func powerBiTableToPb(st *PowerBiTable) (*powerBiTablePb, error) { } pb := &powerBiTablePb{} pb.Catalog = st.Catalog - pb.Name = st.Name - pb.Schema = st.Schema - pb.StorageMode = st.StorageMode pb.ForceSendFields = st.ForceSendFields @@ -3650,12 +3209,9 @@ func powerBiTableToPb(st *PowerBiTable) (*powerBiTablePb, error) { } type powerBiTablePb struct { - Catalog string `json:"catalog,omitempty"` - - Name string `json:"name,omitempty"` - - Schema string `json:"schema,omitempty"` - + Catalog string `json:"catalog,omitempty"` + Name string `json:"name,omitempty"` + Schema string `json:"schema,omitempty"` StorageMode StorageMode `json:"storage_mode,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3689,13 +3245,9 @@ func powerBiTaskToPb(st *PowerBiTask) (*powerBiTaskPb, error) { } pb := &powerBiTaskPb{} pb.ConnectionResourceName = st.ConnectionResourceName - pb.PowerBiModel = st.PowerBiModel - pb.RefreshAfterUpdate = st.RefreshAfterUpdate - pb.Tables = st.Tables - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -3703,15 +3255,11 @@ func powerBiTaskToPb(st *PowerBiTask) (*powerBiTaskPb, error) { } type powerBiTaskPb struct { - ConnectionResourceName string `json:"connection_resource_name,omitempty"` - - PowerBiModel *PowerBiModel `json:"power_bi_model,omitempty"` - - RefreshAfterUpdate bool `json:"refresh_after_update,omitempty"` - - Tables []PowerBiTable `json:"tables,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ConnectionResourceName string `json:"connection_resource_name,omitempty"` + PowerBiModel *PowerBiModel `json:"power_bi_model,omitempty"` + RefreshAfterUpdate bool `json:"refresh_after_update,omitempty"` + Tables []PowerBiTable `json:"tables,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3745,24 +3293,18 @@ func pythonWheelTaskToPb(st *PythonWheelTask) (*pythonWheelTaskPb, error) { } pb := &pythonWheelTaskPb{} pb.EntryPoint = st.EntryPoint - pb.NamedParameters = st.NamedParameters - pb.PackageName = st.PackageName - pb.Parameters = st.Parameters return pb, nil } type pythonWheelTaskPb struct { - EntryPoint string `json:"entry_point"` - + EntryPoint string `json:"entry_point"` NamedParameters map[string]string `json:"named_parameters,omitempty"` - - PackageName string `json:"package_name"` - - Parameters []string `json:"parameters,omitempty"` + PackageName string `json:"package_name"` + Parameters []string `json:"parameters,omitempty"` } func pythonWheelTaskFromPb(pb *pythonWheelTaskPb) (*PythonWheelTask, error) { @@ -3784,7 +3326,6 @@ func queueDetailsToPb(st *QueueDetails) (*queueDetailsPb, error) { } pb := &queueDetailsPb{} pb.Code = st.Code - pb.Message = st.Message pb.ForceSendFields = st.ForceSendFields @@ -3792,9 +3333,8 @@ func queueDetailsToPb(st *QueueDetails) (*queueDetailsPb, error) { } type queueDetailsPb struct { - Code QueueDetailsCodeCode `json:"code,omitempty"` - - Message string `json:"message,omitempty"` + Code QueueDetailsCodeCode `json:"code,omitempty"` + Message string `json:"message,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3849,19 +3389,12 @@ func repairHistoryItemToPb(st *RepairHistoryItem) (*repairHistoryItemPb, error) } pb := &repairHistoryItemPb{} pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget - pb.EndTime = st.EndTime - pb.Id = st.Id - pb.StartTime = st.StartTime - pb.State = st.State - pb.Status = st.Status - pb.TaskRunIds = st.TaskRunIds - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -3869,21 +3402,14 @@ func repairHistoryItemToPb(st *RepairHistoryItem) (*repairHistoryItemPb, error) } type repairHistoryItemPb struct { - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` - - EndTime int64 `json:"end_time,omitempty"` - - Id int64 `json:"id,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - State *RunState `json:"state,omitempty"` - - Status *RunStatus `json:"status,omitempty"` - - TaskRunIds []int64 `json:"task_run_ids,omitempty"` - - Type RepairHistoryItemType `json:"type,omitempty"` + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + Id int64 `json:"id,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + State *RunState `json:"state,omitempty"` + Status *RunStatus `json:"status,omitempty"` + TaskRunIds []int64 `json:"task_run_ids,omitempty"` + Type RepairHistoryItemType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3920,33 +3446,19 @@ func repairRunToPb(st *RepairRun) (*repairRunPb, error) { } pb := &repairRunPb{} pb.DbtCommands = st.DbtCommands - pb.JarParams = st.JarParams - pb.JobParameters = st.JobParameters - pb.LatestRepairId = st.LatestRepairId - pb.NotebookParams = st.NotebookParams - pb.PerformanceTarget = st.PerformanceTarget - pb.PipelineParams = st.PipelineParams - pb.PythonNamedParams = st.PythonNamedParams - pb.PythonParams = st.PythonParams - pb.RerunAllFailedTasks = st.RerunAllFailedTasks - pb.RerunDependentTasks = st.RerunDependentTasks - pb.RerunTasks = st.RerunTasks - pb.RunId = st.RunId - pb.SparkSubmitParams = st.SparkSubmitParams - pb.SqlParams = st.SqlParams pb.ForceSendFields = st.ForceSendFields @@ -3954,35 +3466,21 @@ func repairRunToPb(st *RepairRun) (*repairRunPb, error) { } type repairRunPb struct { - DbtCommands []string `json:"dbt_commands,omitempty"` - - JarParams []string `json:"jar_params,omitempty"` - - JobParameters map[string]string `json:"job_parameters,omitempty"` - - LatestRepairId int64 `json:"latest_repair_id,omitempty"` - - NotebookParams map[string]string `json:"notebook_params,omitempty"` - - PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` - - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` - - PythonNamedParams map[string]string `json:"python_named_params,omitempty"` - - PythonParams []string `json:"python_params,omitempty"` - - RerunAllFailedTasks bool `json:"rerun_all_failed_tasks,omitempty"` - - RerunDependentTasks bool `json:"rerun_dependent_tasks,omitempty"` - - RerunTasks []string `json:"rerun_tasks,omitempty"` - - RunId int64 `json:"run_id"` - - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` - - SqlParams map[string]string `json:"sql_params,omitempty"` + DbtCommands []string `json:"dbt_commands,omitempty"` + JarParams []string `json:"jar_params,omitempty"` + JobParameters map[string]string `json:"job_parameters,omitempty"` + LatestRepairId int64 `json:"latest_repair_id,omitempty"` + NotebookParams map[string]string `json:"notebook_params,omitempty"` + PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` + PythonNamedParams map[string]string `json:"python_named_params,omitempty"` + PythonParams []string `json:"python_params,omitempty"` + RerunAllFailedTasks bool `json:"rerun_all_failed_tasks,omitempty"` + RerunDependentTasks bool `json:"rerun_dependent_tasks,omitempty"` + RerunTasks []string `json:"rerun_tasks,omitempty"` + RunId int64 `json:"run_id"` + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + SqlParams map[string]string `json:"sql_params,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4062,15 +3560,13 @@ func resetJobToPb(st *ResetJob) (*resetJobPb, error) { } pb := &resetJobPb{} pb.JobId = st.JobId - pb.NewSettings = st.NewSettings return pb, nil } type resetJobPb struct { - JobId int64 `json:"job_id"` - + JobId int64 `json:"job_id"` NewSettings JobSettings `json:"new_settings"` } @@ -4112,7 +3608,6 @@ func resolvedConditionTaskValuesToPb(st *ResolvedConditionTaskValues) (*resolved } pb := &resolvedConditionTaskValuesPb{} pb.Left = st.Left - pb.Right = st.Right pb.ForceSendFields = st.ForceSendFields @@ -4120,8 +3615,7 @@ func resolvedConditionTaskValuesToPb(st *ResolvedConditionTaskValues) (*resolved } type resolvedConditionTaskValuesPb struct { - Left string `json:"left,omitempty"` - + Left string `json:"left,omitempty"` Right string `json:"right,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4225,7 +3719,6 @@ func resolvedPythonWheelTaskValuesToPb(st *ResolvedPythonWheelTaskValues) (*reso } pb := &resolvedPythonWheelTaskValuesPb{} pb.NamedParameters = st.NamedParameters - pb.Parameters = st.Parameters return pb, nil @@ -4233,8 +3726,7 @@ func resolvedPythonWheelTaskValuesToPb(st *ResolvedPythonWheelTaskValues) (*reso type resolvedPythonWheelTaskValuesPb struct { NamedParameters map[string]string `json:"named_parameters,omitempty"` - - Parameters []string `json:"parameters,omitempty"` + Parameters []string `json:"parameters,omitempty"` } func resolvedPythonWheelTaskValuesFromPb(pb *resolvedPythonWheelTaskValuesPb) (*ResolvedPythonWheelTaskValues, error) { @@ -4254,7 +3746,6 @@ func resolvedRunJobTaskValuesToPb(st *ResolvedRunJobTaskValues) (*resolvedRunJob } pb := &resolvedRunJobTaskValuesPb{} pb.JobParameters = st.JobParameters - pb.Parameters = st.Parameters return pb, nil @@ -4262,8 +3753,7 @@ func resolvedRunJobTaskValuesToPb(st *ResolvedRunJobTaskValues) (*resolvedRunJob type resolvedRunJobTaskValuesPb struct { JobParameters map[string]string `json:"job_parameters,omitempty"` - - Parameters map[string]string `json:"parameters,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` } func resolvedRunJobTaskValuesFromPb(pb *resolvedRunJobTaskValuesPb) (*ResolvedRunJobTaskValues, error) { @@ -4307,48 +3797,30 @@ func resolvedValuesToPb(st *ResolvedValues) (*resolvedValuesPb, error) { } pb := &resolvedValuesPb{} pb.ConditionTask = st.ConditionTask - pb.DbtTask = st.DbtTask - pb.NotebookTask = st.NotebookTask - pb.PythonWheelTask = st.PythonWheelTask - pb.RunJobTask = st.RunJobTask - pb.SimulationTask = st.SimulationTask - pb.SparkJarTask = st.SparkJarTask - pb.SparkPythonTask = st.SparkPythonTask - pb.SparkSubmitTask = st.SparkSubmitTask - pb.SqlTask = st.SqlTask return pb, nil } type resolvedValuesPb struct { - ConditionTask *ResolvedConditionTaskValues `json:"condition_task,omitempty"` - - DbtTask *ResolvedDbtTaskValues `json:"dbt_task,omitempty"` - - NotebookTask *ResolvedNotebookTaskValues `json:"notebook_task,omitempty"` - + ConditionTask *ResolvedConditionTaskValues `json:"condition_task,omitempty"` + DbtTask *ResolvedDbtTaskValues `json:"dbt_task,omitempty"` + NotebookTask *ResolvedNotebookTaskValues `json:"notebook_task,omitempty"` PythonWheelTask *ResolvedPythonWheelTaskValues `json:"python_wheel_task,omitempty"` - - RunJobTask *ResolvedRunJobTaskValues `json:"run_job_task,omitempty"` - - SimulationTask *ResolvedParamPairValues `json:"simulation_task,omitempty"` - - SparkJarTask *ResolvedStringParamsValues `json:"spark_jar_task,omitempty"` - - SparkPythonTask *ResolvedStringParamsValues `json:"spark_python_task,omitempty"` - - SparkSubmitTask *ResolvedStringParamsValues `json:"spark_submit_task,omitempty"` - - SqlTask *ResolvedParamPairValues `json:"sql_task,omitempty"` + RunJobTask *ResolvedRunJobTaskValues `json:"run_job_task,omitempty"` + SimulationTask *ResolvedParamPairValues `json:"simulation_task,omitempty"` + SparkJarTask *ResolvedStringParamsValues `json:"spark_jar_task,omitempty"` + SparkPythonTask *ResolvedStringParamsValues `json:"spark_python_task,omitempty"` + SparkSubmitTask *ResolvedStringParamsValues `json:"spark_submit_task,omitempty"` + SqlTask *ResolvedParamPairValues `json:"sql_task,omitempty"` } func resolvedValuesFromPb(pb *resolvedValuesPb) (*ResolvedValues, error) { @@ -4376,73 +3848,39 @@ func runToPb(st *Run) (*runPb, error) { } pb := &runPb{} pb.AttemptNumber = st.AttemptNumber - pb.CleanupDuration = st.CleanupDuration - pb.ClusterInstance = st.ClusterInstance - pb.ClusterSpec = st.ClusterSpec - pb.CreatorUserName = st.CreatorUserName - pb.Description = st.Description - pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget - pb.EndTime = st.EndTime - pb.ExecutionDuration = st.ExecutionDuration - pb.GitSource = st.GitSource - pb.HasMore = st.HasMore - pb.Iterations = st.Iterations - pb.JobClusters = st.JobClusters - pb.JobId = st.JobId - pb.JobParameters = st.JobParameters - pb.JobRunId = st.JobRunId - pb.NextPageToken = st.NextPageToken - pb.NumberInJob = st.NumberInJob - pb.OriginalAttemptRunId = st.OriginalAttemptRunId - pb.OverridingParameters = st.OverridingParameters - pb.QueueDuration = st.QueueDuration - pb.RepairHistory = st.RepairHistory - pb.RunDuration = st.RunDuration - pb.RunId = st.RunId - pb.RunName = st.RunName - pb.RunPageUrl = st.RunPageUrl - pb.RunType = st.RunType - pb.Schedule = st.Schedule - pb.SetupDuration = st.SetupDuration - pb.StartTime = st.StartTime - pb.State = st.State - pb.Status = st.Status - pb.Tasks = st.Tasks - pb.Trigger = st.Trigger - pb.TriggerInfo = st.TriggerInfo pb.ForceSendFields = st.ForceSendFields @@ -4450,75 +3888,41 @@ func runToPb(st *Run) (*runPb, error) { } type runPb struct { - AttemptNumber int `json:"attempt_number,omitempty"` - - CleanupDuration int64 `json:"cleanup_duration,omitempty"` - - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` - - ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - Description string `json:"description,omitempty"` - - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` - - EndTime int64 `json:"end_time,omitempty"` - - ExecutionDuration int64 `json:"execution_duration,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - HasMore bool `json:"has_more,omitempty"` - - Iterations []RunTask `json:"iterations,omitempty"` - - JobClusters []JobCluster `json:"job_clusters,omitempty"` - - JobId int64 `json:"job_id,omitempty"` - - JobParameters []JobParameter `json:"job_parameters,omitempty"` - - JobRunId int64 `json:"job_run_id,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - NumberInJob int64 `json:"number_in_job,omitempty"` - - OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` - - OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` - - QueueDuration int64 `json:"queue_duration,omitempty"` - - RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` - - RunDuration int64 `json:"run_duration,omitempty"` - - RunId int64 `json:"run_id,omitempty"` - - RunName string `json:"run_name,omitempty"` - - RunPageUrl string `json:"run_page_url,omitempty"` - - RunType RunType `json:"run_type,omitempty"` - - Schedule *CronSchedule `json:"schedule,omitempty"` - - SetupDuration int64 `json:"setup_duration,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - State *RunState `json:"state,omitempty"` - - Status *RunStatus `json:"status,omitempty"` - - Tasks []RunTask `json:"tasks,omitempty"` - - Trigger TriggerType `json:"trigger,omitempty"` - - TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` + AttemptNumber int `json:"attempt_number,omitempty"` + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + Description string `json:"description,omitempty"` + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + ExecutionDuration int64 `json:"execution_duration,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + HasMore bool `json:"has_more,omitempty"` + Iterations []RunTask `json:"iterations,omitempty"` + JobClusters []JobCluster `json:"job_clusters,omitempty"` + JobId int64 `json:"job_id,omitempty"` + JobParameters []JobParameter `json:"job_parameters,omitempty"` + JobRunId int64 `json:"job_run_id,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + NumberInJob int64 `json:"number_in_job,omitempty"` + OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"` + OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"` + QueueDuration int64 `json:"queue_duration,omitempty"` + RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"` + RunDuration int64 `json:"run_duration,omitempty"` + RunId int64 `json:"run_id,omitempty"` + RunName string `json:"run_name,omitempty"` + RunPageUrl string `json:"run_page_url,omitempty"` + RunType RunType `json:"run_type,omitempty"` + Schedule *CronSchedule `json:"schedule,omitempty"` + SetupDuration int64 `json:"setup_duration,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + State *RunState `json:"state,omitempty"` + Status *RunStatus `json:"status,omitempty"` + Tasks []RunTask `json:"tasks,omitempty"` + Trigger TriggerType `json:"trigger,omitempty"` + TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4582,11 +3986,8 @@ func runConditionTaskToPb(st *RunConditionTask) (*runConditionTaskPb, error) { } pb := &runConditionTaskPb{} pb.Left = st.Left - pb.Op = st.Op - pb.Outcome = st.Outcome - pb.Right = st.Right pb.ForceSendFields = st.ForceSendFields @@ -4594,13 +3995,10 @@ func runConditionTaskToPb(st *RunConditionTask) (*runConditionTaskPb, error) { } type runConditionTaskPb struct { - Left string `json:"left"` - - Op ConditionTaskOp `json:"op"` - - Outcome string `json:"outcome,omitempty"` - - Right string `json:"right"` + Left string `json:"left"` + Op ConditionTaskOp `json:"op"` + Outcome string `json:"outcome,omitempty"` + Right string `json:"right"` ForceSendFields []string `json:"-" url:"-"` } @@ -4633,11 +4031,8 @@ func runForEachTaskToPb(st *RunForEachTask) (*runForEachTaskPb, error) { } pb := &runForEachTaskPb{} pb.Concurrency = st.Concurrency - pb.Inputs = st.Inputs - pb.Stats = st.Stats - pb.Task = st.Task pb.ForceSendFields = st.ForceSendFields @@ -4645,13 +4040,10 @@ func runForEachTaskToPb(st *RunForEachTask) (*runForEachTaskPb, error) { } type runForEachTaskPb struct { - Concurrency int `json:"concurrency,omitempty"` - - Inputs string `json:"inputs"` - - Stats *ForEachStats `json:"stats,omitempty"` - - Task Task `json:"task"` + Concurrency int `json:"concurrency,omitempty"` + Inputs string `json:"inputs"` + Stats *ForEachStats `json:"stats,omitempty"` + Task Task `json:"task"` ForceSendFields []string `json:"-" url:"-"` } @@ -4720,48 +4112,30 @@ func runJobTaskToPb(st *RunJobTask) (*runJobTaskPb, error) { } pb := &runJobTaskPb{} pb.DbtCommands = st.DbtCommands - pb.JarParams = st.JarParams - pb.JobId = st.JobId - pb.JobParameters = st.JobParameters - pb.NotebookParams = st.NotebookParams - pb.PipelineParams = st.PipelineParams - pb.PythonNamedParams = st.PythonNamedParams - pb.PythonParams = st.PythonParams - pb.SparkSubmitParams = st.SparkSubmitParams - pb.SqlParams = st.SqlParams return pb, nil } type runJobTaskPb struct { - DbtCommands []string `json:"dbt_commands,omitempty"` - - JarParams []string `json:"jar_params,omitempty"` - - JobId int64 `json:"job_id"` - - JobParameters map[string]string `json:"job_parameters,omitempty"` - - NotebookParams map[string]string `json:"notebook_params,omitempty"` - - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` - + DbtCommands []string `json:"dbt_commands,omitempty"` + JarParams []string `json:"jar_params,omitempty"` + JobId int64 `json:"job_id"` + JobParameters map[string]string `json:"job_parameters,omitempty"` + NotebookParams map[string]string `json:"notebook_params,omitempty"` + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` PythonNamedParams map[string]string `json:"python_named_params,omitempty"` - - PythonParams []string `json:"python_params,omitempty"` - - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` - - SqlParams map[string]string `json:"sql_params,omitempty"` + PythonParams []string `json:"python_params,omitempty"` + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + SqlParams map[string]string `json:"sql_params,omitempty"` } func runJobTaskFromPb(pb *runJobTaskPb) (*RunJobTask, error) { @@ -4789,31 +4163,18 @@ func runNowToPb(st *RunNow) (*runNowPb, error) { } pb := &runNowPb{} pb.DbtCommands = st.DbtCommands - pb.IdempotencyToken = st.IdempotencyToken - pb.JarParams = st.JarParams - pb.JobId = st.JobId - pb.JobParameters = st.JobParameters - pb.NotebookParams = st.NotebookParams - pb.Only = st.Only - pb.PerformanceTarget = st.PerformanceTarget - pb.PipelineParams = st.PipelineParams - pb.PythonNamedParams = st.PythonNamedParams - pb.PythonParams = st.PythonParams - pb.Queue = st.Queue - pb.SparkSubmitParams = st.SparkSubmitParams - pb.SqlParams = st.SqlParams pb.ForceSendFields = st.ForceSendFields @@ -4821,33 +4182,20 @@ func runNowToPb(st *RunNow) (*runNowPb, error) { } type runNowPb struct { - DbtCommands []string `json:"dbt_commands,omitempty"` - - IdempotencyToken string `json:"idempotency_token,omitempty"` - - JarParams []string `json:"jar_params,omitempty"` - - JobId int64 `json:"job_id"` - - JobParameters map[string]string `json:"job_parameters,omitempty"` - - NotebookParams map[string]string `json:"notebook_params,omitempty"` - - Only []string `json:"only,omitempty"` - + DbtCommands []string `json:"dbt_commands,omitempty"` + IdempotencyToken string `json:"idempotency_token,omitempty"` + JarParams []string `json:"jar_params,omitempty"` + JobId int64 `json:"job_id"` + JobParameters map[string]string `json:"job_parameters,omitempty"` + NotebookParams map[string]string `json:"notebook_params,omitempty"` + Only []string `json:"only,omitempty"` PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"` - - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` - + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` PythonNamedParams map[string]string `json:"python_named_params,omitempty"` - - PythonParams []string `json:"python_params,omitempty"` - - Queue *QueueSettings `json:"queue,omitempty"` - - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` - - SqlParams map[string]string `json:"sql_params,omitempty"` + PythonParams []string `json:"python_params,omitempty"` + Queue *QueueSettings `json:"queue,omitempty"` + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + SqlParams map[string]string `json:"sql_params,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4890,7 +4238,6 @@ func runNowResponseToPb(st *RunNowResponse) (*runNowResponsePb, error) { } pb := &runNowResponsePb{} pb.NumberInJob = st.NumberInJob - pb.RunId = st.RunId pb.ForceSendFields = st.ForceSendFields @@ -4899,8 +4246,7 @@ func runNowResponseToPb(st *RunNowResponse) (*runNowResponsePb, error) { type runNowResponsePb struct { NumberInJob int64 `json:"number_in_job,omitempty"` - - RunId int64 `json:"run_id,omitempty"` + RunId int64 `json:"run_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4931,27 +4277,16 @@ func runOutputToPb(st *RunOutput) (*runOutputPb, error) { } pb := &runOutputPb{} pb.CleanRoomsNotebookOutput = st.CleanRoomsNotebookOutput - pb.DashboardOutput = st.DashboardOutput - pb.DbtOutput = st.DbtOutput - pb.Error = st.Error - pb.ErrorTrace = st.ErrorTrace - pb.Info = st.Info - pb.Logs = st.Logs - pb.LogsTruncated = st.LogsTruncated - pb.Metadata = st.Metadata - pb.NotebookOutput = st.NotebookOutput - pb.RunJobOutput = st.RunJobOutput - pb.SqlOutput = st.SqlOutput pb.ForceSendFields = st.ForceSendFields @@ -4960,28 +4295,17 @@ func runOutputToPb(st *RunOutput) (*runOutputPb, error) { type runOutputPb struct { CleanRoomsNotebookOutput *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput `json:"clean_rooms_notebook_output,omitempty"` - - DashboardOutput *DashboardTaskOutput `json:"dashboard_output,omitempty"` - - DbtOutput *DbtOutput `json:"dbt_output,omitempty"` - - Error string `json:"error,omitempty"` - - ErrorTrace string `json:"error_trace,omitempty"` - - Info string `json:"info,omitempty"` - - Logs string `json:"logs,omitempty"` - - LogsTruncated bool `json:"logs_truncated,omitempty"` - - Metadata *Run `json:"metadata,omitempty"` - - NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` - - RunJobOutput *RunJobOutput `json:"run_job_output,omitempty"` - - SqlOutput *SqlOutput `json:"sql_output,omitempty"` + DashboardOutput *DashboardTaskOutput `json:"dashboard_output,omitempty"` + DbtOutput *DbtOutput `json:"dbt_output,omitempty"` + Error string `json:"error,omitempty"` + ErrorTrace string `json:"error_trace,omitempty"` + Info string `json:"info,omitempty"` + Logs string `json:"logs,omitempty"` + LogsTruncated bool `json:"logs_truncated,omitempty"` + Metadata *Run `json:"metadata,omitempty"` + NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"` + RunJobOutput *RunJobOutput `json:"run_job_output,omitempty"` + SqlOutput *SqlOutput `json:"sql_output,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5022,40 +4346,26 @@ func runParametersToPb(st *RunParameters) (*runParametersPb, error) { } pb := &runParametersPb{} pb.DbtCommands = st.DbtCommands - pb.JarParams = st.JarParams - pb.NotebookParams = st.NotebookParams - pb.PipelineParams = st.PipelineParams - pb.PythonNamedParams = st.PythonNamedParams - pb.PythonParams = st.PythonParams - pb.SparkSubmitParams = st.SparkSubmitParams - pb.SqlParams = st.SqlParams return pb, nil } type runParametersPb struct { - DbtCommands []string `json:"dbt_commands,omitempty"` - - JarParams []string `json:"jar_params,omitempty"` - - NotebookParams map[string]string `json:"notebook_params,omitempty"` - - PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` - + DbtCommands []string `json:"dbt_commands,omitempty"` + JarParams []string `json:"jar_params,omitempty"` + NotebookParams map[string]string `json:"notebook_params,omitempty"` + PipelineParams *PipelineParams `json:"pipeline_params,omitempty"` PythonNamedParams map[string]string `json:"python_named_params,omitempty"` - - PythonParams []string `json:"python_params,omitempty"` - - SparkSubmitParams []string `json:"spark_submit_params,omitempty"` - - SqlParams map[string]string `json:"sql_params,omitempty"` + PythonParams []string `json:"python_params,omitempty"` + SparkSubmitParams []string `json:"spark_submit_params,omitempty"` + SqlParams map[string]string `json:"sql_params,omitempty"` } func runParametersFromPb(pb *runParametersPb) (*RunParameters, error) { @@ -5081,13 +4391,9 @@ func runStateToPb(st *RunState) (*runStatePb, error) { } pb := &runStatePb{} pb.LifeCycleState = st.LifeCycleState - pb.QueueReason = st.QueueReason - pb.ResultState = st.ResultState - pb.StateMessage = st.StateMessage - pb.UserCancelledOrTimedout = st.UserCancelledOrTimedout pb.ForceSendFields = st.ForceSendFields @@ -5095,15 +4401,11 @@ func runStateToPb(st *RunState) (*runStatePb, error) { } type runStatePb struct { - LifeCycleState RunLifeCycleState `json:"life_cycle_state,omitempty"` - - QueueReason string `json:"queue_reason,omitempty"` - - ResultState RunResultState `json:"result_state,omitempty"` - - StateMessage string `json:"state_message,omitempty"` - - UserCancelledOrTimedout bool `json:"user_cancelled_or_timedout,omitempty"` + LifeCycleState RunLifeCycleState `json:"life_cycle_state,omitempty"` + QueueReason string `json:"queue_reason,omitempty"` + ResultState RunResultState `json:"result_state,omitempty"` + StateMessage string `json:"state_message,omitempty"` + UserCancelledOrTimedout bool `json:"user_cancelled_or_timedout,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5137,20 +4439,16 @@ func runStatusToPb(st *RunStatus) (*runStatusPb, error) { } pb := &runStatusPb{} pb.QueueDetails = st.QueueDetails - pb.State = st.State - pb.TerminationDetails = st.TerminationDetails return pb, nil } type runStatusPb struct { - QueueDetails *QueueDetails `json:"queue_details,omitempty"` - - State RunLifecycleStateV2State `json:"state,omitempty"` - - TerminationDetails *TerminationDetails `json:"termination_details,omitempty"` + QueueDetails *QueueDetails `json:"queue_details,omitempty"` + State RunLifecycleStateV2State `json:"state,omitempty"` + TerminationDetails *TerminationDetails `json:"termination_details,omitempty"` } func runStatusFromPb(pb *runStatusPb) (*RunStatus, error) { @@ -5171,93 +4469,49 @@ func runTaskToPb(st *RunTask) (*runTaskPb, error) { } pb := &runTaskPb{} pb.AttemptNumber = st.AttemptNumber - pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask - pb.CleanupDuration = st.CleanupDuration - pb.ClusterInstance = st.ClusterInstance - pb.ConditionTask = st.ConditionTask - pb.DashboardTask = st.DashboardTask - pb.DbtTask = st.DbtTask - pb.DependsOn = st.DependsOn - pb.Description = st.Description - pb.Disabled = st.Disabled - pb.EffectivePerformanceTarget = st.EffectivePerformanceTarget - pb.EmailNotifications = st.EmailNotifications - pb.EndTime = st.EndTime - pb.EnvironmentKey = st.EnvironmentKey - pb.ExecutionDuration = st.ExecutionDuration - pb.ExistingClusterId = st.ExistingClusterId - pb.ForEachTask = st.ForEachTask - pb.GenAiComputeTask = st.GenAiComputeTask - pb.GitSource = st.GitSource - pb.JobClusterKey = st.JobClusterKey - pb.Libraries = st.Libraries - pb.NewCluster = st.NewCluster - pb.NotebookTask = st.NotebookTask - pb.NotificationSettings = st.NotificationSettings - pb.PipelineTask = st.PipelineTask - pb.PowerBiTask = st.PowerBiTask - pb.PythonWheelTask = st.PythonWheelTask - pb.QueueDuration = st.QueueDuration - pb.ResolvedValues = st.ResolvedValues - pb.RunDuration = st.RunDuration - pb.RunId = st.RunId - pb.RunIf = st.RunIf - pb.RunJobTask = st.RunJobTask - pb.RunPageUrl = st.RunPageUrl - pb.SetupDuration = st.SetupDuration - pb.SparkJarTask = st.SparkJarTask - pb.SparkPythonTask = st.SparkPythonTask - pb.SparkSubmitTask = st.SparkSubmitTask - pb.SqlTask = st.SqlTask - pb.StartTime = st.StartTime - pb.State = st.State - pb.Status = st.Status - pb.TaskKey = st.TaskKey - pb.TimeoutSeconds = st.TimeoutSeconds - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -5265,95 +4519,51 @@ func runTaskToPb(st *RunTask) (*runTaskPb, error) { } type runTaskPb struct { - AttemptNumber int `json:"attempt_number,omitempty"` - - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` - - CleanupDuration int64 `json:"cleanup_duration,omitempty"` - - ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` - - ConditionTask *RunConditionTask `json:"condition_task,omitempty"` - - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` - - DbtTask *DbtTask `json:"dbt_task,omitempty"` - - DependsOn []TaskDependency `json:"depends_on,omitempty"` - - Description string `json:"description,omitempty"` - - Disabled bool `json:"disabled,omitempty"` - - EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` - - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - - EndTime int64 `json:"end_time,omitempty"` - - EnvironmentKey string `json:"environment_key,omitempty"` - - ExecutionDuration int64 `json:"execution_duration,omitempty"` - - ExistingClusterId string `json:"existing_cluster_id,omitempty"` - - ForEachTask *RunForEachTask `json:"for_each_task,omitempty"` - - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - JobClusterKey string `json:"job_cluster_key,omitempty"` - - Libraries []compute.Library `json:"libraries,omitempty"` - - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` - - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` - - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` - - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` - - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` - - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` - - QueueDuration int64 `json:"queue_duration,omitempty"` - - ResolvedValues *ResolvedValues `json:"resolved_values,omitempty"` - - RunDuration int64 `json:"run_duration,omitempty"` - - RunId int64 `json:"run_id,omitempty"` - - RunIf RunIf `json:"run_if,omitempty"` - - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` - - RunPageUrl string `json:"run_page_url,omitempty"` - - SetupDuration int64 `json:"setup_duration,omitempty"` - - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` - - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` - - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` - - SqlTask *SqlTask `json:"sql_task,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - State *RunState `json:"state,omitempty"` - - Status *RunStatus `json:"status,omitempty"` - - TaskKey string `json:"task_key"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + AttemptNumber int `json:"attempt_number,omitempty"` + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + CleanupDuration int64 `json:"cleanup_duration,omitempty"` + ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` + ConditionTask *RunConditionTask `json:"condition_task,omitempty"` + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + DbtTask *DbtTask `json:"dbt_task,omitempty"` + DependsOn []TaskDependency `json:"depends_on,omitempty"` + Description string `json:"description,omitempty"` + Disabled bool `json:"disabled,omitempty"` + EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"` + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + EnvironmentKey string `json:"environment_key,omitempty"` + ExecutionDuration int64 `json:"execution_duration,omitempty"` + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + ForEachTask *RunForEachTask `json:"for_each_task,omitempty"` + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + JobClusterKey string `json:"job_cluster_key,omitempty"` + Libraries []compute.Library `json:"libraries,omitempty"` + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + QueueDuration int64 `json:"queue_duration,omitempty"` + ResolvedValues *ResolvedValues `json:"resolved_values,omitempty"` + RunDuration int64 `json:"run_duration,omitempty"` + RunId int64 `json:"run_id,omitempty"` + RunIf RunIf `json:"run_if,omitempty"` + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + RunPageUrl string `json:"run_page_url,omitempty"` + SetupDuration int64 `json:"setup_duration,omitempty"` + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + SqlTask *SqlTask `json:"sql_task,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + State *RunState `json:"state,omitempty"` + Status *RunStatus `json:"status,omitempty"` + TaskKey string `json:"task_key"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5427,11 +4637,8 @@ func sparkJarTaskToPb(st *SparkJarTask) (*sparkJarTaskPb, error) { } pb := &sparkJarTaskPb{} pb.JarUri = st.JarUri - pb.MainClassName = st.MainClassName - pb.Parameters = st.Parameters - pb.RunAsRepl = st.RunAsRepl pb.ForceSendFields = st.ForceSendFields @@ -5439,13 +4646,10 @@ func sparkJarTaskToPb(st *SparkJarTask) (*sparkJarTaskPb, error) { } type sparkJarTaskPb struct { - JarUri string `json:"jar_uri,omitempty"` - - MainClassName string `json:"main_class_name,omitempty"` - - Parameters []string `json:"parameters,omitempty"` - - RunAsRepl bool `json:"run_as_repl,omitempty"` + JarUri string `json:"jar_uri,omitempty"` + MainClassName string `json:"main_class_name,omitempty"` + Parameters []string `json:"parameters,omitempty"` + RunAsRepl bool `json:"run_as_repl,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5478,9 +4682,7 @@ func sparkPythonTaskToPb(st *SparkPythonTask) (*sparkPythonTaskPb, error) { } pb := &sparkPythonTaskPb{} pb.Parameters = st.Parameters - pb.PythonFile = st.PythonFile - pb.Source = st.Source return pb, nil @@ -5488,10 +4690,8 @@ func sparkPythonTaskToPb(st *SparkPythonTask) (*sparkPythonTaskPb, error) { type sparkPythonTaskPb struct { Parameters []string `json:"parameters,omitempty"` - - PythonFile string `json:"python_file"` - - Source Source `json:"source,omitempty"` + PythonFile string `json:"python_file"` + Source Source `json:"source,omitempty"` } func sparkPythonTaskFromPb(pb *sparkPythonTaskPb) (*SparkPythonTask, error) { @@ -5536,13 +4736,9 @@ func sqlAlertOutputToPb(st *SqlAlertOutput) (*sqlAlertOutputPb, error) { } pb := &sqlAlertOutputPb{} pb.AlertState = st.AlertState - pb.OutputLink = st.OutputLink - pb.QueryText = st.QueryText - pb.SqlStatements = st.SqlStatements - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -5550,15 +4746,11 @@ func sqlAlertOutputToPb(st *SqlAlertOutput) (*sqlAlertOutputPb, error) { } type sqlAlertOutputPb struct { - AlertState SqlAlertState `json:"alert_state,omitempty"` - - OutputLink string `json:"output_link,omitempty"` - - QueryText string `json:"query_text,omitempty"` - + AlertState SqlAlertState `json:"alert_state,omitempty"` + OutputLink string `json:"output_link,omitempty"` + QueryText string `json:"query_text,omitempty"` SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5592,7 +4784,6 @@ func sqlDashboardOutputToPb(st *SqlDashboardOutput) (*sqlDashboardOutputPb, erro } pb := &sqlDashboardOutputPb{} pb.WarehouseId = st.WarehouseId - pb.Widgets = st.Widgets pb.ForceSendFields = st.ForceSendFields @@ -5600,9 +4791,8 @@ func sqlDashboardOutputToPb(st *SqlDashboardOutput) (*sqlDashboardOutputPb, erro } type sqlDashboardOutputPb struct { - WarehouseId string `json:"warehouse_id,omitempty"` - - Widgets []SqlDashboardWidgetOutput `json:"widgets,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` + Widgets []SqlDashboardWidgetOutput `json:"widgets,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5633,17 +4823,11 @@ func sqlDashboardWidgetOutputToPb(st *SqlDashboardWidgetOutput) (*sqlDashboardWi } pb := &sqlDashboardWidgetOutputPb{} pb.EndTime = st.EndTime - pb.Error = st.Error - pb.OutputLink = st.OutputLink - pb.StartTime = st.StartTime - pb.Status = st.Status - pb.WidgetId = st.WidgetId - pb.WidgetTitle = st.WidgetTitle pb.ForceSendFields = st.ForceSendFields @@ -5651,19 +4835,13 @@ func sqlDashboardWidgetOutputToPb(st *SqlDashboardWidgetOutput) (*sqlDashboardWi } type sqlDashboardWidgetOutputPb struct { - EndTime int64 `json:"end_time,omitempty"` - - Error *SqlOutputError `json:"error,omitempty"` - - OutputLink string `json:"output_link,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - Status SqlDashboardWidgetOutputStatus `json:"status,omitempty"` - - WidgetId string `json:"widget_id,omitempty"` - - WidgetTitle string `json:"widget_title,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + Error *SqlOutputError `json:"error,omitempty"` + OutputLink string `json:"output_link,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + Status SqlDashboardWidgetOutputStatus `json:"status,omitempty"` + WidgetId string `json:"widget_id,omitempty"` + WidgetTitle string `json:"widget_title,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5699,20 +4877,16 @@ func sqlOutputToPb(st *SqlOutput) (*sqlOutputPb, error) { } pb := &sqlOutputPb{} pb.AlertOutput = st.AlertOutput - pb.DashboardOutput = st.DashboardOutput - pb.QueryOutput = st.QueryOutput return pb, nil } type sqlOutputPb struct { - AlertOutput *SqlAlertOutput `json:"alert_output,omitempty"` - + AlertOutput *SqlAlertOutput `json:"alert_output,omitempty"` DashboardOutput *SqlDashboardOutput `json:"dashboard_output,omitempty"` - - QueryOutput *SqlQueryOutput `json:"query_output,omitempty"` + QueryOutput *SqlQueryOutput `json:"query_output,omitempty"` } func sqlOutputFromPb(pb *sqlOutputPb) (*SqlOutput, error) { @@ -5769,13 +4943,9 @@ func sqlQueryOutputToPb(st *SqlQueryOutput) (*sqlQueryOutputPb, error) { } pb := &sqlQueryOutputPb{} pb.EndpointId = st.EndpointId - pb.OutputLink = st.OutputLink - pb.QueryText = st.QueryText - pb.SqlStatements = st.SqlStatements - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -5783,15 +4953,11 @@ func sqlQueryOutputToPb(st *SqlQueryOutput) (*sqlQueryOutputPb, error) { } type sqlQueryOutputPb struct { - EndpointId string `json:"endpoint_id,omitempty"` - - OutputLink string `json:"output_link,omitempty"` - - QueryText string `json:"query_text,omitempty"` - + EndpointId string `json:"endpoint_id,omitempty"` + OutputLink string `json:"output_link,omitempty"` + QueryText string `json:"query_text,omitempty"` SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5861,32 +5027,22 @@ func sqlTaskToPb(st *SqlTask) (*sqlTaskPb, error) { } pb := &sqlTaskPb{} pb.Alert = st.Alert - pb.Dashboard = st.Dashboard - pb.File = st.File - pb.Parameters = st.Parameters - pb.Query = st.Query - pb.WarehouseId = st.WarehouseId return pb, nil } type sqlTaskPb struct { - Alert *SqlTaskAlert `json:"alert,omitempty"` - - Dashboard *SqlTaskDashboard `json:"dashboard,omitempty"` - - File *SqlTaskFile `json:"file,omitempty"` - - Parameters map[string]string `json:"parameters,omitempty"` - - Query *SqlTaskQuery `json:"query,omitempty"` - - WarehouseId string `json:"warehouse_id"` + Alert *SqlTaskAlert `json:"alert,omitempty"` + Dashboard *SqlTaskDashboard `json:"dashboard,omitempty"` + File *SqlTaskFile `json:"file,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + Query *SqlTaskQuery `json:"query,omitempty"` + WarehouseId string `json:"warehouse_id"` } func sqlTaskFromPb(pb *sqlTaskPb) (*SqlTask, error) { @@ -5910,9 +5066,7 @@ func sqlTaskAlertToPb(st *SqlTaskAlert) (*sqlTaskAlertPb, error) { } pb := &sqlTaskAlertPb{} pb.AlertId = st.AlertId - pb.PauseSubscriptions = st.PauseSubscriptions - pb.Subscriptions = st.Subscriptions pb.ForceSendFields = st.ForceSendFields @@ -5920,11 +5074,9 @@ func sqlTaskAlertToPb(st *SqlTaskAlert) (*sqlTaskAlertPb, error) { } type sqlTaskAlertPb struct { - AlertId string `json:"alert_id"` - - PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` - - Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + AlertId string `json:"alert_id"` + PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5956,11 +5108,8 @@ func sqlTaskDashboardToPb(st *SqlTaskDashboard) (*sqlTaskDashboardPb, error) { } pb := &sqlTaskDashboardPb{} pb.CustomSubject = st.CustomSubject - pb.DashboardId = st.DashboardId - pb.PauseSubscriptions = st.PauseSubscriptions - pb.Subscriptions = st.Subscriptions pb.ForceSendFields = st.ForceSendFields @@ -5968,13 +5117,10 @@ func sqlTaskDashboardToPb(st *SqlTaskDashboard) (*sqlTaskDashboardPb, error) { } type sqlTaskDashboardPb struct { - CustomSubject string `json:"custom_subject,omitempty"` - - DashboardId string `json:"dashboard_id"` - - PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` - - Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + DashboardId string `json:"dashboard_id"` + PauseSubscriptions bool `json:"pause_subscriptions,omitempty"` + Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6007,15 +5153,13 @@ func sqlTaskFileToPb(st *SqlTaskFile) (*sqlTaskFilePb, error) { } pb := &sqlTaskFilePb{} pb.Path = st.Path - pb.Source = st.Source return pb, nil } type sqlTaskFilePb struct { - Path string `json:"path"` - + Path string `json:"path"` Source Source `json:"source,omitempty"` } @@ -6060,7 +5204,6 @@ func sqlTaskSubscriptionToPb(st *SqlTaskSubscription) (*sqlTaskSubscriptionPb, e } pb := &sqlTaskSubscriptionPb{} pb.DestinationId = st.DestinationId - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -6069,8 +5212,7 @@ func sqlTaskSubscriptionToPb(st *SqlTaskSubscription) (*sqlTaskSubscriptionPb, e type sqlTaskSubscriptionPb struct { DestinationId string `json:"destination_id,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6101,31 +5243,18 @@ func submitRunToPb(st *SubmitRun) (*submitRunPb, error) { } pb := &submitRunPb{} pb.AccessControlList = st.AccessControlList - pb.BudgetPolicyId = st.BudgetPolicyId - pb.EmailNotifications = st.EmailNotifications - pb.Environments = st.Environments - pb.GitSource = st.GitSource - pb.Health = st.Health - pb.IdempotencyToken = st.IdempotencyToken - pb.NotificationSettings = st.NotificationSettings - pb.Queue = st.Queue - pb.RunAs = st.RunAs - pb.RunName = st.RunName - pb.Tasks = st.Tasks - pb.TimeoutSeconds = st.TimeoutSeconds - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -6133,33 +5262,20 @@ func submitRunToPb(st *SubmitRun) (*submitRunPb, error) { } type submitRunPb struct { - AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - - Environments []JobEnvironment `json:"environments,omitempty"` - - GitSource *GitSource `json:"git_source,omitempty"` - - Health *JobsHealthRules `json:"health,omitempty"` - - IdempotencyToken string `json:"idempotency_token,omitempty"` - - NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` - - Queue *QueueSettings `json:"queue,omitempty"` - - RunAs *JobRunAs `json:"run_as,omitempty"` - - RunName string `json:"run_name,omitempty"` - - Tasks []SubmitTask `json:"tasks,omitempty"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + Environments []JobEnvironment `json:"environments,omitempty"` + GitSource *GitSource `json:"git_source,omitempty"` + Health *JobsHealthRules `json:"health,omitempty"` + IdempotencyToken string `json:"idempotency_token,omitempty"` + NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + Queue *QueueSettings `json:"queue,omitempty"` + RunAs *JobRunAs `json:"run_as,omitempty"` + RunName string `json:"run_name,omitempty"` + Tasks []SubmitTask `json:"tasks,omitempty"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6238,59 +5354,32 @@ func submitTaskToPb(st *SubmitTask) (*submitTaskPb, error) { } pb := &submitTaskPb{} pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask - pb.ConditionTask = st.ConditionTask - pb.DashboardTask = st.DashboardTask - pb.DbtTask = st.DbtTask - pb.DependsOn = st.DependsOn - pb.Description = st.Description - pb.EmailNotifications = st.EmailNotifications - pb.EnvironmentKey = st.EnvironmentKey - pb.ExistingClusterId = st.ExistingClusterId - pb.ForEachTask = st.ForEachTask - pb.GenAiComputeTask = st.GenAiComputeTask - pb.Health = st.Health - pb.Libraries = st.Libraries - pb.NewCluster = st.NewCluster - pb.NotebookTask = st.NotebookTask - pb.NotificationSettings = st.NotificationSettings - pb.PipelineTask = st.PipelineTask - pb.PowerBiTask = st.PowerBiTask - pb.PythonWheelTask = st.PythonWheelTask - pb.RunIf = st.RunIf - pb.RunJobTask = st.RunJobTask - pb.SparkJarTask = st.SparkJarTask - pb.SparkPythonTask = st.SparkPythonTask - pb.SparkSubmitTask = st.SparkSubmitTask - pb.SqlTask = st.SqlTask - pb.TaskKey = st.TaskKey - pb.TimeoutSeconds = st.TimeoutSeconds - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -6298,61 +5387,34 @@ func submitTaskToPb(st *SubmitTask) (*submitTaskPb, error) { } type submitTaskPb struct { - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` - - ConditionTask *ConditionTask `json:"condition_task,omitempty"` - - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` - - DbtTask *DbtTask `json:"dbt_task,omitempty"` - - DependsOn []TaskDependency `json:"depends_on,omitempty"` - - Description string `json:"description,omitempty"` - - EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - - EnvironmentKey string `json:"environment_key,omitempty"` - - ExistingClusterId string `json:"existing_cluster_id,omitempty"` - - ForEachTask *ForEachTask `json:"for_each_task,omitempty"` - - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` - - Health *JobsHealthRules `json:"health,omitempty"` - - Libraries []compute.Library `json:"libraries,omitempty"` - - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` - - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` - - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` - - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` - - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` - - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` - - RunIf RunIf `json:"run_if,omitempty"` - - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` - - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` - - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` - - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` - - SqlTask *SqlTask `json:"sql_task,omitempty"` - - TaskKey string `json:"task_key"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + ConditionTask *ConditionTask `json:"condition_task,omitempty"` + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + DbtTask *DbtTask `json:"dbt_task,omitempty"` + DependsOn []TaskDependency `json:"depends_on,omitempty"` + Description string `json:"description,omitempty"` + EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + EnvironmentKey string `json:"environment_key,omitempty"` + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + Health *JobsHealthRules `json:"health,omitempty"` + Libraries []compute.Library `json:"libraries,omitempty"` + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + RunIf RunIf `json:"run_if,omitempty"` + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + SqlTask *SqlTask `json:"sql_task,omitempty"` + TaskKey string `json:"task_key"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6409,9 +5471,7 @@ func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { } pb := &subscriptionPb{} pb.CustomSubject = st.CustomSubject - pb.Paused = st.Paused - pb.Subscribers = st.Subscribers pb.ForceSendFields = st.ForceSendFields @@ -6419,11 +5479,9 @@ func subscriptionToPb(st *Subscription) (*subscriptionPb, error) { } type subscriptionPb struct { - CustomSubject string `json:"custom_subject,omitempty"` - - Paused bool `json:"paused,omitempty"` - - Subscribers []SubscriptionSubscriber `json:"subscribers,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + Paused bool `json:"paused,omitempty"` + Subscribers []SubscriptionSubscriber `json:"subscribers,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6455,7 +5513,6 @@ func subscriptionSubscriberToPb(st *SubscriptionSubscriber) (*subscriptionSubscr } pb := &subscriptionSubscriberPb{} pb.DestinationId = st.DestinationId - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -6464,8 +5521,7 @@ func subscriptionSubscriberToPb(st *SubscriptionSubscriber) (*subscriptionSubscr type subscriptionSubscriberPb struct { DestinationId string `json:"destination_id,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6496,11 +5552,8 @@ func tableUpdateTriggerConfigurationToPb(st *TableUpdateTriggerConfiguration) (* } pb := &tableUpdateTriggerConfigurationPb{} pb.Condition = st.Condition - pb.MinTimeBetweenTriggersSeconds = st.MinTimeBetweenTriggersSeconds - pb.TableNames = st.TableNames - pb.WaitAfterLastChangeSeconds = st.WaitAfterLastChangeSeconds pb.ForceSendFields = st.ForceSendFields @@ -6508,13 +5561,10 @@ func tableUpdateTriggerConfigurationToPb(st *TableUpdateTriggerConfiguration) (* } type tableUpdateTriggerConfigurationPb struct { - Condition Condition `json:"condition,omitempty"` - - MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` - - TableNames []string `json:"table_names,omitempty"` - - WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + Condition Condition `json:"condition,omitempty"` + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + TableNames []string `json:"table_names,omitempty"` + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6547,69 +5597,37 @@ func taskToPb(st *Task) (*taskPb, error) { } pb := &taskPb{} pb.CleanRoomsNotebookTask = st.CleanRoomsNotebookTask - pb.ConditionTask = st.ConditionTask - pb.DashboardTask = st.DashboardTask - pb.DbtTask = st.DbtTask - pb.DependsOn = st.DependsOn - pb.Description = st.Description - pb.DisableAutoOptimization = st.DisableAutoOptimization - pb.EmailNotifications = st.EmailNotifications - pb.EnvironmentKey = st.EnvironmentKey - pb.ExistingClusterId = st.ExistingClusterId - pb.ForEachTask = st.ForEachTask - pb.GenAiComputeTask = st.GenAiComputeTask - pb.Health = st.Health - pb.JobClusterKey = st.JobClusterKey - pb.Libraries = st.Libraries - pb.MaxRetries = st.MaxRetries - pb.MinRetryIntervalMillis = st.MinRetryIntervalMillis - pb.NewCluster = st.NewCluster - pb.NotebookTask = st.NotebookTask - pb.NotificationSettings = st.NotificationSettings - pb.PipelineTask = st.PipelineTask - pb.PowerBiTask = st.PowerBiTask - pb.PythonWheelTask = st.PythonWheelTask - pb.RetryOnTimeout = st.RetryOnTimeout - pb.RunIf = st.RunIf - pb.RunJobTask = st.RunJobTask - pb.SparkJarTask = st.SparkJarTask - pb.SparkPythonTask = st.SparkPythonTask - pb.SparkSubmitTask = st.SparkSubmitTask - pb.SqlTask = st.SqlTask - pb.TaskKey = st.TaskKey - pb.TimeoutSeconds = st.TimeoutSeconds - pb.WebhookNotifications = st.WebhookNotifications pb.ForceSendFields = st.ForceSendFields @@ -6617,71 +5635,39 @@ func taskToPb(st *Task) (*taskPb, error) { } type taskPb struct { - CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` - - ConditionTask *ConditionTask `json:"condition_task,omitempty"` - - DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` - - DbtTask *DbtTask `json:"dbt_task,omitempty"` - - DependsOn []TaskDependency `json:"depends_on,omitempty"` - - Description string `json:"description,omitempty"` - - DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"` - - EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"` - - EnvironmentKey string `json:"environment_key,omitempty"` - - ExistingClusterId string `json:"existing_cluster_id,omitempty"` - - ForEachTask *ForEachTask `json:"for_each_task,omitempty"` - - GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` - - Health *JobsHealthRules `json:"health,omitempty"` - - JobClusterKey string `json:"job_cluster_key,omitempty"` - - Libraries []compute.Library `json:"libraries,omitempty"` - - MaxRetries int `json:"max_retries,omitempty"` - - MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"` - - NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` - - NotebookTask *NotebookTask `json:"notebook_task,omitempty"` - - NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` - - PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` - - PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` - - PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` - - RetryOnTimeout bool `json:"retry_on_timeout,omitempty"` - - RunIf RunIf `json:"run_if,omitempty"` - - RunJobTask *RunJobTask `json:"run_job_task,omitempty"` - - SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` - - SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` - - SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` - - SqlTask *SqlTask `json:"sql_task,omitempty"` - - TaskKey string `json:"task_key"` - - TimeoutSeconds int `json:"timeout_seconds,omitempty"` - - WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` + CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"` + ConditionTask *ConditionTask `json:"condition_task,omitempty"` + DashboardTask *DashboardTask `json:"dashboard_task,omitempty"` + DbtTask *DbtTask `json:"dbt_task,omitempty"` + DependsOn []TaskDependency `json:"depends_on,omitempty"` + Description string `json:"description,omitempty"` + DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"` + EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"` + EnvironmentKey string `json:"environment_key,omitempty"` + ExistingClusterId string `json:"existing_cluster_id,omitempty"` + ForEachTask *ForEachTask `json:"for_each_task,omitempty"` + GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"` + Health *JobsHealthRules `json:"health,omitempty"` + JobClusterKey string `json:"job_cluster_key,omitempty"` + Libraries []compute.Library `json:"libraries,omitempty"` + MaxRetries int `json:"max_retries,omitempty"` + MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"` + NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"` + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` + NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"` + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"` + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` + RetryOnTimeout bool `json:"retry_on_timeout,omitempty"` + RunIf RunIf `json:"run_if,omitempty"` + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + SqlTask *SqlTask `json:"sql_task,omitempty"` + TaskKey string `json:"task_key"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` + WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6743,7 +5729,6 @@ func taskDependencyToPb(st *TaskDependency) (*taskDependencyPb, error) { } pb := &taskDependencyPb{} pb.Outcome = st.Outcome - pb.TaskKey = st.TaskKey pb.ForceSendFields = st.ForceSendFields @@ -6752,7 +5737,6 @@ func taskDependencyToPb(st *TaskDependency) (*taskDependencyPb, error) { type taskDependencyPb struct { Outcome string `json:"outcome,omitempty"` - TaskKey string `json:"task_key"` ForceSendFields []string `json:"-" url:"-"` @@ -6784,15 +5768,10 @@ func taskEmailNotificationsToPb(st *TaskEmailNotifications) (*taskEmailNotificat } pb := &taskEmailNotificationsPb{} pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns - pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded - pb.OnFailure = st.OnFailure - pb.OnStart = st.OnStart - pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded - pb.OnSuccess = st.OnSuccess pb.ForceSendFields = st.ForceSendFields @@ -6800,17 +5779,12 @@ func taskEmailNotificationsToPb(st *TaskEmailNotifications) (*taskEmailNotificat } type taskEmailNotificationsPb struct { - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` - + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"` - - OnFailure []string `json:"on_failure,omitempty"` - - OnStart []string `json:"on_start,omitempty"` - - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` - - OnSuccess []string `json:"on_success,omitempty"` + OnFailure []string `json:"on_failure,omitempty"` + OnStart []string `json:"on_start,omitempty"` + OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` + OnSuccess []string `json:"on_success,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6845,9 +5819,7 @@ func taskNotificationSettingsToPb(st *TaskNotificationSettings) (*taskNotificati } pb := &taskNotificationSettingsPb{} pb.AlertOnLastAttempt = st.AlertOnLastAttempt - pb.NoAlertForCanceledRuns = st.NoAlertForCanceledRuns - pb.NoAlertForSkippedRuns = st.NoAlertForSkippedRuns pb.ForceSendFields = st.ForceSendFields @@ -6855,11 +5827,9 @@ func taskNotificationSettingsToPb(st *TaskNotificationSettings) (*taskNotificati } type taskNotificationSettingsPb struct { - AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` - + AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"` - - NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` + NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6891,9 +5861,7 @@ func terminationDetailsToPb(st *TerminationDetails) (*terminationDetailsPb, erro } pb := &terminationDetailsPb{} pb.Code = st.Code - pb.Message = st.Message - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -6901,11 +5869,9 @@ func terminationDetailsToPb(st *TerminationDetails) (*terminationDetailsPb, erro } type terminationDetailsPb struct { - Code TerminationCodeCode `json:"code,omitempty"` - - Message string `json:"message,omitempty"` - - Type TerminationTypeType `json:"type,omitempty"` + Code TerminationCodeCode `json:"code,omitempty"` + Message string `json:"message,omitempty"` + Type TerminationTypeType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6973,13 +5939,9 @@ func triggerSettingsToPb(st *TriggerSettings) (*triggerSettingsPb, error) { } pb := &triggerSettingsPb{} pb.FileArrival = st.FileArrival - pb.PauseStatus = st.PauseStatus - pb.Periodic = st.Periodic - pb.Table = st.Table - pb.TableUpdate = st.TableUpdate return pb, nil @@ -6987,13 +5949,9 @@ func triggerSettingsToPb(st *TriggerSettings) (*triggerSettingsPb, error) { type triggerSettingsPb struct { FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` - - PauseStatus PauseStatus `json:"pause_status,omitempty"` - - Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` - - Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` - + PauseStatus PauseStatus `json:"pause_status,omitempty"` + Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` + Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` TableUpdate *TableUpdateTriggerConfiguration `json:"table_update,omitempty"` } @@ -7017,20 +5975,16 @@ func updateJobToPb(st *UpdateJob) (*updateJobPb, error) { } pb := &updateJobPb{} pb.FieldsToRemove = st.FieldsToRemove - pb.JobId = st.JobId - pb.NewSettings = st.NewSettings return pb, nil } type updateJobPb struct { - FieldsToRemove []string `json:"fields_to_remove,omitempty"` - - JobId int64 `json:"job_id"` - - NewSettings *JobSettings `json:"new_settings,omitempty"` + FieldsToRemove []string `json:"fields_to_remove,omitempty"` + JobId int64 `json:"job_id"` + NewSettings *JobSettings `json:"new_settings,omitempty"` } func updateJobFromPb(pb *updateJobPb) (*UpdateJob, error) { @@ -7072,9 +6026,7 @@ func viewItemToPb(st *ViewItem) (*viewItemPb, error) { } pb := &viewItemPb{} pb.Content = st.Content - pb.Name = st.Name - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -7082,11 +6034,9 @@ func viewItemToPb(st *ViewItem) (*viewItemPb, error) { } type viewItemPb struct { - Content string `json:"content,omitempty"` - - Name string `json:"name,omitempty"` - - Type ViewType `json:"type,omitempty"` + Content string `json:"content,omitempty"` + Name string `json:"name,omitempty"` + Type ViewType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7142,13 +6092,9 @@ func webhookNotificationsToPb(st *WebhookNotifications) (*webhookNotificationsPb } pb := &webhookNotificationsPb{} pb.OnDurationWarningThresholdExceeded = st.OnDurationWarningThresholdExceeded - pb.OnFailure = st.OnFailure - pb.OnStart = st.OnStart - pb.OnStreamingBacklogExceeded = st.OnStreamingBacklogExceeded - pb.OnSuccess = st.OnSuccess return pb, nil @@ -7156,14 +6102,10 @@ func webhookNotificationsToPb(st *WebhookNotifications) (*webhookNotificationsPb type webhookNotificationsPb struct { OnDurationWarningThresholdExceeded []Webhook `json:"on_duration_warning_threshold_exceeded,omitempty"` - - OnFailure []Webhook `json:"on_failure,omitempty"` - - OnStart []Webhook `json:"on_start,omitempty"` - - OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"` - - OnSuccess []Webhook `json:"on_success,omitempty"` + OnFailure []Webhook `json:"on_failure,omitempty"` + OnStart []Webhook `json:"on_start,omitempty"` + OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"` + OnSuccess []Webhook `json:"on_success,omitempty"` } func webhookNotificationsFromPb(pb *webhookNotificationsPb) (*WebhookNotifications, error) { @@ -7215,3 +6157,57 @@ func (st *widgetErrorDetailPb) UnmarshalJSON(b []byte) error { func (st widgetErrorDetailPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/jobs/model.go b/service/jobs/model.go index c2f02ff8d..838c4493e 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -5,8 +5,6 @@ package jobs import ( "encoding/json" "fmt" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/compute" ) @@ -9048,57 +9046,3 @@ func (st WidgetErrorDetail) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/marketplace/internal.go b/service/marketplace/internal.go index adb49814b..891e065d5 100755 --- a/service/marketplace/internal.go +++ b/service/marketplace/internal.go @@ -3,6 +3,10 @@ package marketplace import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,7 +16,6 @@ func addExchangeForListingRequestToPb(st *AddExchangeForListingRequest) (*addExc } pb := &addExchangeForListingRequestPb{} pb.ExchangeId = st.ExchangeId - pb.ListingId = st.ListingId return pb, nil @@ -20,8 +23,7 @@ func addExchangeForListingRequestToPb(st *AddExchangeForListingRequest) (*addExc type addExchangeForListingRequestPb struct { ExchangeId string `json:"exchange_id"` - - ListingId string `json:"listing_id"` + ListingId string `json:"listing_id"` } func addExchangeForListingRequestFromPb(pb *addExchangeForListingRequestPb) (*AddExchangeForListingRequest, error) { @@ -185,11 +187,8 @@ func contactInfoToPb(st *ContactInfo) (*contactInfoPb, error) { } pb := &contactInfoPb{} pb.Company = st.Company - pb.Email = st.Email - pb.FirstName = st.FirstName - pb.LastName = st.LastName pb.ForceSendFields = st.ForceSendFields @@ -197,13 +196,10 @@ func contactInfoToPb(st *ContactInfo) (*contactInfoPb, error) { } type contactInfoPb struct { - Company string `json:"company,omitempty"` - - Email string `json:"email,omitempty"` - + Company string `json:"company,omitempty"` + Email string `json:"email,omitempty"` FirstName string `json:"first_name,omitempty"` - - LastName string `json:"last_name,omitempty"` + LastName string `json:"last_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -356,11 +352,8 @@ func createFileRequestToPb(st *CreateFileRequest) (*createFileRequestPb, error) } pb := &createFileRequestPb{} pb.DisplayName = st.DisplayName - pb.FileParent = st.FileParent - pb.MarketplaceFileType = st.MarketplaceFileType - pb.MimeType = st.MimeType pb.ForceSendFields = st.ForceSendFields @@ -368,13 +361,10 @@ func createFileRequestToPb(st *CreateFileRequest) (*createFileRequestPb, error) } type createFileRequestPb struct { - DisplayName string `json:"display_name,omitempty"` - - FileParent FileParent `json:"file_parent"` - + DisplayName string `json:"display_name,omitempty"` + FileParent FileParent `json:"file_parent"` MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type"` - - MimeType string `json:"mime_type"` + MimeType string `json:"mime_type"` ForceSendFields []string `json:"-" url:"-"` } @@ -407,7 +397,6 @@ func createFileResponseToPb(st *CreateFileResponse) (*createFileResponsePb, erro } pb := &createFileResponsePb{} pb.FileInfo = st.FileInfo - pb.UploadUrl = st.UploadUrl pb.ForceSendFields = st.ForceSendFields @@ -415,9 +404,8 @@ func createFileResponseToPb(st *CreateFileResponse) (*createFileResponsePb, erro } type createFileResponsePb struct { - FileInfo *FileInfo `json:"file_info,omitempty"` - - UploadUrl string `json:"upload_url,omitempty"` + FileInfo *FileInfo `json:"file_info,omitempty"` + UploadUrl string `json:"upload_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -448,15 +436,10 @@ func createInstallationRequestToPb(st *CreateInstallationRequest) (*createInstal } pb := &createInstallationRequestPb{} pb.AcceptedConsumerTerms = st.AcceptedConsumerTerms - pb.CatalogName = st.CatalogName - pb.ListingId = st.ListingId - pb.RecipientType = st.RecipientType - pb.RepoDetail = st.RepoDetail - pb.ShareName = st.ShareName pb.ForceSendFields = st.ForceSendFields @@ -464,17 +447,12 @@ func createInstallationRequestToPb(st *CreateInstallationRequest) (*createInstal } type createInstallationRequestPb struct { - AcceptedConsumerTerms *ConsumerTerms `json:"accepted_consumer_terms,omitempty"` - - CatalogName string `json:"catalog_name,omitempty"` - - ListingId string `json:"-" url:"-"` - - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` - - RepoDetail *RepoInstallation `json:"repo_detail,omitempty"` - - ShareName string `json:"share_name,omitempty"` + AcceptedConsumerTerms *ConsumerTerms `json:"accepted_consumer_terms,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + ListingId string `json:"-" url:"-"` + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + RepoDetail *RepoInstallation `json:"repo_detail,omitempty"` + ShareName string `json:"share_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -569,21 +547,13 @@ func createPersonalizationRequestToPb(st *CreatePersonalizationRequest) (*create } pb := &createPersonalizationRequestPb{} pb.AcceptedConsumerTerms = st.AcceptedConsumerTerms - pb.Comment = st.Comment - pb.Company = st.Company - pb.FirstName = st.FirstName - pb.IntendedUse = st.IntendedUse - pb.IsFromLighthouse = st.IsFromLighthouse - pb.LastName = st.LastName - pb.ListingId = st.ListingId - pb.RecipientType = st.RecipientType pb.ForceSendFields = st.ForceSendFields @@ -591,23 +561,15 @@ func createPersonalizationRequestToPb(st *CreatePersonalizationRequest) (*create } type createPersonalizationRequestPb struct { - AcceptedConsumerTerms ConsumerTerms `json:"accepted_consumer_terms"` - - Comment string `json:"comment,omitempty"` - - Company string `json:"company,omitempty"` - - FirstName string `json:"first_name,omitempty"` - - IntendedUse string `json:"intended_use"` - - IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` - - LastName string `json:"last_name,omitempty"` - - ListingId string `json:"-" url:"-"` - - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + AcceptedConsumerTerms ConsumerTerms `json:"accepted_consumer_terms"` + Comment string `json:"comment,omitempty"` + Company string `json:"company,omitempty"` + FirstName string `json:"first_name,omitempty"` + IntendedUse string `json:"intended_use"` + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + LastName string `json:"last_name,omitempty"` + ListingId string `json:"-" url:"-"` + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -741,16 +703,14 @@ func dataRefreshInfoToPb(st *DataRefreshInfo) (*dataRefreshInfoPb, error) { } pb := &dataRefreshInfoPb{} pb.Interval = st.Interval - pb.Unit = st.Unit return pb, nil } type dataRefreshInfoPb struct { - Interval int64 `json:"interval"` - - Unit DataRefresh `json:"unit"` + Interval int64 `json:"interval"` + Unit DataRefresh `json:"unit"` } func dataRefreshInfoFromPb(pb *dataRefreshInfoPb) (*DataRefreshInfo, error) { @@ -905,7 +865,6 @@ func deleteInstallationRequestToPb(st *DeleteInstallationRequest) (*deleteInstal } pb := &deleteInstallationRequestPb{} pb.InstallationId = st.InstallationId - pb.ListingId = st.ListingId return pb, nil @@ -913,8 +872,7 @@ func deleteInstallationRequestToPb(st *DeleteInstallationRequest) (*deleteInstal type deleteInstallationRequestPb struct { InstallationId string `json:"-" url:"-"` - - ListingId string `json:"-" url:"-"` + ListingId string `json:"-" url:"-"` } func deleteInstallationRequestFromPb(pb *deleteInstallationRequestPb) (*DeleteInstallationRequest, error) { @@ -1045,21 +1003,13 @@ func exchangeToPb(st *Exchange) (*exchangePb, error) { } pb := &exchangePb{} pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Filters = st.Filters - pb.Id = st.Id - pb.LinkedListings = st.LinkedListings - pb.Name = st.Name - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -1067,23 +1017,15 @@ func exchangeToPb(st *Exchange) (*exchangePb, error) { } type exchangePb struct { - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - Filters []ExchangeFilter `json:"filters,omitempty"` - - Id string `json:"id,omitempty"` - + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + Filters []ExchangeFilter `json:"filters,omitempty"` + Id string `json:"id,omitempty"` LinkedListings []ExchangeListing `json:"linked_listings,omitempty"` - - Name string `json:"name"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Name string `json:"name"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1121,21 +1063,13 @@ func exchangeFilterToPb(st *ExchangeFilter) (*exchangeFilterPb, error) { } pb := &exchangeFilterPb{} pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.ExchangeId = st.ExchangeId - pb.FilterType = st.FilterType - pb.FilterValue = st.FilterValue - pb.Id = st.Id - pb.Name = st.Name - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -1143,23 +1077,15 @@ func exchangeFilterToPb(st *ExchangeFilter) (*exchangeFilterPb, error) { } type exchangeFilterPb struct { - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - ExchangeId string `json:"exchange_id"` - - FilterType ExchangeFilterType `json:"filter_type"` - - FilterValue string `json:"filter_value"` - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + ExchangeId string `json:"exchange_id"` + FilterType ExchangeFilterType `json:"filter_type"` + FilterValue string `json:"filter_value"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1197,17 +1123,11 @@ func exchangeListingToPb(st *ExchangeListing) (*exchangeListingPb, error) { } pb := &exchangeListingPb{} pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.ExchangeId = st.ExchangeId - pb.ExchangeName = st.ExchangeName - pb.Id = st.Id - pb.ListingId = st.ListingId - pb.ListingName = st.ListingName pb.ForceSendFields = st.ForceSendFields @@ -1215,19 +1135,13 @@ func exchangeListingToPb(st *ExchangeListing) (*exchangeListingPb, error) { } type exchangeListingPb struct { - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - ExchangeId string `json:"exchange_id,omitempty"` - + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + ExchangeId string `json:"exchange_id,omitempty"` ExchangeName string `json:"exchange_name,omitempty"` - - Id string `json:"id,omitempty"` - - ListingId string `json:"listing_id,omitempty"` - - ListingName string `json:"listing_name,omitempty"` + Id string `json:"id,omitempty"` + ListingId string `json:"listing_id,omitempty"` + ListingName string `json:"listing_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1263,23 +1177,14 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } pb := &fileInfoPb{} pb.CreatedAt = st.CreatedAt - pb.DisplayName = st.DisplayName - pb.DownloadLink = st.DownloadLink - pb.FileParent = st.FileParent - pb.Id = st.Id - pb.MarketplaceFileType = st.MarketplaceFileType - pb.MimeType = st.MimeType - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage - pb.UpdatedAt = st.UpdatedAt pb.ForceSendFields = st.ForceSendFields @@ -1287,25 +1192,16 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } type fileInfoPb struct { - CreatedAt int64 `json:"created_at,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - DownloadLink string `json:"download_link,omitempty"` - - FileParent *FileParent `json:"file_parent,omitempty"` - - Id string `json:"id,omitempty"` - + CreatedAt int64 `json:"created_at,omitempty"` + DisplayName string `json:"display_name,omitempty"` + DownloadLink string `json:"download_link,omitempty"` + FileParent *FileParent `json:"file_parent,omitempty"` + Id string `json:"id,omitempty"` MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` - - MimeType string `json:"mime_type,omitempty"` - - Status FileStatus `json:"status,omitempty"` - - StatusMessage string `json:"status_message,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` + MimeType string `json:"mime_type,omitempty"` + Status FileStatus `json:"status,omitempty"` + StatusMessage string `json:"status_message,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1344,7 +1240,6 @@ func fileParentToPb(st *FileParent) (*fileParentPb, error) { } pb := &fileParentPb{} pb.FileParentType = st.FileParentType - pb.ParentId = st.ParentId pb.ForceSendFields = st.ForceSendFields @@ -1353,8 +1248,7 @@ func fileParentToPb(st *FileParent) (*fileParentPb, error) { type fileParentPb struct { FileParentType FileParentType `json:"file_parent_type,omitempty"` - - ParentId string `json:"parent_id,omitempty"` + ParentId string `json:"parent_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1517,9 +1411,7 @@ func getListingContentMetadataRequestToPb(st *GetListingContentMetadataRequest) } pb := &getListingContentMetadataRequestPb{} pb.ListingId = st.ListingId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1528,9 +1420,7 @@ func getListingContentMetadataRequestToPb(st *GetListingContentMetadataRequest) type getListingContentMetadataRequestPb struct { ListingId string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1563,7 +1453,6 @@ func getListingContentMetadataResponseToPb(st *GetListingContentMetadataResponse } pb := &getListingContentMetadataResponsePb{} pb.NextPageToken = st.NextPageToken - pb.SharedDataObjects = st.SharedDataObjects pb.ForceSendFields = st.ForceSendFields @@ -1571,8 +1460,7 @@ func getListingContentMetadataResponseToPb(st *GetListingContentMetadataResponse } type getListingContentMetadataResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` SharedDataObjects []SharedDataObject `json:"shared_data_objects,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1652,7 +1540,6 @@ func getListingsRequestToPb(st *GetListingsRequest) (*getListingsRequestPb, erro } pb := &getListingsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1660,8 +1547,7 @@ func getListingsRequestToPb(st *GetListingsRequest) (*getListingsRequestPb, erro } type getListingsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1693,7 +1579,6 @@ func getListingsResponseToPb(st *GetListingsResponse) (*getListingsResponsePb, e } pb := &getListingsResponsePb{} pb.Listings = st.Listings - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -1701,9 +1586,8 @@ func getListingsResponseToPb(st *GetListingsResponse) (*getListingsResponsePb, e } type getListingsResponsePb struct { - Listings []Listing `json:"listings,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Listings []Listing `json:"listings,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1854,29 +1738,17 @@ func installationDetailToPb(st *InstallationDetail) (*installationDetailPb, erro } pb := &installationDetailPb{} pb.CatalogName = st.CatalogName - pb.ErrorMessage = st.ErrorMessage - pb.Id = st.Id - pb.InstalledOn = st.InstalledOn - pb.ListingId = st.ListingId - pb.ListingName = st.ListingName - pb.RecipientType = st.RecipientType - pb.RepoName = st.RepoName - pb.RepoPath = st.RepoPath - pb.ShareName = st.ShareName - pb.Status = st.Status - pb.TokenDetail = st.TokenDetail - pb.Tokens = st.Tokens pb.ForceSendFields = st.ForceSendFields @@ -1884,31 +1756,19 @@ func installationDetailToPb(st *InstallationDetail) (*installationDetailPb, erro } type installationDetailPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - ErrorMessage string `json:"error_message,omitempty"` - - Id string `json:"id,omitempty"` - - InstalledOn int64 `json:"installed_on,omitempty"` - - ListingId string `json:"listing_id,omitempty"` - - ListingName string `json:"listing_name,omitempty"` - + CatalogName string `json:"catalog_name,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` + Id string `json:"id,omitempty"` + InstalledOn int64 `json:"installed_on,omitempty"` + ListingId string `json:"listing_id,omitempty"` + ListingName string `json:"listing_name,omitempty"` RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` - - RepoName string `json:"repo_name,omitempty"` - - RepoPath string `json:"repo_path,omitempty"` - - ShareName string `json:"share_name,omitempty"` - - Status InstallationStatus `json:"status,omitempty"` - - TokenDetail *TokenDetail `json:"token_detail,omitempty"` - - Tokens []TokenInfo `json:"tokens,omitempty"` + RepoName string `json:"repo_name,omitempty"` + RepoPath string `json:"repo_path,omitempty"` + ShareName string `json:"share_name,omitempty"` + Status InstallationStatus `json:"status,omitempty"` + TokenDetail *TokenDetail `json:"token_detail,omitempty"` + Tokens []TokenInfo `json:"tokens,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1950,7 +1810,6 @@ func listAllInstallationsRequestToPb(st *ListAllInstallationsRequest) (*listAllI } pb := &listAllInstallationsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1958,8 +1817,7 @@ func listAllInstallationsRequestToPb(st *ListAllInstallationsRequest) (*listAllI } type listAllInstallationsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1991,7 +1849,6 @@ func listAllInstallationsResponseToPb(st *ListAllInstallationsResponse) (*listAl } pb := &listAllInstallationsResponsePb{} pb.Installations = st.Installations - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2000,8 +1857,7 @@ func listAllInstallationsResponseToPb(st *ListAllInstallationsResponse) (*listAl type listAllInstallationsResponsePb struct { Installations []InstallationDetail `json:"installations,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2032,7 +1888,6 @@ func listAllPersonalizationRequestsRequestToPb(st *ListAllPersonalizationRequest } pb := &listAllPersonalizationRequestsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2040,8 +1895,7 @@ func listAllPersonalizationRequestsRequestToPb(st *ListAllPersonalizationRequest } type listAllPersonalizationRequestsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2073,7 +1927,6 @@ func listAllPersonalizationRequestsResponseToPb(st *ListAllPersonalizationReques } pb := &listAllPersonalizationRequestsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.PersonalizationRequests = st.PersonalizationRequests pb.ForceSendFields = st.ForceSendFields @@ -2081,8 +1934,7 @@ func listAllPersonalizationRequestsResponseToPb(st *ListAllPersonalizationReques } type listAllPersonalizationRequestsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2114,9 +1966,7 @@ func listExchangeFiltersRequestToPb(st *ListExchangeFiltersRequest) (*listExchan } pb := &listExchangeFiltersRequestPb{} pb.ExchangeId = st.ExchangeId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2125,10 +1975,8 @@ func listExchangeFiltersRequestToPb(st *ListExchangeFiltersRequest) (*listExchan type listExchangeFiltersRequestPb struct { ExchangeId string `json:"-" url:"exchange_id"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2160,7 +2008,6 @@ func listExchangeFiltersResponseToPb(st *ListExchangeFiltersResponse) (*listExch } pb := &listExchangeFiltersResponsePb{} pb.Filters = st.Filters - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2168,9 +2015,8 @@ func listExchangeFiltersResponseToPb(st *ListExchangeFiltersResponse) (*listExch } type listExchangeFiltersResponsePb struct { - Filters []ExchangeFilter `json:"filters,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Filters []ExchangeFilter `json:"filters,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2201,9 +2047,7 @@ func listExchangesForListingRequestToPb(st *ListExchangesForListingRequest) (*li } pb := &listExchangesForListingRequestPb{} pb.ListingId = st.ListingId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2212,9 +2056,7 @@ func listExchangesForListingRequestToPb(st *ListExchangesForListingRequest) (*li type listExchangesForListingRequestPb struct { ListingId string `json:"-" url:"listing_id"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2247,7 +2089,6 @@ func listExchangesForListingResponseToPb(st *ListExchangesForListingResponse) (* } pb := &listExchangesForListingResponsePb{} pb.ExchangeListing = st.ExchangeListing - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2256,8 +2097,7 @@ func listExchangesForListingResponseToPb(st *ListExchangesForListingResponse) (* type listExchangesForListingResponsePb struct { ExchangeListing []ExchangeListing `json:"exchange_listing,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2288,7 +2128,6 @@ func listExchangesRequestToPb(st *ListExchangesRequest) (*listExchangesRequestPb } pb := &listExchangesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2296,8 +2135,7 @@ func listExchangesRequestToPb(st *ListExchangesRequest) (*listExchangesRequestPb } type listExchangesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2329,7 +2167,6 @@ func listExchangesResponseToPb(st *ListExchangesResponse) (*listExchangesRespons } pb := &listExchangesResponsePb{} pb.Exchanges = st.Exchanges - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2337,9 +2174,8 @@ func listExchangesResponseToPb(st *ListExchangesResponse) (*listExchangesRespons } type listExchangesResponsePb struct { - Exchanges []Exchange `json:"exchanges,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Exchanges []Exchange `json:"exchanges,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2370,9 +2206,7 @@ func listFilesRequestToPb(st *ListFilesRequest) (*listFilesRequestPb, error) { } pb := &listFilesRequestPb{} pb.FileParent = st.FileParent - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2381,10 +2215,8 @@ func listFilesRequestToPb(st *ListFilesRequest) (*listFilesRequestPb, error) { type listFilesRequestPb struct { FileParent FileParent `json:"-" url:"file_parent"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2416,7 +2248,6 @@ func listFilesResponseToPb(st *ListFilesResponse) (*listFilesResponsePb, error) } pb := &listFilesResponsePb{} pb.FileInfos = st.FileInfos - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2424,9 +2255,8 @@ func listFilesResponseToPb(st *ListFilesResponse) (*listFilesResponsePb, error) } type listFilesResponsePb struct { - FileInfos []FileInfo `json:"file_infos,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + FileInfos []FileInfo `json:"file_infos,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2457,9 +2287,7 @@ func listFulfillmentsRequestToPb(st *ListFulfillmentsRequest) (*listFulfillments } pb := &listFulfillmentsRequestPb{} pb.ListingId = st.ListingId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2468,9 +2296,7 @@ func listFulfillmentsRequestToPb(st *ListFulfillmentsRequest) (*listFulfillments type listFulfillmentsRequestPb struct { ListingId string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2503,7 +2329,6 @@ func listFulfillmentsResponseToPb(st *ListFulfillmentsResponse) (*listFulfillmen } pb := &listFulfillmentsResponsePb{} pb.Fulfillments = st.Fulfillments - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2511,9 +2336,8 @@ func listFulfillmentsResponseToPb(st *ListFulfillmentsResponse) (*listFulfillmen } type listFulfillmentsResponsePb struct { - Fulfillments []ListingFulfillment `json:"fulfillments,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Fulfillments []ListingFulfillment `json:"fulfillments,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2544,9 +2368,7 @@ func listInstallationsRequestToPb(st *ListInstallationsRequest) (*listInstallati } pb := &listInstallationsRequestPb{} pb.ListingId = st.ListingId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2555,9 +2377,7 @@ func listInstallationsRequestToPb(st *ListInstallationsRequest) (*listInstallati type listInstallationsRequestPb struct { ListingId string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2590,7 +2410,6 @@ func listInstallationsResponseToPb(st *ListInstallationsResponse) (*listInstalla } pb := &listInstallationsResponsePb{} pb.Installations = st.Installations - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2599,8 +2418,7 @@ func listInstallationsResponseToPb(st *ListInstallationsResponse) (*listInstalla type listInstallationsResponsePb struct { Installations []InstallationDetail `json:"installations,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2631,9 +2449,7 @@ func listListingsForExchangeRequestToPb(st *ListListingsForExchangeRequest) (*li } pb := &listListingsForExchangeRequestPb{} pb.ExchangeId = st.ExchangeId - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2642,10 +2458,8 @@ func listListingsForExchangeRequestToPb(st *ListListingsForExchangeRequest) (*li type listListingsForExchangeRequestPb struct { ExchangeId string `json:"-" url:"exchange_id"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2677,7 +2491,6 @@ func listListingsForExchangeResponseToPb(st *ListListingsForExchangeResponse) (* } pb := &listListingsForExchangeResponsePb{} pb.ExchangeListings = st.ExchangeListings - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2686,8 +2499,7 @@ func listListingsForExchangeResponseToPb(st *ListListingsForExchangeResponse) (* type listListingsForExchangeResponsePb struct { ExchangeListings []ExchangeListing `json:"exchange_listings,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2718,21 +2530,13 @@ func listListingsRequestToPb(st *ListListingsRequest) (*listListingsRequestPb, e } pb := &listListingsRequestPb{} pb.Assets = st.Assets - pb.Categories = st.Categories - pb.IsFree = st.IsFree - pb.IsPrivateExchange = st.IsPrivateExchange - pb.IsStaffPick = st.IsStaffPick - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.ProviderIds = st.ProviderIds - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -2740,23 +2544,15 @@ func listListingsRequestToPb(st *ListListingsRequest) (*listListingsRequestPb, e } type listListingsRequestPb struct { - Assets []AssetType `json:"-" url:"assets,omitempty"` - - Categories []Category `json:"-" url:"categories,omitempty"` - - IsFree bool `json:"-" url:"is_free,omitempty"` - - IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` - - IsStaffPick bool `json:"-" url:"is_staff_pick,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ProviderIds []string `json:"-" url:"provider_ids,omitempty"` - - Tags []ListingTag `json:"-" url:"tags,omitempty"` + Assets []AssetType `json:"-" url:"assets,omitempty"` + Categories []Category `json:"-" url:"categories,omitempty"` + IsFree bool `json:"-" url:"is_free,omitempty"` + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + IsStaffPick bool `json:"-" url:"is_staff_pick,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + Tags []ListingTag `json:"-" url:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2794,7 +2590,6 @@ func listListingsResponseToPb(st *ListListingsResponse) (*listListingsResponsePb } pb := &listListingsResponsePb{} pb.Listings = st.Listings - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2802,9 +2597,8 @@ func listListingsResponseToPb(st *ListListingsResponse) (*listListingsResponsePb } type listListingsResponsePb struct { - Listings []Listing `json:"listings,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Listings []Listing `json:"listings,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2835,9 +2629,7 @@ func listProviderAnalyticsDashboardResponseToPb(st *ListProviderAnalyticsDashboa } pb := &listProviderAnalyticsDashboardResponsePb{} pb.DashboardId = st.DashboardId - pb.Id = st.Id - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -2846,10 +2638,8 @@ func listProviderAnalyticsDashboardResponseToPb(st *ListProviderAnalyticsDashboa type listProviderAnalyticsDashboardResponsePb struct { DashboardId string `json:"dashboard_id"` - - Id string `json:"id"` - - Version int64 `json:"version,omitempty"` + Id string `json:"id"` + Version int64 `json:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2881,9 +2671,7 @@ func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb } pb := &listProvidersRequestPb{} pb.IsFeatured = st.IsFeatured - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2891,11 +2679,9 @@ func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb } type listProvidersRequestPb struct { - IsFeatured bool `json:"-" url:"is_featured,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + IsFeatured bool `json:"-" url:"is_featured,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2927,7 +2713,6 @@ func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersRespons } pb := &listProvidersResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Providers = st.Providers pb.ForceSendFields = st.ForceSendFields @@ -2935,9 +2720,8 @@ func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersRespons } type listProvidersResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Providers []ProviderInfo `json:"providers,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Providers []ProviderInfo `json:"providers,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2968,9 +2752,7 @@ func listingToPb(st *Listing) (*listingPb, error) { } pb := &listingPb{} pb.Detail = st.Detail - pb.Id = st.Id - pb.Summary = st.Summary pb.ForceSendFields = st.ForceSendFields @@ -2978,10 +2760,8 @@ func listingToPb(st *Listing) (*listingPb, error) { } type listingPb struct { - Detail *ListingDetail `json:"detail,omitempty"` - - Id string `json:"id,omitempty"` - + Detail *ListingDetail `json:"detail,omitempty"` + Id string `json:"id,omitempty"` Summary ListingSummary `json:"summary"` ForceSendFields []string `json:"-" url:"-"` @@ -3014,41 +2794,23 @@ func listingDetailToPb(st *ListingDetail) (*listingDetailPb, error) { } pb := &listingDetailPb{} pb.Assets = st.Assets - pb.CollectionDateEnd = st.CollectionDateEnd - pb.CollectionDateStart = st.CollectionDateStart - pb.CollectionGranularity = st.CollectionGranularity - pb.Cost = st.Cost - pb.DataSource = st.DataSource - pb.Description = st.Description - pb.DocumentationLink = st.DocumentationLink - pb.EmbeddedNotebookFileInfos = st.EmbeddedNotebookFileInfos - pb.FileIds = st.FileIds - pb.GeographicalCoverage = st.GeographicalCoverage - pb.License = st.License - pb.PricingModel = st.PricingModel - pb.PrivacyPolicyLink = st.PrivacyPolicyLink - pb.Size = st.Size - pb.SupportLink = st.SupportLink - pb.Tags = st.Tags - pb.TermsOfService = st.TermsOfService - pb.UpdateFrequency = st.UpdateFrequency pb.ForceSendFields = st.ForceSendFields @@ -3056,43 +2818,25 @@ func listingDetailToPb(st *ListingDetail) (*listingDetailPb, error) { } type listingDetailPb struct { - Assets []AssetType `json:"assets,omitempty"` - - CollectionDateEnd int64 `json:"collection_date_end,omitempty"` - - CollectionDateStart int64 `json:"collection_date_start,omitempty"` - - CollectionGranularity *DataRefreshInfo `json:"collection_granularity,omitempty"` - - Cost Cost `json:"cost,omitempty"` - - DataSource string `json:"data_source,omitempty"` - - Description string `json:"description,omitempty"` - - DocumentationLink string `json:"documentation_link,omitempty"` - - EmbeddedNotebookFileInfos []FileInfo `json:"embedded_notebook_file_infos,omitempty"` - - FileIds []string `json:"file_ids,omitempty"` - - GeographicalCoverage string `json:"geographical_coverage,omitempty"` - - License string `json:"license,omitempty"` - - PricingModel string `json:"pricing_model,omitempty"` - - PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` - - Size float64 `json:"size,omitempty"` - - SupportLink string `json:"support_link,omitempty"` - - Tags []ListingTag `json:"tags,omitempty"` - - TermsOfService string `json:"terms_of_service,omitempty"` - - UpdateFrequency *DataRefreshInfo `json:"update_frequency,omitempty"` + Assets []AssetType `json:"assets,omitempty"` + CollectionDateEnd int64 `json:"collection_date_end,omitempty"` + CollectionDateStart int64 `json:"collection_date_start,omitempty"` + CollectionGranularity *DataRefreshInfo `json:"collection_granularity,omitempty"` + Cost Cost `json:"cost,omitempty"` + DataSource string `json:"data_source,omitempty"` + Description string `json:"description,omitempty"` + DocumentationLink string `json:"documentation_link,omitempty"` + EmbeddedNotebookFileInfos []FileInfo `json:"embedded_notebook_file_infos,omitempty"` + FileIds []string `json:"file_ids,omitempty"` + GeographicalCoverage string `json:"geographical_coverage,omitempty"` + License string `json:"license,omitempty"` + PricingModel string `json:"pricing_model,omitempty"` + PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` + Size float64 `json:"size,omitempty"` + SupportLink string `json:"support_link,omitempty"` + Tags []ListingTag `json:"tags,omitempty"` + TermsOfService string `json:"terms_of_service,omitempty"` + UpdateFrequency *DataRefreshInfo `json:"update_frequency,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3140,28 +2884,20 @@ func listingFulfillmentToPb(st *ListingFulfillment) (*listingFulfillmentPb, erro } pb := &listingFulfillmentPb{} pb.FulfillmentType = st.FulfillmentType - pb.ListingId = st.ListingId - pb.RecipientType = st.RecipientType - pb.RepoInfo = st.RepoInfo - pb.ShareInfo = st.ShareInfo return pb, nil } type listingFulfillmentPb struct { - FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` - - ListingId string `json:"listing_id"` - - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` - - RepoInfo *RepoInfo `json:"repo_info,omitempty"` - - ShareInfo *ShareInfo `json:"share_info,omitempty"` + FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` + ListingId string `json:"listing_id"` + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + RepoInfo *RepoInfo `json:"repo_info,omitempty"` + ShareInfo *ShareInfo `json:"share_info,omitempty"` } func listingFulfillmentFromPb(pb *listingFulfillmentPb) (*ListingFulfillment, error) { @@ -3208,41 +2944,23 @@ func listingSummaryToPb(st *ListingSummary) (*listingSummaryPb, error) { } pb := &listingSummaryPb{} pb.Categories = st.Categories - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.CreatedById = st.CreatedById - pb.ExchangeIds = st.ExchangeIds - pb.GitRepo = st.GitRepo - pb.ListingType = st.ListingType - pb.Name = st.Name - pb.ProviderId = st.ProviderId - pb.ProviderRegion = st.ProviderRegion - pb.PublishedAt = st.PublishedAt - pb.PublishedBy = st.PublishedBy - pb.Setting = st.Setting - pb.Share = st.Share - pb.Status = st.Status - pb.Subtitle = st.Subtitle - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy - pb.UpdatedById = st.UpdatedById pb.ForceSendFields = st.ForceSendFields @@ -3250,43 +2968,25 @@ func listingSummaryToPb(st *ListingSummary) (*listingSummaryPb, error) { } type listingSummaryPb struct { - Categories []Category `json:"categories,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - CreatedById int64 `json:"created_by_id,omitempty"` - - ExchangeIds []string `json:"exchange_ids,omitempty"` - - GitRepo *RepoInfo `json:"git_repo,omitempty"` - - ListingType ListingType `json:"listingType"` - - Name string `json:"name"` - - ProviderId string `json:"provider_id,omitempty"` - - ProviderRegion *RegionInfo `json:"provider_region,omitempty"` - - PublishedAt int64 `json:"published_at,omitempty"` - - PublishedBy string `json:"published_by,omitempty"` - - Setting *ListingSetting `json:"setting,omitempty"` - - Share *ShareInfo `json:"share,omitempty"` - - Status ListingStatus `json:"status,omitempty"` - - Subtitle string `json:"subtitle,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` - - UpdatedById int64 `json:"updated_by_id,omitempty"` + Categories []Category `json:"categories,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + CreatedById int64 `json:"created_by_id,omitempty"` + ExchangeIds []string `json:"exchange_ids,omitempty"` + GitRepo *RepoInfo `json:"git_repo,omitempty"` + ListingType ListingType `json:"listingType"` + Name string `json:"name"` + ProviderId string `json:"provider_id,omitempty"` + ProviderRegion *RegionInfo `json:"provider_region,omitempty"` + PublishedAt int64 `json:"published_at,omitempty"` + PublishedBy string `json:"published_by,omitempty"` + Setting *ListingSetting `json:"setting,omitempty"` + Share *ShareInfo `json:"share,omitempty"` + Status ListingStatus `json:"status,omitempty"` + Subtitle string `json:"subtitle,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + UpdatedById int64 `json:"updated_by_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3334,16 +3034,14 @@ func listingTagToPb(st *ListingTag) (*listingTagPb, error) { } pb := &listingTagPb{} pb.TagName = st.TagName - pb.TagValues = st.TagValues return pb, nil } type listingTagPb struct { - TagName ListingTagType `json:"tag_name,omitempty"` - - TagValues []string `json:"tag_values,omitempty"` + TagName ListingTagType `json:"tag_name,omitempty"` + TagValues []string `json:"tag_values,omitempty"` } func listingTagFromPb(pb *listingTagPb) (*ListingTag, error) { @@ -3363,35 +3061,20 @@ func personalizationRequestToPb(st *PersonalizationRequest) (*personalizationReq } pb := &personalizationRequestPb{} pb.Comment = st.Comment - pb.ConsumerRegion = st.ConsumerRegion - pb.ContactInfo = st.ContactInfo - pb.CreatedAt = st.CreatedAt - pb.Id = st.Id - pb.IntendedUse = st.IntendedUse - pb.IsFromLighthouse = st.IsFromLighthouse - pb.ListingId = st.ListingId - pb.ListingName = st.ListingName - pb.MetastoreId = st.MetastoreId - pb.ProviderId = st.ProviderId - pb.RecipientType = st.RecipientType - pb.Share = st.Share - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage - pb.UpdatedAt = st.UpdatedAt pb.ForceSendFields = st.ForceSendFields @@ -3399,37 +3082,22 @@ func personalizationRequestToPb(st *PersonalizationRequest) (*personalizationReq } type personalizationRequestPb struct { - Comment string `json:"comment,omitempty"` - - ConsumerRegion RegionInfo `json:"consumer_region"` - - ContactInfo *ContactInfo `json:"contact_info,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - Id string `json:"id,omitempty"` - - IntendedUse string `json:"intended_use,omitempty"` - - IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` - - ListingId string `json:"listing_id,omitempty"` - - ListingName string `json:"listing_name,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - ProviderId string `json:"provider_id,omitempty"` - - RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` - - Share *ShareInfo `json:"share,omitempty"` - - Status PersonalizationRequestStatus `json:"status,omitempty"` - - StatusMessage string `json:"status_message,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` + Comment string `json:"comment,omitempty"` + ConsumerRegion RegionInfo `json:"consumer_region"` + ContactInfo *ContactInfo `json:"contact_info,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + Id string `json:"id,omitempty"` + IntendedUse string `json:"intended_use,omitempty"` + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + ListingId string `json:"listing_id,omitempty"` + ListingName string `json:"listing_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + ProviderId string `json:"provider_id,omitempty"` + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + Share *ShareInfo `json:"share,omitempty"` + Status PersonalizationRequestStatus `json:"status,omitempty"` + StatusMessage string `json:"status_message,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3498,31 +3166,18 @@ func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { } pb := &providerInfoPb{} pb.BusinessContactEmail = st.BusinessContactEmail - pb.CompanyWebsiteLink = st.CompanyWebsiteLink - pb.DarkModeIconFileId = st.DarkModeIconFileId - pb.DarkModeIconFilePath = st.DarkModeIconFilePath - pb.Description = st.Description - pb.IconFileId = st.IconFileId - pb.IconFilePath = st.IconFilePath - pb.Id = st.Id - pb.IsFeatured = st.IsFeatured - pb.Name = st.Name - pb.PrivacyPolicyLink = st.PrivacyPolicyLink - pb.PublishedBy = st.PublishedBy - pb.SupportContactEmail = st.SupportContactEmail - pb.TermOfServiceLink = st.TermOfServiceLink pb.ForceSendFields = st.ForceSendFields @@ -3531,32 +3186,19 @@ func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { type providerInfoPb struct { BusinessContactEmail string `json:"business_contact_email"` - - CompanyWebsiteLink string `json:"company_website_link,omitempty"` - - DarkModeIconFileId string `json:"dark_mode_icon_file_id,omitempty"` - + CompanyWebsiteLink string `json:"company_website_link,omitempty"` + DarkModeIconFileId string `json:"dark_mode_icon_file_id,omitempty"` DarkModeIconFilePath string `json:"dark_mode_icon_file_path,omitempty"` - - Description string `json:"description,omitempty"` - - IconFileId string `json:"icon_file_id,omitempty"` - - IconFilePath string `json:"icon_file_path,omitempty"` - - Id string `json:"id,omitempty"` - - IsFeatured bool `json:"is_featured,omitempty"` - - Name string `json:"name"` - - PrivacyPolicyLink string `json:"privacy_policy_link"` - - PublishedBy string `json:"published_by,omitempty"` - - SupportContactEmail string `json:"support_contact_email,omitempty"` - - TermOfServiceLink string `json:"term_of_service_link"` + Description string `json:"description,omitempty"` + IconFileId string `json:"icon_file_id,omitempty"` + IconFilePath string `json:"icon_file_path,omitempty"` + Id string `json:"id,omitempty"` + IsFeatured bool `json:"is_featured,omitempty"` + Name string `json:"name"` + PrivacyPolicyLink string `json:"privacy_policy_link"` + PublishedBy string `json:"published_by,omitempty"` + SupportContactEmail string `json:"support_contact_email,omitempty"` + TermOfServiceLink string `json:"term_of_service_link"` ForceSendFields []string `json:"-" url:"-"` } @@ -3599,7 +3241,6 @@ func regionInfoToPb(st *RegionInfo) (*regionInfoPb, error) { } pb := ®ionInfoPb{} pb.Cloud = st.Cloud - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -3607,8 +3248,7 @@ func regionInfoToPb(st *RegionInfo) (*regionInfoPb, error) { } type regionInfoPb struct { - Cloud string `json:"cloud,omitempty"` - + Cloud string `json:"cloud,omitempty"` Region string `json:"region,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3709,7 +3349,6 @@ func repoInstallationToPb(st *RepoInstallation) (*repoInstallationPb, error) { } pb := &repoInstallationPb{} pb.RepoName = st.RepoName - pb.RepoPath = st.RepoPath return pb, nil @@ -3717,7 +3356,6 @@ func repoInstallationToPb(st *RepoInstallation) (*repoInstallationPb, error) { type repoInstallationPb struct { RepoName string `json:"repo_name"` - RepoPath string `json:"repo_path"` } @@ -3738,19 +3376,12 @@ func searchListingsRequestToPb(st *SearchListingsRequest) (*searchListingsReques } pb := &searchListingsRequestPb{} pb.Assets = st.Assets - pb.Categories = st.Categories - pb.IsFree = st.IsFree - pb.IsPrivateExchange = st.IsPrivateExchange - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.ProviderIds = st.ProviderIds - pb.Query = st.Query pb.ForceSendFields = st.ForceSendFields @@ -3758,21 +3389,14 @@ func searchListingsRequestToPb(st *SearchListingsRequest) (*searchListingsReques } type searchListingsRequestPb struct { - Assets []AssetType `json:"-" url:"assets,omitempty"` - - Categories []Category `json:"-" url:"categories,omitempty"` - - IsFree bool `json:"-" url:"is_free,omitempty"` - - IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ProviderIds []string `json:"-" url:"provider_ids,omitempty"` - - Query string `json:"-" url:"query"` + Assets []AssetType `json:"-" url:"assets,omitempty"` + Categories []Category `json:"-" url:"categories,omitempty"` + IsFree bool `json:"-" url:"is_free,omitempty"` + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + Query string `json:"-" url:"query"` ForceSendFields []string `json:"-" url:"-"` } @@ -3809,7 +3433,6 @@ func searchListingsResponseToPb(st *SearchListingsResponse) (*searchListingsResp } pb := &searchListingsResponsePb{} pb.Listings = st.Listings - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -3817,9 +3440,8 @@ func searchListingsResponseToPb(st *SearchListingsResponse) (*searchListingsResp } type searchListingsResponsePb struct { - Listings []Listing `json:"listings,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Listings []Listing `json:"listings,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3850,15 +3472,13 @@ func shareInfoToPb(st *ShareInfo) (*shareInfoPb, error) { } pb := &shareInfoPb{} pb.Name = st.Name - pb.Type = st.Type return pb, nil } type shareInfoPb struct { - Name string `json:"name"` - + Name string `json:"name"` Type ListingShareType `json:"type"` } @@ -3879,7 +3499,6 @@ func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { } pb := &sharedDataObjectPb{} pb.DataObjectType = st.DataObjectType - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3888,8 +3507,7 @@ func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { type sharedDataObjectPb struct { DataObjectType string `json:"data_object_type,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3920,11 +3538,8 @@ func tokenDetailToPb(st *TokenDetail) (*tokenDetailPb, error) { } pb := &tokenDetailPb{} pb.BearerToken = st.BearerToken - pb.Endpoint = st.Endpoint - pb.ExpirationTime = st.ExpirationTime - pb.ShareCredentialsVersion = st.ShareCredentialsVersion pb.ForceSendFields = st.ForceSendFields @@ -3932,13 +3547,10 @@ func tokenDetailToPb(st *TokenDetail) (*tokenDetailPb, error) { } type tokenDetailPb struct { - BearerToken string `json:"bearerToken,omitempty"` - - Endpoint string `json:"endpoint,omitempty"` - - ExpirationTime string `json:"expirationTime,omitempty"` - - ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + BearerToken string `json:"bearerToken,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + ExpirationTime string `json:"expirationTime,omitempty"` + ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3971,17 +3583,11 @@ func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { } pb := &tokenInfoPb{} pb.ActivationUrl = st.ActivationUrl - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.ExpirationTime = st.ExpirationTime - pb.Id = st.Id - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -3989,19 +3595,13 @@ func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { } type tokenInfoPb struct { - ActivationUrl string `json:"activation_url,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - Id string `json:"id,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + ActivationUrl string `json:"activation_url,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + Id string `json:"id,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4037,7 +3637,6 @@ func updateExchangeFilterRequestToPb(st *UpdateExchangeFilterRequest) (*updateEx } pb := &updateExchangeFilterRequestPb{} pb.Filter = st.Filter - pb.Id = st.Id return pb, nil @@ -4045,8 +3644,7 @@ func updateExchangeFilterRequestToPb(st *UpdateExchangeFilterRequest) (*updateEx type updateExchangeFilterRequestPb struct { Filter ExchangeFilter `json:"filter"` - - Id string `json:"-" url:"-"` + Id string `json:"-" url:"-"` } func updateExchangeFilterRequestFromPb(pb *updateExchangeFilterRequestPb) (*UpdateExchangeFilterRequest, error) { @@ -4090,7 +3688,6 @@ func updateExchangeRequestToPb(st *UpdateExchangeRequest) (*updateExchangeReques } pb := &updateExchangeRequestPb{} pb.Exchange = st.Exchange - pb.Id = st.Id return pb, nil @@ -4098,8 +3695,7 @@ func updateExchangeRequestToPb(st *UpdateExchangeRequest) (*updateExchangeReques type updateExchangeRequestPb struct { Exchange Exchange `json:"exchange"` - - Id string `json:"-" url:"-"` + Id string `json:"-" url:"-"` } func updateExchangeRequestFromPb(pb *updateExchangeRequestPb) (*UpdateExchangeRequest, error) { @@ -4143,11 +3739,8 @@ func updateInstallationRequestToPb(st *UpdateInstallationRequest) (*updateInstal } pb := &updateInstallationRequestPb{} pb.Installation = st.Installation - pb.InstallationId = st.InstallationId - pb.ListingId = st.ListingId - pb.RotateToken = st.RotateToken pb.ForceSendFields = st.ForceSendFields @@ -4155,13 +3748,10 @@ func updateInstallationRequestToPb(st *UpdateInstallationRequest) (*updateInstal } type updateInstallationRequestPb struct { - Installation InstallationDetail `json:"installation"` - - InstallationId string `json:"-" url:"-"` - - ListingId string `json:"-" url:"-"` - - RotateToken bool `json:"rotate_token,omitempty"` + Installation InstallationDetail `json:"installation"` + InstallationId string `json:"-" url:"-"` + ListingId string `json:"-" url:"-"` + RotateToken bool `json:"rotate_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4218,15 +3808,13 @@ func updateListingRequestToPb(st *UpdateListingRequest) (*updateListingRequestPb } pb := &updateListingRequestPb{} pb.Id = st.Id - pb.Listing = st.Listing return pb, nil } type updateListingRequestPb struct { - Id string `json:"-" url:"-"` - + Id string `json:"-" url:"-"` Listing Listing `json:"listing"` } @@ -4271,13 +3859,9 @@ func updatePersonalizationRequestRequestToPb(st *UpdatePersonalizationRequestReq } pb := &updatePersonalizationRequestRequestPb{} pb.ListingId = st.ListingId - pb.Reason = st.Reason - pb.RequestId = st.RequestId - pb.Share = st.Share - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -4285,15 +3869,11 @@ func updatePersonalizationRequestRequestToPb(st *UpdatePersonalizationRequestReq } type updatePersonalizationRequestRequestPb struct { - ListingId string `json:"-" url:"-"` - - Reason string `json:"reason,omitempty"` - - RequestId string `json:"-" url:"-"` - - Share *ShareInfo `json:"share,omitempty"` - - Status PersonalizationRequestStatus `json:"status"` + ListingId string `json:"-" url:"-"` + Reason string `json:"reason,omitempty"` + RequestId string `json:"-" url:"-"` + Share *ShareInfo `json:"share,omitempty"` + Status PersonalizationRequestStatus `json:"status"` ForceSendFields []string `json:"-" url:"-"` } @@ -4351,7 +3931,6 @@ func updateProviderAnalyticsDashboardRequestToPb(st *UpdateProviderAnalyticsDash } pb := &updateProviderAnalyticsDashboardRequestPb{} pb.Id = st.Id - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -4359,9 +3938,8 @@ func updateProviderAnalyticsDashboardRequestToPb(st *UpdateProviderAnalyticsDash } type updateProviderAnalyticsDashboardRequestPb struct { - Id string `json:"-" url:"-"` - - Version int64 `json:"version,omitempty"` + Id string `json:"-" url:"-"` + Version int64 `json:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4392,9 +3970,7 @@ func updateProviderAnalyticsDashboardResponseToPb(st *UpdateProviderAnalyticsDas } pb := &updateProviderAnalyticsDashboardResponsePb{} pb.DashboardId = st.DashboardId - pb.Id = st.Id - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -4403,10 +3979,8 @@ func updateProviderAnalyticsDashboardResponseToPb(st *UpdateProviderAnalyticsDas type updateProviderAnalyticsDashboardResponsePb struct { DashboardId string `json:"dashboard_id"` - - Id string `json:"id"` - - Version int64 `json:"version,omitempty"` + Id string `json:"id"` + Version int64 `json:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4438,15 +4012,13 @@ func updateProviderRequestToPb(st *UpdateProviderRequest) (*updateProviderReques } pb := &updateProviderRequestPb{} pb.Id = st.Id - pb.Provider = st.Provider return pb, nil } type updateProviderRequestPb struct { - Id string `json:"-" url:"-"` - + Id string `json:"-" url:"-"` Provider ProviderInfo `json:"provider"` } @@ -4484,3 +4056,57 @@ func updateProviderResponseFromPb(pb *updateProviderResponsePb) (*UpdateProvider return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 565b05a9b..88c0fae79 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -5,8 +5,6 @@ package marketplace import ( "encoding/json" "fmt" - "strings" - "time" ) type AddExchangeForListingRequest struct { @@ -4847,57 +4845,3 @@ func (f *Visibility) Set(v string) error { func (f *Visibility) Type() string { return "Visibility" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/ml/internal.go b/service/ml/internal.go index 24066c923..8003b5753 100755 --- a/service/ml/internal.go +++ b/service/ml/internal.go @@ -3,6 +3,10 @@ package ml import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,21 +16,13 @@ func activityToPb(st *Activity) (*activityPb, error) { } pb := &activityPb{} pb.ActivityType = st.ActivityType - pb.Comment = st.Comment - pb.CreationTimestamp = st.CreationTimestamp - pb.FromStage = st.FromStage - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.SystemComment = st.SystemComment - pb.ToStage = st.ToStage - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -34,23 +30,15 @@ func activityToPb(st *Activity) (*activityPb, error) { } type activityPb struct { - ActivityType ActivityType `json:"activity_type,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - FromStage Stage `json:"from_stage,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - SystemComment string `json:"system_comment,omitempty"` - - ToStage Stage `json:"to_stage,omitempty"` - - UserId string `json:"user_id,omitempty"` + ActivityType ActivityType `json:"activity_type,omitempty"` + Comment string `json:"comment,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + FromStage Stage `json:"from_stage,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + SystemComment string `json:"system_comment,omitempty"` + ToStage Stage `json:"to_stage,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -88,13 +76,9 @@ func approveTransitionRequestToPb(st *ApproveTransitionRequest) (*approveTransit } pb := &approveTransitionRequestPb{} pb.ArchiveExistingVersions = st.ArchiveExistingVersions - pb.Comment = st.Comment - pb.Name = st.Name - pb.Stage = st.Stage - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -102,15 +86,11 @@ func approveTransitionRequestToPb(st *ApproveTransitionRequest) (*approveTransit } type approveTransitionRequestPb struct { - ArchiveExistingVersions bool `json:"archive_existing_versions"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - Stage Stage `json:"stage"` - - Version string `json:"version"` + ArchiveExistingVersions bool `json:"archive_existing_versions"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + Stage Stage `json:"stage"` + Version string `json:"version"` ForceSendFields []string `json:"-" url:"-"` } @@ -168,13 +148,9 @@ func artifactCredentialInfoToPb(st *ArtifactCredentialInfo) (*artifactCredential } pb := &artifactCredentialInfoPb{} pb.Headers = st.Headers - pb.Path = st.Path - pb.RunId = st.RunId - pb.SignedUri = st.SignedUri - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -182,15 +158,11 @@ func artifactCredentialInfoToPb(st *ArtifactCredentialInfo) (*artifactCredential } type artifactCredentialInfoPb struct { - Headers []ArtifactCredentialInfoHttpHeader `json:"headers,omitempty"` - - Path string `json:"path,omitempty"` - - RunId string `json:"run_id,omitempty"` - - SignedUri string `json:"signed_uri,omitempty"` - - Type ArtifactCredentialType `json:"type,omitempty"` + Headers []ArtifactCredentialInfoHttpHeader `json:"headers,omitempty"` + Path string `json:"path,omitempty"` + RunId string `json:"run_id,omitempty"` + SignedUri string `json:"signed_uri,omitempty"` + Type ArtifactCredentialType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -224,7 +196,6 @@ func artifactCredentialInfoHttpHeaderToPb(st *ArtifactCredentialInfoHttpHeader) } pb := &artifactCredentialInfoHttpHeaderPb{} pb.Name = st.Name - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -232,8 +203,7 @@ func artifactCredentialInfoHttpHeaderToPb(st *ArtifactCredentialInfoHttpHeader) } type artifactCredentialInfoHttpHeaderPb struct { - Name string `json:"name,omitempty"` - + Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -265,15 +235,10 @@ func commentObjectToPb(st *CommentObject) (*commentObjectPb, error) { } pb := &commentObjectPb{} pb.AvailableActions = st.AvailableActions - pb.Comment = st.Comment - pb.CreationTimestamp = st.CreationTimestamp - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -281,17 +246,12 @@ func commentObjectToPb(st *CommentObject) (*commentObjectPb, error) { } type commentObjectPb struct { - AvailableActions []CommentActivityAction `json:"available_actions,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - UserId string `json:"user_id,omitempty"` + AvailableActions []CommentActivityAction `json:"available_actions,omitempty"` + Comment string `json:"comment,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -326,9 +286,7 @@ func createCommentToPb(st *CreateComment) (*createCommentPb, error) { } pb := &createCommentPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.Version = st.Version return pb, nil @@ -336,9 +294,7 @@ func createCommentToPb(st *CreateComment) (*createCommentPb, error) { type createCommentPb struct { Comment string `json:"comment"` - - Name string `json:"name"` - + Name string `json:"name"` Version string `json:"version"` } @@ -384,9 +340,7 @@ func createExperimentToPb(st *CreateExperiment) (*createExperimentPb, error) { } pb := &createExperimentPb{} pb.ArtifactLocation = st.ArtifactLocation - pb.Name = st.Name - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -394,11 +348,9 @@ func createExperimentToPb(st *CreateExperiment) (*createExperimentPb, error) { } type createExperimentPb struct { - ArtifactLocation string `json:"artifact_location,omitempty"` - - Name string `json:"name"` - - Tags []ExperimentTag `json:"tags,omitempty"` + ArtifactLocation string `json:"artifact_location,omitempty"` + Name string `json:"name"` + Tags []ExperimentTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -466,37 +418,21 @@ func createForecastingExperimentRequestToPb(st *CreateForecastingExperimentReque } pb := &createForecastingExperimentRequestPb{} pb.CustomWeightsColumn = st.CustomWeightsColumn - pb.ExperimentPath = st.ExperimentPath - pb.ForecastGranularity = st.ForecastGranularity - pb.ForecastHorizon = st.ForecastHorizon - pb.FutureFeatureDataPath = st.FutureFeatureDataPath - pb.HolidayRegions = st.HolidayRegions - pb.IncludeFeatures = st.IncludeFeatures - pb.MaxRuntime = st.MaxRuntime - pb.PredictionDataPath = st.PredictionDataPath - pb.PrimaryMetric = st.PrimaryMetric - pb.RegisterTo = st.RegisterTo - pb.SplitColumn = st.SplitColumn - pb.TargetColumn = st.TargetColumn - pb.TimeColumn = st.TimeColumn - pb.TimeseriesIdentifierColumns = st.TimeseriesIdentifierColumns - pb.TrainDataPath = st.TrainDataPath - pb.TrainingFrameworks = st.TrainingFrameworks pb.ForceSendFields = st.ForceSendFields @@ -504,39 +440,23 @@ func createForecastingExperimentRequestToPb(st *CreateForecastingExperimentReque } type createForecastingExperimentRequestPb struct { - CustomWeightsColumn string `json:"custom_weights_column,omitempty"` - - ExperimentPath string `json:"experiment_path,omitempty"` - - ForecastGranularity string `json:"forecast_granularity"` - - ForecastHorizon int64 `json:"forecast_horizon"` - - FutureFeatureDataPath string `json:"future_feature_data_path,omitempty"` - - HolidayRegions []string `json:"holiday_regions,omitempty"` - - IncludeFeatures []string `json:"include_features,omitempty"` - - MaxRuntime int64 `json:"max_runtime,omitempty"` - - PredictionDataPath string `json:"prediction_data_path,omitempty"` - - PrimaryMetric string `json:"primary_metric,omitempty"` - - RegisterTo string `json:"register_to,omitempty"` - - SplitColumn string `json:"split_column,omitempty"` - - TargetColumn string `json:"target_column"` - - TimeColumn string `json:"time_column"` - + CustomWeightsColumn string `json:"custom_weights_column,omitempty"` + ExperimentPath string `json:"experiment_path,omitempty"` + ForecastGranularity string `json:"forecast_granularity"` + ForecastHorizon int64 `json:"forecast_horizon"` + FutureFeatureDataPath string `json:"future_feature_data_path,omitempty"` + HolidayRegions []string `json:"holiday_regions,omitempty"` + IncludeFeatures []string `json:"include_features,omitempty"` + MaxRuntime int64 `json:"max_runtime,omitempty"` + PredictionDataPath string `json:"prediction_data_path,omitempty"` + PrimaryMetric string `json:"primary_metric,omitempty"` + RegisterTo string `json:"register_to,omitempty"` + SplitColumn string `json:"split_column,omitempty"` + TargetColumn string `json:"target_column"` + TimeColumn string `json:"time_column"` TimeseriesIdentifierColumns []string `json:"timeseries_identifier_columns,omitempty"` - - TrainDataPath string `json:"train_data_path"` - - TrainingFrameworks []string `json:"training_frameworks,omitempty"` + TrainDataPath string `json:"train_data_path"` + TrainingFrameworks []string `json:"training_frameworks,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -618,15 +538,10 @@ func createLoggedModelRequestToPb(st *CreateLoggedModelRequest) (*createLoggedMo } pb := &createLoggedModelRequestPb{} pb.ExperimentId = st.ExperimentId - pb.ModelType = st.ModelType - pb.Name = st.Name - pb.Params = st.Params - pb.SourceRunId = st.SourceRunId - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -634,17 +549,12 @@ func createLoggedModelRequestToPb(st *CreateLoggedModelRequest) (*createLoggedMo } type createLoggedModelRequestPb struct { - ExperimentId string `json:"experiment_id"` - - ModelType string `json:"model_type,omitempty"` - - Name string `json:"name,omitempty"` - - Params []LoggedModelParameter `json:"params,omitempty"` - - SourceRunId string `json:"source_run_id,omitempty"` - - Tags []LoggedModelTag `json:"tags,omitempty"` + ExperimentId string `json:"experiment_id"` + ModelType string `json:"model_type,omitempty"` + Name string `json:"name,omitempty"` + Params []LoggedModelParameter `json:"params,omitempty"` + SourceRunId string `json:"source_run_id,omitempty"` + Tags []LoggedModelTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -703,9 +613,7 @@ func createModelRequestToPb(st *CreateModelRequest) (*createModelRequestPb, erro } pb := &createModelRequestPb{} pb.Description = st.Description - pb.Name = st.Name - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -713,11 +621,9 @@ func createModelRequestToPb(st *CreateModelRequest) (*createModelRequestPb, erro } type createModelRequestPb struct { - Description string `json:"description,omitempty"` - - Name string `json:"name"` - - Tags []ModelTag `json:"tags,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + Tags []ModelTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -773,15 +679,10 @@ func createModelVersionRequestToPb(st *CreateModelVersionRequest) (*createModelV } pb := &createModelVersionRequestPb{} pb.Description = st.Description - pb.Name = st.Name - pb.RunId = st.RunId - pb.RunLink = st.RunLink - pb.Source = st.Source - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -789,17 +690,12 @@ func createModelVersionRequestToPb(st *CreateModelVersionRequest) (*createModelV } type createModelVersionRequestPb struct { - Description string `json:"description,omitempty"` - - Name string `json:"name"` - - RunId string `json:"run_id,omitempty"` - - RunLink string `json:"run_link,omitempty"` - - Source string `json:"source"` - - Tags []ModelVersionTag `json:"tags,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + RunId string `json:"run_id,omitempty"` + RunLink string `json:"run_link,omitempty"` + Source string `json:"source"` + Tags []ModelVersionTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -858,15 +754,10 @@ func createRegistryWebhookToPb(st *CreateRegistryWebhook) (*createRegistryWebhoo } pb := &createRegistryWebhookPb{} pb.Description = st.Description - pb.Events = st.Events - pb.HttpUrlSpec = st.HttpUrlSpec - pb.JobSpec = st.JobSpec - pb.ModelName = st.ModelName - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -874,17 +765,12 @@ func createRegistryWebhookToPb(st *CreateRegistryWebhook) (*createRegistryWebhoo } type createRegistryWebhookPb struct { - Description string `json:"description,omitempty"` - - Events []RegistryWebhookEvent `json:"events"` - - HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` - - JobSpec *JobSpec `json:"job_spec,omitempty"` - - ModelName string `json:"model_name,omitempty"` - - Status RegistryWebhookStatus `json:"status,omitempty"` + Description string `json:"description,omitempty"` + Events []RegistryWebhookEvent `json:"events"` + HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + JobSpec *JobSpec `json:"job_spec,omitempty"` + ModelName string `json:"model_name,omitempty"` + Status RegistryWebhookStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -919,13 +805,9 @@ func createRunToPb(st *CreateRun) (*createRunPb, error) { } pb := &createRunPb{} pb.ExperimentId = st.ExperimentId - pb.RunName = st.RunName - pb.StartTime = st.StartTime - pb.Tags = st.Tags - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -933,15 +815,11 @@ func createRunToPb(st *CreateRun) (*createRunPb, error) { } type createRunPb struct { - ExperimentId string `json:"experiment_id,omitempty"` - - RunName string `json:"run_name,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - Tags []RunTag `json:"tags,omitempty"` - - UserId string `json:"user_id,omitempty"` + ExperimentId string `json:"experiment_id,omitempty"` + RunName string `json:"run_name,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + Tags []RunTag `json:"tags,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -999,11 +877,8 @@ func createTransitionRequestToPb(st *CreateTransitionRequest) (*createTransition } pb := &createTransitionRequestPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.Stage = st.Stage - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -1012,11 +887,8 @@ func createTransitionRequestToPb(st *CreateTransitionRequest) (*createTransition type createTransitionRequestPb struct { Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - Stage Stage `json:"stage"` - + Name string `json:"name"` + Stage Stage `json:"stage"` Version string `json:"version"` ForceSendFields []string `json:"-" url:"-"` @@ -1098,15 +970,10 @@ func datasetToPb(st *Dataset) (*datasetPb, error) { } pb := &datasetPb{} pb.Digest = st.Digest - pb.Name = st.Name - pb.Profile = st.Profile - pb.Schema = st.Schema - pb.Source = st.Source - pb.SourceType = st.SourceType pb.ForceSendFields = st.ForceSendFields @@ -1114,16 +981,11 @@ func datasetToPb(st *Dataset) (*datasetPb, error) { } type datasetPb struct { - Digest string `json:"digest"` - - Name string `json:"name"` - - Profile string `json:"profile,omitempty"` - - Schema string `json:"schema,omitempty"` - - Source string `json:"source"` - + Digest string `json:"digest"` + Name string `json:"name"` + Profile string `json:"profile,omitempty"` + Schema string `json:"schema,omitempty"` + Source string `json:"source"` SourceType string `json:"source_type"` ForceSendFields []string `json:"-" url:"-"` @@ -1159,16 +1021,14 @@ func datasetInputToPb(st *DatasetInput) (*datasetInputPb, error) { } pb := &datasetInputPb{} pb.Dataset = st.Dataset - pb.Tags = st.Tags return pb, nil } type datasetInputPb struct { - Dataset Dataset `json:"dataset"` - - Tags []InputTag `json:"tags,omitempty"` + Dataset Dataset `json:"dataset"` + Tags []InputTag `json:"tags,omitempty"` } func datasetInputFromPb(pb *datasetInputPb) (*DatasetInput, error) { @@ -1323,7 +1183,6 @@ func deleteLoggedModelTagRequestToPb(st *DeleteLoggedModelTagRequest) (*deleteLo } pb := &deleteLoggedModelTagRequestPb{} pb.ModelId = st.ModelId - pb.TagKey = st.TagKey return pb, nil @@ -1331,8 +1190,7 @@ func deleteLoggedModelTagRequestToPb(st *DeleteLoggedModelTagRequest) (*deleteLo type deleteLoggedModelTagRequestPb struct { ModelId string `json:"-" url:"-"` - - TagKey string `json:"-" url:"-"` + TagKey string `json:"-" url:"-"` } func deleteLoggedModelTagRequestFromPb(pb *deleteLoggedModelTagRequestPb) (*DeleteLoggedModelTagRequest, error) { @@ -1418,15 +1276,13 @@ func deleteModelTagRequestToPb(st *DeleteModelTagRequest) (*deleteModelTagReques } pb := &deleteModelTagRequestPb{} pb.Key = st.Key - pb.Name = st.Name return pb, nil } type deleteModelTagRequestPb struct { - Key string `json:"-" url:"key"` - + Key string `json:"-" url:"key"` Name string `json:"-" url:"name"` } @@ -1468,15 +1324,13 @@ func deleteModelVersionRequestToPb(st *DeleteModelVersionRequest) (*deleteModelV } pb := &deleteModelVersionRequestPb{} pb.Name = st.Name - pb.Version = st.Version return pb, nil } type deleteModelVersionRequestPb struct { - Name string `json:"-" url:"name"` - + Name string `json:"-" url:"name"` Version string `json:"-" url:"version"` } @@ -1518,19 +1372,15 @@ func deleteModelVersionTagRequestToPb(st *DeleteModelVersionTagRequest) (*delete } pb := &deleteModelVersionTagRequestPb{} pb.Key = st.Key - pb.Name = st.Name - pb.Version = st.Version return pb, nil } type deleteModelVersionTagRequestPb struct { - Key string `json:"-" url:"key"` - - Name string `json:"-" url:"name"` - + Key string `json:"-" url:"key"` + Name string `json:"-" url:"name"` Version string `json:"-" url:"version"` } @@ -1618,9 +1468,7 @@ func deleteRunsToPb(st *DeleteRuns) (*deleteRunsPb, error) { } pb := &deleteRunsPb{} pb.ExperimentId = st.ExperimentId - pb.MaxRuns = st.MaxRuns - pb.MaxTimestampMillis = st.MaxTimestampMillis pb.ForceSendFields = st.ForceSendFields @@ -1628,11 +1476,9 @@ func deleteRunsToPb(st *DeleteRuns) (*deleteRunsPb, error) { } type deleteRunsPb struct { - ExperimentId string `json:"experiment_id"` - - MaxRuns int `json:"max_runs,omitempty"` - - MaxTimestampMillis int64 `json:"max_timestamp_millis"` + ExperimentId string `json:"experiment_id"` + MaxRuns int `json:"max_runs,omitempty"` + MaxTimestampMillis int64 `json:"max_timestamp_millis"` ForceSendFields []string `json:"-" url:"-"` } @@ -1700,15 +1546,13 @@ func deleteTagToPb(st *DeleteTag) (*deleteTagPb, error) { } pb := &deleteTagPb{} pb.Key = st.Key - pb.RunId = st.RunId return pb, nil } type deleteTagPb struct { - Key string `json:"key"` - + Key string `json:"key"` RunId string `json:"run_id"` } @@ -1750,13 +1594,9 @@ func deleteTransitionRequestRequestToPb(st *DeleteTransitionRequestRequest) (*de } pb := &deleteTransitionRequestRequestPb{} pb.Comment = st.Comment - pb.Creator = st.Creator - pb.Name = st.Name - pb.Stage = st.Stage - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -1764,15 +1604,11 @@ func deleteTransitionRequestRequestToPb(st *DeleteTransitionRequestRequest) (*de } type deleteTransitionRequestRequestPb struct { - Comment string `json:"-" url:"comment,omitempty"` - - Creator string `json:"-" url:"creator"` - - Name string `json:"-" url:"name"` - - Stage DeleteTransitionRequestStage `json:"-" url:"stage"` - - Version string `json:"-" url:"version"` + Comment string `json:"-" url:"comment,omitempty"` + Creator string `json:"-" url:"creator"` + Name string `json:"-" url:"name"` + Stage DeleteTransitionRequestStage `json:"-" url:"stage"` + Version string `json:"-" url:"version"` ForceSendFields []string `json:"-" url:"-"` } @@ -1884,17 +1720,11 @@ func experimentToPb(st *Experiment) (*experimentPb, error) { } pb := &experimentPb{} pb.ArtifactLocation = st.ArtifactLocation - pb.CreationTime = st.CreationTime - pb.ExperimentId = st.ExperimentId - pb.LastUpdateTime = st.LastUpdateTime - pb.LifecycleStage = st.LifecycleStage - pb.Name = st.Name - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -1902,19 +1732,13 @@ func experimentToPb(st *Experiment) (*experimentPb, error) { } type experimentPb struct { - ArtifactLocation string `json:"artifact_location,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - ExperimentId string `json:"experiment_id,omitempty"` - - LastUpdateTime int64 `json:"last_update_time,omitempty"` - - LifecycleStage string `json:"lifecycle_stage,omitempty"` - - Name string `json:"name,omitempty"` - - Tags []ExperimentTag `json:"tags,omitempty"` + ArtifactLocation string `json:"artifact_location,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + ExperimentId string `json:"experiment_id,omitempty"` + LastUpdateTime int64 `json:"last_update_time,omitempty"` + LifecycleStage string `json:"lifecycle_stage,omitempty"` + Name string `json:"name,omitempty"` + Tags []ExperimentTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1950,11 +1774,8 @@ func experimentAccessControlRequestToPb(st *ExperimentAccessControlRequest) (*ex } pb := &experimentAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1962,13 +1783,10 @@ func experimentAccessControlRequestToPb(st *ExperimentAccessControlRequest) (*ex } type experimentAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2001,13 +1819,9 @@ func experimentAccessControlResponseToPb(st *ExperimentAccessControlResponse) (* } pb := &experimentAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2015,15 +1829,11 @@ func experimentAccessControlResponseToPb(st *ExperimentAccessControlResponse) (* } type experimentAccessControlResponsePb struct { - AllPermissions []ExperimentPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []ExperimentPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2057,9 +1867,7 @@ func experimentPermissionToPb(st *ExperimentPermission) (*experimentPermissionPb } pb := &experimentPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2067,11 +1875,9 @@ func experimentPermissionToPb(st *ExperimentPermission) (*experimentPermissionPb } type experimentPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2103,9 +1909,7 @@ func experimentPermissionsToPb(st *ExperimentPermissions) (*experimentPermission } pb := &experimentPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2114,10 +1918,8 @@ func experimentPermissionsToPb(st *ExperimentPermissions) (*experimentPermission type experimentPermissionsPb struct { AccessControlList []ExperimentAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2149,7 +1951,6 @@ func experimentPermissionsDescriptionToPb(st *ExperimentPermissionsDescription) } pb := &experimentPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2157,8 +1958,7 @@ func experimentPermissionsDescriptionToPb(st *ExperimentPermissionsDescription) } type experimentPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2190,7 +1990,6 @@ func experimentPermissionsRequestToPb(st *ExperimentPermissionsRequest) (*experi } pb := &experimentPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.ExperimentId = st.ExperimentId return pb, nil @@ -2198,8 +1997,7 @@ func experimentPermissionsRequestToPb(st *ExperimentPermissionsRequest) (*experi type experimentPermissionsRequestPb struct { AccessControlList []ExperimentAccessControlRequest `json:"access_control_list,omitempty"` - - ExperimentId string `json:"-" url:"-"` + ExperimentId string `json:"-" url:"-"` } func experimentPermissionsRequestFromPb(pb *experimentPermissionsRequestPb) (*ExperimentPermissionsRequest, error) { @@ -2219,7 +2017,6 @@ func experimentTagToPb(st *ExperimentTag) (*experimentTagPb, error) { } pb := &experimentTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -2227,8 +2024,7 @@ func experimentTagToPb(st *ExperimentTag) (*experimentTagPb, error) { } type experimentTagPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2260,9 +2056,7 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } pb := &fileInfoPb{} pb.FileSize = st.FileSize - pb.IsDir = st.IsDir - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -2270,11 +2064,9 @@ func fileInfoToPb(st *FileInfo) (*fileInfoPb, error) { } type fileInfoPb struct { - FileSize int64 `json:"file_size,omitempty"` - - IsDir bool `json:"is_dir,omitempty"` - - Path string `json:"path,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + IsDir bool `json:"is_dir,omitempty"` + Path string `json:"path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2306,16 +2098,14 @@ func finalizeLoggedModelRequestToPb(st *FinalizeLoggedModelRequest) (*finalizeLo } pb := &finalizeLoggedModelRequestPb{} pb.ModelId = st.ModelId - pb.Status = st.Status return pb, nil } type finalizeLoggedModelRequestPb struct { - ModelId string `json:"-" url:"-"` - - Status LoggedModelStatus `json:"status"` + ModelId string `json:"-" url:"-"` + Status LoggedModelStatus `json:"status"` } func finalizeLoggedModelRequestFromPb(pb *finalizeLoggedModelRequestPb) (*FinalizeLoggedModelRequest, error) { @@ -2359,9 +2149,7 @@ func forecastingExperimentToPb(st *ForecastingExperiment) (*forecastingExperimen } pb := &forecastingExperimentPb{} pb.ExperimentId = st.ExperimentId - pb.ExperimentPageUrl = st.ExperimentPageUrl - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -2369,11 +2157,9 @@ func forecastingExperimentToPb(st *ForecastingExperiment) (*forecastingExperimen } type forecastingExperimentPb struct { - ExperimentId string `json:"experiment_id,omitempty"` - - ExperimentPageUrl string `json:"experiment_page_url,omitempty"` - - State ForecastingExperimentState `json:"state,omitempty"` + ExperimentId string `json:"experiment_id,omitempty"` + ExperimentPageUrl string `json:"experiment_page_url,omitempty"` + State ForecastingExperimentState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2693,13 +2479,9 @@ func getHistoryRequestToPb(st *GetHistoryRequest) (*getHistoryRequestPb, error) } pb := &getHistoryRequestPb{} pb.MaxResults = st.MaxResults - pb.MetricKey = st.MetricKey - pb.PageToken = st.PageToken - pb.RunId = st.RunId - pb.RunUuid = st.RunUuid pb.ForceSendFields = st.ForceSendFields @@ -2707,15 +2489,11 @@ func getHistoryRequestToPb(st *GetHistoryRequest) (*getHistoryRequestPb, error) } type getHistoryRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - MetricKey string `json:"-" url:"metric_key"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - RunId string `json:"-" url:"run_id,omitempty"` - - RunUuid string `json:"-" url:"run_uuid,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + MetricKey string `json:"-" url:"metric_key"` + PageToken string `json:"-" url:"page_token,omitempty"` + RunId string `json:"-" url:"run_id,omitempty"` + RunUuid string `json:"-" url:"run_uuid,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2749,15 +2527,13 @@ func getLatestVersionsRequestToPb(st *GetLatestVersionsRequest) (*getLatestVersi } pb := &getLatestVersionsRequestPb{} pb.Name = st.Name - pb.Stages = st.Stages return pb, nil } type getLatestVersionsRequestPb struct { - Name string `json:"name"` - + Name string `json:"name"` Stages []string `json:"stages,omitempty"` } @@ -2850,7 +2626,6 @@ func getMetricHistoryResponseToPb(st *GetMetricHistoryResponse) (*getMetricHisto } pb := &getMetricHistoryResponsePb{} pb.Metrics = st.Metrics - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -2858,9 +2633,8 @@ func getMetricHistoryResponseToPb(st *GetMetricHistoryResponse) (*getMetricHisto } type getMetricHistoryResponsePb struct { - Metrics []Metric `json:"metrics,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Metrics []Metric `json:"metrics,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2939,15 +2713,13 @@ func getModelVersionDownloadUriRequestToPb(st *GetModelVersionDownloadUriRequest } pb := &getModelVersionDownloadUriRequestPb{} pb.Name = st.Name - pb.Version = st.Version return pb, nil } type getModelVersionDownloadUriRequestPb struct { - Name string `json:"-" url:"name"` - + Name string `json:"-" url:"name"` Version string `json:"-" url:"version"` } @@ -3004,15 +2776,13 @@ func getModelVersionRequestToPb(st *GetModelVersionRequest) (*getModelVersionReq } pb := &getModelVersionRequestPb{} pb.Name = st.Name - pb.Version = st.Version return pb, nil } type getModelVersionRequestPb struct { - Name string `json:"-" url:"name"` - + Name string `json:"-" url:"name"` Version string `json:"-" url:"version"` } @@ -3129,7 +2899,6 @@ func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { } pb := &getRunRequestPb{} pb.RunId = st.RunId - pb.RunUuid = st.RunUuid pb.ForceSendFields = st.ForceSendFields @@ -3137,8 +2906,7 @@ func getRunRequestToPb(st *GetRunRequest) (*getRunRequestPb, error) { } type getRunRequestPb struct { - RunId string `json:"-" url:"run_id"` - + RunId string `json:"-" url:"run_id"` RunUuid string `json:"-" url:"run_uuid,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3194,11 +2962,8 @@ func httpUrlSpecToPb(st *HttpUrlSpec) (*httpUrlSpecPb, error) { } pb := &httpUrlSpecPb{} pb.Authorization = st.Authorization - pb.EnableSslVerification = st.EnableSslVerification - pb.Secret = st.Secret - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -3206,13 +2971,10 @@ func httpUrlSpecToPb(st *HttpUrlSpec) (*httpUrlSpecPb, error) { } type httpUrlSpecPb struct { - Authorization string `json:"authorization,omitempty"` - - EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` - - Secret string `json:"secret,omitempty"` - - Url string `json:"url"` + Authorization string `json:"authorization,omitempty"` + EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + Secret string `json:"secret,omitempty"` + Url string `json:"url"` ForceSendFields []string `json:"-" url:"-"` } @@ -3245,7 +3007,6 @@ func httpUrlSpecWithoutSecretToPb(st *HttpUrlSpecWithoutSecret) (*httpUrlSpecWit } pb := &httpUrlSpecWithoutSecretPb{} pb.EnableSslVerification = st.EnableSslVerification - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -3253,9 +3014,8 @@ func httpUrlSpecWithoutSecretToPb(st *HttpUrlSpecWithoutSecret) (*httpUrlSpecWit } type httpUrlSpecWithoutSecretPb struct { - EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` - - Url string `json:"url,omitempty"` + EnableSslVerification bool `json:"enable_ssl_verification,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3286,15 +3046,13 @@ func inputTagToPb(st *InputTag) (*inputTagPb, error) { } pb := &inputTagPb{} pb.Key = st.Key - pb.Value = st.Value return pb, nil } type inputTagPb struct { - Key string `json:"key"` - + Key string `json:"key"` Value string `json:"value"` } @@ -3315,9 +3073,7 @@ func jobSpecToPb(st *JobSpec) (*jobSpecPb, error) { } pb := &jobSpecPb{} pb.AccessToken = st.AccessToken - pb.JobId = st.JobId - pb.WorkspaceUrl = st.WorkspaceUrl pb.ForceSendFields = st.ForceSendFields @@ -3325,10 +3081,8 @@ func jobSpecToPb(st *JobSpec) (*jobSpecPb, error) { } type jobSpecPb struct { - AccessToken string `json:"access_token"` - - JobId string `json:"job_id"` - + AccessToken string `json:"access_token"` + JobId string `json:"job_id"` WorkspaceUrl string `json:"workspace_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3361,7 +3115,6 @@ func jobSpecWithoutSecretToPb(st *JobSpecWithoutSecret) (*jobSpecWithoutSecretPb } pb := &jobSpecWithoutSecretPb{} pb.JobId = st.JobId - pb.WorkspaceUrl = st.WorkspaceUrl pb.ForceSendFields = st.ForceSendFields @@ -3369,8 +3122,7 @@ func jobSpecWithoutSecretToPb(st *JobSpecWithoutSecret) (*jobSpecWithoutSecretPb } type jobSpecWithoutSecretPb struct { - JobId string `json:"job_id,omitempty"` - + JobId string `json:"job_id,omitempty"` WorkspaceUrl string `json:"workspace_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3402,11 +3154,8 @@ func listArtifactsRequestToPb(st *ListArtifactsRequest) (*listArtifactsRequestPb } pb := &listArtifactsRequestPb{} pb.PageToken = st.PageToken - pb.Path = st.Path - pb.RunId = st.RunId - pb.RunUuid = st.RunUuid pb.ForceSendFields = st.ForceSendFields @@ -3415,12 +3164,9 @@ func listArtifactsRequestToPb(st *ListArtifactsRequest) (*listArtifactsRequestPb type listArtifactsRequestPb struct { PageToken string `json:"-" url:"page_token,omitempty"` - - Path string `json:"-" url:"path,omitempty"` - - RunId string `json:"-" url:"run_id,omitempty"` - - RunUuid string `json:"-" url:"run_uuid,omitempty"` + Path string `json:"-" url:"path,omitempty"` + RunId string `json:"-" url:"run_id,omitempty"` + RunUuid string `json:"-" url:"run_uuid,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3453,9 +3199,7 @@ func listArtifactsResponseToPb(st *ListArtifactsResponse) (*listArtifactsRespons } pb := &listArtifactsResponsePb{} pb.Files = st.Files - pb.NextPageToken = st.NextPageToken - pb.RootUri = st.RootUri pb.ForceSendFields = st.ForceSendFields @@ -3463,11 +3207,9 @@ func listArtifactsResponseToPb(st *ListArtifactsResponse) (*listArtifactsRespons } type listArtifactsResponsePb struct { - Files []FileInfo `json:"files,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - RootUri string `json:"root_uri,omitempty"` + Files []FileInfo `json:"files,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + RootUri string `json:"root_uri,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3499,9 +3241,7 @@ func listExperimentsRequestToPb(st *ListExperimentsRequest) (*listExperimentsReq } pb := &listExperimentsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.ViewType = st.ViewType pb.ForceSendFields = st.ForceSendFields @@ -3509,11 +3249,9 @@ func listExperimentsRequestToPb(st *ListExperimentsRequest) (*listExperimentsReq } type listExperimentsRequestPb struct { - MaxResults int64 `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ViewType ViewType `json:"-" url:"view_type,omitempty"` + MaxResults int64 `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ViewType ViewType `json:"-" url:"view_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3545,7 +3283,6 @@ func listExperimentsResponseToPb(st *ListExperimentsResponse) (*listExperimentsR } pb := &listExperimentsResponsePb{} pb.Experiments = st.Experiments - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -3553,9 +3290,8 @@ func listExperimentsResponseToPb(st *ListExperimentsResponse) (*listExperimentsR } type listExperimentsResponsePb struct { - Experiments []Experiment `json:"experiments,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Experiments []Experiment `json:"experiments,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3586,9 +3322,7 @@ func listLoggedModelArtifactsRequestToPb(st *ListLoggedModelArtifactsRequest) (* } pb := &listLoggedModelArtifactsRequestPb{} pb.ArtifactDirectoryPath = st.ArtifactDirectoryPath - pb.ModelId = st.ModelId - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -3597,10 +3331,8 @@ func listLoggedModelArtifactsRequestToPb(st *ListLoggedModelArtifactsRequest) (* type listLoggedModelArtifactsRequestPb struct { ArtifactDirectoryPath string `json:"-" url:"artifact_directory_path,omitempty"` - - ModelId string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + ModelId string `json:"-" url:"-"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3632,9 +3364,7 @@ func listLoggedModelArtifactsResponseToPb(st *ListLoggedModelArtifactsResponse) } pb := &listLoggedModelArtifactsResponsePb{} pb.Files = st.Files - pb.NextPageToken = st.NextPageToken - pb.RootUri = st.RootUri pb.ForceSendFields = st.ForceSendFields @@ -3642,11 +3372,9 @@ func listLoggedModelArtifactsResponseToPb(st *ListLoggedModelArtifactsResponse) } type listLoggedModelArtifactsResponsePb struct { - Files []FileInfo `json:"files,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - RootUri string `json:"root_uri,omitempty"` + Files []FileInfo `json:"files,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + RootUri string `json:"root_uri,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3678,7 +3406,6 @@ func listModelsRequestToPb(st *ListModelsRequest) (*listModelsRequestPb, error) } pb := &listModelsRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -3686,9 +3413,8 @@ func listModelsRequestToPb(st *ListModelsRequest) (*listModelsRequestPb, error) } type listModelsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3719,7 +3445,6 @@ func listModelsResponseToPb(st *ListModelsResponse) (*listModelsResponsePb, erro } pb := &listModelsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.RegisteredModels = st.RegisteredModels pb.ForceSendFields = st.ForceSendFields @@ -3727,8 +3452,7 @@ func listModelsResponseToPb(st *ListModelsResponse) (*listModelsResponsePb, erro } type listModelsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` RegisteredModels []Model `json:"registered_models,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3760,7 +3484,6 @@ func listRegistryWebhooksToPb(st *ListRegistryWebhooks) (*listRegistryWebhooksPb } pb := &listRegistryWebhooksPb{} pb.NextPageToken = st.NextPageToken - pb.Webhooks = st.Webhooks pb.ForceSendFields = st.ForceSendFields @@ -3768,9 +3491,8 @@ func listRegistryWebhooksToPb(st *ListRegistryWebhooks) (*listRegistryWebhooksPb } type listRegistryWebhooksPb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Webhooks []RegistryWebhook `json:"webhooks,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Webhooks []RegistryWebhook `json:"webhooks,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3801,15 +3523,13 @@ func listTransitionRequestsRequestToPb(st *ListTransitionRequestsRequest) (*list } pb := &listTransitionRequestsRequestPb{} pb.Name = st.Name - pb.Version = st.Version return pb, nil } type listTransitionRequestsRequestPb struct { - Name string `json:"-" url:"name"` - + Name string `json:"-" url:"name"` Version string `json:"-" url:"version"` } @@ -3854,9 +3574,7 @@ func listWebhooksRequestToPb(st *ListWebhooksRequest) (*listWebhooksRequestPb, e } pb := &listWebhooksRequestPb{} pb.Events = st.Events - pb.ModelName = st.ModelName - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -3864,11 +3582,9 @@ func listWebhooksRequestToPb(st *ListWebhooksRequest) (*listWebhooksRequestPb, e } type listWebhooksRequestPb struct { - Events []RegistryWebhookEvent `json:"-" url:"events,omitempty"` - - ModelName string `json:"-" url:"model_name,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + Events []RegistryWebhookEvent `json:"-" url:"events,omitempty"` + ModelName string `json:"-" url:"model_name,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3900,11 +3616,8 @@ func logBatchToPb(st *LogBatch) (*logBatchPb, error) { } pb := &logBatchPb{} pb.Metrics = st.Metrics - pb.Params = st.Params - pb.RunId = st.RunId - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -3913,12 +3626,9 @@ func logBatchToPb(st *LogBatch) (*logBatchPb, error) { type logBatchPb struct { Metrics []Metric `json:"metrics,omitempty"` - - Params []Param `json:"params,omitempty"` - - RunId string `json:"run_id,omitempty"` - - Tags []RunTag `json:"tags,omitempty"` + Params []Param `json:"params,omitempty"` + RunId string `json:"run_id,omitempty"` + Tags []RunTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3972,9 +3682,7 @@ func logInputsToPb(st *LogInputs) (*logInputsPb, error) { } pb := &logInputsPb{} pb.Datasets = st.Datasets - pb.Models = st.Models - pb.RunId = st.RunId return pb, nil @@ -3982,10 +3690,8 @@ func logInputsToPb(st *LogInputs) (*logInputsPb, error) { type logInputsPb struct { Datasets []DatasetInput `json:"datasets,omitempty"` - - Models []ModelInput `json:"models,omitempty"` - - RunId string `json:"run_id"` + Models []ModelInput `json:"models,omitempty"` + RunId string `json:"run_id"` } func logInputsFromPb(pb *logInputsPb) (*LogInputs, error) { @@ -4027,16 +3733,14 @@ func logLoggedModelParamsRequestToPb(st *LogLoggedModelParamsRequest) (*logLogge } pb := &logLoggedModelParamsRequestPb{} pb.ModelId = st.ModelId - pb.Params = st.Params return pb, nil } type logLoggedModelParamsRequestPb struct { - ModelId string `json:"-" url:"-"` - - Params []LoggedModelParameter `json:"params,omitempty"` + ModelId string `json:"-" url:"-"` + Params []LoggedModelParameter `json:"params,omitempty"` } func logLoggedModelParamsRequestFromPb(pb *logLoggedModelParamsRequestPb) (*LogLoggedModelParamsRequest, error) { @@ -4077,21 +3781,13 @@ func logMetricToPb(st *LogMetric) (*logMetricPb, error) { } pb := &logMetricPb{} pb.DatasetDigest = st.DatasetDigest - pb.DatasetName = st.DatasetName - pb.Key = st.Key - pb.ModelId = st.ModelId - pb.RunId = st.RunId - pb.RunUuid = st.RunUuid - pb.Step = st.Step - pb.Timestamp = st.Timestamp - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4099,23 +3795,15 @@ func logMetricToPb(st *LogMetric) (*logMetricPb, error) { } type logMetricPb struct { - DatasetDigest string `json:"dataset_digest,omitempty"` - - DatasetName string `json:"dataset_name,omitempty"` - - Key string `json:"key"` - - ModelId string `json:"model_id,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunUuid string `json:"run_uuid,omitempty"` - - Step int64 `json:"step,omitempty"` - - Timestamp int64 `json:"timestamp"` - - Value float64 `json:"value"` + DatasetDigest string `json:"dataset_digest,omitempty"` + DatasetName string `json:"dataset_name,omitempty"` + Key string `json:"key"` + ModelId string `json:"model_id,omitempty"` + RunId string `json:"run_id,omitempty"` + RunUuid string `json:"run_uuid,omitempty"` + Step int64 `json:"step,omitempty"` + Timestamp int64 `json:"timestamp"` + Value float64 `json:"value"` ForceSendFields []string `json:"-" url:"-"` } @@ -4174,7 +3862,6 @@ func logModelToPb(st *LogModel) (*logModelPb, error) { } pb := &logModelPb{} pb.ModelJson = st.ModelJson - pb.RunId = st.RunId pb.ForceSendFields = st.ForceSendFields @@ -4183,8 +3870,7 @@ func logModelToPb(st *LogModel) (*logModelPb, error) { type logModelPb struct { ModelJson string `json:"model_json,omitempty"` - - RunId string `json:"run_id,omitempty"` + RunId string `json:"run_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4236,7 +3922,6 @@ func logOutputsRequestToPb(st *LogOutputsRequest) (*logOutputsRequestPb, error) } pb := &logOutputsRequestPb{} pb.Models = st.Models - pb.RunId = st.RunId return pb, nil @@ -4244,8 +3929,7 @@ func logOutputsRequestToPb(st *LogOutputsRequest) (*logOutputsRequestPb, error) type logOutputsRequestPb struct { Models []ModelOutput `json:"models,omitempty"` - - RunId string `json:"run_id"` + RunId string `json:"run_id"` } func logOutputsRequestFromPb(pb *logOutputsRequestPb) (*LogOutputsRequest, error) { @@ -4286,11 +3970,8 @@ func logParamToPb(st *LogParam) (*logParamPb, error) { } pb := &logParamPb{} pb.Key = st.Key - pb.RunId = st.RunId - pb.RunUuid = st.RunUuid - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4298,13 +3979,10 @@ func logParamToPb(st *LogParam) (*logParamPb, error) { } type logParamPb struct { - Key string `json:"key"` - - RunId string `json:"run_id,omitempty"` - + Key string `json:"key"` + RunId string `json:"run_id,omitempty"` RunUuid string `json:"run_uuid,omitempty"` - - Value string `json:"value"` + Value string `json:"value"` ForceSendFields []string `json:"-" url:"-"` } @@ -4358,7 +4036,6 @@ func loggedModelToPb(st *LoggedModel) (*loggedModelPb, error) { } pb := &loggedModelPb{} pb.Data = st.Data - pb.Info = st.Info return pb, nil @@ -4366,7 +4043,6 @@ func loggedModelToPb(st *LoggedModel) (*loggedModelPb, error) { type loggedModelPb struct { Data *LoggedModelData `json:"data,omitempty"` - Info *LoggedModelInfo `json:"info,omitempty"` } @@ -4387,16 +4063,14 @@ func loggedModelDataToPb(st *LoggedModelData) (*loggedModelDataPb, error) { } pb := &loggedModelDataPb{} pb.Metrics = st.Metrics - pb.Params = st.Params return pb, nil } type loggedModelDataPb struct { - Metrics []Metric `json:"metrics,omitempty"` - - Params []LoggedModelParameter `json:"params,omitempty"` + Metrics []Metric `json:"metrics,omitempty"` + Params []LoggedModelParameter `json:"params,omitempty"` } func loggedModelDataFromPb(pb *loggedModelDataPb) (*LoggedModelData, error) { @@ -4416,27 +4090,16 @@ func loggedModelInfoToPb(st *LoggedModelInfo) (*loggedModelInfoPb, error) { } pb := &loggedModelInfoPb{} pb.ArtifactUri = st.ArtifactUri - pb.CreationTimestampMs = st.CreationTimestampMs - pb.CreatorId = st.CreatorId - pb.ExperimentId = st.ExperimentId - pb.LastUpdatedTimestampMs = st.LastUpdatedTimestampMs - pb.ModelId = st.ModelId - pb.ModelType = st.ModelType - pb.Name = st.Name - pb.SourceRunId = st.SourceRunId - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -4444,29 +4107,18 @@ func loggedModelInfoToPb(st *LoggedModelInfo) (*loggedModelInfoPb, error) { } type loggedModelInfoPb struct { - ArtifactUri string `json:"artifact_uri,omitempty"` - - CreationTimestampMs int64 `json:"creation_timestamp_ms,omitempty"` - - CreatorId int64 `json:"creator_id,omitempty"` - - ExperimentId string `json:"experiment_id,omitempty"` - - LastUpdatedTimestampMs int64 `json:"last_updated_timestamp_ms,omitempty"` - - ModelId string `json:"model_id,omitempty"` - - ModelType string `json:"model_type,omitempty"` - - Name string `json:"name,omitempty"` - - SourceRunId string `json:"source_run_id,omitempty"` - - Status LoggedModelStatus `json:"status,omitempty"` - - StatusMessage string `json:"status_message,omitempty"` - - Tags []LoggedModelTag `json:"tags,omitempty"` + ArtifactUri string `json:"artifact_uri,omitempty"` + CreationTimestampMs int64 `json:"creation_timestamp_ms,omitempty"` + CreatorId int64 `json:"creator_id,omitempty"` + ExperimentId string `json:"experiment_id,omitempty"` + LastUpdatedTimestampMs int64 `json:"last_updated_timestamp_ms,omitempty"` + ModelId string `json:"model_id,omitempty"` + ModelType string `json:"model_type,omitempty"` + Name string `json:"name,omitempty"` + SourceRunId string `json:"source_run_id,omitempty"` + Status LoggedModelStatus `json:"status,omitempty"` + StatusMessage string `json:"status_message,omitempty"` + Tags []LoggedModelTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4507,7 +4159,6 @@ func loggedModelParameterToPb(st *LoggedModelParameter) (*loggedModelParameterPb } pb := &loggedModelParameterPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4515,8 +4166,7 @@ func loggedModelParameterToPb(st *LoggedModelParameter) (*loggedModelParameterPb } type loggedModelParameterPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4548,7 +4198,6 @@ func loggedModelTagToPb(st *LoggedModelTag) (*loggedModelTagPb, error) { } pb := &loggedModelTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4556,8 +4205,7 @@ func loggedModelTagToPb(st *LoggedModelTag) (*loggedModelTagPb, error) { } type loggedModelTagPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4589,19 +4237,12 @@ func metricToPb(st *Metric) (*metricPb, error) { } pb := &metricPb{} pb.DatasetDigest = st.DatasetDigest - pb.DatasetName = st.DatasetName - pb.Key = st.Key - pb.ModelId = st.ModelId - pb.RunId = st.RunId - pb.Step = st.Step - pb.Timestamp = st.Timestamp - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4609,21 +4250,14 @@ func metricToPb(st *Metric) (*metricPb, error) { } type metricPb struct { - DatasetDigest string `json:"dataset_digest,omitempty"` - - DatasetName string `json:"dataset_name,omitempty"` - - Key string `json:"key,omitempty"` - - ModelId string `json:"model_id,omitempty"` - - RunId string `json:"run_id,omitempty"` - - Step int64 `json:"step,omitempty"` - - Timestamp int64 `json:"timestamp,omitempty"` - - Value float64 `json:"value,omitempty"` + DatasetDigest string `json:"dataset_digest,omitempty"` + DatasetName string `json:"dataset_name,omitempty"` + Key string `json:"key,omitempty"` + ModelId string `json:"model_id,omitempty"` + RunId string `json:"run_id,omitempty"` + Step int64 `json:"step,omitempty"` + Timestamp int64 `json:"timestamp,omitempty"` + Value float64 `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4660,17 +4294,11 @@ func modelToPb(st *Model) (*modelPb, error) { } pb := &modelPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Description = st.Description - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.LatestVersions = st.LatestVersions - pb.Name = st.Name - pb.Tags = st.Tags - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -4678,19 +4306,13 @@ func modelToPb(st *Model) (*modelPb, error) { } type modelPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Description string `json:"description,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - LatestVersions []ModelVersion `json:"latest_versions,omitempty"` - - Name string `json:"name,omitempty"` - - Tags []ModelTag `json:"tags,omitempty"` - - UserId string `json:"user_id,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Description string `json:"description,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + Name string `json:"name,omitempty"` + Tags []ModelTag `json:"tags,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4726,21 +4348,13 @@ func modelDatabricksToPb(st *ModelDatabricks) (*modelDatabricksPb, error) { } pb := &modelDatabricksPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Description = st.Description - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.LatestVersions = st.LatestVersions - pb.Name = st.Name - pb.PermissionLevel = st.PermissionLevel - pb.Tags = st.Tags - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -4748,23 +4362,15 @@ func modelDatabricksToPb(st *ModelDatabricks) (*modelDatabricksPb, error) { } type modelDatabricksPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Description string `json:"description,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - LatestVersions []ModelVersion `json:"latest_versions,omitempty"` - - Name string `json:"name,omitempty"` - - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` - - Tags []ModelTag `json:"tags,omitempty"` - - UserId string `json:"user_id,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + LatestVersions []ModelVersion `json:"latest_versions,omitempty"` + Name string `json:"name,omitempty"` + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + Tags []ModelTag `json:"tags,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4826,7 +4432,6 @@ func modelOutputToPb(st *ModelOutput) (*modelOutputPb, error) { } pb := &modelOutputPb{} pb.ModelId = st.ModelId - pb.Step = st.Step return pb, nil @@ -4834,8 +4439,7 @@ func modelOutputToPb(st *ModelOutput) (*modelOutputPb, error) { type modelOutputPb struct { ModelId string `json:"model_id"` - - Step int64 `json:"step"` + Step int64 `json:"step"` } func modelOutputFromPb(pb *modelOutputPb) (*ModelOutput, error) { @@ -4855,7 +4459,6 @@ func modelTagToPb(st *ModelTag) (*modelTagPb, error) { } pb := &modelTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -4863,8 +4466,7 @@ func modelTagToPb(st *ModelTag) (*modelTagPb, error) { } type modelTagPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4896,29 +4498,17 @@ func modelVersionToPb(st *ModelVersion) (*modelVersionPb, error) { } pb := &modelVersionPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.CurrentStage = st.CurrentStage - pb.Description = st.Description - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.Name = st.Name - pb.RunId = st.RunId - pb.RunLink = st.RunLink - pb.Source = st.Source - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage - pb.Tags = st.Tags - pb.UserId = st.UserId - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -4926,31 +4516,19 @@ func modelVersionToPb(st *ModelVersion) (*modelVersionPb, error) { } type modelVersionPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - CurrentStage string `json:"current_stage,omitempty"` - - Description string `json:"description,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - Name string `json:"name,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunLink string `json:"run_link,omitempty"` - - Source string `json:"source,omitempty"` - - Status ModelVersionStatus `json:"status,omitempty"` - - StatusMessage string `json:"status_message,omitempty"` - - Tags []ModelVersionTag `json:"tags,omitempty"` - - UserId string `json:"user_id,omitempty"` - - Version string `json:"version,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + CurrentStage string `json:"current_stage,omitempty"` + Description string `json:"description,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Name string `json:"name,omitempty"` + RunId string `json:"run_id,omitempty"` + RunLink string `json:"run_link,omitempty"` + Source string `json:"source,omitempty"` + Status ModelVersionStatus `json:"status,omitempty"` + StatusMessage string `json:"status_message,omitempty"` + Tags []ModelVersionTag `json:"tags,omitempty"` + UserId string `json:"user_id,omitempty"` + Version string `json:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4992,31 +4570,18 @@ func modelVersionDatabricksToPb(st *ModelVersionDatabricks) (*modelVersionDatabr } pb := &modelVersionDatabricksPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.CurrentStage = st.CurrentStage - pb.Description = st.Description - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.Name = st.Name - pb.PermissionLevel = st.PermissionLevel - pb.RunId = st.RunId - pb.RunLink = st.RunLink - pb.Source = st.Source - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage - pb.Tags = st.Tags - pb.UserId = st.UserId - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -5024,33 +4589,20 @@ func modelVersionDatabricksToPb(st *ModelVersionDatabricks) (*modelVersionDatabr } type modelVersionDatabricksPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - CurrentStage Stage `json:"current_stage,omitempty"` - - Description string `json:"description,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - Name string `json:"name,omitempty"` - - PermissionLevel PermissionLevel `json:"permission_level,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunLink string `json:"run_link,omitempty"` - - Source string `json:"source,omitempty"` - - Status Status `json:"status,omitempty"` - - StatusMessage string `json:"status_message,omitempty"` - - Tags []ModelVersionTag `json:"tags,omitempty"` - - UserId string `json:"user_id,omitempty"` - - Version string `json:"version,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + CurrentStage Stage `json:"current_stage,omitempty"` + Description string `json:"description,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Name string `json:"name,omitempty"` + PermissionLevel PermissionLevel `json:"permission_level,omitempty"` + RunId string `json:"run_id,omitempty"` + RunLink string `json:"run_link,omitempty"` + Source string `json:"source,omitempty"` + Status Status `json:"status,omitempty"` + StatusMessage string `json:"status_message,omitempty"` + Tags []ModelVersionTag `json:"tags,omitempty"` + UserId string `json:"user_id,omitempty"` + Version string `json:"version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5093,7 +4645,6 @@ func modelVersionTagToPb(st *ModelVersionTag) (*modelVersionTagPb, error) { } pb := &modelVersionTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -5101,8 +4652,7 @@ func modelVersionTagToPb(st *ModelVersionTag) (*modelVersionTagPb, error) { } type modelVersionTagPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5134,7 +4684,6 @@ func paramToPb(st *Param) (*paramPb, error) { } pb := ¶mPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -5142,8 +4691,7 @@ func paramToPb(st *Param) (*paramPb, error) { } type paramPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5175,11 +4723,8 @@ func registeredModelAccessControlRequestToPb(st *RegisteredModelAccessControlReq } pb := ®isteredModelAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5187,13 +4732,10 @@ func registeredModelAccessControlRequestToPb(st *RegisteredModelAccessControlReq } type registeredModelAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5226,13 +4768,9 @@ func registeredModelAccessControlResponseToPb(st *RegisteredModelAccessControlRe } pb := ®isteredModelAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5240,15 +4778,11 @@ func registeredModelAccessControlResponseToPb(st *RegisteredModelAccessControlRe } type registeredModelAccessControlResponsePb struct { - AllPermissions []RegisteredModelPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []RegisteredModelPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5282,9 +4816,7 @@ func registeredModelPermissionToPb(st *RegisteredModelPermission) (*registeredMo } pb := ®isteredModelPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5292,11 +4824,9 @@ func registeredModelPermissionToPb(st *RegisteredModelPermission) (*registeredMo } type registeredModelPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5328,9 +4858,7 @@ func registeredModelPermissionsToPb(st *RegisteredModelPermissions) (*registered } pb := ®isteredModelPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -5339,10 +4867,8 @@ func registeredModelPermissionsToPb(st *RegisteredModelPermissions) (*registered type registeredModelPermissionsPb struct { AccessControlList []RegisteredModelAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5374,7 +4900,6 @@ func registeredModelPermissionsDescriptionToPb(st *RegisteredModelPermissionsDes } pb := ®isteredModelPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5382,8 +4907,7 @@ func registeredModelPermissionsDescriptionToPb(st *RegisteredModelPermissionsDes } type registeredModelPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5415,7 +4939,6 @@ func registeredModelPermissionsRequestToPb(st *RegisteredModelPermissionsRequest } pb := ®isteredModelPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.RegisteredModelId = st.RegisteredModelId return pb, nil @@ -5423,8 +4946,7 @@ func registeredModelPermissionsRequestToPb(st *RegisteredModelPermissionsRequest type registeredModelPermissionsRequestPb struct { AccessControlList []RegisteredModelAccessControlRequest `json:"access_control_list,omitempty"` - - RegisteredModelId string `json:"-" url:"-"` + RegisteredModelId string `json:"-" url:"-"` } func registeredModelPermissionsRequestFromPb(pb *registeredModelPermissionsRequestPb) (*RegisteredModelPermissionsRequest, error) { @@ -5444,21 +4966,13 @@ func registryWebhookToPb(st *RegistryWebhook) (*registryWebhookPb, error) { } pb := ®istryWebhookPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Description = st.Description - pb.Events = st.Events - pb.HttpUrlSpec = st.HttpUrlSpec - pb.Id = st.Id - pb.JobSpec = st.JobSpec - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.ModelName = st.ModelName - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -5466,23 +4980,15 @@ func registryWebhookToPb(st *RegistryWebhook) (*registryWebhookPb, error) { } type registryWebhookPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Description string `json:"description,omitempty"` - - Events []RegistryWebhookEvent `json:"events,omitempty"` - - HttpUrlSpec *HttpUrlSpecWithoutSecret `json:"http_url_spec,omitempty"` - - Id string `json:"id,omitempty"` - - JobSpec *JobSpecWithoutSecret `json:"job_spec,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - ModelName string `json:"model_name,omitempty"` - - Status RegistryWebhookStatus `json:"status,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Description string `json:"description,omitempty"` + Events []RegistryWebhookEvent `json:"events,omitempty"` + HttpUrlSpec *HttpUrlSpecWithoutSecret `json:"http_url_spec,omitempty"` + Id string `json:"id,omitempty"` + JobSpec *JobSpecWithoutSecret `json:"job_spec,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + ModelName string `json:"model_name,omitempty"` + Status RegistryWebhookStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5520,11 +5026,8 @@ func rejectTransitionRequestToPb(st *RejectTransitionRequest) (*rejectTransition } pb := &rejectTransitionRequestPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.Stage = st.Stage - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -5533,11 +5036,8 @@ func rejectTransitionRequestToPb(st *RejectTransitionRequest) (*rejectTransition type rejectTransitionRequestPb struct { Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - Stage Stage `json:"stage"` - + Name string `json:"name"` + Stage Stage `json:"stage"` Version string `json:"version"` ForceSendFields []string `json:"-" url:"-"` @@ -5595,7 +5095,6 @@ func renameModelRequestToPb(st *RenameModelRequest) (*renameModelRequestPb, erro } pb := &renameModelRequestPb{} pb.Name = st.Name - pb.NewName = st.NewName pb.ForceSendFields = st.ForceSendFields @@ -5603,8 +5102,7 @@ func renameModelRequestToPb(st *RenameModelRequest) (*renameModelRequestPb, erro } type renameModelRequestPb struct { - Name string `json:"name"` - + Name string `json:"name"` NewName string `json:"new_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5750,9 +5248,7 @@ func restoreRunsToPb(st *RestoreRuns) (*restoreRunsPb, error) { } pb := &restoreRunsPb{} pb.ExperimentId = st.ExperimentId - pb.MaxRuns = st.MaxRuns - pb.MinTimestampMillis = st.MinTimestampMillis pb.ForceSendFields = st.ForceSendFields @@ -5760,11 +5256,9 @@ func restoreRunsToPb(st *RestoreRuns) (*restoreRunsPb, error) { } type restoreRunsPb struct { - ExperimentId string `json:"experiment_id"` - - MaxRuns int `json:"max_runs,omitempty"` - - MinTimestampMillis int64 `json:"min_timestamp_millis"` + ExperimentId string `json:"experiment_id"` + MaxRuns int `json:"max_runs,omitempty"` + MinTimestampMillis int64 `json:"min_timestamp_millis"` ForceSendFields []string `json:"-" url:"-"` } @@ -5832,19 +5326,15 @@ func runToPb(st *Run) (*runPb, error) { } pb := &runPb{} pb.Data = st.Data - pb.Info = st.Info - pb.Inputs = st.Inputs return pb, nil } type runPb struct { - Data *RunData `json:"data,omitempty"` - - Info *RunInfo `json:"info,omitempty"` - + Data *RunData `json:"data,omitempty"` + Info *RunInfo `json:"info,omitempty"` Inputs *RunInputs `json:"inputs,omitempty"` } @@ -5866,9 +5356,7 @@ func runDataToPb(st *RunData) (*runDataPb, error) { } pb := &runDataPb{} pb.Metrics = st.Metrics - pb.Params = st.Params - pb.Tags = st.Tags return pb, nil @@ -5876,10 +5364,8 @@ func runDataToPb(st *RunData) (*runDataPb, error) { type runDataPb struct { Metrics []Metric `json:"metrics,omitempty"` - - Params []Param `json:"params,omitempty"` - - Tags []RunTag `json:"tags,omitempty"` + Params []Param `json:"params,omitempty"` + Tags []RunTag `json:"tags,omitempty"` } func runDataFromPb(pb *runDataPb) (*RunData, error) { @@ -5900,23 +5386,14 @@ func runInfoToPb(st *RunInfo) (*runInfoPb, error) { } pb := &runInfoPb{} pb.ArtifactUri = st.ArtifactUri - pb.EndTime = st.EndTime - pb.ExperimentId = st.ExperimentId - pb.LifecycleStage = st.LifecycleStage - pb.RunId = st.RunId - pb.RunName = st.RunName - pb.RunUuid = st.RunUuid - pb.StartTime = st.StartTime - pb.Status = st.Status - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -5924,25 +5401,16 @@ func runInfoToPb(st *RunInfo) (*runInfoPb, error) { } type runInfoPb struct { - ArtifactUri string `json:"artifact_uri,omitempty"` - - EndTime int64 `json:"end_time,omitempty"` - - ExperimentId string `json:"experiment_id,omitempty"` - - LifecycleStage string `json:"lifecycle_stage,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunName string `json:"run_name,omitempty"` - - RunUuid string `json:"run_uuid,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - Status RunInfoStatus `json:"status,omitempty"` - - UserId string `json:"user_id,omitempty"` + ArtifactUri string `json:"artifact_uri,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + ExperimentId string `json:"experiment_id,omitempty"` + LifecycleStage string `json:"lifecycle_stage,omitempty"` + RunId string `json:"run_id,omitempty"` + RunName string `json:"run_name,omitempty"` + RunUuid string `json:"run_uuid,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + Status RunInfoStatus `json:"status,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5981,7 +5449,6 @@ func runInputsToPb(st *RunInputs) (*runInputsPb, error) { } pb := &runInputsPb{} pb.DatasetInputs = st.DatasetInputs - pb.ModelInputs = st.ModelInputs return pb, nil @@ -5989,8 +5456,7 @@ func runInputsToPb(st *RunInputs) (*runInputsPb, error) { type runInputsPb struct { DatasetInputs []DatasetInput `json:"dataset_inputs,omitempty"` - - ModelInputs []ModelInput `json:"model_inputs,omitempty"` + ModelInputs []ModelInput `json:"model_inputs,omitempty"` } func runInputsFromPb(pb *runInputsPb) (*RunInputs, error) { @@ -6010,7 +5476,6 @@ func runTagToPb(st *RunTag) (*runTagPb, error) { } pb := &runTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -6018,8 +5483,7 @@ func runTagToPb(st *RunTag) (*runTagPb, error) { } type runTagPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6051,13 +5515,9 @@ func searchExperimentsToPb(st *SearchExperiments) (*searchExperimentsPb, error) } pb := &searchExperimentsPb{} pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken - pb.ViewType = st.ViewType pb.ForceSendFields = st.ForceSendFields @@ -6065,15 +5525,11 @@ func searchExperimentsToPb(st *SearchExperiments) (*searchExperimentsPb, error) } type searchExperimentsPb struct { - Filter string `json:"filter,omitempty"` - - MaxResults int64 `json:"max_results,omitempty"` - - OrderBy []string `json:"order_by,omitempty"` - - PageToken string `json:"page_token,omitempty"` - - ViewType ViewType `json:"view_type,omitempty"` + Filter string `json:"filter,omitempty"` + MaxResults int64 `json:"max_results,omitempty"` + OrderBy []string `json:"order_by,omitempty"` + PageToken string `json:"page_token,omitempty"` + ViewType ViewType `json:"view_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6107,7 +5563,6 @@ func searchExperimentsResponseToPb(st *SearchExperimentsResponse) (*searchExperi } pb := &searchExperimentsResponsePb{} pb.Experiments = st.Experiments - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6115,9 +5570,8 @@ func searchExperimentsResponseToPb(st *SearchExperimentsResponse) (*searchExperi } type searchExperimentsResponsePb struct { - Experiments []Experiment `json:"experiments,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Experiments []Experiment `json:"experiments,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6148,7 +5602,6 @@ func searchLoggedModelsDatasetToPb(st *SearchLoggedModelsDataset) (*searchLogged } pb := &searchLoggedModelsDatasetPb{} pb.DatasetDigest = st.DatasetDigest - pb.DatasetName = st.DatasetName pb.ForceSendFields = st.ForceSendFields @@ -6157,8 +5610,7 @@ func searchLoggedModelsDatasetToPb(st *SearchLoggedModelsDataset) (*searchLogged type searchLoggedModelsDatasetPb struct { DatasetDigest string `json:"dataset_digest,omitempty"` - - DatasetName string `json:"dataset_name"` + DatasetName string `json:"dataset_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -6189,11 +5641,8 @@ func searchLoggedModelsOrderByToPb(st *SearchLoggedModelsOrderBy) (*searchLogged } pb := &searchLoggedModelsOrderByPb{} pb.Ascending = st.Ascending - pb.DatasetDigest = st.DatasetDigest - pb.DatasetName = st.DatasetName - pb.FieldName = st.FieldName pb.ForceSendFields = st.ForceSendFields @@ -6201,13 +5650,10 @@ func searchLoggedModelsOrderByToPb(st *SearchLoggedModelsOrderBy) (*searchLogged } type searchLoggedModelsOrderByPb struct { - Ascending bool `json:"ascending,omitempty"` - + Ascending bool `json:"ascending,omitempty"` DatasetDigest string `json:"dataset_digest,omitempty"` - - DatasetName string `json:"dataset_name,omitempty"` - - FieldName string `json:"field_name"` + DatasetName string `json:"dataset_name,omitempty"` + FieldName string `json:"field_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -6240,15 +5686,10 @@ func searchLoggedModelsRequestToPb(st *SearchLoggedModelsRequest) (*searchLogged } pb := &searchLoggedModelsRequestPb{} pb.Datasets = st.Datasets - pb.ExperimentIds = st.ExperimentIds - pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6256,17 +5697,12 @@ func searchLoggedModelsRequestToPb(st *SearchLoggedModelsRequest) (*searchLogged } type searchLoggedModelsRequestPb struct { - Datasets []SearchLoggedModelsDataset `json:"datasets,omitempty"` - - ExperimentIds []string `json:"experiment_ids,omitempty"` - - Filter string `json:"filter,omitempty"` - - MaxResults int `json:"max_results,omitempty"` - - OrderBy []SearchLoggedModelsOrderBy `json:"order_by,omitempty"` - - PageToken string `json:"page_token,omitempty"` + Datasets []SearchLoggedModelsDataset `json:"datasets,omitempty"` + ExperimentIds []string `json:"experiment_ids,omitempty"` + Filter string `json:"filter,omitempty"` + MaxResults int `json:"max_results,omitempty"` + OrderBy []SearchLoggedModelsOrderBy `json:"order_by,omitempty"` + PageToken string `json:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6301,7 +5737,6 @@ func searchLoggedModelsResponseToPb(st *SearchLoggedModelsResponse) (*searchLogg } pb := &searchLoggedModelsResponsePb{} pb.Models = st.Models - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6309,9 +5744,8 @@ func searchLoggedModelsResponseToPb(st *SearchLoggedModelsResponse) (*searchLogg } type searchLoggedModelsResponsePb struct { - Models []LoggedModel `json:"models,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Models []LoggedModel `json:"models,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6342,11 +5776,8 @@ func searchModelVersionsRequestToPb(st *SearchModelVersionsRequest) (*searchMode } pb := &searchModelVersionsRequestPb{} pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6354,13 +5785,10 @@ func searchModelVersionsRequestToPb(st *SearchModelVersionsRequest) (*searchMode } type searchModelVersionsRequestPb struct { - Filter string `json:"-" url:"filter,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - OrderBy []string `json:"-" url:"order_by,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + OrderBy []string `json:"-" url:"order_by,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6393,7 +5821,6 @@ func searchModelVersionsResponseToPb(st *SearchModelVersionsResponse) (*searchMo } pb := &searchModelVersionsResponsePb{} pb.ModelVersions = st.ModelVersions - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -6402,8 +5829,7 @@ func searchModelVersionsResponseToPb(st *SearchModelVersionsResponse) (*searchMo type searchModelVersionsResponsePb struct { ModelVersions []ModelVersion `json:"model_versions,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6434,11 +5860,8 @@ func searchModelsRequestToPb(st *SearchModelsRequest) (*searchModelsRequestPb, e } pb := &searchModelsRequestPb{} pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -6446,13 +5869,10 @@ func searchModelsRequestToPb(st *SearchModelsRequest) (*searchModelsRequestPb, e } type searchModelsRequestPb struct { - Filter string `json:"-" url:"filter,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - OrderBy []string `json:"-" url:"order_by,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + OrderBy []string `json:"-" url:"order_by,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6485,7 +5905,6 @@ func searchModelsResponseToPb(st *SearchModelsResponse) (*searchModelsResponsePb } pb := &searchModelsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.RegisteredModels = st.RegisteredModels pb.ForceSendFields = st.ForceSendFields @@ -6493,8 +5912,7 @@ func searchModelsResponseToPb(st *SearchModelsResponse) (*searchModelsResponsePb } type searchModelsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` RegisteredModels []Model `json:"registered_models,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6526,15 +5944,10 @@ func searchRunsToPb(st *SearchRuns) (*searchRunsPb, error) { } pb := &searchRunsPb{} pb.ExperimentIds = st.ExperimentIds - pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken - pb.RunViewType = st.RunViewType pb.ForceSendFields = st.ForceSendFields @@ -6543,16 +5956,11 @@ func searchRunsToPb(st *SearchRuns) (*searchRunsPb, error) { type searchRunsPb struct { ExperimentIds []string `json:"experiment_ids,omitempty"` - - Filter string `json:"filter,omitempty"` - - MaxResults int `json:"max_results,omitempty"` - - OrderBy []string `json:"order_by,omitempty"` - - PageToken string `json:"page_token,omitempty"` - - RunViewType ViewType `json:"run_view_type,omitempty"` + Filter string `json:"filter,omitempty"` + MaxResults int `json:"max_results,omitempty"` + OrderBy []string `json:"order_by,omitempty"` + PageToken string `json:"page_token,omitempty"` + RunViewType ViewType `json:"run_view_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6587,7 +5995,6 @@ func searchRunsResponseToPb(st *SearchRunsResponse) (*searchRunsResponsePb, erro } pb := &searchRunsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Runs = st.Runs pb.ForceSendFields = st.ForceSendFields @@ -6596,8 +6003,7 @@ func searchRunsResponseToPb(st *SearchRunsResponse) (*searchRunsResponsePb, erro type searchRunsResponsePb struct { NextPageToken string `json:"next_page_token,omitempty"` - - Runs []Run `json:"runs,omitempty"` + Runs []Run `json:"runs,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6628,9 +6034,7 @@ func setExperimentTagToPb(st *SetExperimentTag) (*setExperimentTagPb, error) { } pb := &setExperimentTagPb{} pb.ExperimentId = st.ExperimentId - pb.Key = st.Key - pb.Value = st.Value return pb, nil @@ -6638,10 +6042,8 @@ func setExperimentTagToPb(st *SetExperimentTag) (*setExperimentTagPb, error) { type setExperimentTagPb struct { ExperimentId string `json:"experiment_id"` - - Key string `json:"key"` - - Value string `json:"value"` + Key string `json:"key"` + Value string `json:"value"` } func setExperimentTagFromPb(pb *setExperimentTagPb) (*SetExperimentTag, error) { @@ -6683,16 +6085,14 @@ func setLoggedModelTagsRequestToPb(st *SetLoggedModelTagsRequest) (*setLoggedMod } pb := &setLoggedModelTagsRequestPb{} pb.ModelId = st.ModelId - pb.Tags = st.Tags return pb, nil } type setLoggedModelTagsRequestPb struct { - ModelId string `json:"-" url:"-"` - - Tags []LoggedModelTag `json:"tags,omitempty"` + ModelId string `json:"-" url:"-"` + Tags []LoggedModelTag `json:"tags,omitempty"` } func setLoggedModelTagsRequestFromPb(pb *setLoggedModelTagsRequestPb) (*SetLoggedModelTagsRequest, error) { @@ -6733,19 +6133,15 @@ func setModelTagRequestToPb(st *SetModelTagRequest) (*setModelTagRequestPb, erro } pb := &setModelTagRequestPb{} pb.Key = st.Key - pb.Name = st.Name - pb.Value = st.Value return pb, nil } type setModelTagRequestPb struct { - Key string `json:"key"` - - Name string `json:"name"` - + Key string `json:"key"` + Name string `json:"name"` Value string `json:"value"` } @@ -6788,23 +6184,17 @@ func setModelVersionTagRequestToPb(st *SetModelVersionTagRequest) (*setModelVers } pb := &setModelVersionTagRequestPb{} pb.Key = st.Key - pb.Name = st.Name - pb.Value = st.Value - pb.Version = st.Version return pb, nil } type setModelVersionTagRequestPb struct { - Key string `json:"key"` - - Name string `json:"name"` - - Value string `json:"value"` - + Key string `json:"key"` + Name string `json:"name"` + Value string `json:"value"` Version string `json:"version"` } @@ -6848,11 +6238,8 @@ func setTagToPb(st *SetTag) (*setTagPb, error) { } pb := &setTagPb{} pb.Key = st.Key - pb.RunId = st.RunId - pb.RunUuid = st.RunUuid - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -6860,13 +6247,10 @@ func setTagToPb(st *SetTag) (*setTagPb, error) { } type setTagPb struct { - Key string `json:"key"` - - RunId string `json:"run_id,omitempty"` - + Key string `json:"key"` + RunId string `json:"run_id,omitempty"` RunUuid string `json:"run_uuid,omitempty"` - - Value string `json:"value"` + Value string `json:"value"` ForceSendFields []string `json:"-" url:"-"` } @@ -6920,7 +6304,6 @@ func testRegistryWebhookToPb(st *TestRegistryWebhook) (*testRegistryWebhookPb, e } pb := &testRegistryWebhookPb{} pb.Body = st.Body - pb.StatusCode = st.StatusCode pb.ForceSendFields = st.ForceSendFields @@ -6928,9 +6311,8 @@ func testRegistryWebhookToPb(st *TestRegistryWebhook) (*testRegistryWebhookPb, e } type testRegistryWebhookPb struct { - Body string `json:"body,omitempty"` - - StatusCode int `json:"status_code,omitempty"` + Body string `json:"body,omitempty"` + StatusCode int `json:"status_code,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6961,7 +6343,6 @@ func testRegistryWebhookRequestToPb(st *TestRegistryWebhookRequest) (*testRegist } pb := &testRegistryWebhookRequestPb{} pb.Event = st.Event - pb.Id = st.Id return pb, nil @@ -6969,8 +6350,7 @@ func testRegistryWebhookRequestToPb(st *TestRegistryWebhookRequest) (*testRegist type testRegistryWebhookRequestPb struct { Event RegistryWebhookEvent `json:"event,omitempty"` - - Id string `json:"id"` + Id string `json:"id"` } func testRegistryWebhookRequestFromPb(pb *testRegistryWebhookRequestPb) (*TestRegistryWebhookRequest, error) { @@ -7014,13 +6394,9 @@ func transitionModelVersionStageDatabricksToPb(st *TransitionModelVersionStageDa } pb := &transitionModelVersionStageDatabricksPb{} pb.ArchiveExistingVersions = st.ArchiveExistingVersions - pb.Comment = st.Comment - pb.Name = st.Name - pb.Stage = st.Stage - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -7028,15 +6404,11 @@ func transitionModelVersionStageDatabricksToPb(st *TransitionModelVersionStageDa } type transitionModelVersionStageDatabricksPb struct { - ArchiveExistingVersions bool `json:"archive_existing_versions"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - Stage Stage `json:"stage"` - - Version string `json:"version"` + ArchiveExistingVersions bool `json:"archive_existing_versions"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + Stage Stage `json:"stage"` + Version string `json:"version"` ForceSendFields []string `json:"-" url:"-"` } @@ -7070,13 +6442,9 @@ func transitionRequestToPb(st *TransitionRequest) (*transitionRequestPb, error) } pb := &transitionRequestPb{} pb.AvailableActions = st.AvailableActions - pb.Comment = st.Comment - pb.CreationTimestamp = st.CreationTimestamp - pb.ToStage = st.ToStage - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -7084,15 +6452,11 @@ func transitionRequestToPb(st *TransitionRequest) (*transitionRequestPb, error) } type transitionRequestPb struct { - AvailableActions []ActivityAction `json:"available_actions,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - ToStage Stage `json:"to_stage,omitempty"` - - UserId string `json:"user_id,omitempty"` + AvailableActions []ActivityAction `json:"available_actions,omitempty"` + Comment string `json:"comment,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + ToStage Stage `json:"to_stage,omitempty"` + UserId string `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7150,7 +6514,6 @@ func updateCommentToPb(st *UpdateComment) (*updateCommentPb, error) { } pb := &updateCommentPb{} pb.Comment = st.Comment - pb.Id = st.Id return pb, nil @@ -7158,8 +6521,7 @@ func updateCommentToPb(st *UpdateComment) (*updateCommentPb, error) { type updateCommentPb struct { Comment string `json:"comment"` - - Id string `json:"id"` + Id string `json:"id"` } func updateCommentFromPb(pb *updateCommentPb) (*UpdateComment, error) { @@ -7203,7 +6565,6 @@ func updateExperimentToPb(st *UpdateExperiment) (*updateExperimentPb, error) { } pb := &updateExperimentPb{} pb.ExperimentId = st.ExperimentId - pb.NewName = st.NewName pb.ForceSendFields = st.ForceSendFields @@ -7212,8 +6573,7 @@ func updateExperimentToPb(st *UpdateExperiment) (*updateExperimentPb, error) { type updateExperimentPb struct { ExperimentId string `json:"experiment_id"` - - NewName string `json:"new_name,omitempty"` + NewName string `json:"new_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7265,7 +6625,6 @@ func updateModelRequestToPb(st *UpdateModelRequest) (*updateModelRequestPb, erro } pb := &updateModelRequestPb{} pb.Description = st.Description - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -7274,8 +6633,7 @@ func updateModelRequestToPb(st *UpdateModelRequest) (*updateModelRequestPb, erro type updateModelRequestPb struct { Description string `json:"description,omitempty"` - - Name string `json:"name"` + Name string `json:"name"` ForceSendFields []string `json:"-" url:"-"` } @@ -7327,9 +6685,7 @@ func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelV } pb := &updateModelVersionRequestPb{} pb.Description = st.Description - pb.Name = st.Name - pb.Version = st.Version pb.ForceSendFields = st.ForceSendFields @@ -7338,10 +6694,8 @@ func updateModelVersionRequestToPb(st *UpdateModelVersionRequest) (*updateModelV type updateModelVersionRequestPb struct { Description string `json:"description,omitempty"` - - Name string `json:"name"` - - Version string `json:"version"` + Name string `json:"name"` + Version string `json:"version"` ForceSendFields []string `json:"-" url:"-"` } @@ -7394,15 +6748,10 @@ func updateRegistryWebhookToPb(st *UpdateRegistryWebhook) (*updateRegistryWebhoo } pb := &updateRegistryWebhookPb{} pb.Description = st.Description - pb.Events = st.Events - pb.HttpUrlSpec = st.HttpUrlSpec - pb.Id = st.Id - pb.JobSpec = st.JobSpec - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -7410,17 +6759,12 @@ func updateRegistryWebhookToPb(st *UpdateRegistryWebhook) (*updateRegistryWebhoo } type updateRegistryWebhookPb struct { - Description string `json:"description,omitempty"` - - Events []RegistryWebhookEvent `json:"events,omitempty"` - - HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` - - Id string `json:"id"` - - JobSpec *JobSpec `json:"job_spec,omitempty"` - - Status RegistryWebhookStatus `json:"status,omitempty"` + Description string `json:"description,omitempty"` + Events []RegistryWebhookEvent `json:"events,omitempty"` + HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"` + Id string `json:"id"` + JobSpec *JobSpec `json:"job_spec,omitempty"` + Status RegistryWebhookStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7455,13 +6799,9 @@ func updateRunToPb(st *UpdateRun) (*updateRunPb, error) { } pb := &updateRunPb{} pb.EndTime = st.EndTime - pb.RunId = st.RunId - pb.RunName = st.RunName - pb.RunUuid = st.RunUuid - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -7469,15 +6809,11 @@ func updateRunToPb(st *UpdateRun) (*updateRunPb, error) { } type updateRunPb struct { - EndTime int64 `json:"end_time,omitempty"` - - RunId string `json:"run_id,omitempty"` - - RunName string `json:"run_name,omitempty"` - - RunUuid string `json:"run_uuid,omitempty"` - - Status UpdateRunStatus `json:"status,omitempty"` + EndTime int64 `json:"end_time,omitempty"` + RunId string `json:"run_id,omitempty"` + RunName string `json:"run_name,omitempty"` + RunUuid string `json:"run_uuid,omitempty"` + Status UpdateRunStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7549,3 +6885,57 @@ func updateWebhookResponseFromPb(pb *updateWebhookResponsePb) (*UpdateWebhookRes return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/ml/model.go b/service/ml/model.go index aeb50a777..24dd5cb44 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -5,8 +5,6 @@ package ml import ( "encoding/json" "fmt" - "strings" - "time" ) // Activity recorded for the action. @@ -8489,57 +8487,3 @@ func (f *ViewType) Set(v string) error { func (f *ViewType) Type() string { return "ViewType" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/oauth2/internal.go b/service/oauth2/internal.go index 8fc20567e..9da34af50 100755 --- a/service/oauth2/internal.go +++ b/service/oauth2/internal.go @@ -3,6 +3,10 @@ package oauth2 import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,7 +16,6 @@ func createAccountFederationPolicyRequestToPb(st *CreateAccountFederationPolicyR } pb := &createAccountFederationPolicyRequestPb{} pb.Policy = st.Policy - pb.PolicyId = st.PolicyId pb.ForceSendFields = st.ForceSendFields @@ -20,9 +23,8 @@ func createAccountFederationPolicyRequestToPb(st *CreateAccountFederationPolicyR } type createAccountFederationPolicyRequestPb struct { - Policy FederationPolicy `json:"policy"` - - PolicyId string `json:"-" url:"policy_id,omitempty"` + Policy FederationPolicy `json:"policy"` + PolicyId string `json:"-" url:"policy_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -53,15 +55,10 @@ func createCustomAppIntegrationToPb(st *CreateCustomAppIntegration) (*createCust } pb := &createCustomAppIntegrationPb{} pb.Confidential = st.Confidential - pb.Name = st.Name - pb.RedirectUrls = st.RedirectUrls - pb.Scopes = st.Scopes - pb.TokenAccessPolicy = st.TokenAccessPolicy - pb.UserAuthorizedScopes = st.UserAuthorizedScopes pb.ForceSendFields = st.ForceSendFields @@ -69,17 +66,12 @@ func createCustomAppIntegrationToPb(st *CreateCustomAppIntegration) (*createCust } type createCustomAppIntegrationPb struct { - Confidential bool `json:"confidential,omitempty"` - - Name string `json:"name,omitempty"` - - RedirectUrls []string `json:"redirect_urls,omitempty"` - - Scopes []string `json:"scopes,omitempty"` - - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` - - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + Confidential bool `json:"confidential,omitempty"` + Name string `json:"name,omitempty"` + RedirectUrls []string `json:"redirect_urls,omitempty"` + Scopes []string `json:"scopes,omitempty"` + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -114,9 +106,7 @@ func createCustomAppIntegrationOutputToPb(st *CreateCustomAppIntegrationOutput) } pb := &createCustomAppIntegrationOutputPb{} pb.ClientId = st.ClientId - pb.ClientSecret = st.ClientSecret - pb.IntegrationId = st.IntegrationId pb.ForceSendFields = st.ForceSendFields @@ -124,10 +114,8 @@ func createCustomAppIntegrationOutputToPb(st *CreateCustomAppIntegrationOutput) } type createCustomAppIntegrationOutputPb struct { - ClientId string `json:"client_id,omitempty"` - - ClientSecret string `json:"client_secret,omitempty"` - + ClientId string `json:"client_id,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` IntegrationId string `json:"integration_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -160,7 +148,6 @@ func createPublishedAppIntegrationToPb(st *CreatePublishedAppIntegration) (*crea } pb := &createPublishedAppIntegrationPb{} pb.AppId = st.AppId - pb.TokenAccessPolicy = st.TokenAccessPolicy pb.ForceSendFields = st.ForceSendFields @@ -168,8 +155,7 @@ func createPublishedAppIntegrationToPb(st *CreatePublishedAppIntegration) (*crea } type createPublishedAppIntegrationPb struct { - AppId string `json:"app_id,omitempty"` - + AppId string `json:"app_id,omitempty"` TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -237,9 +223,7 @@ func createServicePrincipalFederationPolicyRequestToPb(st *CreateServicePrincipa } pb := &createServicePrincipalFederationPolicyRequestPb{} pb.Policy = st.Policy - pb.PolicyId = st.PolicyId - pb.ServicePrincipalId = st.ServicePrincipalId pb.ForceSendFields = st.ForceSendFields @@ -247,11 +231,9 @@ func createServicePrincipalFederationPolicyRequestToPb(st *CreateServicePrincipa } type createServicePrincipalFederationPolicyRequestPb struct { - Policy FederationPolicy `json:"policy"` - - PolicyId string `json:"-" url:"policy_id,omitempty"` - - ServicePrincipalId int64 `json:"-" url:"-"` + Policy FederationPolicy `json:"policy"` + PolicyId string `json:"-" url:"policy_id,omitempty"` + ServicePrincipalId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -283,7 +265,6 @@ func createServicePrincipalSecretRequestToPb(st *CreateServicePrincipalSecretReq } pb := &createServicePrincipalSecretRequestPb{} pb.Lifetime = st.Lifetime - pb.ServicePrincipalId = st.ServicePrincipalId pb.ForceSendFields = st.ForceSendFields @@ -291,9 +272,8 @@ func createServicePrincipalSecretRequestToPb(st *CreateServicePrincipalSecretReq } type createServicePrincipalSecretRequestPb struct { - Lifetime string `json:"lifetime,omitempty"` - - ServicePrincipalId int64 `json:"-" url:"-"` + Lifetime string `json:"lifetime,omitempty"` + ServicePrincipalId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -324,17 +304,11 @@ func createServicePrincipalSecretResponseToPb(st *CreateServicePrincipalSecretRe } pb := &createServicePrincipalSecretResponsePb{} pb.CreateTime = st.CreateTime - pb.ExpireTime = st.ExpireTime - pb.Id = st.Id - pb.Secret = st.Secret - pb.SecretHash = st.SecretHash - pb.Status = st.Status - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -343,17 +317,11 @@ func createServicePrincipalSecretResponseToPb(st *CreateServicePrincipalSecretRe type createServicePrincipalSecretResponsePb struct { CreateTime string `json:"create_time,omitempty"` - ExpireTime string `json:"expire_time,omitempty"` - - Id string `json:"id,omitempty"` - - Secret string `json:"secret,omitempty"` - + Id string `json:"id,omitempty"` + Secret string `json:"secret,omitempty"` SecretHash string `json:"secret_hash,omitempty"` - - Status string `json:"status,omitempty"` - + Status string `json:"status,omitempty"` UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -525,16 +493,14 @@ func deleteServicePrincipalFederationPolicyRequestToPb(st *DeleteServicePrincipa } pb := &deleteServicePrincipalFederationPolicyRequestPb{} pb.PolicyId = st.PolicyId - pb.ServicePrincipalId = st.ServicePrincipalId return pb, nil } type deleteServicePrincipalFederationPolicyRequestPb struct { - PolicyId string `json:"-" url:"-"` - - ServicePrincipalId int64 `json:"-" url:"-"` + PolicyId string `json:"-" url:"-"` + ServicePrincipalId int64 `json:"-" url:"-"` } func deleteServicePrincipalFederationPolicyRequestFromPb(pb *deleteServicePrincipalFederationPolicyRequestPb) (*DeleteServicePrincipalFederationPolicyRequest, error) { @@ -554,16 +520,14 @@ func deleteServicePrincipalSecretRequestToPb(st *DeleteServicePrincipalSecretReq } pb := &deleteServicePrincipalSecretRequestPb{} pb.SecretId = st.SecretId - pb.ServicePrincipalId = st.ServicePrincipalId return pb, nil } type deleteServicePrincipalSecretRequestPb struct { - SecretId string `json:"-" url:"-"` - - ServicePrincipalId int64 `json:"-" url:"-"` + SecretId string `json:"-" url:"-"` + ServicePrincipalId int64 `json:"-" url:"-"` } func deleteServicePrincipalSecretRequestFromPb(pb *deleteServicePrincipalSecretRequestPb) (*DeleteServicePrincipalSecretRequest, error) { @@ -583,19 +547,12 @@ func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { } pb := &federationPolicyPb{} pb.CreateTime = st.CreateTime - pb.Description = st.Description - pb.Name = st.Name - pb.OidcPolicy = st.OidcPolicy - pb.PolicyId = st.PolicyId - pb.ServicePrincipalId = st.ServicePrincipalId - pb.Uid = st.Uid - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -603,21 +560,14 @@ func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { } type federationPolicyPb struct { - CreateTime string `json:"create_time,omitempty"` - - Description string `json:"description,omitempty"` - - Name string `json:"name,omitempty"` - - OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - ServicePrincipalId int64 `json:"service_principal_id,omitempty"` - - Uid string `json:"uid,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + Uid string `json:"uid,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -678,25 +628,15 @@ func getCustomAppIntegrationOutputToPb(st *GetCustomAppIntegrationOutput) (*getC } pb := &getCustomAppIntegrationOutputPb{} pb.ClientId = st.ClientId - pb.Confidential = st.Confidential - pb.CreateTime = st.CreateTime - pb.CreatedBy = st.CreatedBy - pb.CreatorUsername = st.CreatorUsername - pb.IntegrationId = st.IntegrationId - pb.Name = st.Name - pb.RedirectUrls = st.RedirectUrls - pb.Scopes = st.Scopes - pb.TokenAccessPolicy = st.TokenAccessPolicy - pb.UserAuthorizedScopes = st.UserAuthorizedScopes pb.ForceSendFields = st.ForceSendFields @@ -704,27 +644,17 @@ func getCustomAppIntegrationOutputToPb(st *GetCustomAppIntegrationOutput) (*getC } type getCustomAppIntegrationOutputPb struct { - ClientId string `json:"client_id,omitempty"` - - Confidential bool `json:"confidential,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - CreatedBy int64 `json:"created_by,omitempty"` - - CreatorUsername string `json:"creator_username,omitempty"` - - IntegrationId string `json:"integration_id,omitempty"` - - Name string `json:"name,omitempty"` - - RedirectUrls []string `json:"redirect_urls,omitempty"` - - Scopes []string `json:"scopes,omitempty"` - - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` - - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + ClientId string `json:"client_id,omitempty"` + Confidential bool `json:"confidential,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CreatedBy int64 `json:"created_by,omitempty"` + CreatorUsername string `json:"creator_username,omitempty"` + IntegrationId string `json:"integration_id,omitempty"` + Name string `json:"name,omitempty"` + RedirectUrls []string `json:"redirect_urls,omitempty"` + Scopes []string `json:"scopes,omitempty"` + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -788,7 +718,6 @@ func getCustomAppIntegrationsOutputToPb(st *GetCustomAppIntegrationsOutput) (*ge } pb := &getCustomAppIntegrationsOutputPb{} pb.Apps = st.Apps - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -796,9 +725,8 @@ func getCustomAppIntegrationsOutputToPb(st *GetCustomAppIntegrationsOutput) (*ge } type getCustomAppIntegrationsOutputPb struct { - Apps []GetCustomAppIntegrationOutput `json:"apps,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Apps []GetCustomAppIntegrationOutput `json:"apps,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -829,15 +757,10 @@ func getPublishedAppIntegrationOutputToPb(st *GetPublishedAppIntegrationOutput) } pb := &getPublishedAppIntegrationOutputPb{} pb.AppId = st.AppId - pb.CreateTime = st.CreateTime - pb.CreatedBy = st.CreatedBy - pb.IntegrationId = st.IntegrationId - pb.Name = st.Name - pb.TokenAccessPolicy = st.TokenAccessPolicy pb.ForceSendFields = st.ForceSendFields @@ -845,16 +768,11 @@ func getPublishedAppIntegrationOutputToPb(st *GetPublishedAppIntegrationOutput) } type getPublishedAppIntegrationOutputPb struct { - AppId string `json:"app_id,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - CreatedBy int64 `json:"created_by,omitempty"` - - IntegrationId string `json:"integration_id,omitempty"` - - Name string `json:"name,omitempty"` - + AppId string `json:"app_id,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CreatedBy int64 `json:"created_by,omitempty"` + IntegrationId string `json:"integration_id,omitempty"` + Name string `json:"name,omitempty"` TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -914,7 +832,6 @@ func getPublishedAppIntegrationsOutputToPb(st *GetPublishedAppIntegrationsOutput } pb := &getPublishedAppIntegrationsOutputPb{} pb.Apps = st.Apps - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -922,9 +839,8 @@ func getPublishedAppIntegrationsOutputToPb(st *GetPublishedAppIntegrationsOutput } type getPublishedAppIntegrationsOutputPb struct { - Apps []GetPublishedAppIntegrationOutput `json:"apps,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Apps []GetPublishedAppIntegrationOutput `json:"apps,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -955,7 +871,6 @@ func getPublishedAppsOutputToPb(st *GetPublishedAppsOutput) (*getPublishedAppsOu } pb := &getPublishedAppsOutputPb{} pb.Apps = st.Apps - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -963,9 +878,8 @@ func getPublishedAppsOutputToPb(st *GetPublishedAppsOutput) (*getPublishedAppsOu } type getPublishedAppsOutputPb struct { - Apps []PublishedAppOutput `json:"apps,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Apps []PublishedAppOutput `json:"apps,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -996,16 +910,14 @@ func getServicePrincipalFederationPolicyRequestToPb(st *GetServicePrincipalFeder } pb := &getServicePrincipalFederationPolicyRequestPb{} pb.PolicyId = st.PolicyId - pb.ServicePrincipalId = st.ServicePrincipalId return pb, nil } type getServicePrincipalFederationPolicyRequestPb struct { - PolicyId string `json:"-" url:"-"` - - ServicePrincipalId int64 `json:"-" url:"-"` + PolicyId string `json:"-" url:"-"` + ServicePrincipalId int64 `json:"-" url:"-"` } func getServicePrincipalFederationPolicyRequestFromPb(pb *getServicePrincipalFederationPolicyRequestPb) (*GetServicePrincipalFederationPolicyRequest, error) { @@ -1025,7 +937,6 @@ func listAccountFederationPoliciesRequestToPb(st *ListAccountFederationPoliciesR } pb := &listAccountFederationPoliciesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1033,8 +944,7 @@ func listAccountFederationPoliciesRequestToPb(st *ListAccountFederationPoliciesR } type listAccountFederationPoliciesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1066,9 +976,7 @@ func listCustomAppIntegrationsRequestToPb(st *ListCustomAppIntegrationsRequest) } pb := &listCustomAppIntegrationsRequestPb{} pb.IncludeCreatorUsername = st.IncludeCreatorUsername - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1076,11 +984,9 @@ func listCustomAppIntegrationsRequestToPb(st *ListCustomAppIntegrationsRequest) } type listCustomAppIntegrationsRequestPb struct { - IncludeCreatorUsername bool `json:"-" url:"include_creator_username,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + IncludeCreatorUsername bool `json:"-" url:"include_creator_username,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1112,7 +1018,6 @@ func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*li } pb := &listFederationPoliciesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Policies = st.Policies pb.ForceSendFields = st.ForceSendFields @@ -1120,9 +1025,8 @@ func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*li } type listFederationPoliciesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Policies []FederationPolicy `json:"policies,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Policies []FederationPolicy `json:"policies,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1153,7 +1057,6 @@ func listOAuthPublishedAppsRequestToPb(st *ListOAuthPublishedAppsRequest) (*list } pb := &listOAuthPublishedAppsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1161,8 +1064,7 @@ func listOAuthPublishedAppsRequestToPb(st *ListOAuthPublishedAppsRequest) (*list } type listOAuthPublishedAppsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1194,7 +1096,6 @@ func listPublishedAppIntegrationsRequestToPb(st *ListPublishedAppIntegrationsReq } pb := &listPublishedAppIntegrationsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1202,8 +1103,7 @@ func listPublishedAppIntegrationsRequestToPb(st *ListPublishedAppIntegrationsReq } type listPublishedAppIntegrationsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1235,9 +1135,7 @@ func listServicePrincipalFederationPoliciesRequestToPb(st *ListServicePrincipalF } pb := &listServicePrincipalFederationPoliciesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken - pb.ServicePrincipalId = st.ServicePrincipalId pb.ForceSendFields = st.ForceSendFields @@ -1245,11 +1143,9 @@ func listServicePrincipalFederationPoliciesRequestToPb(st *ListServicePrincipalF } type listServicePrincipalFederationPoliciesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - ServicePrincipalId int64 `json:"-" url:"-"` + PageSize int `json:"-" url:"page_size,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + ServicePrincipalId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1281,7 +1177,6 @@ func listServicePrincipalSecretsRequestToPb(st *ListServicePrincipalSecretsReque } pb := &listServicePrincipalSecretsRequestPb{} pb.PageToken = st.PageToken - pb.ServicePrincipalId = st.ServicePrincipalId pb.ForceSendFields = st.ForceSendFields @@ -1289,9 +1184,8 @@ func listServicePrincipalSecretsRequestToPb(st *ListServicePrincipalSecretsReque } type listServicePrincipalSecretsRequestPb struct { - PageToken string `json:"-" url:"page_token,omitempty"` - - ServicePrincipalId int64 `json:"-" url:"-"` + PageToken string `json:"-" url:"page_token,omitempty"` + ServicePrincipalId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1322,7 +1216,6 @@ func listServicePrincipalSecretsResponseToPb(st *ListServicePrincipalSecretsResp } pb := &listServicePrincipalSecretsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Secrets = st.Secrets pb.ForceSendFields = st.ForceSendFields @@ -1330,9 +1223,8 @@ func listServicePrincipalSecretsResponseToPb(st *ListServicePrincipalSecretsResp } type listServicePrincipalSecretsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Secrets []SecretInfo `json:"secrets,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Secrets []SecretInfo `json:"secrets,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1363,15 +1255,10 @@ func oidcFederationPolicyToPb(st *OidcFederationPolicy) (*oidcFederationPolicyPb } pb := &oidcFederationPolicyPb{} pb.Audiences = st.Audiences - pb.Issuer = st.Issuer - pb.JwksJson = st.JwksJson - pb.JwksUri = st.JwksUri - pb.Subject = st.Subject - pb.SubjectClaim = st.SubjectClaim pb.ForceSendFields = st.ForceSendFields @@ -1379,17 +1266,12 @@ func oidcFederationPolicyToPb(st *OidcFederationPolicy) (*oidcFederationPolicyPb } type oidcFederationPolicyPb struct { - Audiences []string `json:"audiences,omitempty"` - - Issuer string `json:"issuer,omitempty"` - - JwksJson string `json:"jwks_json,omitempty"` - - JwksUri string `json:"jwks_uri,omitempty"` - - Subject string `json:"subject,omitempty"` - - SubjectClaim string `json:"subject_claim,omitempty"` + Audiences []string `json:"audiences,omitempty"` + Issuer string `json:"issuer,omitempty"` + JwksJson string `json:"jwks_json,omitempty"` + JwksUri string `json:"jwks_uri,omitempty"` + Subject string `json:"subject,omitempty"` + SubjectClaim string `json:"subject_claim,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1424,17 +1306,11 @@ func publishedAppOutputToPb(st *PublishedAppOutput) (*publishedAppOutputPb, erro } pb := &publishedAppOutputPb{} pb.AppId = st.AppId - pb.ClientId = st.ClientId - pb.Description = st.Description - pb.IsConfidentialClient = st.IsConfidentialClient - pb.Name = st.Name - pb.RedirectUrls = st.RedirectUrls - pb.Scopes = st.Scopes pb.ForceSendFields = st.ForceSendFields @@ -1442,19 +1318,13 @@ func publishedAppOutputToPb(st *PublishedAppOutput) (*publishedAppOutputPb, erro } type publishedAppOutputPb struct { - AppId string `json:"app_id,omitempty"` - - ClientId string `json:"client_id,omitempty"` - - Description string `json:"description,omitempty"` - - IsConfidentialClient bool `json:"is_confidential_client,omitempty"` - - Name string `json:"name,omitempty"` - - RedirectUrls []string `json:"redirect_urls,omitempty"` - - Scopes []string `json:"scopes,omitempty"` + AppId string `json:"app_id,omitempty"` + ClientId string `json:"client_id,omitempty"` + Description string `json:"description,omitempty"` + IsConfidentialClient bool `json:"is_confidential_client,omitempty"` + Name string `json:"name,omitempty"` + RedirectUrls []string `json:"redirect_urls,omitempty"` + Scopes []string `json:"scopes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1490,15 +1360,10 @@ func secretInfoToPb(st *SecretInfo) (*secretInfoPb, error) { } pb := &secretInfoPb{} pb.CreateTime = st.CreateTime - pb.ExpireTime = st.ExpireTime - pb.Id = st.Id - pb.SecretHash = st.SecretHash - pb.Status = st.Status - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -1507,15 +1372,10 @@ func secretInfoToPb(st *SecretInfo) (*secretInfoPb, error) { type secretInfoPb struct { CreateTime string `json:"create_time,omitempty"` - ExpireTime string `json:"expire_time,omitempty"` - - Id string `json:"id,omitempty"` - + Id string `json:"id,omitempty"` SecretHash string `json:"secret_hash,omitempty"` - - Status string `json:"status,omitempty"` - + Status string `json:"status,omitempty"` UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1551,7 +1411,6 @@ func tokenAccessPolicyToPb(st *TokenAccessPolicy) (*tokenAccessPolicyPb, error) } pb := &tokenAccessPolicyPb{} pb.AccessTokenTtlInMinutes = st.AccessTokenTtlInMinutes - pb.RefreshTokenTtlInMinutes = st.RefreshTokenTtlInMinutes pb.ForceSendFields = st.ForceSendFields @@ -1559,8 +1418,7 @@ func tokenAccessPolicyToPb(st *TokenAccessPolicy) (*tokenAccessPolicyPb, error) } type tokenAccessPolicyPb struct { - AccessTokenTtlInMinutes int `json:"access_token_ttl_in_minutes,omitempty"` - + AccessTokenTtlInMinutes int `json:"access_token_ttl_in_minutes,omitempty"` RefreshTokenTtlInMinutes int `json:"refresh_token_ttl_in_minutes,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1592,9 +1450,7 @@ func updateAccountFederationPolicyRequestToPb(st *UpdateAccountFederationPolicyR } pb := &updateAccountFederationPolicyRequestPb{} pb.Policy = st.Policy - pb.PolicyId = st.PolicyId - pb.UpdateMask = st.UpdateMask pb.ForceSendFields = st.ForceSendFields @@ -1602,11 +1458,9 @@ func updateAccountFederationPolicyRequestToPb(st *UpdateAccountFederationPolicyR } type updateAccountFederationPolicyRequestPb struct { - Policy FederationPolicy `json:"policy"` - - PolicyId string `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask,omitempty"` + Policy FederationPolicy `json:"policy"` + PolicyId string `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1638,28 +1492,20 @@ func updateCustomAppIntegrationToPb(st *UpdateCustomAppIntegration) (*updateCust } pb := &updateCustomAppIntegrationPb{} pb.IntegrationId = st.IntegrationId - pb.RedirectUrls = st.RedirectUrls - pb.Scopes = st.Scopes - pb.TokenAccessPolicy = st.TokenAccessPolicy - pb.UserAuthorizedScopes = st.UserAuthorizedScopes return pb, nil } type updateCustomAppIntegrationPb struct { - IntegrationId string `json:"-" url:"-"` - - RedirectUrls []string `json:"redirect_urls,omitempty"` - - Scopes []string `json:"scopes,omitempty"` - - TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` - - UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` + IntegrationId string `json:"-" url:"-"` + RedirectUrls []string `json:"redirect_urls,omitempty"` + Scopes []string `json:"scopes,omitempty"` + TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` + UserAuthorizedScopes []string `json:"user_authorized_scopes,omitempty"` } func updateCustomAppIntegrationFromPb(pb *updateCustomAppIntegrationPb) (*UpdateCustomAppIntegration, error) { @@ -1703,15 +1549,13 @@ func updatePublishedAppIntegrationToPb(st *UpdatePublishedAppIntegration) (*upda } pb := &updatePublishedAppIntegrationPb{} pb.IntegrationId = st.IntegrationId - pb.TokenAccessPolicy = st.TokenAccessPolicy return pb, nil } type updatePublishedAppIntegrationPb struct { - IntegrationId string `json:"-" url:"-"` - + IntegrationId string `json:"-" url:"-"` TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"` } @@ -1753,11 +1597,8 @@ func updateServicePrincipalFederationPolicyRequestToPb(st *UpdateServicePrincipa } pb := &updateServicePrincipalFederationPolicyRequestPb{} pb.Policy = st.Policy - pb.PolicyId = st.PolicyId - pb.ServicePrincipalId = st.ServicePrincipalId - pb.UpdateMask = st.UpdateMask pb.ForceSendFields = st.ForceSendFields @@ -1765,13 +1606,10 @@ func updateServicePrincipalFederationPolicyRequestToPb(st *UpdateServicePrincipa } type updateServicePrincipalFederationPolicyRequestPb struct { - Policy FederationPolicy `json:"policy"` - - PolicyId string `json:"-" url:"-"` - - ServicePrincipalId int64 `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask,omitempty"` + Policy FederationPolicy `json:"policy"` + PolicyId string `json:"-" url:"-"` + ServicePrincipalId int64 `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1797,3 +1635,57 @@ func (st *updateServicePrincipalFederationPolicyRequestPb) UnmarshalJSON(b []byt func (st updateServicePrincipalFederationPolicyRequestPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/oauth2/model.go b/service/oauth2/model.go index a97fdc5d0..c6a1b4d29 100755 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -5,8 +5,6 @@ package oauth2 import ( "encoding/json" "fmt" - "strings" - "time" ) // Create account federation policy @@ -1752,57 +1750,3 @@ func (st UpdateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, e } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/pipelines/internal.go b/service/pipelines/internal.go index 8ad8dba6e..8bf2ab2b7 100755 --- a/service/pipelines/internal.go +++ b/service/pipelines/internal.go @@ -3,6 +3,10 @@ package pipelines import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/compute" ) @@ -13,59 +17,32 @@ func createPipelineToPb(st *CreatePipeline) (*createPipelinePb, error) { } pb := &createPipelinePb{} pb.AllowDuplicateNames = st.AllowDuplicateNames - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Catalog = st.Catalog - pb.Channel = st.Channel - pb.Clusters = st.Clusters - pb.Configuration = st.Configuration - pb.Continuous = st.Continuous - pb.Deployment = st.Deployment - pb.Development = st.Development - pb.DryRun = st.DryRun - pb.Edition = st.Edition - pb.EventLog = st.EventLog - pb.Filters = st.Filters - pb.GatewayDefinition = st.GatewayDefinition - pb.Id = st.Id - pb.IngestionDefinition = st.IngestionDefinition - pb.Libraries = st.Libraries - pb.Name = st.Name - pb.Notifications = st.Notifications - pb.Photon = st.Photon - pb.RestartWindow = st.RestartWindow - pb.RootPath = st.RootPath - pb.RunAs = st.RunAs - pb.Schema = st.Schema - pb.Serverless = st.Serverless - pb.Storage = st.Storage - pb.Target = st.Target - pb.Trigger = st.Trigger pb.ForceSendFields = st.ForceSendFields @@ -73,61 +50,34 @@ func createPipelineToPb(st *CreatePipeline) (*createPipelinePb, error) { } type createPipelinePb struct { - AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Channel string `json:"channel,omitempty"` - - Clusters []PipelineCluster `json:"clusters,omitempty"` - - Configuration map[string]string `json:"configuration,omitempty"` - - Continuous bool `json:"continuous,omitempty"` - - Deployment *PipelineDeployment `json:"deployment,omitempty"` - - Development bool `json:"development,omitempty"` - - DryRun bool `json:"dry_run,omitempty"` - - Edition string `json:"edition,omitempty"` - - EventLog *EventLogSpec `json:"event_log,omitempty"` - - Filters *Filters `json:"filters,omitempty"` - - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` - - Id string `json:"id,omitempty"` - - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` - - Libraries []PipelineLibrary `json:"libraries,omitempty"` - - Name string `json:"name,omitempty"` - - Notifications []Notifications `json:"notifications,omitempty"` - - Photon bool `json:"photon,omitempty"` - - RestartWindow *RestartWindow `json:"restart_window,omitempty"` - - RootPath string `json:"root_path,omitempty"` - - RunAs *RunAs `json:"run_as,omitempty"` - - Schema string `json:"schema,omitempty"` - - Serverless bool `json:"serverless,omitempty"` - - Storage string `json:"storage,omitempty"` - - Target string `json:"target,omitempty"` - - Trigger *PipelineTrigger `json:"trigger,omitempty"` + AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Catalog string `json:"catalog,omitempty"` + Channel string `json:"channel,omitempty"` + Clusters []PipelineCluster `json:"clusters,omitempty"` + Configuration map[string]string `json:"configuration,omitempty"` + Continuous bool `json:"continuous,omitempty"` + Deployment *PipelineDeployment `json:"deployment,omitempty"` + Development bool `json:"development,omitempty"` + DryRun bool `json:"dry_run,omitempty"` + Edition string `json:"edition,omitempty"` + EventLog *EventLogSpec `json:"event_log,omitempty"` + Filters *Filters `json:"filters,omitempty"` + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + Id string `json:"id,omitempty"` + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + Libraries []PipelineLibrary `json:"libraries,omitempty"` + Name string `json:"name,omitempty"` + Notifications []Notifications `json:"notifications,omitempty"` + Photon bool `json:"photon,omitempty"` + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + RootPath string `json:"root_path,omitempty"` + RunAs *RunAs `json:"run_as,omitempty"` + Schema string `json:"schema,omitempty"` + Serverless bool `json:"serverless,omitempty"` + Storage string `json:"storage,omitempty"` + Target string `json:"target,omitempty"` + Trigger *PipelineTrigger `json:"trigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -184,7 +134,6 @@ func createPipelineResponseToPb(st *CreatePipelineResponse) (*createPipelineResp } pb := &createPipelineResponsePb{} pb.EffectiveSettings = st.EffectiveSettings - pb.PipelineId = st.PipelineId pb.ForceSendFields = st.ForceSendFields @@ -193,8 +142,7 @@ func createPipelineResponseToPb(st *CreatePipelineResponse) (*createPipelineResp type createPipelineResponsePb struct { EffectiveSettings *PipelineSpec `json:"effective_settings,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -225,7 +173,6 @@ func cronTriggerToPb(st *CronTrigger) (*cronTriggerPb, error) { } pb := &cronTriggerPb{} pb.QuartzCronSchedule = st.QuartzCronSchedule - pb.TimezoneId = st.TimezoneId pb.ForceSendFields = st.ForceSendFields @@ -234,8 +181,7 @@ func cronTriggerToPb(st *CronTrigger) (*cronTriggerPb, error) { type cronTriggerPb struct { QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` - - TimezoneId string `json:"timezone_id,omitempty"` + TimezoneId string `json:"timezone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -266,7 +212,6 @@ func dataPlaneIdToPb(st *DataPlaneId) (*dataPlaneIdPb, error) { } pb := &dataPlaneIdPb{} pb.Instance = st.Instance - pb.SeqNo = st.SeqNo pb.ForceSendFields = st.ForceSendFields @@ -275,8 +220,7 @@ func dataPlaneIdToPb(st *DataPlaneId) (*dataPlaneIdPb, error) { type dataPlaneIdPb struct { Instance string `json:"instance,omitempty"` - - SeqNo int64 `json:"seq_no,omitempty"` + SeqNo int64 `json:"seq_no,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -352,61 +296,33 @@ func editPipelineToPb(st *EditPipeline) (*editPipelinePb, error) { } pb := &editPipelinePb{} pb.AllowDuplicateNames = st.AllowDuplicateNames - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Catalog = st.Catalog - pb.Channel = st.Channel - pb.Clusters = st.Clusters - pb.Configuration = st.Configuration - pb.Continuous = st.Continuous - pb.Deployment = st.Deployment - pb.Development = st.Development - pb.Edition = st.Edition - pb.EventLog = st.EventLog - pb.ExpectedLastModified = st.ExpectedLastModified - pb.Filters = st.Filters - pb.GatewayDefinition = st.GatewayDefinition - pb.Id = st.Id - pb.IngestionDefinition = st.IngestionDefinition - pb.Libraries = st.Libraries - pb.Name = st.Name - pb.Notifications = st.Notifications - pb.Photon = st.Photon - pb.PipelineId = st.PipelineId - pb.RestartWindow = st.RestartWindow - pb.RootPath = st.RootPath - pb.RunAs = st.RunAs - pb.Schema = st.Schema - pb.Serverless = st.Serverless - pb.Storage = st.Storage - pb.Target = st.Target - pb.Trigger = st.Trigger pb.ForceSendFields = st.ForceSendFields @@ -414,63 +330,35 @@ func editPipelineToPb(st *EditPipeline) (*editPipelinePb, error) { } type editPipelinePb struct { - AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Channel string `json:"channel,omitempty"` - - Clusters []PipelineCluster `json:"clusters,omitempty"` - - Configuration map[string]string `json:"configuration,omitempty"` - - Continuous bool `json:"continuous,omitempty"` - - Deployment *PipelineDeployment `json:"deployment,omitempty"` - - Development bool `json:"development,omitempty"` - - Edition string `json:"edition,omitempty"` - - EventLog *EventLogSpec `json:"event_log,omitempty"` - - ExpectedLastModified int64 `json:"expected_last_modified,omitempty"` - - Filters *Filters `json:"filters,omitempty"` - - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` - - Id string `json:"id,omitempty"` - - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` - - Libraries []PipelineLibrary `json:"libraries,omitempty"` - - Name string `json:"name,omitempty"` - - Notifications []Notifications `json:"notifications,omitempty"` - - Photon bool `json:"photon,omitempty"` - - PipelineId string `json:"-" url:"-"` - - RestartWindow *RestartWindow `json:"restart_window,omitempty"` - - RootPath string `json:"root_path,omitempty"` - - RunAs *RunAs `json:"run_as,omitempty"` - - Schema string `json:"schema,omitempty"` - - Serverless bool `json:"serverless,omitempty"` - - Storage string `json:"storage,omitempty"` - - Target string `json:"target,omitempty"` - - Trigger *PipelineTrigger `json:"trigger,omitempty"` + AllowDuplicateNames bool `json:"allow_duplicate_names,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Catalog string `json:"catalog,omitempty"` + Channel string `json:"channel,omitempty"` + Clusters []PipelineCluster `json:"clusters,omitempty"` + Configuration map[string]string `json:"configuration,omitempty"` + Continuous bool `json:"continuous,omitempty"` + Deployment *PipelineDeployment `json:"deployment,omitempty"` + Development bool `json:"development,omitempty"` + Edition string `json:"edition,omitempty"` + EventLog *EventLogSpec `json:"event_log,omitempty"` + ExpectedLastModified int64 `json:"expected_last_modified,omitempty"` + Filters *Filters `json:"filters,omitempty"` + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + Id string `json:"id,omitempty"` + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + Libraries []PipelineLibrary `json:"libraries,omitempty"` + Name string `json:"name,omitempty"` + Notifications []Notifications `json:"notifications,omitempty"` + Photon bool `json:"photon,omitempty"` + PipelineId string `json:"-" url:"-"` + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + RootPath string `json:"root_path,omitempty"` + RunAs *RunAs `json:"run_as,omitempty"` + Schema string `json:"schema,omitempty"` + Serverless bool `json:"serverless,omitempty"` + Storage string `json:"storage,omitempty"` + Target string `json:"target,omitempty"` + Trigger *PipelineTrigger `json:"trigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -549,7 +437,6 @@ func errorDetailToPb(st *ErrorDetail) (*errorDetailPb, error) { } pb := &errorDetailPb{} pb.Exceptions = st.Exceptions - pb.Fatal = st.Fatal pb.ForceSendFields = st.ForceSendFields @@ -558,8 +445,7 @@ func errorDetailToPb(st *ErrorDetail) (*errorDetailPb, error) { type errorDetailPb struct { Exceptions []SerializedException `json:"exceptions,omitempty"` - - Fatal bool `json:"fatal,omitempty"` + Fatal bool `json:"fatal,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -590,9 +476,7 @@ func eventLogSpecToPb(st *EventLogSpec) (*eventLogSpecPb, error) { } pb := &eventLogSpecPb{} pb.Catalog = st.Catalog - pb.Name = st.Name - pb.Schema = st.Schema pb.ForceSendFields = st.ForceSendFields @@ -601,10 +485,8 @@ func eventLogSpecToPb(st *EventLogSpec) (*eventLogSpecPb, error) { type eventLogSpecPb struct { Catalog string `json:"catalog,omitempty"` - - Name string `json:"name,omitempty"` - - Schema string `json:"schema,omitempty"` + Name string `json:"name,omitempty"` + Schema string `json:"schema,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -672,7 +554,6 @@ func filtersToPb(st *Filters) (*filtersPb, error) { } pb := &filtersPb{} pb.Exclude = st.Exclude - pb.Include = st.Include return pb, nil @@ -680,7 +561,6 @@ func filtersToPb(st *Filters) (*filtersPb, error) { type filtersPb struct { Exclude []string `json:"exclude,omitempty"` - Include []string `json:"include,omitempty"` } @@ -797,27 +677,16 @@ func getPipelineResponseToPb(st *GetPipelineResponse) (*getPipelineResponsePb, e } pb := &getPipelineResponsePb{} pb.Cause = st.Cause - pb.ClusterId = st.ClusterId - pb.CreatorUserName = st.CreatorUserName - pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId - pb.Health = st.Health - pb.LastModified = st.LastModified - pb.LatestUpdates = st.LatestUpdates - pb.Name = st.Name - pb.PipelineId = st.PipelineId - pb.RunAsUserName = st.RunAsUserName - pb.Spec = st.Spec - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -825,29 +694,18 @@ func getPipelineResponseToPb(st *GetPipelineResponse) (*getPipelineResponsePb, e } type getPipelineResponsePb struct { - Cause string `json:"cause,omitempty"` - - ClusterId string `json:"cluster_id,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` - - Health GetPipelineResponseHealth `json:"health,omitempty"` - - LastModified int64 `json:"last_modified,omitempty"` - - LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` - - Name string `json:"name,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - RunAsUserName string `json:"run_as_user_name,omitempty"` - - Spec *PipelineSpec `json:"spec,omitempty"` - - State PipelineState `json:"state,omitempty"` + Cause string `json:"cause,omitempty"` + ClusterId string `json:"cluster_id,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + Health GetPipelineResponseHealth `json:"health,omitempty"` + LastModified int64 `json:"last_modified,omitempty"` + LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + Name string `json:"name,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + RunAsUserName string `json:"run_as_user_name,omitempty"` + Spec *PipelineSpec `json:"spec,omitempty"` + State PipelineState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -888,7 +746,6 @@ func getUpdateRequestToPb(st *GetUpdateRequest) (*getUpdateRequestPb, error) { } pb := &getUpdateRequestPb{} pb.PipelineId = st.PipelineId - pb.UpdateId = st.UpdateId return pb, nil @@ -896,8 +753,7 @@ func getUpdateRequestToPb(st *GetUpdateRequest) (*getUpdateRequestPb, error) { type getUpdateRequestPb struct { PipelineId string `json:"-" url:"-"` - - UpdateId string `json:"-" url:"-"` + UpdateId string `json:"-" url:"-"` } func getUpdateRequestFromPb(pb *getUpdateRequestPb) (*GetUpdateRequest, error) { @@ -941,9 +797,7 @@ func ingestionConfigToPb(st *IngestionConfig) (*ingestionConfigPb, error) { } pb := &ingestionConfigPb{} pb.Report = st.Report - pb.Schema = st.Schema - pb.Table = st.Table return pb, nil @@ -951,10 +805,8 @@ func ingestionConfigToPb(st *IngestionConfig) (*ingestionConfigPb, error) { type ingestionConfigPb struct { Report *ReportSpec `json:"report,omitempty"` - Schema *SchemaSpec `json:"schema,omitempty"` - - Table *TableSpec `json:"table,omitempty"` + Table *TableSpec `json:"table,omitempty"` } func ingestionConfigFromPb(pb *ingestionConfigPb) (*IngestionConfig, error) { @@ -975,13 +827,9 @@ func ingestionGatewayPipelineDefinitionToPb(st *IngestionGatewayPipelineDefiniti } pb := &ingestionGatewayPipelineDefinitionPb{} pb.ConnectionId = st.ConnectionId - pb.ConnectionName = st.ConnectionName - pb.GatewayStorageCatalog = st.GatewayStorageCatalog - pb.GatewayStorageName = st.GatewayStorageName - pb.GatewayStorageSchema = st.GatewayStorageSchema pb.ForceSendFields = st.ForceSendFields @@ -989,15 +837,11 @@ func ingestionGatewayPipelineDefinitionToPb(st *IngestionGatewayPipelineDefiniti } type ingestionGatewayPipelineDefinitionPb struct { - ConnectionId string `json:"connection_id,omitempty"` - - ConnectionName string `json:"connection_name"` - + ConnectionId string `json:"connection_id,omitempty"` + ConnectionName string `json:"connection_name"` GatewayStorageCatalog string `json:"gateway_storage_catalog"` - - GatewayStorageName string `json:"gateway_storage_name,omitempty"` - - GatewayStorageSchema string `json:"gateway_storage_schema"` + GatewayStorageName string `json:"gateway_storage_name,omitempty"` + GatewayStorageSchema string `json:"gateway_storage_schema"` ForceSendFields []string `json:"-" url:"-"` } @@ -1031,13 +875,9 @@ func ingestionPipelineDefinitionToPb(st *IngestionPipelineDefinition) (*ingestio } pb := &ingestionPipelineDefinitionPb{} pb.ConnectionName = st.ConnectionName - pb.IngestionGatewayId = st.IngestionGatewayId - pb.Objects = st.Objects - pb.SourceType = st.SourceType - pb.TableConfiguration = st.TableConfiguration pb.ForceSendFields = st.ForceSendFields @@ -1045,14 +885,10 @@ func ingestionPipelineDefinitionToPb(st *IngestionPipelineDefinition) (*ingestio } type ingestionPipelineDefinitionPb struct { - ConnectionName string `json:"connection_name,omitempty"` - - IngestionGatewayId string `json:"ingestion_gateway_id,omitempty"` - - Objects []IngestionConfig `json:"objects,omitempty"` - - SourceType IngestionSourceType `json:"source_type,omitempty"` - + ConnectionName string `json:"connection_name,omitempty"` + IngestionGatewayId string `json:"ingestion_gateway_id,omitempty"` + Objects []IngestionConfig `json:"objects,omitempty"` + SourceType IngestionSourceType `json:"source_type,omitempty"` TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1087,13 +923,9 @@ func listPipelineEventsRequestToPb(st *ListPipelineEventsRequest) (*listPipeline } pb := &listPipelineEventsRequestPb{} pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken - pb.PipelineId = st.PipelineId pb.ForceSendFields = st.ForceSendFields @@ -1101,15 +933,11 @@ func listPipelineEventsRequestToPb(st *ListPipelineEventsRequest) (*listPipeline } type listPipelineEventsRequestPb struct { - Filter string `json:"-" url:"filter,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - OrderBy []string `json:"-" url:"order_by,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - PipelineId string `json:"-" url:"-"` + Filter string `json:"-" url:"filter,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + OrderBy []string `json:"-" url:"order_by,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + PipelineId string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1143,9 +971,7 @@ func listPipelineEventsResponseToPb(st *ListPipelineEventsResponse) (*listPipeli } pb := &listPipelineEventsResponsePb{} pb.Events = st.Events - pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken pb.ForceSendFields = st.ForceSendFields @@ -1153,11 +979,9 @@ func listPipelineEventsResponseToPb(st *ListPipelineEventsResponse) (*listPipeli } type listPipelineEventsResponsePb struct { - Events []PipelineEvent `json:"events,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` + Events []PipelineEvent `json:"events,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1189,11 +1013,8 @@ func listPipelinesRequestToPb(st *ListPipelinesRequest) (*listPipelinesRequestPb } pb := &listPipelinesRequestPb{} pb.Filter = st.Filter - pb.MaxResults = st.MaxResults - pb.OrderBy = st.OrderBy - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1201,13 +1022,10 @@ func listPipelinesRequestToPb(st *ListPipelinesRequest) (*listPipelinesRequestPb } type listPipelinesRequestPb struct { - Filter string `json:"-" url:"filter,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - OrderBy []string `json:"-" url:"order_by,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + Filter string `json:"-" url:"filter,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + OrderBy []string `json:"-" url:"order_by,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1240,7 +1058,6 @@ func listPipelinesResponseToPb(st *ListPipelinesResponse) (*listPipelinesRespons } pb := &listPipelinesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Statuses = st.Statuses pb.ForceSendFields = st.ForceSendFields @@ -1248,9 +1065,8 @@ func listPipelinesResponseToPb(st *ListPipelinesResponse) (*listPipelinesRespons } type listPipelinesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Statuses []PipelineStateInfo `json:"statuses,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Statuses []PipelineStateInfo `json:"statuses,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1281,11 +1097,8 @@ func listUpdatesRequestToPb(st *ListUpdatesRequest) (*listUpdatesRequestPb, erro } pb := &listUpdatesRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.PipelineId = st.PipelineId - pb.UntilUpdateId = st.UntilUpdateId pb.ForceSendFields = st.ForceSendFields @@ -1293,12 +1106,9 @@ func listUpdatesRequestToPb(st *ListUpdatesRequest) (*listUpdatesRequestPb, erro } type listUpdatesRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - - PipelineId string `json:"-" url:"-"` - + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` + PipelineId string `json:"-" url:"-"` UntilUpdateId string `json:"-" url:"until_update_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1332,9 +1142,7 @@ func listUpdatesResponseToPb(st *ListUpdatesResponse) (*listUpdatesResponsePb, e } pb := &listUpdatesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.PrevPageToken = st.PrevPageToken - pb.Updates = st.Updates pb.ForceSendFields = st.ForceSendFields @@ -1342,11 +1150,9 @@ func listUpdatesResponseToPb(st *ListUpdatesResponse) (*listUpdatesResponsePb, e } type listUpdatesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - PrevPageToken string `json:"prev_page_token,omitempty"` - - Updates []UpdateInfo `json:"updates,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + PrevPageToken string `json:"prev_page_token,omitempty"` + Updates []UpdateInfo `json:"updates,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1435,15 +1241,13 @@ func notificationsToPb(st *Notifications) (*notificationsPb, error) { } pb := ¬ificationsPb{} pb.Alerts = st.Alerts - pb.EmailRecipients = st.EmailRecipients return pb, nil } type notificationsPb struct { - Alerts []string `json:"alerts,omitempty"` - + Alerts []string `json:"alerts,omitempty"` EmailRecipients []string `json:"email_recipients,omitempty"` } @@ -1464,37 +1268,21 @@ func originToPb(st *Origin) (*originPb, error) { } pb := &originPb{} pb.BatchId = st.BatchId - pb.Cloud = st.Cloud - pb.ClusterId = st.ClusterId - pb.DatasetName = st.DatasetName - pb.FlowId = st.FlowId - pb.FlowName = st.FlowName - pb.Host = st.Host - pb.MaintenanceId = st.MaintenanceId - pb.MaterializationName = st.MaterializationName - pb.OrgId = st.OrgId - pb.PipelineId = st.PipelineId - pb.PipelineName = st.PipelineName - pb.Region = st.Region - pb.RequestId = st.RequestId - pb.TableId = st.TableId - pb.UcResourceId = st.UcResourceId - pb.UpdateId = st.UpdateId pb.ForceSendFields = st.ForceSendFields @@ -1502,39 +1290,23 @@ func originToPb(st *Origin) (*originPb, error) { } type originPb struct { - BatchId int64 `json:"batch_id,omitempty"` - - Cloud string `json:"cloud,omitempty"` - - ClusterId string `json:"cluster_id,omitempty"` - - DatasetName string `json:"dataset_name,omitempty"` - - FlowId string `json:"flow_id,omitempty"` - - FlowName string `json:"flow_name,omitempty"` - - Host string `json:"host,omitempty"` - - MaintenanceId string `json:"maintenance_id,omitempty"` - + BatchId int64 `json:"batch_id,omitempty"` + Cloud string `json:"cloud,omitempty"` + ClusterId string `json:"cluster_id,omitempty"` + DatasetName string `json:"dataset_name,omitempty"` + FlowId string `json:"flow_id,omitempty"` + FlowName string `json:"flow_name,omitempty"` + Host string `json:"host,omitempty"` + MaintenanceId string `json:"maintenance_id,omitempty"` MaterializationName string `json:"materialization_name,omitempty"` - - OrgId int64 `json:"org_id,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - PipelineName string `json:"pipeline_name,omitempty"` - - Region string `json:"region,omitempty"` - - RequestId string `json:"request_id,omitempty"` - - TableId string `json:"table_id,omitempty"` - - UcResourceId string `json:"uc_resource_id,omitempty"` - - UpdateId string `json:"update_id,omitempty"` + OrgId int64 `json:"org_id,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + PipelineName string `json:"pipeline_name,omitempty"` + Region string `json:"region,omitempty"` + RequestId string `json:"request_id,omitempty"` + TableId string `json:"table_id,omitempty"` + UcResourceId string `json:"uc_resource_id,omitempty"` + UpdateId string `json:"update_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1616,11 +1388,8 @@ func pipelineAccessControlRequestToPb(st *PipelineAccessControlRequest) (*pipeli } pb := &pipelineAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1628,13 +1397,10 @@ func pipelineAccessControlRequestToPb(st *PipelineAccessControlRequest) (*pipeli } type pipelineAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1667,13 +1433,9 @@ func pipelineAccessControlResponseToPb(st *PipelineAccessControlResponse) (*pipe } pb := &pipelineAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1681,15 +1443,11 @@ func pipelineAccessControlResponseToPb(st *PipelineAccessControlResponse) (*pipe } type pipelineAccessControlResponsePb struct { - AllPermissions []PipelinePermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []PipelinePermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1723,41 +1481,23 @@ func pipelineClusterToPb(st *PipelineCluster) (*pipelineClusterPb, error) { } pb := &pipelineClusterPb{} pb.ApplyPolicyDefaultValues = st.ApplyPolicyDefaultValues - pb.Autoscale = st.Autoscale - pb.AwsAttributes = st.AwsAttributes - pb.AzureAttributes = st.AzureAttributes - pb.ClusterLogConf = st.ClusterLogConf - pb.CustomTags = st.CustomTags - pb.DriverInstancePoolId = st.DriverInstancePoolId - pb.DriverNodeTypeId = st.DriverNodeTypeId - pb.EnableLocalDiskEncryption = st.EnableLocalDiskEncryption - pb.GcpAttributes = st.GcpAttributes - pb.InitScripts = st.InitScripts - pb.InstancePoolId = st.InstancePoolId - pb.Label = st.Label - pb.NodeTypeId = st.NodeTypeId - pb.NumWorkers = st.NumWorkers - pb.PolicyId = st.PolicyId - pb.SparkConf = st.SparkConf - pb.SparkEnvVars = st.SparkEnvVars - pb.SshPublicKeys = st.SshPublicKeys pb.ForceSendFields = st.ForceSendFields @@ -1765,43 +1505,25 @@ func pipelineClusterToPb(st *PipelineCluster) (*pipelineClusterPb, error) { } type pipelineClusterPb struct { - ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` - - Autoscale *PipelineClusterAutoscale `json:"autoscale,omitempty"` - - AwsAttributes *compute.AwsAttributes `json:"aws_attributes,omitempty"` - - AzureAttributes *compute.AzureAttributes `json:"azure_attributes,omitempty"` - - ClusterLogConf *compute.ClusterLogConf `json:"cluster_log_conf,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` - - DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` - - EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` - - GcpAttributes *compute.GcpAttributes `json:"gcp_attributes,omitempty"` - - InitScripts []compute.InitScriptInfo `json:"init_scripts,omitempty"` - - InstancePoolId string `json:"instance_pool_id,omitempty"` - - Label string `json:"label,omitempty"` - - NodeTypeId string `json:"node_type_id,omitempty"` - - NumWorkers int `json:"num_workers,omitempty"` - - PolicyId string `json:"policy_id,omitempty"` - - SparkConf map[string]string `json:"spark_conf,omitempty"` - - SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` - - SshPublicKeys []string `json:"ssh_public_keys,omitempty"` + ApplyPolicyDefaultValues bool `json:"apply_policy_default_values,omitempty"` + Autoscale *PipelineClusterAutoscale `json:"autoscale,omitempty"` + AwsAttributes *compute.AwsAttributes `json:"aws_attributes,omitempty"` + AzureAttributes *compute.AzureAttributes `json:"azure_attributes,omitempty"` + ClusterLogConf *compute.ClusterLogConf `json:"cluster_log_conf,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DriverInstancePoolId string `json:"driver_instance_pool_id,omitempty"` + DriverNodeTypeId string `json:"driver_node_type_id,omitempty"` + EnableLocalDiskEncryption bool `json:"enable_local_disk_encryption,omitempty"` + GcpAttributes *compute.GcpAttributes `json:"gcp_attributes,omitempty"` + InitScripts []compute.InitScriptInfo `json:"init_scripts,omitempty"` + InstancePoolId string `json:"instance_pool_id,omitempty"` + Label string `json:"label,omitempty"` + NodeTypeId string `json:"node_type_id,omitempty"` + NumWorkers int `json:"num_workers,omitempty"` + PolicyId string `json:"policy_id,omitempty"` + SparkConf map[string]string `json:"spark_conf,omitempty"` + SparkEnvVars map[string]string `json:"spark_env_vars,omitempty"` + SshPublicKeys []string `json:"ssh_public_keys,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1849,20 +1571,16 @@ func pipelineClusterAutoscaleToPb(st *PipelineClusterAutoscale) (*pipelineCluste } pb := &pipelineClusterAutoscalePb{} pb.MaxWorkers = st.MaxWorkers - pb.MinWorkers = st.MinWorkers - pb.Mode = st.Mode return pb, nil } type pipelineClusterAutoscalePb struct { - MaxWorkers int `json:"max_workers"` - - MinWorkers int `json:"min_workers"` - - Mode PipelineClusterAutoscaleMode `json:"mode,omitempty"` + MaxWorkers int `json:"max_workers"` + MinWorkers int `json:"min_workers"` + Mode PipelineClusterAutoscaleMode `json:"mode,omitempty"` } func pipelineClusterAutoscaleFromPb(pb *pipelineClusterAutoscalePb) (*PipelineClusterAutoscale, error) { @@ -1883,7 +1601,6 @@ func pipelineDeploymentToPb(st *PipelineDeployment) (*pipelineDeploymentPb, erro } pb := &pipelineDeploymentPb{} pb.Kind = st.Kind - pb.MetadataFilePath = st.MetadataFilePath pb.ForceSendFields = st.ForceSendFields @@ -1891,9 +1608,8 @@ func pipelineDeploymentToPb(st *PipelineDeployment) (*pipelineDeploymentPb, erro } type pipelineDeploymentPb struct { - Kind DeploymentKind `json:"kind"` - - MetadataFilePath string `json:"metadata_file_path,omitempty"` + Kind DeploymentKind `json:"kind"` + MetadataFilePath string `json:"metadata_file_path,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1924,21 +1640,13 @@ func pipelineEventToPb(st *PipelineEvent) (*pipelineEventPb, error) { } pb := &pipelineEventPb{} pb.Error = st.Error - pb.EventType = st.EventType - pb.Id = st.Id - pb.Level = st.Level - pb.MaturityLevel = st.MaturityLevel - pb.Message = st.Message - pb.Origin = st.Origin - pb.Sequence = st.Sequence - pb.Timestamp = st.Timestamp pb.ForceSendFields = st.ForceSendFields @@ -1946,23 +1654,15 @@ func pipelineEventToPb(st *PipelineEvent) (*pipelineEventPb, error) { } type pipelineEventPb struct { - Error *ErrorDetail `json:"error,omitempty"` - - EventType string `json:"event_type,omitempty"` - - Id string `json:"id,omitempty"` - - Level EventLevel `json:"level,omitempty"` - + Error *ErrorDetail `json:"error,omitempty"` + EventType string `json:"event_type,omitempty"` + Id string `json:"id,omitempty"` + Level EventLevel `json:"level,omitempty"` MaturityLevel MaturityLevel `json:"maturity_level,omitempty"` - - Message string `json:"message,omitempty"` - - Origin *Origin `json:"origin,omitempty"` - - Sequence *Sequencing `json:"sequence,omitempty"` - - Timestamp string `json:"timestamp,omitempty"` + Message string `json:"message,omitempty"` + Origin *Origin `json:"origin,omitempty"` + Sequence *Sequencing `json:"sequence,omitempty"` + Timestamp string `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2000,15 +1700,10 @@ func pipelineLibraryToPb(st *PipelineLibrary) (*pipelineLibraryPb, error) { } pb := &pipelineLibraryPb{} pb.File = st.File - pb.Glob = st.Glob - pb.Jar = st.Jar - pb.Maven = st.Maven - pb.Notebook = st.Notebook - pb.Whl = st.Whl pb.ForceSendFields = st.ForceSendFields @@ -2016,17 +1711,12 @@ func pipelineLibraryToPb(st *PipelineLibrary) (*pipelineLibraryPb, error) { } type pipelineLibraryPb struct { - File *FileLibrary `json:"file,omitempty"` - - Glob *PathPattern `json:"glob,omitempty"` - - Jar string `json:"jar,omitempty"` - - Maven *compute.MavenLibrary `json:"maven,omitempty"` - - Notebook *NotebookLibrary `json:"notebook,omitempty"` - - Whl string `json:"whl,omitempty"` + File *FileLibrary `json:"file,omitempty"` + Glob *PathPattern `json:"glob,omitempty"` + Jar string `json:"jar,omitempty"` + Maven *compute.MavenLibrary `json:"maven,omitempty"` + Notebook *NotebookLibrary `json:"notebook,omitempty"` + Whl string `json:"whl,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2061,9 +1751,7 @@ func pipelinePermissionToPb(st *PipelinePermission) (*pipelinePermissionPb, erro } pb := &pipelinePermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2071,11 +1759,9 @@ func pipelinePermissionToPb(st *PipelinePermission) (*pipelinePermissionPb, erro } type pipelinePermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2107,9 +1793,7 @@ func pipelinePermissionsToPb(st *PipelinePermissions) (*pipelinePermissionsPb, e } pb := &pipelinePermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2118,10 +1802,8 @@ func pipelinePermissionsToPb(st *PipelinePermissions) (*pipelinePermissionsPb, e type pipelinePermissionsPb struct { AccessControlList []PipelineAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2153,7 +1835,6 @@ func pipelinePermissionsDescriptionToPb(st *PipelinePermissionsDescription) (*pi } pb := &pipelinePermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2161,8 +1842,7 @@ func pipelinePermissionsDescriptionToPb(st *PipelinePermissionsDescription) (*pi } type pipelinePermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel PipelinePermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2194,7 +1874,6 @@ func pipelinePermissionsRequestToPb(st *PipelinePermissionsRequest) (*pipelinePe } pb := &pipelinePermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.PipelineId = st.PipelineId return pb, nil @@ -2202,8 +1881,7 @@ func pipelinePermissionsRequestToPb(st *PipelinePermissionsRequest) (*pipelinePe type pipelinePermissionsRequestPb struct { AccessControlList []PipelineAccessControlRequest `json:"access_control_list,omitempty"` - - PipelineId string `json:"-" url:"-"` + PipelineId string `json:"-" url:"-"` } func pipelinePermissionsRequestFromPb(pb *pipelinePermissionsRequestPb) (*PipelinePermissionsRequest, error) { @@ -2223,53 +1901,29 @@ func pipelineSpecToPb(st *PipelineSpec) (*pipelineSpecPb, error) { } pb := &pipelineSpecPb{} pb.BudgetPolicyId = st.BudgetPolicyId - pb.Catalog = st.Catalog - pb.Channel = st.Channel - pb.Clusters = st.Clusters - pb.Configuration = st.Configuration - pb.Continuous = st.Continuous - pb.Deployment = st.Deployment - pb.Development = st.Development - pb.Edition = st.Edition - pb.EventLog = st.EventLog - pb.Filters = st.Filters - pb.GatewayDefinition = st.GatewayDefinition - pb.Id = st.Id - pb.IngestionDefinition = st.IngestionDefinition - pb.Libraries = st.Libraries - pb.Name = st.Name - pb.Notifications = st.Notifications - pb.Photon = st.Photon - pb.RestartWindow = st.RestartWindow - pb.RootPath = st.RootPath - pb.Schema = st.Schema - pb.Serverless = st.Serverless - pb.Storage = st.Storage - pb.Target = st.Target - pb.Trigger = st.Trigger pb.ForceSendFields = st.ForceSendFields @@ -2277,55 +1931,31 @@ func pipelineSpecToPb(st *PipelineSpec) (*pipelineSpecPb, error) { } type pipelineSpecPb struct { - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Channel string `json:"channel,omitempty"` - - Clusters []PipelineCluster `json:"clusters,omitempty"` - - Configuration map[string]string `json:"configuration,omitempty"` - - Continuous bool `json:"continuous,omitempty"` - - Deployment *PipelineDeployment `json:"deployment,omitempty"` - - Development bool `json:"development,omitempty"` - - Edition string `json:"edition,omitempty"` - - EventLog *EventLogSpec `json:"event_log,omitempty"` - - Filters *Filters `json:"filters,omitempty"` - - GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` - - Id string `json:"id,omitempty"` - - IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` - - Libraries []PipelineLibrary `json:"libraries,omitempty"` - - Name string `json:"name,omitempty"` - - Notifications []Notifications `json:"notifications,omitempty"` - - Photon bool `json:"photon,omitempty"` - - RestartWindow *RestartWindow `json:"restart_window,omitempty"` - - RootPath string `json:"root_path,omitempty"` - - Schema string `json:"schema,omitempty"` - - Serverless bool `json:"serverless,omitempty"` - - Storage string `json:"storage,omitempty"` - - Target string `json:"target,omitempty"` - - Trigger *PipelineTrigger `json:"trigger,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Catalog string `json:"catalog,omitempty"` + Channel string `json:"channel,omitempty"` + Clusters []PipelineCluster `json:"clusters,omitempty"` + Configuration map[string]string `json:"configuration,omitempty"` + Continuous bool `json:"continuous,omitempty"` + Deployment *PipelineDeployment `json:"deployment,omitempty"` + Development bool `json:"development,omitempty"` + Edition string `json:"edition,omitempty"` + EventLog *EventLogSpec `json:"event_log,omitempty"` + Filters *Filters `json:"filters,omitempty"` + GatewayDefinition *IngestionGatewayPipelineDefinition `json:"gateway_definition,omitempty"` + Id string `json:"id,omitempty"` + IngestionDefinition *IngestionPipelineDefinition `json:"ingestion_definition,omitempty"` + Libraries []PipelineLibrary `json:"libraries,omitempty"` + Name string `json:"name,omitempty"` + Notifications []Notifications `json:"notifications,omitempty"` + Photon bool `json:"photon,omitempty"` + RestartWindow *RestartWindow `json:"restart_window,omitempty"` + RootPath string `json:"root_path,omitempty"` + Schema string `json:"schema,omitempty"` + Serverless bool `json:"serverless,omitempty"` + Storage string `json:"storage,omitempty"` + Target string `json:"target,omitempty"` + Trigger *PipelineTrigger `json:"trigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2379,19 +2009,12 @@ func pipelineStateInfoToPb(st *PipelineStateInfo) (*pipelineStateInfoPb, error) } pb := &pipelineStateInfoPb{} pb.ClusterId = st.ClusterId - pb.CreatorUserName = st.CreatorUserName - pb.Health = st.Health - pb.LatestUpdates = st.LatestUpdates - pb.Name = st.Name - pb.PipelineId = st.PipelineId - pb.RunAsUserName = st.RunAsUserName - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -2399,21 +2022,14 @@ func pipelineStateInfoToPb(st *PipelineStateInfo) (*pipelineStateInfoPb, error) } type pipelineStateInfoPb struct { - ClusterId string `json:"cluster_id,omitempty"` - - CreatorUserName string `json:"creator_user_name,omitempty"` - - Health PipelineStateInfoHealth `json:"health,omitempty"` - - LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` - - Name string `json:"name,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - RunAsUserName string `json:"run_as_user_name,omitempty"` - - State PipelineState `json:"state,omitempty"` + ClusterId string `json:"cluster_id,omitempty"` + CreatorUserName string `json:"creator_user_name,omitempty"` + Health PipelineStateInfoHealth `json:"health,omitempty"` + LatestUpdates []UpdateStateInfo `json:"latest_updates,omitempty"` + Name string `json:"name,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + RunAsUserName string `json:"run_as_user_name,omitempty"` + State PipelineState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2450,15 +2066,13 @@ func pipelineTriggerToPb(st *PipelineTrigger) (*pipelineTriggerPb, error) { } pb := &pipelineTriggerPb{} pb.Cron = st.Cron - pb.Manual = st.Manual return pb, nil } type pipelineTriggerPb struct { - Cron *CronTrigger `json:"cron,omitempty"` - + Cron *CronTrigger `json:"cron,omitempty"` Manual *ManualTrigger `json:"manual,omitempty"` } @@ -2479,13 +2093,9 @@ func reportSpecToPb(st *ReportSpec) (*reportSpecPb, error) { } pb := &reportSpecPb{} pb.DestinationCatalog = st.DestinationCatalog - pb.DestinationSchema = st.DestinationSchema - pb.DestinationTable = st.DestinationTable - pb.SourceUrl = st.SourceUrl - pb.TableConfiguration = st.TableConfiguration pb.ForceSendFields = st.ForceSendFields @@ -2493,14 +2103,10 @@ func reportSpecToPb(st *ReportSpec) (*reportSpecPb, error) { } type reportSpecPb struct { - DestinationCatalog string `json:"destination_catalog"` - - DestinationSchema string `json:"destination_schema"` - - DestinationTable string `json:"destination_table,omitempty"` - - SourceUrl string `json:"source_url"` - + DestinationCatalog string `json:"destination_catalog"` + DestinationSchema string `json:"destination_schema"` + DestinationTable string `json:"destination_table,omitempty"` + SourceUrl string `json:"source_url"` TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2535,9 +2141,7 @@ func restartWindowToPb(st *RestartWindow) (*restartWindowPb, error) { } pb := &restartWindowPb{} pb.DaysOfWeek = st.DaysOfWeek - pb.StartHour = st.StartHour - pb.TimeZoneId = st.TimeZoneId pb.ForceSendFields = st.ForceSendFields @@ -2546,10 +2150,8 @@ func restartWindowToPb(st *RestartWindow) (*restartWindowPb, error) { type restartWindowPb struct { DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` - - StartHour int `json:"start_hour"` - - TimeZoneId string `json:"time_zone_id,omitempty"` + StartHour int `json:"start_hour"` + TimeZoneId string `json:"time_zone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2581,7 +2183,6 @@ func runAsToPb(st *RunAs) (*runAsPb, error) { } pb := &runAsPb{} pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2590,8 +2191,7 @@ func runAsToPb(st *RunAs) (*runAsPb, error) { type runAsPb struct { ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2622,13 +2222,9 @@ func schemaSpecToPb(st *SchemaSpec) (*schemaSpecPb, error) { } pb := &schemaSpecPb{} pb.DestinationCatalog = st.DestinationCatalog - pb.DestinationSchema = st.DestinationSchema - pb.SourceCatalog = st.SourceCatalog - pb.SourceSchema = st.SourceSchema - pb.TableConfiguration = st.TableConfiguration pb.ForceSendFields = st.ForceSendFields @@ -2636,14 +2232,10 @@ func schemaSpecToPb(st *SchemaSpec) (*schemaSpecPb, error) { } type schemaSpecPb struct { - DestinationCatalog string `json:"destination_catalog"` - - DestinationSchema string `json:"destination_schema"` - - SourceCatalog string `json:"source_catalog,omitempty"` - - SourceSchema string `json:"source_schema"` - + DestinationCatalog string `json:"destination_catalog"` + DestinationSchema string `json:"destination_schema"` + SourceCatalog string `json:"source_catalog,omitempty"` + SourceSchema string `json:"source_schema"` TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2678,7 +2270,6 @@ func sequencingToPb(st *Sequencing) (*sequencingPb, error) { } pb := &sequencingPb{} pb.ControlPlaneSeqNo = st.ControlPlaneSeqNo - pb.DataPlaneId = st.DataPlaneId pb.ForceSendFields = st.ForceSendFields @@ -2686,9 +2277,8 @@ func sequencingToPb(st *Sequencing) (*sequencingPb, error) { } type sequencingPb struct { - ControlPlaneSeqNo int64 `json:"control_plane_seq_no,omitempty"` - - DataPlaneId *DataPlaneId `json:"data_plane_id,omitempty"` + ControlPlaneSeqNo int64 `json:"control_plane_seq_no,omitempty"` + DataPlaneId *DataPlaneId `json:"data_plane_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2719,9 +2309,7 @@ func serializedExceptionToPb(st *SerializedException) (*serializedExceptionPb, e } pb := &serializedExceptionPb{} pb.ClassName = st.ClassName - pb.Message = st.Message - pb.Stack = st.Stack pb.ForceSendFields = st.ForceSendFields @@ -2729,11 +2317,9 @@ func serializedExceptionToPb(st *SerializedException) (*serializedExceptionPb, e } type serializedExceptionPb struct { - ClassName string `json:"class_name,omitempty"` - - Message string `json:"message,omitempty"` - - Stack []StackFrame `json:"stack,omitempty"` + ClassName string `json:"class_name,omitempty"` + Message string `json:"message,omitempty"` + Stack []StackFrame `json:"stack,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2765,11 +2351,8 @@ func stackFrameToPb(st *StackFrame) (*stackFramePb, error) { } pb := &stackFramePb{} pb.DeclaringClass = st.DeclaringClass - pb.FileName = st.FileName - pb.LineNumber = st.LineNumber - pb.MethodName = st.MethodName pb.ForceSendFields = st.ForceSendFields @@ -2778,12 +2361,9 @@ func stackFrameToPb(st *StackFrame) (*stackFramePb, error) { type stackFramePb struct { DeclaringClass string `json:"declaring_class,omitempty"` - - FileName string `json:"file_name,omitempty"` - - LineNumber int `json:"line_number,omitempty"` - - MethodName string `json:"method_name,omitempty"` + FileName string `json:"file_name,omitempty"` + LineNumber int `json:"line_number,omitempty"` + MethodName string `json:"method_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2816,15 +2396,10 @@ func startUpdateToPb(st *StartUpdate) (*startUpdatePb, error) { } pb := &startUpdatePb{} pb.Cause = st.Cause - pb.FullRefresh = st.FullRefresh - pb.FullRefreshSelection = st.FullRefreshSelection - pb.PipelineId = st.PipelineId - pb.RefreshSelection = st.RefreshSelection - pb.ValidateOnly = st.ValidateOnly pb.ForceSendFields = st.ForceSendFields @@ -2832,17 +2407,12 @@ func startUpdateToPb(st *StartUpdate) (*startUpdatePb, error) { } type startUpdatePb struct { - Cause StartUpdateCause `json:"cause,omitempty"` - - FullRefresh bool `json:"full_refresh,omitempty"` - - FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` - - PipelineId string `json:"-" url:"-"` - - RefreshSelection []string `json:"refresh_selection,omitempty"` - - ValidateOnly bool `json:"validate_only,omitempty"` + Cause StartUpdateCause `json:"cause,omitempty"` + FullRefresh bool `json:"full_refresh,omitempty"` + FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + PipelineId string `json:"-" url:"-"` + RefreshSelection []string `json:"refresh_selection,omitempty"` + ValidateOnly bool `json:"validate_only,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2958,17 +2528,11 @@ func tableSpecToPb(st *TableSpec) (*tableSpecPb, error) { } pb := &tableSpecPb{} pb.DestinationCatalog = st.DestinationCatalog - pb.DestinationSchema = st.DestinationSchema - pb.DestinationTable = st.DestinationTable - pb.SourceCatalog = st.SourceCatalog - pb.SourceSchema = st.SourceSchema - pb.SourceTable = st.SourceTable - pb.TableConfiguration = st.TableConfiguration pb.ForceSendFields = st.ForceSendFields @@ -2976,18 +2540,12 @@ func tableSpecToPb(st *TableSpec) (*tableSpecPb, error) { } type tableSpecPb struct { - DestinationCatalog string `json:"destination_catalog"` - - DestinationSchema string `json:"destination_schema"` - - DestinationTable string `json:"destination_table,omitempty"` - - SourceCatalog string `json:"source_catalog,omitempty"` - - SourceSchema string `json:"source_schema,omitempty"` - - SourceTable string `json:"source_table"` - + DestinationCatalog string `json:"destination_catalog"` + DestinationSchema string `json:"destination_schema"` + DestinationTable string `json:"destination_table,omitempty"` + SourceCatalog string `json:"source_catalog,omitempty"` + SourceSchema string `json:"source_schema,omitempty"` + SourceTable string `json:"source_table"` TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3024,15 +2582,10 @@ func tableSpecificConfigToPb(st *TableSpecificConfig) (*tableSpecificConfigPb, e } pb := &tableSpecificConfigPb{} pb.ExcludeColumns = st.ExcludeColumns - pb.IncludeColumns = st.IncludeColumns - pb.PrimaryKeys = st.PrimaryKeys - pb.SalesforceIncludeFormulaFields = st.SalesforceIncludeFormulaFields - pb.ScdType = st.ScdType - pb.SequenceBy = st.SequenceBy pb.ForceSendFields = st.ForceSendFields @@ -3040,17 +2593,12 @@ func tableSpecificConfigToPb(st *TableSpecificConfig) (*tableSpecificConfigPb, e } type tableSpecificConfigPb struct { - ExcludeColumns []string `json:"exclude_columns,omitempty"` - - IncludeColumns []string `json:"include_columns,omitempty"` - - PrimaryKeys []string `json:"primary_keys,omitempty"` - - SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` - - ScdType TableSpecificConfigScdType `json:"scd_type,omitempty"` - - SequenceBy []string `json:"sequence_by,omitempty"` + ExcludeColumns []string `json:"exclude_columns,omitempty"` + IncludeColumns []string `json:"include_columns,omitempty"` + PrimaryKeys []string `json:"primary_keys,omitempty"` + SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` + ScdType TableSpecificConfigScdType `json:"scd_type,omitempty"` + SequenceBy []string `json:"sequence_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3085,25 +2633,15 @@ func updateInfoToPb(st *UpdateInfo) (*updateInfoPb, error) { } pb := &updateInfoPb{} pb.Cause = st.Cause - pb.ClusterId = st.ClusterId - pb.Config = st.Config - pb.CreationTime = st.CreationTime - pb.FullRefresh = st.FullRefresh - pb.FullRefreshSelection = st.FullRefreshSelection - pb.PipelineId = st.PipelineId - pb.RefreshSelection = st.RefreshSelection - pb.State = st.State - pb.UpdateId = st.UpdateId - pb.ValidateOnly = st.ValidateOnly pb.ForceSendFields = st.ForceSendFields @@ -3111,27 +2649,17 @@ func updateInfoToPb(st *UpdateInfo) (*updateInfoPb, error) { } type updateInfoPb struct { - Cause UpdateInfoCause `json:"cause,omitempty"` - - ClusterId string `json:"cluster_id,omitempty"` - - Config *PipelineSpec `json:"config,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - FullRefresh bool `json:"full_refresh,omitempty"` - - FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - RefreshSelection []string `json:"refresh_selection,omitempty"` - - State UpdateInfoState `json:"state,omitempty"` - - UpdateId string `json:"update_id,omitempty"` - - ValidateOnly bool `json:"validate_only,omitempty"` + Cause UpdateInfoCause `json:"cause,omitempty"` + ClusterId string `json:"cluster_id,omitempty"` + Config *PipelineSpec `json:"config,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + FullRefresh bool `json:"full_refresh,omitempty"` + FullRefreshSelection []string `json:"full_refresh_selection,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + RefreshSelection []string `json:"refresh_selection,omitempty"` + State UpdateInfoState `json:"state,omitempty"` + UpdateId string `json:"update_id,omitempty"` + ValidateOnly bool `json:"validate_only,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3171,9 +2699,7 @@ func updateStateInfoToPb(st *UpdateStateInfo) (*updateStateInfoPb, error) { } pb := &updateStateInfoPb{} pb.CreationTime = st.CreationTime - pb.State = st.State - pb.UpdateId = st.UpdateId pb.ForceSendFields = st.ForceSendFields @@ -3181,11 +2707,9 @@ func updateStateInfoToPb(st *UpdateStateInfo) (*updateStateInfoPb, error) { } type updateStateInfoPb struct { - CreationTime string `json:"creation_time,omitempty"` - - State UpdateStateInfoState `json:"state,omitempty"` - - UpdateId string `json:"update_id,omitempty"` + CreationTime string `json:"creation_time,omitempty"` + State UpdateStateInfoState `json:"state,omitempty"` + UpdateId string `json:"update_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3210,3 +2734,57 @@ func (st *updateStateInfoPb) UnmarshalJSON(b []byte) error { func (st updateStateInfoPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 7a725ad5d..814a5f0f2 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -5,8 +5,6 @@ package pipelines import ( "encoding/json" "fmt" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/compute" ) @@ -3491,57 +3489,3 @@ func (f *UpdateStateInfoState) Set(v string) error { func (f *UpdateStateInfoState) Type() string { return "UpdateStateInfoState" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/pkg.go b/service/pkg.go index 74dffcabb..00f58b46e 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -54,10 +54,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. -// // - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. // +// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. @@ -365,8 +365,8 @@ var ( _ *marketplace.ConsumerListingsAPI = nil _ *marketplace.ConsumerPersonalizationRequestsAPI = nil _ *marketplace.ConsumerProvidersAPI = nil - _ *provisioning.CredentialsAPI = nil _ *catalog.CredentialsAPI = nil + _ *provisioning.CredentialsAPI = nil _ *settings.CredentialsManagerAPI = nil _ *settings.CspEnablementAccountAPI = nil _ *iam.CurrentUserAPI = nil diff --git a/service/provisioning/internal.go b/service/provisioning/internal.go index d5a4106f2..6ec59d338 100755 --- a/service/provisioning/internal.go +++ b/service/provisioning/internal.go @@ -3,6 +3,10 @@ package provisioning import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -36,11 +40,8 @@ func awsKeyInfoToPb(st *AwsKeyInfo) (*awsKeyInfoPb, error) { } pb := &awsKeyInfoPb{} pb.KeyAlias = st.KeyAlias - pb.KeyArn = st.KeyArn - pb.KeyRegion = st.KeyRegion - pb.ReuseKeyForClusterVolumes = st.ReuseKeyForClusterVolumes pb.ForceSendFields = st.ForceSendFields @@ -48,13 +49,10 @@ func awsKeyInfoToPb(st *AwsKeyInfo) (*awsKeyInfoPb, error) { } type awsKeyInfoPb struct { - KeyAlias string `json:"key_alias,omitempty"` - - KeyArn string `json:"key_arn"` - - KeyRegion string `json:"key_region"` - - ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + KeyAlias string `json:"key_alias,omitempty"` + KeyArn string `json:"key_arn"` + KeyRegion string `json:"key_region"` + ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -87,7 +85,6 @@ func azureWorkspaceInfoToPb(st *AzureWorkspaceInfo) (*azureWorkspaceInfoPb, erro } pb := &azureWorkspaceInfoPb{} pb.ResourceGroup = st.ResourceGroup - pb.SubscriptionId = st.SubscriptionId pb.ForceSendFields = st.ForceSendFields @@ -95,8 +92,7 @@ func azureWorkspaceInfoToPb(st *AzureWorkspaceInfo) (*azureWorkspaceInfoPb, erro } type azureWorkspaceInfoPb struct { - ResourceGroup string `json:"resource_group,omitempty"` - + ResourceGroup string `json:"resource_group,omitempty"` SubscriptionId string `json:"subscription_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -152,9 +148,7 @@ func createAwsKeyInfoToPb(st *CreateAwsKeyInfo) (*createAwsKeyInfoPb, error) { } pb := &createAwsKeyInfoPb{} pb.KeyAlias = st.KeyAlias - pb.KeyArn = st.KeyArn - pb.ReuseKeyForClusterVolumes = st.ReuseKeyForClusterVolumes pb.ForceSendFields = st.ForceSendFields @@ -162,11 +156,9 @@ func createAwsKeyInfoToPb(st *CreateAwsKeyInfo) (*createAwsKeyInfoPb, error) { } type createAwsKeyInfoPb struct { - KeyAlias string `json:"key_alias,omitempty"` - - KeyArn string `json:"key_arn"` - - ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` + KeyAlias string `json:"key_alias,omitempty"` + KeyArn string `json:"key_arn"` + ReuseKeyForClusterVolumes bool `json:"reuse_key_for_cluster_volumes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -222,16 +214,14 @@ func createCredentialRequestToPb(st *CreateCredentialRequest) (*createCredential } pb := &createCredentialRequestPb{} pb.AwsCredentials = st.AwsCredentials - pb.CredentialsName = st.CredentialsName return pb, nil } type createCredentialRequestPb struct { - AwsCredentials CreateCredentialAwsCredentials `json:"aws_credentials"` - - CredentialsName string `json:"credentials_name"` + AwsCredentials CreateCredentialAwsCredentials `json:"aws_credentials"` + CredentialsName string `json:"credentials_name"` } func createCredentialRequestFromPb(pb *createCredentialRequestPb) (*CreateCredentialRequest, error) { @@ -287,9 +277,7 @@ func createCustomerManagedKeyRequestToPb(st *CreateCustomerManagedKeyRequest) (* } pb := &createCustomerManagedKeyRequestPb{} pb.AwsKeyInfo = st.AwsKeyInfo - pb.GcpKeyInfo = st.GcpKeyInfo - pb.UseCases = st.UseCases return pb, nil @@ -297,10 +285,8 @@ func createCustomerManagedKeyRequestToPb(st *CreateCustomerManagedKeyRequest) (* type createCustomerManagedKeyRequestPb struct { AwsKeyInfo *CreateAwsKeyInfo `json:"aws_key_info,omitempty"` - GcpKeyInfo *CreateGcpKeyInfo `json:"gcp_key_info,omitempty"` - - UseCases []KeyUseCase `json:"use_cases"` + UseCases []KeyUseCase `json:"use_cases"` } func createCustomerManagedKeyRequestFromPb(pb *createCustomerManagedKeyRequestPb) (*CreateCustomerManagedKeyRequest, error) { @@ -345,15 +331,10 @@ func createNetworkRequestToPb(st *CreateNetworkRequest) (*createNetworkRequestPb } pb := &createNetworkRequestPb{} pb.GcpNetworkInfo = st.GcpNetworkInfo - pb.NetworkName = st.NetworkName - pb.SecurityGroupIds = st.SecurityGroupIds - pb.SubnetIds = st.SubnetIds - pb.VpcEndpoints = st.VpcEndpoints - pb.VpcId = st.VpcId pb.ForceSendFields = st.ForceSendFields @@ -361,17 +342,12 @@ func createNetworkRequestToPb(st *CreateNetworkRequest) (*createNetworkRequestPb } type createNetworkRequestPb struct { - GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` - - NetworkName string `json:"network_name"` - - SecurityGroupIds []string `json:"security_group_ids,omitempty"` - - SubnetIds []string `json:"subnet_ids,omitempty"` - - VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` - - VpcId string `json:"vpc_id,omitempty"` + GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + NetworkName string `json:"network_name"` + SecurityGroupIds []string `json:"security_group_ids,omitempty"` + SubnetIds []string `json:"subnet_ids,omitempty"` + VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + VpcId string `json:"vpc_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -406,16 +382,14 @@ func createStorageConfigurationRequestToPb(st *CreateStorageConfigurationRequest } pb := &createStorageConfigurationRequestPb{} pb.RootBucketInfo = st.RootBucketInfo - pb.StorageConfigurationName = st.StorageConfigurationName return pb, nil } type createStorageConfigurationRequestPb struct { - RootBucketInfo RootBucketInfo `json:"root_bucket_info"` - - StorageConfigurationName string `json:"storage_configuration_name"` + RootBucketInfo RootBucketInfo `json:"root_bucket_info"` + StorageConfigurationName string `json:"storage_configuration_name"` } func createStorageConfigurationRequestFromPb(pb *createStorageConfigurationRequestPb) (*CreateStorageConfigurationRequest, error) { @@ -435,11 +409,8 @@ func createVpcEndpointRequestToPb(st *CreateVpcEndpointRequest) (*createVpcEndpo } pb := &createVpcEndpointRequestPb{} pb.AwsVpcEndpointId = st.AwsVpcEndpointId - pb.GcpVpcEndpointInfo = st.GcpVpcEndpointInfo - pb.Region = st.Region - pb.VpcEndpointName = st.VpcEndpointName pb.ForceSendFields = st.ForceSendFields @@ -447,13 +418,10 @@ func createVpcEndpointRequestToPb(st *CreateVpcEndpointRequest) (*createVpcEndpo } type createVpcEndpointRequestPb struct { - AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` - + AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` - - Region string `json:"region,omitempty"` - - VpcEndpointName string `json:"vpc_endpoint_name"` + Region string `json:"region,omitempty"` + VpcEndpointName string `json:"vpc_endpoint_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -486,37 +454,21 @@ func createWorkspaceRequestToPb(st *CreateWorkspaceRequest) (*createWorkspaceReq } pb := &createWorkspaceRequestPb{} pb.AwsRegion = st.AwsRegion - pb.Cloud = st.Cloud - pb.CloudResourceContainer = st.CloudResourceContainer - pb.CredentialsId = st.CredentialsId - pb.CustomTags = st.CustomTags - pb.DeploymentName = st.DeploymentName - pb.GcpManagedNetworkConfig = st.GcpManagedNetworkConfig - pb.GkeConfig = st.GkeConfig - pb.IsNoPublicIpEnabled = st.IsNoPublicIpEnabled - pb.Location = st.Location - pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId - pb.NetworkId = st.NetworkId - pb.PricingTier = st.PricingTier - pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId - pb.StorageConfigurationId = st.StorageConfigurationId - pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId - pb.WorkspaceName = st.WorkspaceName pb.ForceSendFields = st.ForceSendFields @@ -524,39 +476,23 @@ func createWorkspaceRequestToPb(st *CreateWorkspaceRequest) (*createWorkspaceReq } type createWorkspaceRequestPb struct { - AwsRegion string `json:"aws_region,omitempty"` - - Cloud string `json:"cloud,omitempty"` - - CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` - - CredentialsId string `json:"credentials_id,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DeploymentName string `json:"deployment_name,omitempty"` - - GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` - - GkeConfig *GkeConfig `json:"gke_config,omitempty"` - - IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` - - Location string `json:"location,omitempty"` - - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` - - NetworkId string `json:"network_id,omitempty"` - - PricingTier PricingTier `json:"pricing_tier,omitempty"` - - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` - - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` - - WorkspaceName string `json:"workspace_name"` + AwsRegion string `json:"aws_region,omitempty"` + Cloud string `json:"cloud,omitempty"` + CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + CredentialsId string `json:"credentials_id,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DeploymentName string `json:"deployment_name,omitempty"` + GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + GkeConfig *GkeConfig `json:"gke_config,omitempty"` + IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + Location string `json:"location,omitempty"` + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + NetworkId string `json:"network_id,omitempty"` + PricingTier PricingTier `json:"pricing_tier,omitempty"` + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + WorkspaceName string `json:"workspace_name"` ForceSendFields []string `json:"-" url:"-"` } @@ -602,13 +538,9 @@ func credentialToPb(st *Credential) (*credentialPb, error) { } pb := &credentialPb{} pb.AccountId = st.AccountId - pb.AwsCredentials = st.AwsCredentials - pb.CreationTime = st.CreationTime - pb.CredentialsId = st.CredentialsId - pb.CredentialsName = st.CredentialsName pb.ForceSendFields = st.ForceSendFields @@ -616,15 +548,11 @@ func credentialToPb(st *Credential) (*credentialPb, error) { } type credentialPb struct { - AccountId string `json:"account_id,omitempty"` - - AwsCredentials *AwsCredentials `json:"aws_credentials,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - CredentialsId string `json:"credentials_id,omitempty"` - - CredentialsName string `json:"credentials_name,omitempty"` + AccountId string `json:"account_id,omitempty"` + AwsCredentials *AwsCredentials `json:"aws_credentials,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + CredentialsId string `json:"credentials_id,omitempty"` + CredentialsName string `json:"credentials_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -712,15 +640,10 @@ func customerManagedKeyToPb(st *CustomerManagedKey) (*customerManagedKeyPb, erro } pb := &customerManagedKeyPb{} pb.AccountId = st.AccountId - pb.AwsKeyInfo = st.AwsKeyInfo - pb.CreationTime = st.CreationTime - pb.CustomerManagedKeyId = st.CustomerManagedKeyId - pb.GcpKeyInfo = st.GcpKeyInfo - pb.UseCases = st.UseCases pb.ForceSendFields = st.ForceSendFields @@ -728,17 +651,12 @@ func customerManagedKeyToPb(st *CustomerManagedKey) (*customerManagedKeyPb, erro } type customerManagedKeyPb struct { - AccountId string `json:"account_id,omitempty"` - - AwsKeyInfo *AwsKeyInfo `json:"aws_key_info,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - CustomerManagedKeyId string `json:"customer_managed_key_id,omitempty"` - - GcpKeyInfo *GcpKeyInfo `json:"gcp_key_info,omitempty"` - - UseCases []KeyUseCase `json:"use_cases,omitempty"` + AccountId string `json:"account_id,omitempty"` + AwsKeyInfo *AwsKeyInfo `json:"aws_key_info,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + CustomerManagedKeyId string `json:"customer_managed_key_id,omitempty"` + GcpKeyInfo *GcpKeyInfo `json:"gcp_key_info,omitempty"` + UseCases []KeyUseCase `json:"use_cases,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -962,9 +880,7 @@ func externalCustomerInfoToPb(st *ExternalCustomerInfo) (*externalCustomerInfoPb } pb := &externalCustomerInfoPb{} pb.AuthoritativeUserEmail = st.AuthoritativeUserEmail - pb.AuthoritativeUserFullName = st.AuthoritativeUserFullName - pb.CustomerName = st.CustomerName pb.ForceSendFields = st.ForceSendFields @@ -972,11 +888,9 @@ func externalCustomerInfoToPb(st *ExternalCustomerInfo) (*externalCustomerInfoPb } type externalCustomerInfoPb struct { - AuthoritativeUserEmail string `json:"authoritative_user_email,omitempty"` - + AuthoritativeUserEmail string `json:"authoritative_user_email,omitempty"` AuthoritativeUserFullName string `json:"authoritative_user_full_name,omitempty"` - - CustomerName string `json:"customer_name,omitempty"` + CustomerName string `json:"customer_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1032,9 +946,7 @@ func gcpManagedNetworkConfigToPb(st *GcpManagedNetworkConfig) (*gcpManagedNetwor } pb := &gcpManagedNetworkConfigPb{} pb.GkeClusterPodIpRange = st.GkeClusterPodIpRange - pb.GkeClusterServiceIpRange = st.GkeClusterServiceIpRange - pb.SubnetCidr = st.SubnetCidr pb.ForceSendFields = st.ForceSendFields @@ -1042,11 +954,9 @@ func gcpManagedNetworkConfigToPb(st *GcpManagedNetworkConfig) (*gcpManagedNetwor } type gcpManagedNetworkConfigPb struct { - GkeClusterPodIpRange string `json:"gke_cluster_pod_ip_range,omitempty"` - + GkeClusterPodIpRange string `json:"gke_cluster_pod_ip_range,omitempty"` GkeClusterServiceIpRange string `json:"gke_cluster_service_ip_range,omitempty"` - - SubnetCidr string `json:"subnet_cidr,omitempty"` + SubnetCidr string `json:"subnet_cidr,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1078,32 +988,22 @@ func gcpNetworkInfoToPb(st *GcpNetworkInfo) (*gcpNetworkInfoPb, error) { } pb := &gcpNetworkInfoPb{} pb.NetworkProjectId = st.NetworkProjectId - pb.PodIpRangeName = st.PodIpRangeName - pb.ServiceIpRangeName = st.ServiceIpRangeName - pb.SubnetId = st.SubnetId - pb.SubnetRegion = st.SubnetRegion - pb.VpcId = st.VpcId return pb, nil } type gcpNetworkInfoPb struct { - NetworkProjectId string `json:"network_project_id"` - - PodIpRangeName string `json:"pod_ip_range_name"` - + NetworkProjectId string `json:"network_project_id"` + PodIpRangeName string `json:"pod_ip_range_name"` ServiceIpRangeName string `json:"service_ip_range_name"` - - SubnetId string `json:"subnet_id"` - - SubnetRegion string `json:"subnet_region"` - - VpcId string `json:"vpc_id"` + SubnetId string `json:"subnet_id"` + SubnetRegion string `json:"subnet_region"` + VpcId string `json:"vpc_id"` } func gcpNetworkInfoFromPb(pb *gcpNetworkInfoPb) (*GcpNetworkInfo, error) { @@ -1127,13 +1027,9 @@ func gcpVpcEndpointInfoToPb(st *GcpVpcEndpointInfo) (*gcpVpcEndpointInfoPb, erro } pb := &gcpVpcEndpointInfoPb{} pb.EndpointRegion = st.EndpointRegion - pb.ProjectId = st.ProjectId - pb.PscConnectionId = st.PscConnectionId - pb.PscEndpointName = st.PscEndpointName - pb.ServiceAttachmentId = st.ServiceAttachmentId pb.ForceSendFields = st.ForceSendFields @@ -1141,14 +1037,10 @@ func gcpVpcEndpointInfoToPb(st *GcpVpcEndpointInfo) (*gcpVpcEndpointInfoPb, erro } type gcpVpcEndpointInfoPb struct { - EndpointRegion string `json:"endpoint_region"` - - ProjectId string `json:"project_id"` - - PscConnectionId string `json:"psc_connection_id,omitempty"` - - PscEndpointName string `json:"psc_endpoint_name"` - + EndpointRegion string `json:"endpoint_region"` + ProjectId string `json:"project_id"` + PscConnectionId string `json:"psc_connection_id,omitempty"` + PscEndpointName string `json:"psc_endpoint_name"` ServiceAttachmentId string `json:"service_attachment_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1351,7 +1243,6 @@ func gkeConfigToPb(st *GkeConfig) (*gkeConfigPb, error) { } pb := &gkeConfigPb{} pb.ConnectivityType = st.ConnectivityType - pb.MasterIpRange = st.MasterIpRange pb.ForceSendFields = st.ForceSendFields @@ -1360,8 +1251,7 @@ func gkeConfigToPb(st *GkeConfig) (*gkeConfigPb, error) { type gkeConfigPb struct { ConnectivityType GkeConfigConnectivityType `json:"connectivity_type,omitempty"` - - MasterIpRange string `json:"master_ip_range,omitempty"` + MasterIpRange string `json:"master_ip_range,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1392,29 +1282,17 @@ func networkToPb(st *Network) (*networkPb, error) { } pb := &networkPb{} pb.AccountId = st.AccountId - pb.CreationTime = st.CreationTime - pb.ErrorMessages = st.ErrorMessages - pb.GcpNetworkInfo = st.GcpNetworkInfo - pb.NetworkId = st.NetworkId - pb.NetworkName = st.NetworkName - pb.SecurityGroupIds = st.SecurityGroupIds - pb.SubnetIds = st.SubnetIds - pb.VpcEndpoints = st.VpcEndpoints - pb.VpcId = st.VpcId - pb.VpcStatus = st.VpcStatus - pb.WarningMessages = st.WarningMessages - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -1422,31 +1300,19 @@ func networkToPb(st *Network) (*networkPb, error) { } type networkPb struct { - AccountId string `json:"account_id,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - ErrorMessages []NetworkHealth `json:"error_messages,omitempty"` - - GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` - - NetworkId string `json:"network_id,omitempty"` - - NetworkName string `json:"network_name,omitempty"` - - SecurityGroupIds []string `json:"security_group_ids,omitempty"` - - SubnetIds []string `json:"subnet_ids,omitempty"` - - VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` - - VpcId string `json:"vpc_id,omitempty"` - - VpcStatus VpcStatus `json:"vpc_status,omitempty"` - - WarningMessages []NetworkWarning `json:"warning_messages,omitempty"` - - WorkspaceId int64 `json:"workspace_id,omitempty"` + AccountId string `json:"account_id,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + ErrorMessages []NetworkHealth `json:"error_messages,omitempty"` + GcpNetworkInfo *GcpNetworkInfo `json:"gcp_network_info,omitempty"` + NetworkId string `json:"network_id,omitempty"` + NetworkName string `json:"network_name,omitempty"` + SecurityGroupIds []string `json:"security_group_ids,omitempty"` + SubnetIds []string `json:"subnet_ids,omitempty"` + VpcEndpoints *NetworkVpcEndpoints `json:"vpc_endpoints,omitempty"` + VpcId string `json:"vpc_id,omitempty"` + VpcStatus VpcStatus `json:"vpc_status,omitempty"` + WarningMessages []NetworkWarning `json:"warning_messages,omitempty"` + WorkspaceId int64 `json:"workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1488,7 +1354,6 @@ func networkHealthToPb(st *NetworkHealth) (*networkHealthPb, error) { } pb := &networkHealthPb{} pb.ErrorMessage = st.ErrorMessage - pb.ErrorType = st.ErrorType pb.ForceSendFields = st.ForceSendFields @@ -1496,9 +1361,8 @@ func networkHealthToPb(st *NetworkHealth) (*networkHealthPb, error) { } type networkHealthPb struct { - ErrorMessage string `json:"error_message,omitempty"` - - ErrorType ErrorType `json:"error_type,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` + ErrorType ErrorType `json:"error_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1529,7 +1393,6 @@ func networkVpcEndpointsToPb(st *NetworkVpcEndpoints) (*networkVpcEndpointsPb, e } pb := &networkVpcEndpointsPb{} pb.DataplaneRelay = st.DataplaneRelay - pb.RestApi = st.RestApi return pb, nil @@ -1537,8 +1400,7 @@ func networkVpcEndpointsToPb(st *NetworkVpcEndpoints) (*networkVpcEndpointsPb, e type networkVpcEndpointsPb struct { DataplaneRelay []string `json:"dataplane_relay"` - - RestApi []string `json:"rest_api"` + RestApi []string `json:"rest_api"` } func networkVpcEndpointsFromPb(pb *networkVpcEndpointsPb) (*NetworkVpcEndpoints, error) { @@ -1558,7 +1420,6 @@ func networkWarningToPb(st *NetworkWarning) (*networkWarningPb, error) { } pb := &networkWarningPb{} pb.WarningMessage = st.WarningMessage - pb.WarningType = st.WarningType pb.ForceSendFields = st.ForceSendFields @@ -1566,9 +1427,8 @@ func networkWarningToPb(st *NetworkWarning) (*networkWarningPb, error) { } type networkWarningPb struct { - WarningMessage string `json:"warning_message,omitempty"` - - WarningType WarningType `json:"warning_type,omitempty"` + WarningMessage string `json:"warning_message,omitempty"` + WarningType WarningType `json:"warning_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1599,17 +1459,11 @@ func privateAccessSettingsToPb(st *PrivateAccessSettings) (*privateAccessSetting } pb := &privateAccessSettingsPb{} pb.AccountId = st.AccountId - pb.AllowedVpcEndpointIds = st.AllowedVpcEndpointIds - pb.PrivateAccessLevel = st.PrivateAccessLevel - pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId - pb.PrivateAccessSettingsName = st.PrivateAccessSettingsName - pb.PublicAccessEnabled = st.PublicAccessEnabled - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -1617,19 +1471,13 @@ func privateAccessSettingsToPb(st *PrivateAccessSettings) (*privateAccessSetting } type privateAccessSettingsPb struct { - AccountId string `json:"account_id,omitempty"` - - AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` - - PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` - - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` - - PrivateAccessSettingsName string `json:"private_access_settings_name,omitempty"` - - PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` - - Region string `json:"region,omitempty"` + AccountId string `json:"account_id,omitempty"` + AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + PrivateAccessSettingsName string `json:"private_access_settings_name,omitempty"` + PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + Region string `json:"region,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1722,13 +1570,9 @@ func storageConfigurationToPb(st *StorageConfiguration) (*storageConfigurationPb } pb := &storageConfigurationPb{} pb.AccountId = st.AccountId - pb.CreationTime = st.CreationTime - pb.RootBucketInfo = st.RootBucketInfo - pb.StorageConfigurationId = st.StorageConfigurationId - pb.StorageConfigurationName = st.StorageConfigurationName pb.ForceSendFields = st.ForceSendFields @@ -1736,15 +1580,11 @@ func storageConfigurationToPb(st *StorageConfiguration) (*storageConfigurationPb } type storageConfigurationPb struct { - AccountId string `json:"account_id,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - RootBucketInfo *RootBucketInfo `json:"root_bucket_info,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` - - StorageConfigurationName string `json:"storage_configuration_name,omitempty"` + AccountId string `json:"account_id,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + RootBucketInfo *RootBucketInfo `json:"root_bucket_info,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + StorageConfigurationName string `json:"storage_configuration_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1778,7 +1618,6 @@ func stsRoleToPb(st *StsRole) (*stsRolePb, error) { } pb := &stsRolePb{} pb.ExternalId = st.ExternalId - pb.RoleArn = st.RoleArn pb.ForceSendFields = st.ForceSendFields @@ -1787,8 +1626,7 @@ func stsRoleToPb(st *StsRole) (*stsRolePb, error) { type stsRolePb struct { ExternalId string `json:"external_id,omitempty"` - - RoleArn string `json:"role_arn,omitempty"` + RoleArn string `json:"role_arn,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1840,23 +1678,14 @@ func updateWorkspaceRequestToPb(st *UpdateWorkspaceRequest) (*updateWorkspaceReq } pb := &updateWorkspaceRequestPb{} pb.AwsRegion = st.AwsRegion - pb.CredentialsId = st.CredentialsId - pb.CustomTags = st.CustomTags - pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId - pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.NetworkId = st.NetworkId - pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId - pb.StorageConfigurationId = st.StorageConfigurationId - pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -1864,25 +1693,16 @@ func updateWorkspaceRequestToPb(st *UpdateWorkspaceRequest) (*updateWorkspaceReq } type updateWorkspaceRequestPb struct { - AwsRegion string `json:"aws_region,omitempty"` - - CredentialsId string `json:"credentials_id,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` - - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` - - NetworkId string `json:"network_id,omitempty"` - - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` - - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` - - WorkspaceId int64 `json:"-" url:"-"` + AwsRegion string `json:"aws_region,omitempty"` + CredentialsId string `json:"credentials_id,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + NetworkId string `json:"network_id,omitempty"` + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + WorkspaceId int64 `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1921,15 +1741,10 @@ func upsertPrivateAccessSettingsRequestToPb(st *UpsertPrivateAccessSettingsReque } pb := &upsertPrivateAccessSettingsRequestPb{} pb.AllowedVpcEndpointIds = st.AllowedVpcEndpointIds - pb.PrivateAccessLevel = st.PrivateAccessLevel - pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId - pb.PrivateAccessSettingsName = st.PrivateAccessSettingsName - pb.PublicAccessEnabled = st.PublicAccessEnabled - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -1937,17 +1752,12 @@ func upsertPrivateAccessSettingsRequestToPb(st *UpsertPrivateAccessSettingsReque } type upsertPrivateAccessSettingsRequestPb struct { - AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` - - PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` - - PrivateAccessSettingsId string `json:"-" url:"-"` - - PrivateAccessSettingsName string `json:"private_access_settings_name"` - - PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` - - Region string `json:"region"` + AllowedVpcEndpointIds []string `json:"allowed_vpc_endpoint_ids,omitempty"` + PrivateAccessLevel PrivateAccessLevel `json:"private_access_level,omitempty"` + PrivateAccessSettingsId string `json:"-" url:"-"` + PrivateAccessSettingsName string `json:"private_access_settings_name"` + PublicAccessEnabled bool `json:"public_access_enabled,omitempty"` + Region string `json:"region"` ForceSendFields []string `json:"-" url:"-"` } @@ -1982,23 +1792,14 @@ func vpcEndpointToPb(st *VpcEndpoint) (*vpcEndpointPb, error) { } pb := &vpcEndpointPb{} pb.AccountId = st.AccountId - pb.AwsAccountId = st.AwsAccountId - pb.AwsEndpointServiceId = st.AwsEndpointServiceId - pb.AwsVpcEndpointId = st.AwsVpcEndpointId - pb.GcpVpcEndpointInfo = st.GcpVpcEndpointInfo - pb.Region = st.Region - pb.State = st.State - pb.UseCase = st.UseCase - pb.VpcEndpointId = st.VpcEndpointId - pb.VpcEndpointName = st.VpcEndpointName pb.ForceSendFields = st.ForceSendFields @@ -2006,25 +1807,16 @@ func vpcEndpointToPb(st *VpcEndpoint) (*vpcEndpointPb, error) { } type vpcEndpointPb struct { - AccountId string `json:"account_id,omitempty"` - - AwsAccountId string `json:"aws_account_id,omitempty"` - - AwsEndpointServiceId string `json:"aws_endpoint_service_id,omitempty"` - - AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` - - GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` - - Region string `json:"region,omitempty"` - - State string `json:"state,omitempty"` - - UseCase EndpointUseCase `json:"use_case,omitempty"` - - VpcEndpointId string `json:"vpc_endpoint_id,omitempty"` - - VpcEndpointName string `json:"vpc_endpoint_name,omitempty"` + AccountId string `json:"account_id,omitempty"` + AwsAccountId string `json:"aws_account_id,omitempty"` + AwsEndpointServiceId string `json:"aws_endpoint_service_id,omitempty"` + AwsVpcEndpointId string `json:"aws_vpc_endpoint_id,omitempty"` + GcpVpcEndpointInfo *GcpVpcEndpointInfo `json:"gcp_vpc_endpoint_info,omitempty"` + Region string `json:"region,omitempty"` + State string `json:"state,omitempty"` + UseCase EndpointUseCase `json:"use_case,omitempty"` + VpcEndpointId string `json:"vpc_endpoint_id,omitempty"` + VpcEndpointName string `json:"vpc_endpoint_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2063,51 +1855,28 @@ func workspaceToPb(st *Workspace) (*workspacePb, error) { } pb := &workspacePb{} pb.AccountId = st.AccountId - pb.AwsRegion = st.AwsRegion - pb.AzureWorkspaceInfo = st.AzureWorkspaceInfo - pb.Cloud = st.Cloud - pb.CloudResourceContainer = st.CloudResourceContainer - pb.CreationTime = st.CreationTime - pb.CredentialsId = st.CredentialsId - pb.CustomTags = st.CustomTags - pb.DeploymentName = st.DeploymentName - pb.ExternalCustomerInfo = st.ExternalCustomerInfo - pb.GcpManagedNetworkConfig = st.GcpManagedNetworkConfig - pb.GkeConfig = st.GkeConfig - pb.IsNoPublicIpEnabled = st.IsNoPublicIpEnabled - pb.Location = st.Location - pb.ManagedServicesCustomerManagedKeyId = st.ManagedServicesCustomerManagedKeyId - pb.NetworkId = st.NetworkId - pb.PricingTier = st.PricingTier - pb.PrivateAccessSettingsId = st.PrivateAccessSettingsId - pb.StorageConfigurationId = st.StorageConfigurationId - pb.StorageCustomerManagedKeyId = st.StorageCustomerManagedKeyId - pb.WorkspaceId = st.WorkspaceId - pb.WorkspaceName = st.WorkspaceName - pb.WorkspaceStatus = st.WorkspaceStatus - pb.WorkspaceStatusMessage = st.WorkspaceStatusMessage pb.ForceSendFields = st.ForceSendFields @@ -2115,53 +1884,30 @@ func workspaceToPb(st *Workspace) (*workspacePb, error) { } type workspacePb struct { - AccountId string `json:"account_id,omitempty"` - - AwsRegion string `json:"aws_region,omitempty"` - - AzureWorkspaceInfo *AzureWorkspaceInfo `json:"azure_workspace_info,omitempty"` - - Cloud string `json:"cloud,omitempty"` - - CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - CredentialsId string `json:"credentials_id,omitempty"` - - CustomTags map[string]string `json:"custom_tags,omitempty"` - - DeploymentName string `json:"deployment_name,omitempty"` - - ExternalCustomerInfo *ExternalCustomerInfo `json:"external_customer_info,omitempty"` - - GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` - - GkeConfig *GkeConfig `json:"gke_config,omitempty"` - - IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` - - Location string `json:"location,omitempty"` - - ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` - - NetworkId string `json:"network_id,omitempty"` - - PricingTier PricingTier `json:"pricing_tier,omitempty"` - - PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` - - StorageConfigurationId string `json:"storage_configuration_id,omitempty"` - - StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` - - WorkspaceId int64 `json:"workspace_id,omitempty"` - - WorkspaceName string `json:"workspace_name,omitempty"` - - WorkspaceStatus WorkspaceStatus `json:"workspace_status,omitempty"` - - WorkspaceStatusMessage string `json:"workspace_status_message,omitempty"` + AccountId string `json:"account_id,omitempty"` + AwsRegion string `json:"aws_region,omitempty"` + AzureWorkspaceInfo *AzureWorkspaceInfo `json:"azure_workspace_info,omitempty"` + Cloud string `json:"cloud,omitempty"` + CloudResourceContainer *CloudResourceContainer `json:"cloud_resource_container,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + CredentialsId string `json:"credentials_id,omitempty"` + CustomTags map[string]string `json:"custom_tags,omitempty"` + DeploymentName string `json:"deployment_name,omitempty"` + ExternalCustomerInfo *ExternalCustomerInfo `json:"external_customer_info,omitempty"` + GcpManagedNetworkConfig *GcpManagedNetworkConfig `json:"gcp_managed_network_config,omitempty"` + GkeConfig *GkeConfig `json:"gke_config,omitempty"` + IsNoPublicIpEnabled bool `json:"is_no_public_ip_enabled,omitempty"` + Location string `json:"location,omitempty"` + ManagedServicesCustomerManagedKeyId string `json:"managed_services_customer_managed_key_id,omitempty"` + NetworkId string `json:"network_id,omitempty"` + PricingTier PricingTier `json:"pricing_tier,omitempty"` + PrivateAccessSettingsId string `json:"private_access_settings_id,omitempty"` + StorageConfigurationId string `json:"storage_configuration_id,omitempty"` + StorageCustomerManagedKeyId string `json:"storage_customer_managed_key_id,omitempty"` + WorkspaceId int64 `json:"workspace_id,omitempty"` + WorkspaceName string `json:"workspace_name,omitempty"` + WorkspaceStatus WorkspaceStatus `json:"workspace_status,omitempty"` + WorkspaceStatusMessage string `json:"workspace_status_message,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2207,3 +1953,57 @@ func (st *workspacePb) UnmarshalJSON(b []byte) error { func (st workspacePb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/provisioning/model.go b/service/provisioning/model.go index 13f20114b..a265f25d0 100755 --- a/service/provisioning/model.go +++ b/service/provisioning/model.go @@ -5,8 +5,6 @@ package provisioning import ( "encoding/json" "fmt" - "strings" - "time" ) type AwsCredentials struct { @@ -2646,57 +2644,3 @@ func (f *WorkspaceStatus) Set(v string) error { func (f *WorkspaceStatus) Type() string { return "WorkspaceStatus" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/qualitymonitor/internal.go b/service/qualitymonitor/internal.go index 51a8ae6e4..1a6be8e63 100755 --- a/service/qualitymonitor/internal.go +++ b/service/qualitymonitor/internal.go @@ -3,6 +3,10 @@ package qualitymonitor import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,11 +16,8 @@ func anomalyDetectionConfigToPb(st *AnomalyDetectionConfig) (*anomalyDetectionCo } pb := &anomalyDetectionConfigPb{} pb.AnomalyDetectionWorkflowId = st.AnomalyDetectionWorkflowId - pb.LastRunId = st.LastRunId - pb.LatestRunStatus = st.LatestRunStatus - pb.PublishHealthIndicator = st.PublishHealthIndicator pb.ForceSendFields = st.ForceSendFields @@ -24,13 +25,10 @@ func anomalyDetectionConfigToPb(st *AnomalyDetectionConfig) (*anomalyDetectionCo } type anomalyDetectionConfigPb struct { - AnomalyDetectionWorkflowId int64 `json:"anomaly_detection_workflow_id,omitempty"` - - LastRunId string `json:"last_run_id,omitempty"` - - LatestRunStatus AnomalyDetectionRunStatus `json:"latest_run_status,omitempty"` - - PublishHealthIndicator bool `json:"publish_health_indicator,omitempty"` + AnomalyDetectionWorkflowId int64 `json:"anomaly_detection_workflow_id,omitempty"` + LastRunId string `json:"last_run_id,omitempty"` + LatestRunStatus AnomalyDetectionRunStatus `json:"latest_run_status,omitempty"` + PublishHealthIndicator bool `json:"publish_health_indicator,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -87,15 +85,13 @@ func deleteQualityMonitorRequestToPb(st *DeleteQualityMonitorRequest) (*deleteQu } pb := &deleteQualityMonitorRequestPb{} pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType return pb, nil } type deleteQualityMonitorRequestPb struct { - ObjectId string `json:"-" url:"-"` - + ObjectId string `json:"-" url:"-"` ObjectType string `json:"-" url:"-"` } @@ -137,15 +133,13 @@ func getQualityMonitorRequestToPb(st *GetQualityMonitorRequest) (*getQualityMoni } pb := &getQualityMonitorRequestPb{} pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType return pb, nil } type getQualityMonitorRequestPb struct { - ObjectId string `json:"-" url:"-"` - + ObjectId string `json:"-" url:"-"` ObjectType string `json:"-" url:"-"` } @@ -166,7 +160,6 @@ func listQualityMonitorRequestToPb(st *ListQualityMonitorRequest) (*listQualityM } pb := &listQualityMonitorRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -174,8 +167,7 @@ func listQualityMonitorRequestToPb(st *ListQualityMonitorRequest) (*listQualityM } type listQualityMonitorRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -207,7 +199,6 @@ func listQualityMonitorResponseToPb(st *ListQualityMonitorResponse) (*listQualit } pb := &listQualityMonitorResponsePb{} pb.NextPageToken = st.NextPageToken - pb.QualityMonitors = st.QualityMonitors pb.ForceSendFields = st.ForceSendFields @@ -215,8 +206,7 @@ func listQualityMonitorResponseToPb(st *ListQualityMonitorResponse) (*listQualit } type listQualityMonitorResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` QualityMonitors []QualityMonitor `json:"quality_monitors,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -248,9 +238,7 @@ func qualityMonitorToPb(st *QualityMonitor) (*qualityMonitorPb, error) { } pb := &qualityMonitorPb{} pb.AnomalyDetectionConfig = st.AnomalyDetectionConfig - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType return pb, nil @@ -258,10 +246,8 @@ func qualityMonitorToPb(st *QualityMonitor) (*qualityMonitorPb, error) { type qualityMonitorPb struct { AnomalyDetectionConfig *AnomalyDetectionConfig `json:"anomaly_detection_config,omitempty"` - - ObjectId string `json:"object_id"` - - ObjectType string `json:"object_type"` + ObjectId string `json:"object_id"` + ObjectType string `json:"object_type"` } func qualityMonitorFromPb(pb *qualityMonitorPb) (*QualityMonitor, error) { @@ -282,19 +268,15 @@ func updateQualityMonitorRequestToPb(st *UpdateQualityMonitorRequest) (*updateQu } pb := &updateQualityMonitorRequestPb{} pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType - pb.QualityMonitor = st.QualityMonitor return pb, nil } type updateQualityMonitorRequestPb struct { - ObjectId string `json:"-" url:"-"` - - ObjectType string `json:"-" url:"-"` - + ObjectId string `json:"-" url:"-"` + ObjectType string `json:"-" url:"-"` QualityMonitor QualityMonitor `json:"quality_monitor"` } @@ -309,3 +291,57 @@ func updateQualityMonitorRequestFromPb(pb *updateQualityMonitorRequestPb) (*Upda return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/qualitymonitor/model.go b/service/qualitymonitor/model.go index b90a3adae..3b2a4333d 100755 --- a/service/qualitymonitor/model.go +++ b/service/qualitymonitor/model.go @@ -5,8 +5,6 @@ package qualitymonitor import ( "encoding/json" "fmt" - "strings" - "time" ) type AnomalyDetectionConfig struct { @@ -370,57 +368,3 @@ func (st UpdateQualityMonitorRequest) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/serving/internal.go b/service/serving/internal.go index cf9384470..7e56ea331 100755 --- a/service/serving/internal.go +++ b/service/serving/internal.go @@ -3,7 +3,10 @@ package serving import ( + "fmt" "io" + "strings" + "time" "github.com/databricks/databricks-sdk-go/marshal" ) @@ -14,7 +17,6 @@ func ai21LabsConfigToPb(st *Ai21LabsConfig) (*ai21LabsConfigPb, error) { } pb := &ai21LabsConfigPb{} pb.Ai21labsApiKey = st.Ai21labsApiKey - pb.Ai21labsApiKeyPlaintext = st.Ai21labsApiKeyPlaintext pb.ForceSendFields = st.ForceSendFields @@ -22,8 +24,7 @@ func ai21LabsConfigToPb(st *Ai21LabsConfig) (*ai21LabsConfigPb, error) { } type ai21LabsConfigPb struct { - Ai21labsApiKey string `json:"ai21labs_api_key,omitempty"` - + Ai21labsApiKey string `json:"ai21labs_api_key,omitempty"` Ai21labsApiKeyPlaintext string `json:"ai21labs_api_key_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -55,28 +56,20 @@ func aiGatewayConfigToPb(st *AiGatewayConfig) (*aiGatewayConfigPb, error) { } pb := &aiGatewayConfigPb{} pb.FallbackConfig = st.FallbackConfig - pb.Guardrails = st.Guardrails - pb.InferenceTableConfig = st.InferenceTableConfig - pb.RateLimits = st.RateLimits - pb.UsageTrackingConfig = st.UsageTrackingConfig return pb, nil } type aiGatewayConfigPb struct { - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` - - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` - + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` - - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` - - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` } func aiGatewayConfigFromPb(pb *aiGatewayConfigPb) (*AiGatewayConfig, error) { @@ -99,11 +92,8 @@ func aiGatewayGuardrailParametersToPb(st *AiGatewayGuardrailParameters) (*aiGate } pb := &aiGatewayGuardrailParametersPb{} pb.InvalidKeywords = st.InvalidKeywords - pb.Pii = st.Pii - pb.Safety = st.Safety - pb.ValidTopics = st.ValidTopics pb.ForceSendFields = st.ForceSendFields @@ -111,13 +101,10 @@ func aiGatewayGuardrailParametersToPb(st *AiGatewayGuardrailParameters) (*aiGate } type aiGatewayGuardrailParametersPb struct { - InvalidKeywords []string `json:"invalid_keywords,omitempty"` - - Pii *AiGatewayGuardrailPiiBehavior `json:"pii,omitempty"` - - Safety bool `json:"safety,omitempty"` - - ValidTopics []string `json:"valid_topics,omitempty"` + InvalidKeywords []string `json:"invalid_keywords,omitempty"` + Pii *AiGatewayGuardrailPiiBehavior `json:"pii,omitempty"` + Safety bool `json:"safety,omitempty"` + ValidTopics []string `json:"valid_topics,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -174,15 +161,13 @@ func aiGatewayGuardrailsToPb(st *AiGatewayGuardrails) (*aiGatewayGuardrailsPb, e } pb := &aiGatewayGuardrailsPb{} pb.Input = st.Input - pb.Output = st.Output return pb, nil } type aiGatewayGuardrailsPb struct { - Input *AiGatewayGuardrailParameters `json:"input,omitempty"` - + Input *AiGatewayGuardrailParameters `json:"input,omitempty"` Output *AiGatewayGuardrailParameters `json:"output,omitempty"` } @@ -203,11 +188,8 @@ func aiGatewayInferenceTableConfigToPb(st *AiGatewayInferenceTableConfig) (*aiGa } pb := &aiGatewayInferenceTableConfigPb{} pb.CatalogName = st.CatalogName - pb.Enabled = st.Enabled - pb.SchemaName = st.SchemaName - pb.TableNamePrefix = st.TableNamePrefix pb.ForceSendFields = st.ForceSendFields @@ -215,12 +197,9 @@ func aiGatewayInferenceTableConfigToPb(st *AiGatewayInferenceTableConfig) (*aiGa } type aiGatewayInferenceTableConfigPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - + CatalogName string `json:"catalog_name,omitempty"` + Enabled bool `json:"enabled,omitempty"` + SchemaName string `json:"schema_name,omitempty"` TableNamePrefix string `json:"table_name_prefix,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -254,19 +233,15 @@ func aiGatewayRateLimitToPb(st *AiGatewayRateLimit) (*aiGatewayRateLimitPb, erro } pb := &aiGatewayRateLimitPb{} pb.Calls = st.Calls - pb.Key = st.Key - pb.RenewalPeriod = st.RenewalPeriod return pb, nil } type aiGatewayRateLimitPb struct { - Calls int64 `json:"calls"` - - Key AiGatewayRateLimitKey `json:"key,omitempty"` - + Calls int64 `json:"calls"` + Key AiGatewayRateLimitKey `json:"key,omitempty"` RenewalPeriod AiGatewayRateLimitRenewalPeriod `json:"renewal_period"` } @@ -324,17 +299,11 @@ func amazonBedrockConfigToPb(st *AmazonBedrockConfig) (*amazonBedrockConfigPb, e } pb := &amazonBedrockConfigPb{} pb.AwsAccessKeyId = st.AwsAccessKeyId - pb.AwsAccessKeyIdPlaintext = st.AwsAccessKeyIdPlaintext - pb.AwsRegion = st.AwsRegion - pb.AwsSecretAccessKey = st.AwsSecretAccessKey - pb.AwsSecretAccessKeyPlaintext = st.AwsSecretAccessKeyPlaintext - pb.BedrockProvider = st.BedrockProvider - pb.InstanceProfileArn = st.InstanceProfileArn pb.ForceSendFields = st.ForceSendFields @@ -342,19 +311,13 @@ func amazonBedrockConfigToPb(st *AmazonBedrockConfig) (*amazonBedrockConfigPb, e } type amazonBedrockConfigPb struct { - AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` - - AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` - - AwsRegion string `json:"aws_region"` - - AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` - - AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` - - BedrockProvider AmazonBedrockConfigBedrockProvider `json:"bedrock_provider"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` + AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` + AwsRegion string `json:"aws_region"` + AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` + AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` + BedrockProvider AmazonBedrockConfigBedrockProvider `json:"bedrock_provider"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -390,7 +353,6 @@ func anthropicConfigToPb(st *AnthropicConfig) (*anthropicConfigPb, error) { } pb := &anthropicConfigPb{} pb.AnthropicApiKey = st.AnthropicApiKey - pb.AnthropicApiKeyPlaintext = st.AnthropicApiKeyPlaintext pb.ForceSendFields = st.ForceSendFields @@ -398,8 +360,7 @@ func anthropicConfigToPb(st *AnthropicConfig) (*anthropicConfigPb, error) { } type anthropicConfigPb struct { - AnthropicApiKey string `json:"anthropic_api_key,omitempty"` - + AnthropicApiKey string `json:"anthropic_api_key,omitempty"` AnthropicApiKeyPlaintext string `json:"anthropic_api_key_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -431,9 +392,7 @@ func apiKeyAuthToPb(st *ApiKeyAuth) (*apiKeyAuthPb, error) { } pb := &apiKeyAuthPb{} pb.Key = st.Key - pb.Value = st.Value - pb.ValuePlaintext = st.ValuePlaintext pb.ForceSendFields = st.ForceSendFields @@ -441,10 +400,8 @@ func apiKeyAuthToPb(st *ApiKeyAuth) (*apiKeyAuthPb, error) { } type apiKeyAuthPb struct { - Key string `json:"key"` - - Value string `json:"value,omitempty"` - + Key string `json:"key"` + Value string `json:"value,omitempty"` ValuePlaintext string `json:"value_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -477,11 +434,8 @@ func autoCaptureConfigInputToPb(st *AutoCaptureConfigInput) (*autoCaptureConfigI } pb := &autoCaptureConfigInputPb{} pb.CatalogName = st.CatalogName - pb.Enabled = st.Enabled - pb.SchemaName = st.SchemaName - pb.TableNamePrefix = st.TableNamePrefix pb.ForceSendFields = st.ForceSendFields @@ -489,12 +443,9 @@ func autoCaptureConfigInputToPb(st *AutoCaptureConfigInput) (*autoCaptureConfigI } type autoCaptureConfigInputPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - + CatalogName string `json:"catalog_name,omitempty"` + Enabled bool `json:"enabled,omitempty"` + SchemaName string `json:"schema_name,omitempty"` TableNamePrefix string `json:"table_name_prefix,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -528,13 +479,9 @@ func autoCaptureConfigOutputToPb(st *AutoCaptureConfigOutput) (*autoCaptureConfi } pb := &autoCaptureConfigOutputPb{} pb.CatalogName = st.CatalogName - pb.Enabled = st.Enabled - pb.SchemaName = st.SchemaName - pb.State = st.State - pb.TableNamePrefix = st.TableNamePrefix pb.ForceSendFields = st.ForceSendFields @@ -542,15 +489,11 @@ func autoCaptureConfigOutputToPb(st *AutoCaptureConfigOutput) (*autoCaptureConfi } type autoCaptureConfigOutputPb struct { - CatalogName string `json:"catalog_name,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` - - State *AutoCaptureState `json:"state,omitempty"` - - TableNamePrefix string `json:"table_name_prefix,omitempty"` + CatalogName string `json:"catalog_name,omitempty"` + Enabled bool `json:"enabled,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + State *AutoCaptureState `json:"state,omitempty"` + TableNamePrefix string `json:"table_name_prefix,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -608,7 +551,6 @@ func bearerTokenAuthToPb(st *BearerTokenAuth) (*bearerTokenAuthPb, error) { } pb := &bearerTokenAuthPb{} pb.Token = st.Token - pb.TokenPlaintext = st.TokenPlaintext pb.ForceSendFields = st.ForceSendFields @@ -616,8 +558,7 @@ func bearerTokenAuthToPb(st *BearerTokenAuth) (*bearerTokenAuthPb, error) { } type bearerTokenAuthPb struct { - Token string `json:"token,omitempty"` - + Token string `json:"token,omitempty"` TokenPlaintext string `json:"token_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -649,15 +590,13 @@ func buildLogsRequestToPb(st *BuildLogsRequest) (*buildLogsRequestPb, error) { } pb := &buildLogsRequestPb{} pb.Name = st.Name - pb.ServedModelName = st.ServedModelName return pb, nil } type buildLogsRequestPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` ServedModelName string `json:"-" url:"-"` } @@ -702,7 +641,6 @@ func chatMessageToPb(st *ChatMessage) (*chatMessagePb, error) { } pb := &chatMessagePb{} pb.Content = st.Content - pb.Role = st.Role pb.ForceSendFields = st.ForceSendFields @@ -710,9 +648,8 @@ func chatMessageToPb(st *ChatMessage) (*chatMessagePb, error) { } type chatMessagePb struct { - Content string `json:"content,omitempty"` - - Role ChatMessageRole `json:"role,omitempty"` + Content string `json:"content,omitempty"` + Role ChatMessageRole `json:"role,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -743,9 +680,7 @@ func cohereConfigToPb(st *CohereConfig) (*cohereConfigPb, error) { } pb := &cohereConfigPb{} pb.CohereApiBase = st.CohereApiBase - pb.CohereApiKey = st.CohereApiKey - pb.CohereApiKeyPlaintext = st.CohereApiKeyPlaintext pb.ForceSendFields = st.ForceSendFields @@ -753,10 +688,8 @@ func cohereConfigToPb(st *CohereConfig) (*cohereConfigPb, error) { } type cohereConfigPb struct { - CohereApiBase string `json:"cohere_api_base,omitempty"` - - CohereApiKey string `json:"cohere_api_key,omitempty"` - + CohereApiBase string `json:"cohere_api_base,omitempty"` + CohereApiKey string `json:"cohere_api_key,omitempty"` CohereApiKeyPlaintext string `json:"cohere_api_key_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -789,13 +722,9 @@ func createPtEndpointRequestToPb(st *CreatePtEndpointRequest) (*createPtEndpoint } pb := &createPtEndpointRequestPb{} pb.AiGateway = st.AiGateway - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Config = st.Config - pb.Name = st.Name - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -803,15 +732,11 @@ func createPtEndpointRequestToPb(st *CreatePtEndpointRequest) (*createPtEndpoint } type createPtEndpointRequestPb struct { - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Config PtEndpointCoreConfig `json:"config"` - - Name string `json:"name"` - - Tags []EndpointTag `json:"tags,omitempty"` + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Config PtEndpointCoreConfig `json:"config"` + Name string `json:"name"` + Tags []EndpointTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -845,17 +770,11 @@ func createServingEndpointToPb(st *CreateServingEndpoint) (*createServingEndpoin } pb := &createServingEndpointPb{} pb.AiGateway = st.AiGateway - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Config = st.Config - pb.Name = st.Name - pb.RateLimits = st.RateLimits - pb.RouteOptimized = st.RouteOptimized - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -863,19 +782,13 @@ func createServingEndpointToPb(st *CreateServingEndpoint) (*createServingEndpoin } type createServingEndpointPb struct { - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Config *EndpointCoreConfigInput `json:"config,omitempty"` - - Name string `json:"name"` - - RateLimits []RateLimit `json:"rate_limits,omitempty"` - - RouteOptimized bool `json:"route_optimized,omitempty"` - - Tags []EndpointTag `json:"tags,omitempty"` + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Config *EndpointCoreConfigInput `json:"config,omitempty"` + Name string `json:"name"` + RateLimits []RateLimit `json:"rate_limits,omitempty"` + RouteOptimized bool `json:"route_optimized,omitempty"` + Tags []EndpointTag `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -911,20 +824,16 @@ func customProviderConfigToPb(st *CustomProviderConfig) (*customProviderConfigPb } pb := &customProviderConfigPb{} pb.ApiKeyAuth = st.ApiKeyAuth - pb.BearerTokenAuth = st.BearerTokenAuth - pb.CustomProviderUrl = st.CustomProviderUrl return pb, nil } type customProviderConfigPb struct { - ApiKeyAuth *ApiKeyAuth `json:"api_key_auth,omitempty"` - - BearerTokenAuth *BearerTokenAuth `json:"bearer_token_auth,omitempty"` - - CustomProviderUrl string `json:"custom_provider_url"` + ApiKeyAuth *ApiKeyAuth `json:"api_key_auth,omitempty"` + BearerTokenAuth *BearerTokenAuth `json:"bearer_token_auth,omitempty"` + CustomProviderUrl string `json:"custom_provider_url"` } func customProviderConfigFromPb(pb *customProviderConfigPb) (*CustomProviderConfig, error) { @@ -945,7 +854,6 @@ func dataPlaneInfoToPb(st *DataPlaneInfo) (*dataPlaneInfoPb, error) { } pb := &dataPlaneInfoPb{} pb.AuthorizationDetails = st.AuthorizationDetails - pb.EndpointUrl = st.EndpointUrl pb.ForceSendFields = st.ForceSendFields @@ -954,8 +862,7 @@ func dataPlaneInfoToPb(st *DataPlaneInfo) (*dataPlaneInfoPb, error) { type dataPlaneInfoPb struct { AuthorizationDetails string `json:"authorization_details,omitempty"` - - EndpointUrl string `json:"endpoint_url,omitempty"` + EndpointUrl string `json:"endpoint_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -986,9 +893,7 @@ func databricksModelServingConfigToPb(st *DatabricksModelServingConfig) (*databr } pb := &databricksModelServingConfigPb{} pb.DatabricksApiToken = st.DatabricksApiToken - pb.DatabricksApiTokenPlaintext = st.DatabricksApiTokenPlaintext - pb.DatabricksWorkspaceUrl = st.DatabricksWorkspaceUrl pb.ForceSendFields = st.ForceSendFields @@ -996,11 +901,9 @@ func databricksModelServingConfigToPb(st *DatabricksModelServingConfig) (*databr } type databricksModelServingConfigPb struct { - DatabricksApiToken string `json:"databricks_api_token,omitempty"` - + DatabricksApiToken string `json:"databricks_api_token,omitempty"` DatabricksApiTokenPlaintext string `json:"databricks_api_token_plaintext,omitempty"` - - DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` + DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` ForceSendFields []string `json:"-" url:"-"` } @@ -1032,9 +935,7 @@ func dataframeSplitInputToPb(st *DataframeSplitInput) (*dataframeSplitInputPb, e } pb := &dataframeSplitInputPb{} pb.Columns = st.Columns - pb.Data = st.Data - pb.Index = st.Index return pb, nil @@ -1042,10 +943,8 @@ func dataframeSplitInputToPb(st *DataframeSplitInput) (*dataframeSplitInputPb, e type dataframeSplitInputPb struct { Columns []any `json:"columns,omitempty"` - - Data []any `json:"data,omitempty"` - - Index []int `json:"index,omitempty"` + Data []any `json:"data,omitempty"` + Index []int `json:"index,omitempty"` } func dataframeSplitInputFromPb(pb *dataframeSplitInputPb) (*DataframeSplitInput, error) { @@ -1111,9 +1010,7 @@ func embeddingsV1ResponseEmbeddingElementToPb(st *EmbeddingsV1ResponseEmbeddingE } pb := &embeddingsV1ResponseEmbeddingElementPb{} pb.Embedding = st.Embedding - pb.Index = st.Index - pb.Object = st.Object pb.ForceSendFields = st.ForceSendFields @@ -1121,11 +1018,9 @@ func embeddingsV1ResponseEmbeddingElementToPb(st *EmbeddingsV1ResponseEmbeddingE } type embeddingsV1ResponseEmbeddingElementPb struct { - Embedding []float64 `json:"embedding,omitempty"` - - Index int `json:"index,omitempty"` - - Object EmbeddingsV1ResponseEmbeddingElementObject `json:"object,omitempty"` + Embedding []float64 `json:"embedding,omitempty"` + Index int `json:"index,omitempty"` + Object EmbeddingsV1ResponseEmbeddingElementObject `json:"object,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1157,13 +1052,9 @@ func endpointCoreConfigInputToPb(st *EndpointCoreConfigInput) (*endpointCoreConf } pb := &endpointCoreConfigInputPb{} pb.AutoCaptureConfig = st.AutoCaptureConfig - pb.Name = st.Name - pb.ServedEntities = st.ServedEntities - pb.ServedModels = st.ServedModels - pb.TrafficConfig = st.TrafficConfig return pb, nil @@ -1171,14 +1062,10 @@ func endpointCoreConfigInputToPb(st *EndpointCoreConfigInput) (*endpointCoreConf type endpointCoreConfigInputPb struct { AutoCaptureConfig *AutoCaptureConfigInput `json:"auto_capture_config,omitempty"` - - Name string `json:"-" url:"-"` - - ServedEntities []ServedEntityInput `json:"served_entities,omitempty"` - - ServedModels []ServedModelInput `json:"served_models,omitempty"` - - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + Name string `json:"-" url:"-"` + ServedEntities []ServedEntityInput `json:"served_entities,omitempty"` + ServedModels []ServedModelInput `json:"served_models,omitempty"` + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` } func endpointCoreConfigInputFromPb(pb *endpointCoreConfigInputPb) (*EndpointCoreConfigInput, error) { @@ -1201,13 +1088,9 @@ func endpointCoreConfigOutputToPb(st *EndpointCoreConfigOutput) (*endpointCoreCo } pb := &endpointCoreConfigOutputPb{} pb.AutoCaptureConfig = st.AutoCaptureConfig - pb.ConfigVersion = st.ConfigVersion - pb.ServedEntities = st.ServedEntities - pb.ServedModels = st.ServedModels - pb.TrafficConfig = st.TrafficConfig pb.ForceSendFields = st.ForceSendFields @@ -1216,14 +1099,10 @@ func endpointCoreConfigOutputToPb(st *EndpointCoreConfigOutput) (*endpointCoreCo type endpointCoreConfigOutputPb struct { AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` - - ConfigVersion int64 `json:"config_version,omitempty"` - - ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` - - ServedModels []ServedModelOutput `json:"served_models,omitempty"` - - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + ConfigVersion int64 `json:"config_version,omitempty"` + ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + ServedModels []ServedModelOutput `json:"served_models,omitempty"` + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1257,7 +1136,6 @@ func endpointCoreConfigSummaryToPb(st *EndpointCoreConfigSummary) (*endpointCore } pb := &endpointCoreConfigSummaryPb{} pb.ServedEntities = st.ServedEntities - pb.ServedModels = st.ServedModels return pb, nil @@ -1265,8 +1143,7 @@ func endpointCoreConfigSummaryToPb(st *EndpointCoreConfigSummary) (*endpointCore type endpointCoreConfigSummaryPb struct { ServedEntities []ServedEntitySpec `json:"served_entities,omitempty"` - - ServedModels []ServedModelSpec `json:"served_models,omitempty"` + ServedModels []ServedModelSpec `json:"served_models,omitempty"` } func endpointCoreConfigSummaryFromPb(pb *endpointCoreConfigSummaryPb) (*EndpointCoreConfigSummary, error) { @@ -1286,15 +1163,10 @@ func endpointPendingConfigToPb(st *EndpointPendingConfig) (*endpointPendingConfi } pb := &endpointPendingConfigPb{} pb.AutoCaptureConfig = st.AutoCaptureConfig - pb.ConfigVersion = st.ConfigVersion - pb.ServedEntities = st.ServedEntities - pb.ServedModels = st.ServedModels - pb.StartTime = st.StartTime - pb.TrafficConfig = st.TrafficConfig pb.ForceSendFields = st.ForceSendFields @@ -1303,16 +1175,11 @@ func endpointPendingConfigToPb(st *EndpointPendingConfig) (*endpointPendingConfi type endpointPendingConfigPb struct { AutoCaptureConfig *AutoCaptureConfigOutput `json:"auto_capture_config,omitempty"` - - ConfigVersion int `json:"config_version,omitempty"` - - ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` - - ServedModels []ServedModelOutput `json:"served_models,omitempty"` - - StartTime int64 `json:"start_time,omitempty"` - - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + ConfigVersion int `json:"config_version,omitempty"` + ServedEntities []ServedEntityOutput `json:"served_entities,omitempty"` + ServedModels []ServedModelOutput `json:"served_models,omitempty"` + StartTime int64 `json:"start_time,omitempty"` + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1347,7 +1214,6 @@ func endpointStateToPb(st *EndpointState) (*endpointStatePb, error) { } pb := &endpointStatePb{} pb.ConfigUpdate = st.ConfigUpdate - pb.Ready = st.Ready return pb, nil @@ -1355,8 +1221,7 @@ func endpointStateToPb(st *EndpointState) (*endpointStatePb, error) { type endpointStatePb struct { ConfigUpdate EndpointStateConfigUpdate `json:"config_update,omitempty"` - - Ready EndpointStateReady `json:"ready,omitempty"` + Ready EndpointStateReady `json:"ready,omitempty"` } func endpointStateFromPb(pb *endpointStatePb) (*EndpointState, error) { @@ -1376,7 +1241,6 @@ func endpointTagToPb(st *EndpointTag) (*endpointTagPb, error) { } pb := &endpointTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -1384,8 +1248,7 @@ func endpointTagToPb(st *EndpointTag) (*endpointTagPb, error) { } type endpointTagPb struct { - Key string `json:"key"` - + Key string `json:"key"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1489,15 +1352,10 @@ func externalFunctionRequestToPb(st *ExternalFunctionRequest) (*externalFunction } pb := &externalFunctionRequestPb{} pb.ConnectionName = st.ConnectionName - pb.Headers = st.Headers - pb.Json = st.Json - pb.Method = st.Method - pb.Params = st.Params - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -1505,17 +1363,12 @@ func externalFunctionRequestToPb(st *ExternalFunctionRequest) (*externalFunction } type externalFunctionRequestPb struct { - ConnectionName string `json:"connection_name"` - - Headers string `json:"headers,omitempty"` - - Json string `json:"json,omitempty"` - - Method ExternalFunctionRequestHttpMethod `json:"method"` - - Params string `json:"params,omitempty"` - - Path string `json:"path"` + ConnectionName string `json:"connection_name"` + Headers string `json:"headers,omitempty"` + Json string `json:"json,omitempty"` + Method ExternalFunctionRequestHttpMethod `json:"method"` + Params string `json:"params,omitempty"` + Path string `json:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -1550,56 +1403,34 @@ func externalModelToPb(st *ExternalModel) (*externalModelPb, error) { } pb := &externalModelPb{} pb.Ai21labsConfig = st.Ai21labsConfig - pb.AmazonBedrockConfig = st.AmazonBedrockConfig - pb.AnthropicConfig = st.AnthropicConfig - pb.CohereConfig = st.CohereConfig - pb.CustomProviderConfig = st.CustomProviderConfig - pb.DatabricksModelServingConfig = st.DatabricksModelServingConfig - pb.GoogleCloudVertexAiConfig = st.GoogleCloudVertexAiConfig - pb.Name = st.Name - pb.OpenaiConfig = st.OpenaiConfig - pb.PalmConfig = st.PalmConfig - pb.Provider = st.Provider - pb.Task = st.Task return pb, nil } type externalModelPb struct { - Ai21labsConfig *Ai21LabsConfig `json:"ai21labs_config,omitempty"` - - AmazonBedrockConfig *AmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` - - AnthropicConfig *AnthropicConfig `json:"anthropic_config,omitempty"` - - CohereConfig *CohereConfig `json:"cohere_config,omitempty"` - - CustomProviderConfig *CustomProviderConfig `json:"custom_provider_config,omitempty"` - + Ai21labsConfig *Ai21LabsConfig `json:"ai21labs_config,omitempty"` + AmazonBedrockConfig *AmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` + AnthropicConfig *AnthropicConfig `json:"anthropic_config,omitempty"` + CohereConfig *CohereConfig `json:"cohere_config,omitempty"` + CustomProviderConfig *CustomProviderConfig `json:"custom_provider_config,omitempty"` DatabricksModelServingConfig *DatabricksModelServingConfig `json:"databricks_model_serving_config,omitempty"` - - GoogleCloudVertexAiConfig *GoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` - - Name string `json:"name"` - - OpenaiConfig *OpenAiConfig `json:"openai_config,omitempty"` - - PalmConfig *PaLmConfig `json:"palm_config,omitempty"` - - Provider ExternalModelProvider `json:"provider"` - - Task string `json:"task"` + GoogleCloudVertexAiConfig *GoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` + Name string `json:"name"` + OpenaiConfig *OpenAiConfig `json:"openai_config,omitempty"` + PalmConfig *PaLmConfig `json:"palm_config,omitempty"` + Provider ExternalModelProvider `json:"provider"` + Task string `json:"task"` } func externalModelFromPb(pb *externalModelPb) (*ExternalModel, error) { @@ -1629,9 +1460,7 @@ func externalModelUsageElementToPb(st *ExternalModelUsageElement) (*externalMode } pb := &externalModelUsageElementPb{} pb.CompletionTokens = st.CompletionTokens - pb.PromptTokens = st.PromptTokens - pb.TotalTokens = st.TotalTokens pb.ForceSendFields = st.ForceSendFields @@ -1640,10 +1469,8 @@ func externalModelUsageElementToPb(st *ExternalModelUsageElement) (*externalMode type externalModelUsageElementPb struct { CompletionTokens int `json:"completion_tokens,omitempty"` - - PromptTokens int `json:"prompt_tokens,omitempty"` - - TotalTokens int `json:"total_tokens,omitempty"` + PromptTokens int `json:"prompt_tokens,omitempty"` + TotalTokens int `json:"total_tokens,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1699,11 +1526,8 @@ func foundationModelToPb(st *FoundationModel) (*foundationModelPb, error) { } pb := &foundationModelPb{} pb.Description = st.Description - pb.DisplayName = st.DisplayName - pb.Docs = st.Docs - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -1712,12 +1536,9 @@ func foundationModelToPb(st *FoundationModel) (*foundationModelPb, error) { type foundationModelPb struct { Description string `json:"description,omitempty"` - DisplayName string `json:"display_name,omitempty"` - - Docs string `json:"docs,omitempty"` - - Name string `json:"name,omitempty"` + Docs string `json:"docs,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1894,11 +1715,8 @@ func googleCloudVertexAiConfigToPb(st *GoogleCloudVertexAiConfig) (*googleCloudV } pb := &googleCloudVertexAiConfigPb{} pb.PrivateKey = st.PrivateKey - pb.PrivateKeyPlaintext = st.PrivateKeyPlaintext - pb.ProjectId = st.ProjectId - pb.Region = st.Region pb.ForceSendFields = st.ForceSendFields @@ -1906,13 +1724,10 @@ func googleCloudVertexAiConfigToPb(st *GoogleCloudVertexAiConfig) (*googleCloudV } type googleCloudVertexAiConfigPb struct { - PrivateKey string `json:"private_key,omitempty"` - + PrivateKey string `json:"private_key,omitempty"` PrivateKeyPlaintext string `json:"private_key_plaintext,omitempty"` - - ProjectId string `json:"project_id"` - - Region string `json:"region"` + ProjectId string `json:"project_id"` + Region string `json:"region"` ForceSendFields []string `json:"-" url:"-"` } @@ -1993,15 +1808,13 @@ func logsRequestToPb(st *LogsRequest) (*logsRequestPb, error) { } pb := &logsRequestPb{} pb.Name = st.Name - pb.ServedModelName = st.ServedModelName return pb, nil } type logsRequestPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` ServedModelName string `json:"-" url:"-"` } @@ -2046,25 +1859,15 @@ func openAiConfigToPb(st *OpenAiConfig) (*openAiConfigPb, error) { } pb := &openAiConfigPb{} pb.MicrosoftEntraClientId = st.MicrosoftEntraClientId - pb.MicrosoftEntraClientSecret = st.MicrosoftEntraClientSecret - pb.MicrosoftEntraClientSecretPlaintext = st.MicrosoftEntraClientSecretPlaintext - pb.MicrosoftEntraTenantId = st.MicrosoftEntraTenantId - pb.OpenaiApiBase = st.OpenaiApiBase - pb.OpenaiApiKey = st.OpenaiApiKey - pb.OpenaiApiKeyPlaintext = st.OpenaiApiKeyPlaintext - pb.OpenaiApiType = st.OpenaiApiType - pb.OpenaiApiVersion = st.OpenaiApiVersion - pb.OpenaiDeploymentName = st.OpenaiDeploymentName - pb.OpenaiOrganization = st.OpenaiOrganization pb.ForceSendFields = st.ForceSendFields @@ -2072,27 +1875,17 @@ func openAiConfigToPb(st *OpenAiConfig) (*openAiConfigPb, error) { } type openAiConfigPb struct { - MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` - - MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` - + MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` + MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` MicrosoftEntraClientSecretPlaintext string `json:"microsoft_entra_client_secret_plaintext,omitempty"` - - MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` - - OpenaiApiBase string `json:"openai_api_base,omitempty"` - - OpenaiApiKey string `json:"openai_api_key,omitempty"` - - OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` - - OpenaiApiType string `json:"openai_api_type,omitempty"` - - OpenaiApiVersion string `json:"openai_api_version,omitempty"` - - OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` - - OpenaiOrganization string `json:"openai_organization,omitempty"` + MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` + OpenaiApiBase string `json:"openai_api_base,omitempty"` + OpenaiApiKey string `json:"openai_api_key,omitempty"` + OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` + OpenaiApiType string `json:"openai_api_type,omitempty"` + OpenaiApiVersion string `json:"openai_api_version,omitempty"` + OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` + OpenaiOrganization string `json:"openai_organization,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2132,7 +1925,6 @@ func paLmConfigToPb(st *PaLmConfig) (*paLmConfigPb, error) { } pb := &paLmConfigPb{} pb.PalmApiKey = st.PalmApiKey - pb.PalmApiKeyPlaintext = st.PalmApiKeyPlaintext pb.ForceSendFields = st.ForceSendFields @@ -2140,8 +1932,7 @@ func paLmConfigToPb(st *PaLmConfig) (*paLmConfigPb, error) { } type paLmConfigPb struct { - PalmApiKey string `json:"palm_api_key,omitempty"` - + PalmApiKey string `json:"palm_api_key,omitempty"` PalmApiKeyPlaintext string `json:"palm_api_key_plaintext,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2173,20 +1964,16 @@ func patchServingEndpointTagsToPb(st *PatchServingEndpointTags) (*patchServingEn } pb := &patchServingEndpointTagsPb{} pb.AddTags = st.AddTags - pb.DeleteTags = st.DeleteTags - pb.Name = st.Name return pb, nil } type patchServingEndpointTagsPb struct { - AddTags []EndpointTag `json:"add_tags,omitempty"` - - DeleteTags []string `json:"delete_tags,omitempty"` - - Name string `json:"-" url:"-"` + AddTags []EndpointTag `json:"add_tags,omitempty"` + DeleteTags []string `json:"delete_tags,omitempty"` + Name string `json:"-" url:"-"` } func patchServingEndpointTagsFromPb(pb *patchServingEndpointTagsPb) (*PatchServingEndpointTags, error) { @@ -2207,9 +1994,7 @@ func payloadTableToPb(st *PayloadTable) (*payloadTablePb, error) { } pb := &payloadTablePb{} pb.Name = st.Name - pb.Status = st.Status - pb.StatusMessage = st.StatusMessage pb.ForceSendFields = st.ForceSendFields @@ -2217,10 +2002,8 @@ func payloadTableToPb(st *PayloadTable) (*payloadTablePb, error) { } type payloadTablePb struct { - Name string `json:"name,omitempty"` - - Status string `json:"status,omitempty"` - + Name string `json:"name,omitempty"` + Status string `json:"status,omitempty"` StatusMessage string `json:"status_message,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2253,7 +2036,6 @@ func ptEndpointCoreConfigToPb(st *PtEndpointCoreConfig) (*ptEndpointCoreConfigPb } pb := &ptEndpointCoreConfigPb{} pb.ServedEntities = st.ServedEntities - pb.TrafficConfig = st.TrafficConfig return pb, nil @@ -2261,8 +2043,7 @@ func ptEndpointCoreConfigToPb(st *PtEndpointCoreConfig) (*ptEndpointCoreConfigPb type ptEndpointCoreConfigPb struct { ServedEntities []PtServedModel `json:"served_entities,omitempty"` - - TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` } func ptEndpointCoreConfigFromPb(pb *ptEndpointCoreConfigPb) (*PtEndpointCoreConfig, error) { @@ -2282,11 +2063,8 @@ func ptServedModelToPb(st *PtServedModel) (*ptServedModelPb, error) { } pb := &ptServedModelPb{} pb.EntityName = st.EntityName - pb.EntityVersion = st.EntityVersion - pb.Name = st.Name - pb.ProvisionedModelUnits = st.ProvisionedModelUnits pb.ForceSendFields = st.ForceSendFields @@ -2294,13 +2072,10 @@ func ptServedModelToPb(st *PtServedModel) (*ptServedModelPb, error) { } type ptServedModelPb struct { - EntityName string `json:"entity_name"` - - EntityVersion string `json:"entity_version,omitempty"` - - Name string `json:"name,omitempty"` - - ProvisionedModelUnits int64 `json:"provisioned_model_units"` + EntityName string `json:"entity_name"` + EntityVersion string `json:"entity_version,omitempty"` + Name string `json:"name,omitempty"` + ProvisionedModelUnits int64 `json:"provisioned_model_units"` ForceSendFields []string `json:"-" url:"-"` } @@ -2333,32 +2108,22 @@ func putAiGatewayRequestToPb(st *PutAiGatewayRequest) (*putAiGatewayRequestPb, e } pb := &putAiGatewayRequestPb{} pb.FallbackConfig = st.FallbackConfig - pb.Guardrails = st.Guardrails - pb.InferenceTableConfig = st.InferenceTableConfig - pb.Name = st.Name - pb.RateLimits = st.RateLimits - pb.UsageTrackingConfig = st.UsageTrackingConfig return pb, nil } type putAiGatewayRequestPb struct { - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` - - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` - + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` - - Name string `json:"-" url:"-"` - - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` - - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + Name string `json:"-" url:"-"` + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` } func putAiGatewayRequestFromPb(pb *putAiGatewayRequestPb) (*PutAiGatewayRequest, error) { @@ -2382,28 +2147,20 @@ func putAiGatewayResponseToPb(st *PutAiGatewayResponse) (*putAiGatewayResponsePb } pb := &putAiGatewayResponsePb{} pb.FallbackConfig = st.FallbackConfig - pb.Guardrails = st.Guardrails - pb.InferenceTableConfig = st.InferenceTableConfig - pb.RateLimits = st.RateLimits - pb.UsageTrackingConfig = st.UsageTrackingConfig return pb, nil } type putAiGatewayResponsePb struct { - FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` - - Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` - + FallbackConfig *FallbackConfig `json:"fallback_config,omitempty"` + Guardrails *AiGatewayGuardrails `json:"guardrails,omitempty"` InferenceTableConfig *AiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` - - RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` - - UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` + RateLimits []AiGatewayRateLimit `json:"rate_limits,omitempty"` + UsageTrackingConfig *AiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` } func putAiGatewayResponseFromPb(pb *putAiGatewayResponsePb) (*PutAiGatewayResponse, error) { @@ -2426,15 +2183,13 @@ func putRequestToPb(st *PutRequest) (*putRequestPb, error) { } pb := &putRequestPb{} pb.Name = st.Name - pb.RateLimits = st.RateLimits return pb, nil } type putRequestPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` RateLimits []RateLimit `json:"rate_limits,omitempty"` } @@ -2479,31 +2234,18 @@ func queryEndpointInputToPb(st *QueryEndpointInput) (*queryEndpointInputPb, erro } pb := &queryEndpointInputPb{} pb.DataframeRecords = st.DataframeRecords - pb.DataframeSplit = st.DataframeSplit - pb.ExtraParams = st.ExtraParams - pb.Input = st.Input - pb.Inputs = st.Inputs - pb.Instances = st.Instances - pb.MaxTokens = st.MaxTokens - pb.Messages = st.Messages - pb.N = st.N - pb.Name = st.Name - pb.Prompt = st.Prompt - pb.Stop = st.Stop - pb.Stream = st.Stream - pb.Temperature = st.Temperature pb.ForceSendFields = st.ForceSendFields @@ -2511,33 +2253,20 @@ func queryEndpointInputToPb(st *QueryEndpointInput) (*queryEndpointInputPb, erro } type queryEndpointInputPb struct { - DataframeRecords []any `json:"dataframe_records,omitempty"` - - DataframeSplit *DataframeSplitInput `json:"dataframe_split,omitempty"` - - ExtraParams map[string]string `json:"extra_params,omitempty"` - - Input any `json:"input,omitempty"` - - Inputs any `json:"inputs,omitempty"` - - Instances []any `json:"instances,omitempty"` - - MaxTokens int `json:"max_tokens,omitempty"` - - Messages []ChatMessage `json:"messages,omitempty"` - - N int `json:"n,omitempty"` - - Name string `json:"-" url:"-"` - - Prompt any `json:"prompt,omitempty"` - - Stop []string `json:"stop,omitempty"` - - Stream bool `json:"stream,omitempty"` - - Temperature float64 `json:"temperature,omitempty"` + DataframeRecords []any `json:"dataframe_records,omitempty"` + DataframeSplit *DataframeSplitInput `json:"dataframe_split,omitempty"` + ExtraParams map[string]string `json:"extra_params,omitempty"` + Input any `json:"input,omitempty"` + Inputs any `json:"inputs,omitempty"` + Instances []any `json:"instances,omitempty"` + MaxTokens int `json:"max_tokens,omitempty"` + Messages []ChatMessage `json:"messages,omitempty"` + N int `json:"n,omitempty"` + Name string `json:"-" url:"-"` + Prompt any `json:"prompt,omitempty"` + Stop []string `json:"stop,omitempty"` + Stream bool `json:"stream,omitempty"` + Temperature float64 `json:"temperature,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2580,21 +2309,13 @@ func queryEndpointResponseToPb(st *QueryEndpointResponse) (*queryEndpointRespons } pb := &queryEndpointResponsePb{} pb.Choices = st.Choices - pb.Created = st.Created - pb.Data = st.Data - pb.Id = st.Id - pb.Model = st.Model - pb.Object = st.Object - pb.Predictions = st.Predictions - pb.ServedModelName = st.ServedModelName - pb.Usage = st.Usage pb.ForceSendFields = st.ForceSendFields @@ -2602,23 +2323,15 @@ func queryEndpointResponseToPb(st *QueryEndpointResponse) (*queryEndpointRespons } type queryEndpointResponsePb struct { - Choices []V1ResponseChoiceElement `json:"choices,omitempty"` - - Created int64 `json:"created,omitempty"` - - Data []EmbeddingsV1ResponseEmbeddingElement `json:"data,omitempty"` - - Id string `json:"id,omitempty"` - - Model string `json:"model,omitempty"` - - Object QueryEndpointResponseObject `json:"object,omitempty"` - - Predictions []any `json:"predictions,omitempty"` - - ServedModelName string `json:"-" url:"-" header:"served-model-name,omitempty"` - - Usage *ExternalModelUsageElement `json:"usage,omitempty"` + Choices []V1ResponseChoiceElement `json:"choices,omitempty"` + Created int64 `json:"created,omitempty"` + Data []EmbeddingsV1ResponseEmbeddingElement `json:"data,omitempty"` + Id string `json:"id,omitempty"` + Model string `json:"model,omitempty"` + Object QueryEndpointResponseObject `json:"object,omitempty"` + Predictions []any `json:"predictions,omitempty"` + ServedModelName string `json:"-" url:"-" header:"served-model-name,omitempty"` + Usage *ExternalModelUsageElement `json:"usage,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2656,19 +2369,15 @@ func rateLimitToPb(st *RateLimit) (*rateLimitPb, error) { } pb := &rateLimitPb{} pb.Calls = st.Calls - pb.Key = st.Key - pb.RenewalPeriod = st.RenewalPeriod return pb, nil } type rateLimitPb struct { - Calls int64 `json:"calls"` - - Key RateLimitKey `json:"key,omitempty"` - + Calls int64 `json:"calls"` + Key RateLimitKey `json:"key,omitempty"` RenewalPeriod RateLimitRenewalPeriod `json:"renewal_period"` } @@ -2690,16 +2399,14 @@ func routeToPb(st *Route) (*routePb, error) { } pb := &routePb{} pb.ServedModelName = st.ServedModelName - pb.TrafficPercentage = st.TrafficPercentage return pb, nil } type routePb struct { - ServedModelName string `json:"served_model_name"` - - TrafficPercentage int `json:"traffic_percentage"` + ServedModelName string `json:"served_model_name"` + TrafficPercentage int `json:"traffic_percentage"` } func routeFromPb(pb *routePb) (*Route, error) { @@ -2719,27 +2426,16 @@ func servedEntityInputToPb(st *ServedEntityInput) (*servedEntityInputPb, error) } pb := &servedEntityInputPb{} pb.EntityName = st.EntityName - pb.EntityVersion = st.EntityVersion - pb.EnvironmentVars = st.EnvironmentVars - pb.ExternalModel = st.ExternalModel - pb.InstanceProfileArn = st.InstanceProfileArn - pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput - pb.MinProvisionedThroughput = st.MinProvisionedThroughput - pb.Name = st.Name - pb.ProvisionedModelUnits = st.ProvisionedModelUnits - pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled - pb.WorkloadSize = st.WorkloadSize - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -2747,29 +2443,18 @@ func servedEntityInputToPb(st *ServedEntityInput) (*servedEntityInputPb, error) } type servedEntityInputPb struct { - EntityName string `json:"entity_name,omitempty"` - - EntityVersion string `json:"entity_version,omitempty"` - - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` - - ExternalModel *ExternalModel `json:"external_model,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` - - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` - - Name string `json:"name,omitempty"` - - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` - - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` - - WorkloadSize string `json:"workload_size,omitempty"` - - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + EntityName string `json:"entity_name,omitempty"` + EntityVersion string `json:"entity_version,omitempty"` + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + ExternalModel *ExternalModel `json:"external_model,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + Name string `json:"name,omitempty"` + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + WorkloadSize string `json:"workload_size,omitempty"` + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2810,35 +2495,20 @@ func servedEntityOutputToPb(st *ServedEntityOutput) (*servedEntityOutputPb, erro } pb := &servedEntityOutputPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Creator = st.Creator - pb.EntityName = st.EntityName - pb.EntityVersion = st.EntityVersion - pb.EnvironmentVars = st.EnvironmentVars - pb.ExternalModel = st.ExternalModel - pb.FoundationModel = st.FoundationModel - pb.InstanceProfileArn = st.InstanceProfileArn - pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput - pb.MinProvisionedThroughput = st.MinProvisionedThroughput - pb.Name = st.Name - pb.ProvisionedModelUnits = st.ProvisionedModelUnits - pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled - pb.State = st.State - pb.WorkloadSize = st.WorkloadSize - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -2846,37 +2516,22 @@ func servedEntityOutputToPb(st *ServedEntityOutput) (*servedEntityOutputPb, erro } type servedEntityOutputPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Creator string `json:"creator,omitempty"` - - EntityName string `json:"entity_name,omitempty"` - - EntityVersion string `json:"entity_version,omitempty"` - - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` - - ExternalModel *ExternalModel `json:"external_model,omitempty"` - - FoundationModel *FoundationModel `json:"foundation_model,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` - - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` - - Name string `json:"name,omitempty"` - - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` - - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` - - State *ServedModelState `json:"state,omitempty"` - - WorkloadSize string `json:"workload_size,omitempty"` - - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + EntityName string `json:"entity_name,omitempty"` + EntityVersion string `json:"entity_version,omitempty"` + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + ExternalModel *ExternalModel `json:"external_model,omitempty"` + FoundationModel *FoundationModel `json:"foundation_model,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + Name string `json:"name,omitempty"` + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + State *ServedModelState `json:"state,omitempty"` + WorkloadSize string `json:"workload_size,omitempty"` + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2921,13 +2576,9 @@ func servedEntitySpecToPb(st *ServedEntitySpec) (*servedEntitySpecPb, error) { } pb := &servedEntitySpecPb{} pb.EntityName = st.EntityName - pb.EntityVersion = st.EntityVersion - pb.ExternalModel = st.ExternalModel - pb.FoundationModel = st.FoundationModel - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -2935,15 +2586,11 @@ func servedEntitySpecToPb(st *ServedEntitySpec) (*servedEntitySpecPb, error) { } type servedEntitySpecPb struct { - EntityName string `json:"entity_name,omitempty"` - - EntityVersion string `json:"entity_version,omitempty"` - - ExternalModel *ExternalModel `json:"external_model,omitempty"` - + EntityName string `json:"entity_name,omitempty"` + EntityVersion string `json:"entity_version,omitempty"` + ExternalModel *ExternalModel `json:"external_model,omitempty"` FoundationModel *FoundationModel `json:"foundation_model,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2977,25 +2624,15 @@ func servedModelInputToPb(st *ServedModelInput) (*servedModelInputPb, error) { } pb := &servedModelInputPb{} pb.EnvironmentVars = st.EnvironmentVars - pb.InstanceProfileArn = st.InstanceProfileArn - pb.MaxProvisionedThroughput = st.MaxProvisionedThroughput - pb.MinProvisionedThroughput = st.MinProvisionedThroughput - pb.ModelName = st.ModelName - pb.ModelVersion = st.ModelVersion - pb.Name = st.Name - pb.ProvisionedModelUnits = st.ProvisionedModelUnits - pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled - pb.WorkloadSize = st.WorkloadSize - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -3003,27 +2640,17 @@ func servedModelInputToPb(st *ServedModelInput) (*servedModelInputPb, error) { } type servedModelInputPb struct { - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` - - MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` - - ModelName string `json:"model_name"` - - ModelVersion string `json:"model_version"` - - Name string `json:"name,omitempty"` - - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` - - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled"` - - WorkloadSize string `json:"workload_size,omitempty"` - - WorkloadType ServedModelInputWorkloadType `json:"workload_type,omitempty"` + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + MaxProvisionedThroughput int `json:"max_provisioned_throughput,omitempty"` + MinProvisionedThroughput int `json:"min_provisioned_throughput,omitempty"` + ModelName string `json:"model_name"` + ModelVersion string `json:"model_version"` + Name string `json:"name,omitempty"` + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled"` + WorkloadSize string `json:"workload_size,omitempty"` + WorkloadType ServedModelInputWorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3063,27 +2690,16 @@ func servedModelOutputToPb(st *ServedModelOutput) (*servedModelOutputPb, error) } pb := &servedModelOutputPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Creator = st.Creator - pb.EnvironmentVars = st.EnvironmentVars - pb.InstanceProfileArn = st.InstanceProfileArn - pb.ModelName = st.ModelName - pb.ModelVersion = st.ModelVersion - pb.Name = st.Name - pb.ProvisionedModelUnits = st.ProvisionedModelUnits - pb.ScaleToZeroEnabled = st.ScaleToZeroEnabled - pb.State = st.State - pb.WorkloadSize = st.WorkloadSize - pb.WorkloadType = st.WorkloadType pb.ForceSendFields = st.ForceSendFields @@ -3091,29 +2707,18 @@ func servedModelOutputToPb(st *ServedModelOutput) (*servedModelOutputPb, error) } type servedModelOutputPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Creator string `json:"creator,omitempty"` - - EnvironmentVars map[string]string `json:"environment_vars,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - ModelName string `json:"model_name,omitempty"` - - ModelVersion string `json:"model_version,omitempty"` - - Name string `json:"name,omitempty"` - - ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` - - ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` - - State *ServedModelState `json:"state,omitempty"` - - WorkloadSize string `json:"workload_size,omitempty"` - - WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + EnvironmentVars map[string]string `json:"environment_vars,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + ModelName string `json:"model_name,omitempty"` + ModelVersion string `json:"model_version,omitempty"` + Name string `json:"name,omitempty"` + ProvisionedModelUnits int64 `json:"provisioned_model_units,omitempty"` + ScaleToZeroEnabled bool `json:"scale_to_zero_enabled,omitempty"` + State *ServedModelState `json:"state,omitempty"` + WorkloadSize string `json:"workload_size,omitempty"` + WorkloadType ServingModelWorkloadType `json:"workload_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3154,9 +2759,7 @@ func servedModelSpecToPb(st *ServedModelSpec) (*servedModelSpecPb, error) { } pb := &servedModelSpecPb{} pb.ModelName = st.ModelName - pb.ModelVersion = st.ModelVersion - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -3164,11 +2767,9 @@ func servedModelSpecToPb(st *ServedModelSpec) (*servedModelSpecPb, error) { } type servedModelSpecPb struct { - ModelName string `json:"model_name,omitempty"` - + ModelName string `json:"model_name,omitempty"` ModelVersion string `json:"model_version,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3200,7 +2801,6 @@ func servedModelStateToPb(st *ServedModelState) (*servedModelStatePb, error) { } pb := &servedModelStatePb{} pb.Deployment = st.Deployment - pb.DeploymentStateMessage = st.DeploymentStateMessage pb.ForceSendFields = st.ForceSendFields @@ -3208,9 +2808,8 @@ func servedModelStateToPb(st *ServedModelState) (*servedModelStatePb, error) { } type servedModelStatePb struct { - Deployment ServedModelStateDeployment `json:"deployment,omitempty"` - - DeploymentStateMessage string `json:"deployment_state_message,omitempty"` + Deployment ServedModelStateDeployment `json:"deployment,omitempty"` + DeploymentStateMessage string `json:"deployment_state_message,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3265,25 +2864,15 @@ func servingEndpointToPb(st *ServingEndpoint) (*servingEndpointPb, error) { } pb := &servingEndpointPb{} pb.AiGateway = st.AiGateway - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Config = st.Config - pb.CreationTimestamp = st.CreationTimestamp - pb.Creator = st.Creator - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.Name = st.Name - pb.State = st.State - pb.Tags = st.Tags - pb.Task = st.Task pb.ForceSendFields = st.ForceSendFields @@ -3291,27 +2880,17 @@ func servingEndpointToPb(st *ServingEndpoint) (*servingEndpointPb, error) { } type servingEndpointPb struct { - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Config *EndpointCoreConfigSummary `json:"config,omitempty"` - - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Creator string `json:"creator,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - Name string `json:"name,omitempty"` - - State *EndpointState `json:"state,omitempty"` - - Tags []EndpointTag `json:"tags,omitempty"` - - Task string `json:"task,omitempty"` + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Config *EndpointCoreConfigSummary `json:"config,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Name string `json:"name,omitempty"` + State *EndpointState `json:"state,omitempty"` + Tags []EndpointTag `json:"tags,omitempty"` + Task string `json:"task,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3351,11 +2930,8 @@ func servingEndpointAccessControlRequestToPb(st *ServingEndpointAccessControlReq } pb := &servingEndpointAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -3363,13 +2939,10 @@ func servingEndpointAccessControlRequestToPb(st *ServingEndpointAccessControlReq } type servingEndpointAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3402,13 +2975,9 @@ func servingEndpointAccessControlResponseToPb(st *ServingEndpointAccessControlRe } pb := &servingEndpointAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -3416,15 +2985,11 @@ func servingEndpointAccessControlResponseToPb(st *ServingEndpointAccessControlRe } type servingEndpointAccessControlResponsePb struct { - AllPermissions []ServingEndpointPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []ServingEndpointPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3458,35 +3023,20 @@ func servingEndpointDetailedToPb(st *ServingEndpointDetailed) (*servingEndpointD } pb := &servingEndpointDetailedPb{} pb.AiGateway = st.AiGateway - pb.BudgetPolicyId = st.BudgetPolicyId - pb.Config = st.Config - pb.CreationTimestamp = st.CreationTimestamp - pb.Creator = st.Creator - pb.DataPlaneInfo = st.DataPlaneInfo - pb.EndpointUrl = st.EndpointUrl - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.Name = st.Name - pb.PendingConfig = st.PendingConfig - pb.PermissionLevel = st.PermissionLevel - pb.RouteOptimized = st.RouteOptimized - pb.State = st.State - pb.Tags = st.Tags - pb.Task = st.Task pb.ForceSendFields = st.ForceSendFields @@ -3494,37 +3044,22 @@ func servingEndpointDetailedToPb(st *ServingEndpointDetailed) (*servingEndpointD } type servingEndpointDetailedPb struct { - AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` - - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - Config *EndpointCoreConfigOutput `json:"config,omitempty"` - - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Creator string `json:"creator,omitempty"` - - DataPlaneInfo *ModelDataPlaneInfo `json:"data_plane_info,omitempty"` - - EndpointUrl string `json:"endpoint_url,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - Name string `json:"name,omitempty"` - - PendingConfig *EndpointPendingConfig `json:"pending_config,omitempty"` - - PermissionLevel ServingEndpointDetailedPermissionLevel `json:"permission_level,omitempty"` - - RouteOptimized bool `json:"route_optimized,omitempty"` - - State *EndpointState `json:"state,omitempty"` - - Tags []EndpointTag `json:"tags,omitempty"` - - Task string `json:"task,omitempty"` + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + Config *EndpointCoreConfigOutput `json:"config,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + DataPlaneInfo *ModelDataPlaneInfo `json:"data_plane_info,omitempty"` + EndpointUrl string `json:"endpoint_url,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Name string `json:"name,omitempty"` + PendingConfig *EndpointPendingConfig `json:"pending_config,omitempty"` + PermissionLevel ServingEndpointDetailedPermissionLevel `json:"permission_level,omitempty"` + RouteOptimized bool `json:"route_optimized,omitempty"` + State *EndpointState `json:"state,omitempty"` + Tags []EndpointTag `json:"tags,omitempty"` + Task string `json:"task,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3569,9 +3104,7 @@ func servingEndpointPermissionToPb(st *ServingEndpointPermission) (*servingEndpo } pb := &servingEndpointPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -3579,11 +3112,9 @@ func servingEndpointPermissionToPb(st *ServingEndpointPermission) (*servingEndpo } type servingEndpointPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3615,9 +3146,7 @@ func servingEndpointPermissionsToPb(st *ServingEndpointPermissions) (*servingEnd } pb := &servingEndpointPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -3626,10 +3155,8 @@ func servingEndpointPermissionsToPb(st *ServingEndpointPermissions) (*servingEnd type servingEndpointPermissionsPb struct { AccessControlList []ServingEndpointAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3661,7 +3188,6 @@ func servingEndpointPermissionsDescriptionToPb(st *ServingEndpointPermissionsDes } pb := &servingEndpointPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -3669,8 +3195,7 @@ func servingEndpointPermissionsDescriptionToPb(st *ServingEndpointPermissionsDes } type servingEndpointPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel ServingEndpointPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3702,7 +3227,6 @@ func servingEndpointPermissionsRequestToPb(st *ServingEndpointPermissionsRequest } pb := &servingEndpointPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.ServingEndpointId = st.ServingEndpointId return pb, nil @@ -3710,8 +3234,7 @@ func servingEndpointPermissionsRequestToPb(st *ServingEndpointPermissionsRequest type servingEndpointPermissionsRequestPb struct { AccessControlList []ServingEndpointAccessControlRequest `json:"access_control_list,omitempty"` - - ServingEndpointId string `json:"-" url:"-"` + ServingEndpointId string `json:"-" url:"-"` } func servingEndpointPermissionsRequestFromPb(pb *servingEndpointPermissionsRequestPb) (*ServingEndpointPermissionsRequest, error) { @@ -3755,7 +3278,6 @@ func updateProvisionedThroughputEndpointConfigRequestToPb(st *UpdateProvisionedT } pb := &updateProvisionedThroughputEndpointConfigRequestPb{} pb.Config = st.Config - pb.Name = st.Name return pb, nil @@ -3763,8 +3285,7 @@ func updateProvisionedThroughputEndpointConfigRequestToPb(st *UpdateProvisionedT type updateProvisionedThroughputEndpointConfigRequestPb struct { Config PtEndpointCoreConfig `json:"config"` - - Name string `json:"-" url:"-"` + Name string `json:"-" url:"-"` } func updateProvisionedThroughputEndpointConfigRequestFromPb(pb *updateProvisionedThroughputEndpointConfigRequestPb) (*UpdateProvisionedThroughputEndpointConfigRequest, error) { @@ -3784,13 +3305,9 @@ func v1ResponseChoiceElementToPb(st *V1ResponseChoiceElement) (*v1ResponseChoice } pb := &v1ResponseChoiceElementPb{} pb.FinishReason = st.FinishReason - pb.Index = st.Index - pb.Logprobs = st.Logprobs - pb.Message = st.Message - pb.Text = st.Text pb.ForceSendFields = st.ForceSendFields @@ -3798,15 +3315,11 @@ func v1ResponseChoiceElementToPb(st *V1ResponseChoiceElement) (*v1ResponseChoice } type v1ResponseChoiceElementPb struct { - FinishReason string `json:"finishReason,omitempty"` - - Index int `json:"index,omitempty"` - - Logprobs int `json:"logprobs,omitempty"` - - Message *ChatMessage `json:"message,omitempty"` - - Text string `json:"text,omitempty"` + FinishReason string `json:"finishReason,omitempty"` + Index int `json:"index,omitempty"` + Logprobs int `json:"logprobs,omitempty"` + Message *ChatMessage `json:"message,omitempty"` + Text string `json:"text,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3833,3 +3346,57 @@ func (st *v1ResponseChoiceElementPb) UnmarshalJSON(b []byte) error { func (st v1ResponseChoiceElementPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/serving/model.go b/service/serving/model.go index c6d632f8b..bd9917f29 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -6,8 +6,6 @@ import ( "encoding/json" "fmt" "io" - "strings" - "time" ) type Ai21LabsConfig struct { @@ -4436,57 +4434,3 @@ func (st V1ResponseChoiceElement) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/settings/internal.go b/service/settings/internal.go index ed62e745d..e467bf7d8 100755 --- a/service/settings/internal.go +++ b/service/settings/internal.go @@ -3,6 +3,10 @@ package settings import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,9 +16,7 @@ func accountIpAccessEnableToPb(st *AccountIpAccessEnable) (*accountIpAccessEnabl } pb := &accountIpAccessEnablePb{} pb.AcctIpAclEnable = st.AcctIpAclEnable - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -23,10 +25,8 @@ func accountIpAccessEnableToPb(st *AccountIpAccessEnable) (*accountIpAccessEnabl type accountIpAccessEnablePb struct { AcctIpAclEnable BooleanMessage `json:"acct_ip_acl_enable"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -58,9 +58,7 @@ func accountNetworkPolicyToPb(st *AccountNetworkPolicy) (*accountNetworkPolicyPb } pb := &accountNetworkPolicyPb{} pb.AccountId = st.AccountId - pb.Egress = st.Egress - pb.NetworkPolicyId = st.NetworkPolicyId pb.ForceSendFields = st.ForceSendFields @@ -68,11 +66,9 @@ func accountNetworkPolicyToPb(st *AccountNetworkPolicy) (*accountNetworkPolicyPb } type accountNetworkPolicyPb struct { - AccountId string `json:"account_id,omitempty"` - - Egress *NetworkPolicyEgress `json:"egress,omitempty"` - - NetworkPolicyId string `json:"network_policy_id,omitempty"` + AccountId string `json:"account_id,omitempty"` + Egress *NetworkPolicyEgress `json:"egress,omitempty"` + NetworkPolicyId string `json:"network_policy_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -128,9 +124,7 @@ func aibiDashboardEmbeddingAccessPolicySettingToPb(st *AibiDashboardEmbeddingAcc } pb := &aibiDashboardEmbeddingAccessPolicySettingPb{} pb.AibiDashboardEmbeddingAccessPolicy = st.AibiDashboardEmbeddingAccessPolicy - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -139,10 +133,8 @@ func aibiDashboardEmbeddingAccessPolicySettingToPb(st *AibiDashboardEmbeddingAcc type aibiDashboardEmbeddingAccessPolicySettingPb struct { AibiDashboardEmbeddingAccessPolicy AibiDashboardEmbeddingAccessPolicy `json:"aibi_dashboard_embedding_access_policy"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -198,9 +190,7 @@ func aibiDashboardEmbeddingApprovedDomainsSettingToPb(st *AibiDashboardEmbedding } pb := &aibiDashboardEmbeddingApprovedDomainsSettingPb{} pb.AibiDashboardEmbeddingApprovedDomains = st.AibiDashboardEmbeddingApprovedDomains - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -209,10 +199,8 @@ func aibiDashboardEmbeddingApprovedDomainsSettingToPb(st *AibiDashboardEmbedding type aibiDashboardEmbeddingApprovedDomainsSettingPb struct { AibiDashboardEmbeddingApprovedDomains AibiDashboardEmbeddingApprovedDomains `json:"aibi_dashboard_embedding_approved_domains"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -244,9 +232,7 @@ func automaticClusterUpdateSettingToPb(st *AutomaticClusterUpdateSetting) (*auto } pb := &automaticClusterUpdateSettingPb{} pb.AutomaticClusterUpdateWorkspace = st.AutomaticClusterUpdateWorkspace - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -255,10 +241,8 @@ func automaticClusterUpdateSettingToPb(st *AutomaticClusterUpdateSetting) (*auto type automaticClusterUpdateSettingPb struct { AutomaticClusterUpdateWorkspace ClusterAutoRestartMessage `json:"automatic_cluster_update_workspace"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -326,13 +310,9 @@ func clusterAutoRestartMessageToPb(st *ClusterAutoRestartMessage) (*clusterAutoR } pb := &clusterAutoRestartMessagePb{} pb.CanToggle = st.CanToggle - pb.Enabled = st.Enabled - pb.EnablementDetails = st.EnablementDetails - pb.MaintenanceWindow = st.MaintenanceWindow - pb.RestartEvenIfNoUpdatesAvailable = st.RestartEvenIfNoUpdatesAvailable pb.ForceSendFields = st.ForceSendFields @@ -340,15 +320,11 @@ func clusterAutoRestartMessageToPb(st *ClusterAutoRestartMessage) (*clusterAutoR } type clusterAutoRestartMessagePb struct { - CanToggle bool `json:"can_toggle,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - EnablementDetails *ClusterAutoRestartMessageEnablementDetails `json:"enablement_details,omitempty"` - - MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow `json:"maintenance_window,omitempty"` - - RestartEvenIfNoUpdatesAvailable bool `json:"restart_even_if_no_updates_available,omitempty"` + CanToggle bool `json:"can_toggle,omitempty"` + Enabled bool `json:"enabled,omitempty"` + EnablementDetails *ClusterAutoRestartMessageEnablementDetails `json:"enablement_details,omitempty"` + MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow `json:"maintenance_window,omitempty"` + RestartEvenIfNoUpdatesAvailable bool `json:"restart_even_if_no_updates_available,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -382,9 +358,7 @@ func clusterAutoRestartMessageEnablementDetailsToPb(st *ClusterAutoRestartMessag } pb := &clusterAutoRestartMessageEnablementDetailsPb{} pb.ForcedForComplianceMode = st.ForcedForComplianceMode - pb.UnavailableForDisabledEntitlement = st.UnavailableForDisabledEntitlement - pb.UnavailableForNonEnterpriseTier = st.UnavailableForNonEnterpriseTier pb.ForceSendFields = st.ForceSendFields @@ -392,11 +366,9 @@ func clusterAutoRestartMessageEnablementDetailsToPb(st *ClusterAutoRestartMessag } type clusterAutoRestartMessageEnablementDetailsPb struct { - ForcedForComplianceMode bool `json:"forced_for_compliance_mode,omitempty"` - + ForcedForComplianceMode bool `json:"forced_for_compliance_mode,omitempty"` UnavailableForDisabledEntitlement bool `json:"unavailable_for_disabled_entitlement,omitempty"` - - UnavailableForNonEnterpriseTier bool `json:"unavailable_for_non_enterprise_tier,omitempty"` + UnavailableForNonEnterpriseTier bool `json:"unavailable_for_non_enterprise_tier,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -452,19 +424,15 @@ func clusterAutoRestartMessageMaintenanceWindowWeekDayBasedScheduleToPb(st *Clus } pb := &clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb{} pb.DayOfWeek = st.DayOfWeek - pb.Frequency = st.Frequency - pb.WindowStartTime = st.WindowStartTime return pb, nil } type clusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedulePb struct { - DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"` - - Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency `json:"frequency,omitempty"` - + DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"` + Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency `json:"frequency,omitempty"` WindowStartTime *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime `json:"window_start_time,omitempty"` } @@ -486,7 +454,6 @@ func clusterAutoRestartMessageMaintenanceWindowWindowStartTimeToPb(st *ClusterAu } pb := &clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb{} pb.Hours = st.Hours - pb.Minutes = st.Minutes pb.ForceSendFields = st.ForceSendFields @@ -494,8 +461,7 @@ func clusterAutoRestartMessageMaintenanceWindowWindowStartTimeToPb(st *ClusterAu } type clusterAutoRestartMessageMaintenanceWindowWindowStartTimePb struct { - Hours int `json:"hours,omitempty"` - + Hours int `json:"hours,omitempty"` Minutes int `json:"minutes,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -527,7 +493,6 @@ func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSe } pb := &complianceSecurityProfilePb{} pb.ComplianceStandards = st.ComplianceStandards - pb.IsEnabled = st.IsEnabled pb.ForceSendFields = st.ForceSendFields @@ -536,8 +501,7 @@ func complianceSecurityProfileToPb(st *ComplianceSecurityProfile) (*complianceSe type complianceSecurityProfilePb struct { ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` - - IsEnabled bool `json:"is_enabled,omitempty"` + IsEnabled bool `json:"is_enabled,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -568,9 +532,7 @@ func complianceSecurityProfileSettingToPb(st *ComplianceSecurityProfileSetting) } pb := &complianceSecurityProfileSettingPb{} pb.ComplianceSecurityProfileWorkspace = st.ComplianceSecurityProfileWorkspace - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -579,10 +541,8 @@ func complianceSecurityProfileSettingToPb(st *ComplianceSecurityProfileSetting) type complianceSecurityProfileSettingPb struct { ComplianceSecurityProfileWorkspace ComplianceSecurityProfile `json:"compliance_security_profile_workspace"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -614,28 +574,20 @@ func configToPb(st *Config) (*configPb, error) { } pb := &configPb{} pb.Email = st.Email - pb.GenericWebhook = st.GenericWebhook - pb.MicrosoftTeams = st.MicrosoftTeams - pb.Pagerduty = st.Pagerduty - pb.Slack = st.Slack return pb, nil } type configPb struct { - Email *EmailConfig `json:"email,omitempty"` - + Email *EmailConfig `json:"email,omitempty"` GenericWebhook *GenericWebhookConfig `json:"generic_webhook,omitempty"` - MicrosoftTeams *MicrosoftTeamsConfig `json:"microsoft_teams,omitempty"` - - Pagerduty *PagerdutyConfig `json:"pagerduty,omitempty"` - - Slack *SlackConfig `json:"slack,omitempty"` + Pagerduty *PagerdutyConfig `json:"pagerduty,omitempty"` + Slack *SlackConfig `json:"slack,omitempty"` } func configFromPb(pb *configPb) (*Config, error) { @@ -658,9 +610,7 @@ func createIpAccessListToPb(st *CreateIpAccessList) (*createIpAccessListPb, erro } pb := &createIpAccessListPb{} pb.IpAddresses = st.IpAddresses - pb.Label = st.Label - pb.ListType = st.ListType return pb, nil @@ -668,10 +618,8 @@ func createIpAccessListToPb(st *CreateIpAccessList) (*createIpAccessListPb, erro type createIpAccessListPb struct { IpAddresses []string `json:"ip_addresses,omitempty"` - - Label string `json:"label"` - - ListType ListType `json:"list_type"` + Label string `json:"label"` + ListType ListType `json:"list_type"` } func createIpAccessListFromPb(pb *createIpAccessListPb) (*CreateIpAccessList, error) { @@ -740,15 +688,13 @@ func createNetworkConnectivityConfigurationToPb(st *CreateNetworkConnectivityCon } pb := &createNetworkConnectivityConfigurationPb{} pb.Name = st.Name - pb.Region = st.Region return pb, nil } type createNetworkConnectivityConfigurationPb struct { - Name string `json:"name"` - + Name string `json:"name"` Region string `json:"region"` } @@ -793,7 +739,6 @@ func createNotificationDestinationRequestToPb(st *CreateNotificationDestinationR } pb := &createNotificationDestinationRequestPb{} pb.Config = st.Config - pb.DisplayName = st.DisplayName pb.ForceSendFields = st.ForceSendFields @@ -801,9 +746,8 @@ func createNotificationDestinationRequestToPb(st *CreateNotificationDestinationR } type createNotificationDestinationRequestPb struct { - Config *Config `json:"config,omitempty"` - - DisplayName string `json:"display_name,omitempty"` + Config *Config `json:"config,omitempty"` + DisplayName string `json:"display_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -834,9 +778,7 @@ func createOboTokenRequestToPb(st *CreateOboTokenRequest) (*createOboTokenReques } pb := &createOboTokenRequestPb{} pb.ApplicationId = st.ApplicationId - pb.Comment = st.Comment - pb.LifetimeSeconds = st.LifetimeSeconds pb.ForceSendFields = st.ForceSendFields @@ -844,11 +786,9 @@ func createOboTokenRequestToPb(st *CreateOboTokenRequest) (*createOboTokenReques } type createOboTokenRequestPb struct { - ApplicationId string `json:"application_id"` - - Comment string `json:"comment,omitempty"` - - LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + ApplicationId string `json:"application_id"` + Comment string `json:"comment,omitempty"` + LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -880,7 +820,6 @@ func createOboTokenResponseToPb(st *CreateOboTokenResponse) (*createOboTokenResp } pb := &createOboTokenResponsePb{} pb.TokenInfo = st.TokenInfo - pb.TokenValue = st.TokenValue pb.ForceSendFields = st.ForceSendFields @@ -888,9 +827,8 @@ func createOboTokenResponseToPb(st *CreateOboTokenResponse) (*createOboTokenResp } type createOboTokenResponsePb struct { - TokenInfo *TokenInfo `json:"token_info,omitempty"` - - TokenValue string `json:"token_value,omitempty"` + TokenInfo *TokenInfo `json:"token_info,omitempty"` + TokenValue string `json:"token_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -921,9 +859,7 @@ func createPrivateEndpointRuleToPb(st *CreatePrivateEndpointRule) (*createPrivat } pb := &createPrivateEndpointRulePb{} pb.DomainNames = st.DomainNames - pb.GroupId = st.GroupId - pb.ResourceId = st.ResourceId pb.ForceSendFields = st.ForceSendFields @@ -932,10 +868,8 @@ func createPrivateEndpointRuleToPb(st *CreatePrivateEndpointRule) (*createPrivat type createPrivateEndpointRulePb struct { DomainNames []string `json:"domain_names,omitempty"` - - GroupId string `json:"group_id,omitempty"` - - ResourceId string `json:"resource_id"` + GroupId string `json:"group_id,omitempty"` + ResourceId string `json:"resource_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -967,16 +901,14 @@ func createPrivateEndpointRuleRequestToPb(st *CreatePrivateEndpointRuleRequest) } pb := &createPrivateEndpointRuleRequestPb{} pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.PrivateEndpointRule = st.PrivateEndpointRule return pb, nil } type createPrivateEndpointRuleRequestPb struct { - NetworkConnectivityConfigId string `json:"-" url:"-"` - - PrivateEndpointRule CreatePrivateEndpointRule `json:"private_endpoint_rule"` + NetworkConnectivityConfigId string `json:"-" url:"-"` + PrivateEndpointRule CreatePrivateEndpointRule `json:"private_endpoint_rule"` } func createPrivateEndpointRuleRequestFromPb(pb *createPrivateEndpointRuleRequestPb) (*CreatePrivateEndpointRuleRequest, error) { @@ -996,7 +928,6 @@ func createTokenRequestToPb(st *CreateTokenRequest) (*createTokenRequestPb, erro } pb := &createTokenRequestPb{} pb.Comment = st.Comment - pb.LifetimeSeconds = st.LifetimeSeconds pb.ForceSendFields = st.ForceSendFields @@ -1004,9 +935,8 @@ func createTokenRequestToPb(st *CreateTokenRequest) (*createTokenRequestPb, erro } type createTokenRequestPb struct { - Comment string `json:"comment,omitempty"` - - LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` + Comment string `json:"comment,omitempty"` + LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1037,7 +967,6 @@ func createTokenResponseToPb(st *CreateTokenResponse) (*createTokenResponsePb, e } pb := &createTokenResponsePb{} pb.TokenInfo = st.TokenInfo - pb.TokenValue = st.TokenValue pb.ForceSendFields = st.ForceSendFields @@ -1045,9 +974,8 @@ func createTokenResponseToPb(st *CreateTokenResponse) (*createTokenResponsePb, e } type createTokenResponsePb struct { - TokenInfo *PublicTokenInfo `json:"token_info,omitempty"` - - TokenValue string `json:"token_value,omitempty"` + TokenInfo *PublicTokenInfo `json:"token_info,omitempty"` + TokenValue string `json:"token_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1078,7 +1006,6 @@ func cspEnablementAccountToPb(st *CspEnablementAccount) (*cspEnablementAccountPb } pb := &cspEnablementAccountPb{} pb.ComplianceStandards = st.ComplianceStandards - pb.IsEnforced = st.IsEnforced pb.ForceSendFields = st.ForceSendFields @@ -1087,8 +1014,7 @@ func cspEnablementAccountToPb(st *CspEnablementAccount) (*cspEnablementAccountPb type cspEnablementAccountPb struct { ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` - - IsEnforced bool `json:"is_enforced,omitempty"` + IsEnforced bool `json:"is_enforced,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1119,9 +1045,7 @@ func cspEnablementAccountSettingToPb(st *CspEnablementAccountSetting) (*cspEnabl } pb := &cspEnablementAccountSettingPb{} pb.CspEnablementAccount = st.CspEnablementAccount - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -1130,10 +1054,8 @@ func cspEnablementAccountSettingToPb(st *CspEnablementAccountSetting) (*cspEnabl type cspEnablementAccountSettingPb struct { CspEnablementAccount CspEnablementAccount `json:"csp_enablement_account"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1165,9 +1087,7 @@ func defaultNamespaceSettingToPb(st *DefaultNamespaceSetting) (*defaultNamespace } pb := &defaultNamespaceSettingPb{} pb.Etag = st.Etag - pb.Namespace = st.Namespace - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -1175,11 +1095,9 @@ func defaultNamespaceSettingToPb(st *DefaultNamespaceSetting) (*defaultNamespace } type defaultNamespaceSettingPb struct { - Etag string `json:"etag,omitempty"` - - Namespace StringMessage `json:"namespace"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + Namespace StringMessage `json:"namespace"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1913,7 +1831,6 @@ func deletePrivateEndpointRuleRequestToPb(st *DeletePrivateEndpointRuleRequest) } pb := &deletePrivateEndpointRuleRequestPb{} pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId return pb, nil @@ -1921,8 +1838,7 @@ func deletePrivateEndpointRuleRequestToPb(st *DeletePrivateEndpointRuleRequest) type deletePrivateEndpointRuleRequestPb struct { NetworkConnectivityConfigId string `json:"-" url:"-"` - - PrivateEndpointRuleId string `json:"-" url:"-"` + PrivateEndpointRuleId string `json:"-" url:"-"` } func deletePrivateEndpointRuleRequestFromPb(pb *deletePrivateEndpointRuleRequestPb) (*DeletePrivateEndpointRuleRequest, error) { @@ -2047,9 +1963,7 @@ func disableLegacyAccessToPb(st *DisableLegacyAccess) (*disableLegacyAccessPb, e } pb := &disableLegacyAccessPb{} pb.DisableLegacyAccess = st.DisableLegacyAccess - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2058,10 +1972,8 @@ func disableLegacyAccessToPb(st *DisableLegacyAccess) (*disableLegacyAccessPb, e type disableLegacyAccessPb struct { DisableLegacyAccess BooleanMessage `json:"disable_legacy_access"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2093,9 +2005,7 @@ func disableLegacyDbfsToPb(st *DisableLegacyDbfs) (*disableLegacyDbfsPb, error) } pb := &disableLegacyDbfsPb{} pb.DisableLegacyDbfs = st.DisableLegacyDbfs - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2104,10 +2014,8 @@ func disableLegacyDbfsToPb(st *DisableLegacyDbfs) (*disableLegacyDbfsPb, error) type disableLegacyDbfsPb struct { DisableLegacyDbfs BooleanMessage `json:"disable_legacy_dbfs"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2139,9 +2047,7 @@ func disableLegacyFeaturesToPb(st *DisableLegacyFeatures) (*disableLegacyFeature } pb := &disableLegacyFeaturesPb{} pb.DisableLegacyFeatures = st.DisableLegacyFeatures - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2150,10 +2056,8 @@ func disableLegacyFeaturesToPb(st *DisableLegacyFeatures) (*disableLegacyFeature type disableLegacyFeaturesPb struct { DisableLegacyFeatures BooleanMessage `json:"disable_legacy_features"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2209,11 +2113,8 @@ func egressNetworkPolicyInternetAccessPolicyToPb(st *EgressNetworkPolicyInternet } pb := &egressNetworkPolicyInternetAccessPolicyPb{} pb.AllowedInternetDestinations = st.AllowedInternetDestinations - pb.AllowedStorageDestinations = st.AllowedStorageDestinations - pb.LogOnlyMode = st.LogOnlyMode - pb.RestrictionMode = st.RestrictionMode return pb, nil @@ -2221,12 +2122,9 @@ func egressNetworkPolicyInternetAccessPolicyToPb(st *EgressNetworkPolicyInternet type egressNetworkPolicyInternetAccessPolicyPb struct { AllowedInternetDestinations []EgressNetworkPolicyInternetAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` - - AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` - - LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode `json:"log_only_mode,omitempty"` - - RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode `json:"restriction_mode,omitempty"` + AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode `json:"log_only_mode,omitempty"` + RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode `json:"restriction_mode,omitempty"` } func egressNetworkPolicyInternetAccessPolicyFromPb(pb *egressNetworkPolicyInternetAccessPolicyPb) (*EgressNetworkPolicyInternetAccessPolicy, error) { @@ -2248,9 +2146,7 @@ func egressNetworkPolicyInternetAccessPolicyInternetDestinationToPb(st *EgressNe } pb := &egressNetworkPolicyInternetAccessPolicyInternetDestinationPb{} pb.Destination = st.Destination - pb.Protocol = st.Protocol - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -2258,11 +2154,9 @@ func egressNetworkPolicyInternetAccessPolicyInternetDestinationToPb(st *EgressNe } type egressNetworkPolicyInternetAccessPolicyInternetDestinationPb struct { - Destination string `json:"destination,omitempty"` - - Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol `json:"protocol,omitempty"` - - Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType `json:"type,omitempty"` + Destination string `json:"destination,omitempty"` + Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol `json:"protocol,omitempty"` + Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2294,7 +2188,6 @@ func egressNetworkPolicyInternetAccessPolicyLogOnlyModeToPb(st *EgressNetworkPol } pb := &egressNetworkPolicyInternetAccessPolicyLogOnlyModePb{} pb.LogOnlyModeType = st.LogOnlyModeType - pb.Workloads = st.Workloads return pb, nil @@ -2302,8 +2195,7 @@ func egressNetworkPolicyInternetAccessPolicyLogOnlyModeToPb(st *EgressNetworkPol type egressNetworkPolicyInternetAccessPolicyLogOnlyModePb struct { LogOnlyModeType EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType `json:"log_only_mode_type,omitempty"` - - Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType `json:"workloads,omitempty"` + Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType `json:"workloads,omitempty"` } func egressNetworkPolicyInternetAccessPolicyLogOnlyModeFromPb(pb *egressNetworkPolicyInternetAccessPolicyLogOnlyModePb) (*EgressNetworkPolicyInternetAccessPolicyLogOnlyMode, error) { @@ -2323,19 +2215,12 @@ func egressNetworkPolicyInternetAccessPolicyStorageDestinationToPb(st *EgressNet } pb := &egressNetworkPolicyInternetAccessPolicyStorageDestinationPb{} pb.AllowedPaths = st.AllowedPaths - pb.AzureContainer = st.AzureContainer - pb.AzureDnsZone = st.AzureDnsZone - pb.AzureStorageAccount = st.AzureStorageAccount - pb.AzureStorageService = st.AzureStorageService - pb.BucketName = st.BucketName - pb.Region = st.Region - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -2343,21 +2228,14 @@ func egressNetworkPolicyInternetAccessPolicyStorageDestinationToPb(st *EgressNet } type egressNetworkPolicyInternetAccessPolicyStorageDestinationPb struct { - AllowedPaths []string `json:"allowed_paths,omitempty"` - - AzureContainer string `json:"azure_container,omitempty"` - - AzureDnsZone string `json:"azure_dns_zone,omitempty"` - - AzureStorageAccount string `json:"azure_storage_account,omitempty"` - - AzureStorageService string `json:"azure_storage_service,omitempty"` - - BucketName string `json:"bucket_name,omitempty"` - - Region string `json:"region,omitempty"` - - Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType `json:"type,omitempty"` + AllowedPaths []string `json:"allowed_paths,omitempty"` + AzureContainer string `json:"azure_container,omitempty"` + AzureDnsZone string `json:"azure_dns_zone,omitempty"` + AzureStorageAccount string `json:"azure_storage_account,omitempty"` + AzureStorageService string `json:"azure_storage_service,omitempty"` + BucketName string `json:"bucket_name,omitempty"` + Region string `json:"region,omitempty"` + Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2394,11 +2272,8 @@ func egressNetworkPolicyNetworkAccessPolicyToPb(st *EgressNetworkPolicyNetworkAc } pb := &egressNetworkPolicyNetworkAccessPolicyPb{} pb.AllowedInternetDestinations = st.AllowedInternetDestinations - pb.AllowedStorageDestinations = st.AllowedStorageDestinations - pb.PolicyEnforcement = st.PolicyEnforcement - pb.RestrictionMode = st.RestrictionMode return pb, nil @@ -2406,12 +2281,9 @@ func egressNetworkPolicyNetworkAccessPolicyToPb(st *EgressNetworkPolicyNetworkAc type egressNetworkPolicyNetworkAccessPolicyPb struct { AllowedInternetDestinations []EgressNetworkPolicyNetworkAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` - - AllowedStorageDestinations []EgressNetworkPolicyNetworkAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` - - PolicyEnforcement *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement `json:"policy_enforcement,omitempty"` - - RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode `json:"restriction_mode"` + AllowedStorageDestinations []EgressNetworkPolicyNetworkAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + PolicyEnforcement *EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement `json:"policy_enforcement,omitempty"` + RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode `json:"restriction_mode"` } func egressNetworkPolicyNetworkAccessPolicyFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPb) (*EgressNetworkPolicyNetworkAccessPolicy, error) { @@ -2433,7 +2305,6 @@ func egressNetworkPolicyNetworkAccessPolicyInternetDestinationToPb(st *EgressNet } pb := &egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb{} pb.Destination = st.Destination - pb.InternetDestinationType = st.InternetDestinationType pb.ForceSendFields = st.ForceSendFields @@ -2441,8 +2312,7 @@ func egressNetworkPolicyNetworkAccessPolicyInternetDestinationToPb(st *EgressNet } type egressNetworkPolicyNetworkAccessPolicyInternetDestinationPb struct { - Destination string `json:"destination,omitempty"` - + Destination string `json:"destination,omitempty"` InternetDestinationType EgressNetworkPolicyNetworkAccessPolicyInternetDestinationInternetDestinationType `json:"internet_destination_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2474,7 +2344,6 @@ func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementToPb(st *EgressNetwo } pb := &egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb{} pb.DryRunModeProductFilter = st.DryRunModeProductFilter - pb.EnforcementMode = st.EnforcementMode return pb, nil @@ -2482,8 +2351,7 @@ func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementToPb(st *EgressNetwo type egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb struct { DryRunModeProductFilter []EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementDryRunModeProductFilter `json:"dry_run_mode_product_filter,omitempty"` - - EnforcementMode EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode `json:"enforcement_mode,omitempty"` + EnforcementMode EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode `json:"enforcement_mode,omitempty"` } func egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementFromPb(pb *egressNetworkPolicyNetworkAccessPolicyPolicyEnforcementPb) (*EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcement, error) { @@ -2503,13 +2371,9 @@ func egressNetworkPolicyNetworkAccessPolicyStorageDestinationToPb(st *EgressNetw } pb := &egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb{} pb.AzureStorageAccount = st.AzureStorageAccount - pb.AzureStorageService = st.AzureStorageService - pb.BucketName = st.BucketName - pb.Region = st.Region - pb.StorageDestinationType = st.StorageDestinationType pb.ForceSendFields = st.ForceSendFields @@ -2517,14 +2381,10 @@ func egressNetworkPolicyNetworkAccessPolicyStorageDestinationToPb(st *EgressNetw } type egressNetworkPolicyNetworkAccessPolicyStorageDestinationPb struct { - AzureStorageAccount string `json:"azure_storage_account,omitempty"` - - AzureStorageService string `json:"azure_storage_service,omitempty"` - - BucketName string `json:"bucket_name,omitempty"` - - Region string `json:"region,omitempty"` - + AzureStorageAccount string `json:"azure_storage_account,omitempty"` + AzureStorageService string `json:"azure_storage_service,omitempty"` + BucketName string `json:"bucket_name,omitempty"` + Region string `json:"region,omitempty"` StorageDestinationType EgressNetworkPolicyNetworkAccessPolicyStorageDestinationStorageDestinationType `json:"storage_destination_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2604,7 +2464,6 @@ func enableExportNotebookToPb(st *EnableExportNotebook) (*enableExportNotebookPb } pb := &enableExportNotebookPb{} pb.BooleanVal = st.BooleanVal - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2612,9 +2471,8 @@ func enableExportNotebookToPb(st *EnableExportNotebook) (*enableExportNotebookPb } type enableExportNotebookPb struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2645,7 +2503,6 @@ func enableNotebookTableClipboardToPb(st *EnableNotebookTableClipboard) (*enable } pb := &enableNotebookTableClipboardPb{} pb.BooleanVal = st.BooleanVal - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2653,9 +2510,8 @@ func enableNotebookTableClipboardToPb(st *EnableNotebookTableClipboard) (*enable } type enableNotebookTableClipboardPb struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2686,7 +2542,6 @@ func enableResultsDownloadingToPb(st *EnableResultsDownloading) (*enableResultsD } pb := &enableResultsDownloadingPb{} pb.BooleanVal = st.BooleanVal - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2694,9 +2549,8 @@ func enableResultsDownloadingToPb(st *EnableResultsDownloading) (*enableResultsD } type enableResultsDownloadingPb struct { - BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2763,9 +2617,7 @@ func enhancedSecurityMonitoringSettingToPb(st *EnhancedSecurityMonitoringSetting } pb := &enhancedSecurityMonitoringSettingPb{} pb.EnhancedSecurityMonitoringWorkspace = st.EnhancedSecurityMonitoringWorkspace - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2774,10 +2626,8 @@ func enhancedSecurityMonitoringSettingToPb(st *EnhancedSecurityMonitoringSetting type enhancedSecurityMonitoringSettingPb struct { EnhancedSecurityMonitoringWorkspace EnhancedSecurityMonitoring `json:"enhanced_security_monitoring_workspace"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2845,9 +2695,7 @@ func esmEnablementAccountSettingToPb(st *EsmEnablementAccountSetting) (*esmEnabl } pb := &esmEnablementAccountSettingPb{} pb.EsmEnablementAccount = st.EsmEnablementAccount - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -2856,10 +2704,8 @@ func esmEnablementAccountSettingToPb(st *EsmEnablementAccountSetting) (*esmEnabl type esmEnablementAccountSettingPb struct { EsmEnablementAccount EsmEnablementAccount `json:"esm_enablement_account"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2891,13 +2737,9 @@ func exchangeTokenToPb(st *ExchangeToken) (*exchangeTokenPb, error) { } pb := &exchangeTokenPb{} pb.Credential = st.Credential - pb.CredentialEolTime = st.CredentialEolTime - pb.OwnerId = st.OwnerId - pb.Scopes = st.Scopes - pb.TokenType = st.TokenType pb.ForceSendFields = st.ForceSendFields @@ -2905,15 +2747,11 @@ func exchangeTokenToPb(st *ExchangeToken) (*exchangeTokenPb, error) { } type exchangeTokenPb struct { - Credential string `json:"credential,omitempty"` - - CredentialEolTime int64 `json:"credentialEolTime,omitempty"` - - OwnerId int64 `json:"ownerId,omitempty"` - - Scopes []string `json:"scopes,omitempty"` - - TokenType TokenType `json:"tokenType,omitempty"` + Credential string `json:"credential,omitempty"` + CredentialEolTime int64 `json:"credentialEolTime,omitempty"` + OwnerId int64 `json:"ownerId,omitempty"` + Scopes []string `json:"scopes,omitempty"` + TokenType TokenType `json:"tokenType,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2947,9 +2785,7 @@ func exchangeTokenRequestToPb(st *ExchangeTokenRequest) (*exchangeTokenRequestPb } pb := &exchangeTokenRequestPb{} pb.PartitionId = st.PartitionId - pb.Scopes = st.Scopes - pb.TokenType = st.TokenType return pb, nil @@ -2957,10 +2793,8 @@ func exchangeTokenRequestToPb(st *ExchangeTokenRequest) (*exchangeTokenRequestPb type exchangeTokenRequestPb struct { PartitionId PartitionId `json:"partitionId"` - - Scopes []string `json:"scopes"` - - TokenType []TokenType `json:"tokenType"` + Scopes []string `json:"scopes"` + TokenType []TokenType `json:"tokenType"` } func exchangeTokenRequestFromPb(pb *exchangeTokenRequestPb) (*ExchangeTokenRequest, error) { @@ -3029,15 +2863,10 @@ func genericWebhookConfigToPb(st *GenericWebhookConfig) (*genericWebhookConfigPb } pb := &genericWebhookConfigPb{} pb.Password = st.Password - pb.PasswordSet = st.PasswordSet - pb.Url = st.Url - pb.UrlSet = st.UrlSet - pb.Username = st.Username - pb.UsernameSet = st.UsernameSet pb.ForceSendFields = st.ForceSendFields @@ -3045,17 +2874,12 @@ func genericWebhookConfigToPb(st *GenericWebhookConfig) (*genericWebhookConfigPb } type genericWebhookConfigPb struct { - Password string `json:"password,omitempty"` - - PasswordSet bool `json:"password_set,omitempty"` - - Url string `json:"url,omitempty"` - - UrlSet bool `json:"url_set,omitempty"` - - Username string `json:"username,omitempty"` - - UsernameSet bool `json:"username_set,omitempty"` + Password string `json:"password,omitempty"` + PasswordSet bool `json:"password_set,omitempty"` + Url string `json:"url,omitempty"` + UrlSet bool `json:"url_set,omitempty"` + Username string `json:"username,omitempty"` + UsernameSet bool `json:"username_set,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3834,7 +3658,6 @@ func getPrivateEndpointRuleRequestToPb(st *GetPrivateEndpointRuleRequest) (*getP } pb := &getPrivateEndpointRuleRequestPb{} pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId return pb, nil @@ -3842,8 +3665,7 @@ func getPrivateEndpointRuleRequestToPb(st *GetPrivateEndpointRuleRequest) (*getP type getPrivateEndpointRuleRequestPb struct { NetworkConnectivityConfigId string `json:"-" url:"-"` - - PrivateEndpointRuleId string `json:"-" url:"-"` + PrivateEndpointRuleId string `json:"-" url:"-"` } func getPrivateEndpointRuleRequestFromPb(pb *getPrivateEndpointRuleRequestPb) (*GetPrivateEndpointRuleRequest, error) { @@ -4019,23 +3841,14 @@ func ipAccessListInfoToPb(st *IpAccessListInfo) (*ipAccessListInfoPb, error) { } pb := &ipAccessListInfoPb{} pb.AddressCount = st.AddressCount - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Enabled = st.Enabled - pb.IpAddresses = st.IpAddresses - pb.Label = st.Label - pb.ListId = st.ListId - pb.ListType = st.ListType - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -4043,25 +3856,16 @@ func ipAccessListInfoToPb(st *IpAccessListInfo) (*ipAccessListInfoPb, error) { } type ipAccessListInfoPb struct { - AddressCount int `json:"address_count,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy int64 `json:"created_by,omitempty"` - - Enabled bool `json:"enabled,omitempty"` - - IpAddresses []string `json:"ip_addresses,omitempty"` - - Label string `json:"label,omitempty"` - - ListId string `json:"list_id,omitempty"` - - ListType ListType `json:"list_type,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy int64 `json:"updated_by,omitempty"` + AddressCount int `json:"address_count,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy int64 `json:"created_by,omitempty"` + Enabled bool `json:"enabled,omitempty"` + IpAddresses []string `json:"ip_addresses,omitempty"` + Label string `json:"label,omitempty"` + ListId string `json:"list_id,omitempty"` + ListType ListType `json:"list_type,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy int64 `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4124,7 +3928,6 @@ func listNccAzurePrivateEndpointRulesResponseToPb(st *ListNccAzurePrivateEndpoin } pb := &listNccAzurePrivateEndpointRulesResponsePb{} pb.Items = st.Items - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -4132,9 +3935,8 @@ func listNccAzurePrivateEndpointRulesResponseToPb(st *ListNccAzurePrivateEndpoin } type listNccAzurePrivateEndpointRulesResponsePb struct { - Items []NccAzurePrivateEndpointRule `json:"items,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Items []NccAzurePrivateEndpointRule `json:"items,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4201,7 +4003,6 @@ func listNetworkConnectivityConfigurationsResponseToPb(st *ListNetworkConnectivi } pb := &listNetworkConnectivityConfigurationsResponsePb{} pb.Items = st.Items - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -4209,9 +4010,8 @@ func listNetworkConnectivityConfigurationsResponseToPb(st *ListNetworkConnectivi } type listNetworkConnectivityConfigurationsResponsePb struct { - Items []NetworkConnectivityConfiguration `json:"items,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Items []NetworkConnectivityConfiguration `json:"items,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4278,7 +4078,6 @@ func listNetworkPoliciesResponseToPb(st *ListNetworkPoliciesResponse) (*listNetw } pb := &listNetworkPoliciesResponsePb{} pb.Items = st.Items - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -4286,9 +4085,8 @@ func listNetworkPoliciesResponseToPb(st *ListNetworkPoliciesResponse) (*listNetw } type listNetworkPoliciesResponsePb struct { - Items []AccountNetworkPolicy `json:"items,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Items []AccountNetworkPolicy `json:"items,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4319,7 +4117,6 @@ func listNotificationDestinationsRequestToPb(st *ListNotificationDestinationsReq } pb := &listNotificationDestinationsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4327,8 +4124,7 @@ func listNotificationDestinationsRequestToPb(st *ListNotificationDestinationsReq } type listNotificationDestinationsRequestPb struct { - PageSize int64 `json:"-" url:"page_size,omitempty"` - + PageSize int64 `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4360,7 +4156,6 @@ func listNotificationDestinationsResponseToPb(st *ListNotificationDestinationsRe } pb := &listNotificationDestinationsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -4368,9 +4163,8 @@ func listNotificationDestinationsResponseToPb(st *ListNotificationDestinationsRe } type listNotificationDestinationsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Results []ListNotificationDestinationsResult `json:"results,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Results []ListNotificationDestinationsResult `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4401,9 +4195,7 @@ func listNotificationDestinationsResultToPb(st *ListNotificationDestinationsResu } pb := &listNotificationDestinationsResultPb{} pb.DestinationType = st.DestinationType - pb.DisplayName = st.DisplayName - pb.Id = st.Id pb.ForceSendFields = st.ForceSendFields @@ -4412,10 +4204,8 @@ func listNotificationDestinationsResultToPb(st *ListNotificationDestinationsResu type listNotificationDestinationsResultPb struct { DestinationType DestinationType `json:"destination_type,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4447,7 +4237,6 @@ func listPrivateEndpointRulesRequestToPb(st *ListPrivateEndpointRulesRequest) (* } pb := &listPrivateEndpointRulesRequestPb{} pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4456,8 +4245,7 @@ func listPrivateEndpointRulesRequestToPb(st *ListPrivateEndpointRulesRequest) (* type listPrivateEndpointRulesRequestPb struct { NetworkConnectivityConfigId string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4512,7 +4300,6 @@ func listTokenManagementRequestToPb(st *ListTokenManagementRequest) (*listTokenM } pb := &listTokenManagementRequestPb{} pb.CreatedById = st.CreatedById - pb.CreatedByUsername = st.CreatedByUsername pb.ForceSendFields = st.ForceSendFields @@ -4520,8 +4307,7 @@ func listTokenManagementRequestToPb(st *ListTokenManagementRequest) (*listTokenM } type listTokenManagementRequestPb struct { - CreatedById int64 `json:"-" url:"created_by_id,omitempty"` - + CreatedById int64 `json:"-" url:"created_by_id,omitempty"` CreatedByUsername string `json:"-" url:"created_by_username,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4577,9 +4363,7 @@ func llmProxyPartnerPoweredAccountToPb(st *LlmProxyPartnerPoweredAccount) (*llmP } pb := &llmProxyPartnerPoweredAccountPb{} pb.BooleanVal = st.BooleanVal - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -4587,11 +4371,9 @@ func llmProxyPartnerPoweredAccountToPb(st *LlmProxyPartnerPoweredAccount) (*llmP } type llmProxyPartnerPoweredAccountPb struct { - BooleanVal BooleanMessage `json:"boolean_val"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal BooleanMessage `json:"boolean_val"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4623,9 +4405,7 @@ func llmProxyPartnerPoweredEnforceToPb(st *LlmProxyPartnerPoweredEnforce) (*llmP } pb := &llmProxyPartnerPoweredEnforcePb{} pb.BooleanVal = st.BooleanVal - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -4633,11 +4413,9 @@ func llmProxyPartnerPoweredEnforceToPb(st *LlmProxyPartnerPoweredEnforce) (*llmP } type llmProxyPartnerPoweredEnforcePb struct { - BooleanVal BooleanMessage `json:"boolean_val"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal BooleanMessage `json:"boolean_val"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4669,9 +4447,7 @@ func llmProxyPartnerPoweredWorkspaceToPb(st *LlmProxyPartnerPoweredWorkspace) (* } pb := &llmProxyPartnerPoweredWorkspacePb{} pb.BooleanVal = st.BooleanVal - pb.Etag = st.Etag - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -4679,11 +4455,9 @@ func llmProxyPartnerPoweredWorkspaceToPb(st *LlmProxyPartnerPoweredWorkspace) (* } type llmProxyPartnerPoweredWorkspacePb struct { - BooleanVal BooleanMessage `json:"boolean_val"` - - Etag string `json:"etag,omitempty"` - - SettingName string `json:"setting_name,omitempty"` + BooleanVal BooleanMessage `json:"boolean_val"` + Etag string `json:"etag,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4715,7 +4489,6 @@ func microsoftTeamsConfigToPb(st *MicrosoftTeamsConfig) (*microsoftTeamsConfigPb } pb := µsoftTeamsConfigPb{} pb.Url = st.Url - pb.UrlSet = st.UrlSet pb.ForceSendFields = st.ForceSendFields @@ -4723,9 +4496,8 @@ func microsoftTeamsConfigToPb(st *MicrosoftTeamsConfig) (*microsoftTeamsConfigPb } type microsoftTeamsConfigPb struct { - Url string `json:"url,omitempty"` - - UrlSet bool `json:"url_set,omitempty"` + Url string `json:"url,omitempty"` + UrlSet bool `json:"url_set,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4780,25 +4552,15 @@ func nccAzurePrivateEndpointRuleToPb(st *NccAzurePrivateEndpointRule) (*nccAzure } pb := &nccAzurePrivateEndpointRulePb{} pb.ConnectionState = st.ConnectionState - pb.CreationTime = st.CreationTime - pb.Deactivated = st.Deactivated - pb.DeactivatedAt = st.DeactivatedAt - pb.DomainNames = st.DomainNames - pb.EndpointName = st.EndpointName - pb.GroupId = st.GroupId - pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.ResourceId = st.ResourceId - pb.RuleId = st.RuleId - pb.UpdatedTime = st.UpdatedTime pb.ForceSendFields = st.ForceSendFields @@ -4806,27 +4568,17 @@ func nccAzurePrivateEndpointRuleToPb(st *NccAzurePrivateEndpointRule) (*nccAzure } type nccAzurePrivateEndpointRulePb struct { - ConnectionState NccAzurePrivateEndpointRuleConnectionState `json:"connection_state,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - Deactivated bool `json:"deactivated,omitempty"` - - DeactivatedAt int64 `json:"deactivated_at,omitempty"` - - DomainNames []string `json:"domain_names,omitempty"` - - EndpointName string `json:"endpoint_name,omitempty"` - - GroupId string `json:"group_id,omitempty"` - - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` - - ResourceId string `json:"resource_id,omitempty"` - - RuleId string `json:"rule_id,omitempty"` - - UpdatedTime int64 `json:"updated_time,omitempty"` + ConnectionState NccAzurePrivateEndpointRuleConnectionState `json:"connection_state,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + Deactivated bool `json:"deactivated,omitempty"` + DeactivatedAt int64 `json:"deactivated_at,omitempty"` + DomainNames []string `json:"domain_names,omitempty"` + EndpointName string `json:"endpoint_name,omitempty"` + GroupId string `json:"group_id,omitempty"` + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + ResourceId string `json:"resource_id,omitempty"` + RuleId string `json:"rule_id,omitempty"` + UpdatedTime int64 `json:"updated_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4866,9 +4618,7 @@ func nccAzureServiceEndpointRuleToPb(st *NccAzureServiceEndpointRule) (*nccAzure } pb := &nccAzureServiceEndpointRulePb{} pb.Subnets = st.Subnets - pb.TargetRegion = st.TargetRegion - pb.TargetServices = st.TargetServices pb.ForceSendFields = st.ForceSendFields @@ -4876,10 +4626,8 @@ func nccAzureServiceEndpointRuleToPb(st *NccAzureServiceEndpointRule) (*nccAzure } type nccAzureServiceEndpointRulePb struct { - Subnets []string `json:"subnets,omitempty"` - - TargetRegion string `json:"target_region,omitempty"` - + Subnets []string `json:"subnets,omitempty"` + TargetRegion string `json:"target_region,omitempty"` TargetServices []EgressResourceType `json:"target_services,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4912,7 +4660,6 @@ func nccEgressConfigToPb(st *NccEgressConfig) (*nccEgressConfigPb, error) { } pb := &nccEgressConfigPb{} pb.DefaultRules = st.DefaultRules - pb.TargetRules = st.TargetRules return pb, nil @@ -4920,8 +4667,7 @@ func nccEgressConfigToPb(st *NccEgressConfig) (*nccEgressConfigPb, error) { type nccEgressConfigPb struct { DefaultRules *NccEgressDefaultRules `json:"default_rules,omitempty"` - - TargetRules *NccEgressTargetRules `json:"target_rules,omitempty"` + TargetRules *NccEgressTargetRules `json:"target_rules,omitempty"` } func nccEgressConfigFromPb(pb *nccEgressConfigPb) (*NccEgressConfig, error) { @@ -4941,15 +4687,13 @@ func nccEgressDefaultRulesToPb(st *NccEgressDefaultRules) (*nccEgressDefaultRule } pb := &nccEgressDefaultRulesPb{} pb.AwsStableIpRule = st.AwsStableIpRule - pb.AzureServiceEndpointRule = st.AzureServiceEndpointRule return pb, nil } type nccEgressDefaultRulesPb struct { - AwsStableIpRule *NccAwsStableIpRule `json:"aws_stable_ip_rule,omitempty"` - + AwsStableIpRule *NccAwsStableIpRule `json:"aws_stable_ip_rule,omitempty"` AzureServiceEndpointRule *NccAzureServiceEndpointRule `json:"azure_service_endpoint_rule,omitempty"` } @@ -4994,17 +4738,11 @@ func networkConnectivityConfigurationToPb(st *NetworkConnectivityConfiguration) } pb := &networkConnectivityConfigurationPb{} pb.AccountId = st.AccountId - pb.CreationTime = st.CreationTime - pb.EgressConfig = st.EgressConfig - pb.Name = st.Name - pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.Region = st.Region - pb.UpdatedTime = st.UpdatedTime pb.ForceSendFields = st.ForceSendFields @@ -5012,19 +4750,13 @@ func networkConnectivityConfigurationToPb(st *NetworkConnectivityConfiguration) } type networkConnectivityConfigurationPb struct { - AccountId string `json:"account_id,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - EgressConfig *NccEgressConfig `json:"egress_config,omitempty"` - - Name string `json:"name,omitempty"` - - NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` - - Region string `json:"region,omitempty"` - - UpdatedTime int64 `json:"updated_time,omitempty"` + AccountId string `json:"account_id,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + EgressConfig *NccEgressConfig `json:"egress_config,omitempty"` + Name string `json:"name,omitempty"` + NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"` + Region string `json:"region,omitempty"` + UpdatedTime int64 `json:"updated_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5084,11 +4816,8 @@ func notificationDestinationToPb(st *NotificationDestination) (*notificationDest } pb := ¬ificationDestinationPb{} pb.Config = st.Config - pb.DestinationType = st.DestinationType - pb.DisplayName = st.DisplayName - pb.Id = st.Id pb.ForceSendFields = st.ForceSendFields @@ -5096,13 +4825,10 @@ func notificationDestinationToPb(st *NotificationDestination) (*notificationDest } type notificationDestinationPb struct { - Config *Config `json:"config,omitempty"` - + Config *Config `json:"config,omitempty"` DestinationType DestinationType `json:"destination_type,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5135,7 +4861,6 @@ func pagerdutyConfigToPb(st *PagerdutyConfig) (*pagerdutyConfigPb, error) { } pb := &pagerdutyConfigPb{} pb.IntegrationKey = st.IntegrationKey - pb.IntegrationKeySet = st.IntegrationKeySet pb.ForceSendFields = st.ForceSendFields @@ -5143,9 +4868,8 @@ func pagerdutyConfigToPb(st *PagerdutyConfig) (*pagerdutyConfigPb, error) { } type pagerdutyConfigPb struct { - IntegrationKey string `json:"integration_key,omitempty"` - - IntegrationKeySet bool `json:"integration_key_set,omitempty"` + IntegrationKey string `json:"integration_key,omitempty"` + IntegrationKeySet bool `json:"integration_key_set,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5236,9 +4960,7 @@ func personalComputeSettingToPb(st *PersonalComputeSetting) (*personalComputeSet } pb := &personalComputeSettingPb{} pb.Etag = st.Etag - pb.PersonalCompute = st.PersonalCompute - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -5246,11 +4968,9 @@ func personalComputeSettingToPb(st *PersonalComputeSetting) (*personalComputeSet } type personalComputeSettingPb struct { - Etag string `json:"etag,omitempty"` - + Etag string `json:"etag,omitempty"` PersonalCompute PersonalComputeMessage `json:"personal_compute"` - - SettingName string `json:"setting_name,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5282,11 +5002,8 @@ func publicTokenInfoToPb(st *PublicTokenInfo) (*publicTokenInfoPb, error) { } pb := &publicTokenInfoPb{} pb.Comment = st.Comment - pb.CreationTime = st.CreationTime - pb.ExpiryTime = st.ExpiryTime - pb.TokenId = st.TokenId pb.ForceSendFields = st.ForceSendFields @@ -5294,13 +5011,10 @@ func publicTokenInfoToPb(st *PublicTokenInfo) (*publicTokenInfoPb, error) { } type publicTokenInfoPb struct { - Comment string `json:"comment,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - ExpiryTime int64 `json:"expiry_time,omitempty"` - - TokenId string `json:"token_id,omitempty"` + Comment string `json:"comment,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + ExpiryTime int64 `json:"expiry_time,omitempty"` + TokenId string `json:"token_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5333,28 +5047,20 @@ func replaceIpAccessListToPb(st *ReplaceIpAccessList) (*replaceIpAccessListPb, e } pb := &replaceIpAccessListPb{} pb.Enabled = st.Enabled - pb.IpAccessListId = st.IpAccessListId - pb.IpAddresses = st.IpAddresses - pb.Label = st.Label - pb.ListType = st.ListType return pb, nil } type replaceIpAccessListPb struct { - Enabled bool `json:"enabled"` - - IpAccessListId string `json:"-" url:"-"` - - IpAddresses []string `json:"ip_addresses,omitempty"` - - Label string `json:"label"` - - ListType ListType `json:"list_type"` + Enabled bool `json:"enabled"` + IpAccessListId string `json:"-" url:"-"` + IpAddresses []string `json:"ip_addresses,omitempty"` + Label string `json:"label"` + ListType ListType `json:"list_type"` } func replaceIpAccessListFromPb(pb *replaceIpAccessListPb) (*ReplaceIpAccessList, error) { @@ -5422,9 +5128,7 @@ func restrictWorkspaceAdminsSettingToPb(st *RestrictWorkspaceAdminsSetting) (*re } pb := &restrictWorkspaceAdminsSettingPb{} pb.Etag = st.Etag - pb.RestrictWorkspaceAdmins = st.RestrictWorkspaceAdmins - pb.SettingName = st.SettingName pb.ForceSendFields = st.ForceSendFields @@ -5432,11 +5136,9 @@ func restrictWorkspaceAdminsSettingToPb(st *RestrictWorkspaceAdminsSetting) (*re } type restrictWorkspaceAdminsSettingPb struct { - Etag string `json:"etag,omitempty"` - + Etag string `json:"etag,omitempty"` RestrictWorkspaceAdmins RestrictWorkspaceAdminsMessage `json:"restrict_workspace_admins"` - - SettingName string `json:"setting_name,omitempty"` + SettingName string `json:"setting_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5534,7 +5236,6 @@ func slackConfigToPb(st *SlackConfig) (*slackConfigPb, error) { } pb := &slackConfigPb{} pb.Url = st.Url - pb.UrlSet = st.UrlSet pb.ForceSendFields = st.ForceSendFields @@ -5542,9 +5243,8 @@ func slackConfigToPb(st *SlackConfig) (*slackConfigPb, error) { } type slackConfigPb struct { - Url string `json:"url,omitempty"` - - UrlSet bool `json:"url_set,omitempty"` + Url string `json:"url,omitempty"` + UrlSet bool `json:"url_set,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5611,11 +5311,8 @@ func tokenAccessControlRequestToPb(st *TokenAccessControlRequest) (*tokenAccessC } pb := &tokenAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5623,13 +5320,10 @@ func tokenAccessControlRequestToPb(st *TokenAccessControlRequest) (*tokenAccessC } type tokenAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5662,13 +5356,9 @@ func tokenAccessControlResponseToPb(st *TokenAccessControlResponse) (*tokenAcces } pb := &tokenAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -5676,15 +5366,11 @@ func tokenAccessControlResponseToPb(st *TokenAccessControlResponse) (*tokenAcces } type tokenAccessControlResponsePb struct { - AllPermissions []TokenPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []TokenPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5718,21 +5404,13 @@ func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { } pb := &tokenInfoPb{} pb.Comment = st.Comment - pb.CreatedById = st.CreatedById - pb.CreatedByUsername = st.CreatedByUsername - pb.CreationTime = st.CreationTime - pb.ExpiryTime = st.ExpiryTime - pb.LastUsedDay = st.LastUsedDay - pb.OwnerId = st.OwnerId - pb.TokenId = st.TokenId - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -5740,23 +5418,15 @@ func tokenInfoToPb(st *TokenInfo) (*tokenInfoPb, error) { } type tokenInfoPb struct { - Comment string `json:"comment,omitempty"` - - CreatedById int64 `json:"created_by_id,omitempty"` - + Comment string `json:"comment,omitempty"` + CreatedById int64 `json:"created_by_id,omitempty"` CreatedByUsername string `json:"created_by_username,omitempty"` - - CreationTime int64 `json:"creation_time,omitempty"` - - ExpiryTime int64 `json:"expiry_time,omitempty"` - - LastUsedDay int64 `json:"last_used_day,omitempty"` - - OwnerId int64 `json:"owner_id,omitempty"` - - TokenId string `json:"token_id,omitempty"` - - WorkspaceId int64 `json:"workspace_id,omitempty"` + CreationTime int64 `json:"creation_time,omitempty"` + ExpiryTime int64 `json:"expiry_time,omitempty"` + LastUsedDay int64 `json:"last_used_day,omitempty"` + OwnerId int64 `json:"owner_id,omitempty"` + TokenId string `json:"token_id,omitempty"` + WorkspaceId int64 `json:"workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5794,9 +5464,7 @@ func tokenPermissionToPb(st *TokenPermission) (*tokenPermissionPb, error) { } pb := &tokenPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5804,11 +5472,9 @@ func tokenPermissionToPb(st *TokenPermission) (*tokenPermissionPb, error) { } type tokenPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5840,9 +5506,7 @@ func tokenPermissionsToPb(st *TokenPermissions) (*tokenPermissionsPb, error) { } pb := &tokenPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -5851,10 +5515,8 @@ func tokenPermissionsToPb(st *TokenPermissions) (*tokenPermissionsPb, error) { type tokenPermissionsPb struct { AccessControlList []TokenAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5886,7 +5548,6 @@ func tokenPermissionsDescriptionToPb(st *TokenPermissionsDescription) (*tokenPer } pb := &tokenPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -5894,8 +5555,7 @@ func tokenPermissionsDescriptionToPb(st *TokenPermissionsDescription) (*tokenPer } type tokenPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5951,20 +5611,16 @@ func updateAccountIpAccessEnableRequestToPb(st *UpdateAccountIpAccessEnableReque } pb := &updateAccountIpAccessEnableRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateAccountIpAccessEnableRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting AccountIpAccessEnable `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting AccountIpAccessEnable `json:"setting"` } func updateAccountIpAccessEnableRequestFromPb(pb *updateAccountIpAccessEnableRequestPb) (*UpdateAccountIpAccessEnableRequest, error) { @@ -5985,20 +5641,16 @@ func updateAibiDashboardEmbeddingAccessPolicySettingRequestToPb(st *UpdateAibiDa } pb := &updateAibiDashboardEmbeddingAccessPolicySettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateAibiDashboardEmbeddingAccessPolicySettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting AibiDashboardEmbeddingAccessPolicySetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting AibiDashboardEmbeddingAccessPolicySetting `json:"setting"` } func updateAibiDashboardEmbeddingAccessPolicySettingRequestFromPb(pb *updateAibiDashboardEmbeddingAccessPolicySettingRequestPb) (*UpdateAibiDashboardEmbeddingAccessPolicySettingRequest, error) { @@ -6019,20 +5671,16 @@ func updateAibiDashboardEmbeddingApprovedDomainsSettingRequestToPb(st *UpdateAib } pb := &updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting AibiDashboardEmbeddingApprovedDomainsSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting AibiDashboardEmbeddingApprovedDomainsSetting `json:"setting"` } func updateAibiDashboardEmbeddingApprovedDomainsSettingRequestFromPb(pb *updateAibiDashboardEmbeddingApprovedDomainsSettingRequestPb) (*UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest, error) { @@ -6053,20 +5701,16 @@ func updateAutomaticClusterUpdateSettingRequestToPb(st *UpdateAutomaticClusterUp } pb := &updateAutomaticClusterUpdateSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateAutomaticClusterUpdateSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting AutomaticClusterUpdateSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting AutomaticClusterUpdateSetting `json:"setting"` } func updateAutomaticClusterUpdateSettingRequestFromPb(pb *updateAutomaticClusterUpdateSettingRequestPb) (*UpdateAutomaticClusterUpdateSettingRequest, error) { @@ -6087,20 +5731,16 @@ func updateComplianceSecurityProfileSettingRequestToPb(st *UpdateComplianceSecur } pb := &updateComplianceSecurityProfileSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateComplianceSecurityProfileSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting ComplianceSecurityProfileSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting ComplianceSecurityProfileSetting `json:"setting"` } func updateComplianceSecurityProfileSettingRequestFromPb(pb *updateComplianceSecurityProfileSettingRequestPb) (*UpdateComplianceSecurityProfileSettingRequest, error) { @@ -6121,20 +5761,16 @@ func updateCspEnablementAccountSettingRequestToPb(st *UpdateCspEnablementAccount } pb := &updateCspEnablementAccountSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateCspEnablementAccountSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting CspEnablementAccountSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting CspEnablementAccountSetting `json:"setting"` } func updateCspEnablementAccountSettingRequestFromPb(pb *updateCspEnablementAccountSettingRequestPb) (*UpdateCspEnablementAccountSettingRequest, error) { @@ -6155,20 +5791,16 @@ func updateDefaultNamespaceSettingRequestToPb(st *UpdateDefaultNamespaceSettingR } pb := &updateDefaultNamespaceSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateDefaultNamespaceSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting DefaultNamespaceSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting DefaultNamespaceSetting `json:"setting"` } func updateDefaultNamespaceSettingRequestFromPb(pb *updateDefaultNamespaceSettingRequestPb) (*UpdateDefaultNamespaceSettingRequest, error) { @@ -6189,20 +5821,16 @@ func updateDisableLegacyAccessRequestToPb(st *UpdateDisableLegacyAccessRequest) } pb := &updateDisableLegacyAccessRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateDisableLegacyAccessRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting DisableLegacyAccess `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting DisableLegacyAccess `json:"setting"` } func updateDisableLegacyAccessRequestFromPb(pb *updateDisableLegacyAccessRequestPb) (*UpdateDisableLegacyAccessRequest, error) { @@ -6223,20 +5851,16 @@ func updateDisableLegacyDbfsRequestToPb(st *UpdateDisableLegacyDbfsRequest) (*up } pb := &updateDisableLegacyDbfsRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateDisableLegacyDbfsRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting DisableLegacyDbfs `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting DisableLegacyDbfs `json:"setting"` } func updateDisableLegacyDbfsRequestFromPb(pb *updateDisableLegacyDbfsRequestPb) (*UpdateDisableLegacyDbfsRequest, error) { @@ -6257,20 +5881,16 @@ func updateDisableLegacyFeaturesRequestToPb(st *UpdateDisableLegacyFeaturesReque } pb := &updateDisableLegacyFeaturesRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateDisableLegacyFeaturesRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting DisableLegacyFeatures `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting DisableLegacyFeatures `json:"setting"` } func updateDisableLegacyFeaturesRequestFromPb(pb *updateDisableLegacyFeaturesRequestPb) (*UpdateDisableLegacyFeaturesRequest, error) { @@ -6291,20 +5911,16 @@ func updateEnableExportNotebookRequestToPb(st *UpdateEnableExportNotebookRequest } pb := &updateEnableExportNotebookRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateEnableExportNotebookRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting EnableExportNotebook `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting EnableExportNotebook `json:"setting"` } func updateEnableExportNotebookRequestFromPb(pb *updateEnableExportNotebookRequestPb) (*UpdateEnableExportNotebookRequest, error) { @@ -6325,20 +5941,16 @@ func updateEnableNotebookTableClipboardRequestToPb(st *UpdateEnableNotebookTable } pb := &updateEnableNotebookTableClipboardRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateEnableNotebookTableClipboardRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting EnableNotebookTableClipboard `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting EnableNotebookTableClipboard `json:"setting"` } func updateEnableNotebookTableClipboardRequestFromPb(pb *updateEnableNotebookTableClipboardRequestPb) (*UpdateEnableNotebookTableClipboardRequest, error) { @@ -6359,20 +5971,16 @@ func updateEnableResultsDownloadingRequestToPb(st *UpdateEnableResultsDownloadin } pb := &updateEnableResultsDownloadingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateEnableResultsDownloadingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting EnableResultsDownloading `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting EnableResultsDownloading `json:"setting"` } func updateEnableResultsDownloadingRequestFromPb(pb *updateEnableResultsDownloadingRequestPb) (*UpdateEnableResultsDownloadingRequest, error) { @@ -6393,20 +6001,16 @@ func updateEnhancedSecurityMonitoringSettingRequestToPb(st *UpdateEnhancedSecuri } pb := &updateEnhancedSecurityMonitoringSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateEnhancedSecurityMonitoringSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting EnhancedSecurityMonitoringSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting EnhancedSecurityMonitoringSetting `json:"setting"` } func updateEnhancedSecurityMonitoringSettingRequestFromPb(pb *updateEnhancedSecurityMonitoringSettingRequestPb) (*UpdateEnhancedSecurityMonitoringSettingRequest, error) { @@ -6427,20 +6031,16 @@ func updateEsmEnablementAccountSettingRequestToPb(st *UpdateEsmEnablementAccount } pb := &updateEsmEnablementAccountSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateEsmEnablementAccountSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting EsmEnablementAccountSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting EsmEnablementAccountSetting `json:"setting"` } func updateEsmEnablementAccountSettingRequestFromPb(pb *updateEsmEnablementAccountSettingRequestPb) (*UpdateEsmEnablementAccountSettingRequest, error) { @@ -6461,13 +6061,9 @@ func updateIpAccessListToPb(st *UpdateIpAccessList) (*updateIpAccessListPb, erro } pb := &updateIpAccessListPb{} pb.Enabled = st.Enabled - pb.IpAccessListId = st.IpAccessListId - pb.IpAddresses = st.IpAddresses - pb.Label = st.Label - pb.ListType = st.ListType pb.ForceSendFields = st.ForceSendFields @@ -6475,15 +6071,11 @@ func updateIpAccessListToPb(st *UpdateIpAccessList) (*updateIpAccessListPb, erro } type updateIpAccessListPb struct { - Enabled bool `json:"enabled,omitempty"` - - IpAccessListId string `json:"-" url:"-"` - - IpAddresses []string `json:"ip_addresses,omitempty"` - - Label string `json:"label,omitempty"` - - ListType ListType `json:"list_type,omitempty"` + Enabled bool `json:"enabled,omitempty"` + IpAccessListId string `json:"-" url:"-"` + IpAddresses []string `json:"ip_addresses,omitempty"` + Label string `json:"label,omitempty"` + ListType ListType `json:"list_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6517,20 +6109,16 @@ func updateLlmProxyPartnerPoweredAccountRequestToPb(st *UpdateLlmProxyPartnerPow } pb := &updateLlmProxyPartnerPoweredAccountRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateLlmProxyPartnerPoweredAccountRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting LlmProxyPartnerPoweredAccount `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting LlmProxyPartnerPoweredAccount `json:"setting"` } func updateLlmProxyPartnerPoweredAccountRequestFromPb(pb *updateLlmProxyPartnerPoweredAccountRequestPb) (*UpdateLlmProxyPartnerPoweredAccountRequest, error) { @@ -6551,20 +6139,16 @@ func updateLlmProxyPartnerPoweredEnforceRequestToPb(st *UpdateLlmProxyPartnerPow } pb := &updateLlmProxyPartnerPoweredEnforceRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateLlmProxyPartnerPoweredEnforceRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting LlmProxyPartnerPoweredEnforce `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting LlmProxyPartnerPoweredEnforce `json:"setting"` } func updateLlmProxyPartnerPoweredEnforceRequestFromPb(pb *updateLlmProxyPartnerPoweredEnforceRequestPb) (*UpdateLlmProxyPartnerPoweredEnforceRequest, error) { @@ -6585,20 +6169,16 @@ func updateLlmProxyPartnerPoweredWorkspaceRequestToPb(st *UpdateLlmProxyPartnerP } pb := &updateLlmProxyPartnerPoweredWorkspaceRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateLlmProxyPartnerPoweredWorkspaceRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` } func updateLlmProxyPartnerPoweredWorkspaceRequestFromPb(pb *updateLlmProxyPartnerPoweredWorkspaceRequestPb) (*UpdateLlmProxyPartnerPoweredWorkspaceRequest, error) { @@ -6619,24 +6199,18 @@ func updateNccAzurePrivateEndpointRulePublicRequestToPb(st *UpdateNccAzurePrivat } pb := &updateNccAzurePrivateEndpointRulePublicRequestPb{} pb.NetworkConnectivityConfigId = st.NetworkConnectivityConfigId - pb.PrivateEndpointRule = st.PrivateEndpointRule - pb.PrivateEndpointRuleId = st.PrivateEndpointRuleId - pb.UpdateMask = st.UpdateMask return pb, nil } type updateNccAzurePrivateEndpointRulePublicRequestPb struct { - NetworkConnectivityConfigId string `json:"-" url:"-"` - - PrivateEndpointRule UpdatePrivateEndpointRule `json:"private_endpoint_rule"` - - PrivateEndpointRuleId string `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask"` + NetworkConnectivityConfigId string `json:"-" url:"-"` + PrivateEndpointRule UpdatePrivateEndpointRule `json:"private_endpoint_rule"` + PrivateEndpointRuleId string `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask"` } func updateNccAzurePrivateEndpointRulePublicRequestFromPb(pb *updateNccAzurePrivateEndpointRulePublicRequestPb) (*UpdateNccAzurePrivateEndpointRulePublicRequest, error) { @@ -6658,16 +6232,14 @@ func updateNetworkPolicyRequestToPb(st *UpdateNetworkPolicyRequest) (*updateNetw } pb := &updateNetworkPolicyRequestPb{} pb.NetworkPolicy = st.NetworkPolicy - pb.NetworkPolicyId = st.NetworkPolicyId return pb, nil } type updateNetworkPolicyRequestPb struct { - NetworkPolicy AccountNetworkPolicy `json:"network_policy"` - - NetworkPolicyId string `json:"-" url:"-"` + NetworkPolicy AccountNetworkPolicy `json:"network_policy"` + NetworkPolicyId string `json:"-" url:"-"` } func updateNetworkPolicyRequestFromPb(pb *updateNetworkPolicyRequestPb) (*UpdateNetworkPolicyRequest, error) { @@ -6687,9 +6259,7 @@ func updateNotificationDestinationRequestToPb(st *UpdateNotificationDestinationR } pb := &updateNotificationDestinationRequestPb{} pb.Config = st.Config - pb.DisplayName = st.DisplayName - pb.Id = st.Id pb.ForceSendFields = st.ForceSendFields @@ -6697,11 +6267,9 @@ func updateNotificationDestinationRequestToPb(st *UpdateNotificationDestinationR } type updateNotificationDestinationRequestPb struct { - Config *Config `json:"config,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"-" url:"-"` + Config *Config `json:"config,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -6733,20 +6301,16 @@ func updatePersonalComputeSettingRequestToPb(st *UpdatePersonalComputeSettingReq } pb := &updatePersonalComputeSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updatePersonalComputeSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting PersonalComputeSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting PersonalComputeSetting `json:"setting"` } func updatePersonalComputeSettingRequestFromPb(pb *updatePersonalComputeSettingRequestPb) (*UpdatePersonalComputeSettingRequest, error) { @@ -6812,20 +6376,16 @@ func updateRestrictWorkspaceAdminsSettingRequestToPb(st *UpdateRestrictWorkspace } pb := &updateRestrictWorkspaceAdminsSettingRequestPb{} pb.AllowMissing = st.AllowMissing - pb.FieldMask = st.FieldMask - pb.Setting = st.Setting return pb, nil } type updateRestrictWorkspaceAdminsSettingRequestPb struct { - AllowMissing bool `json:"allow_missing"` - - FieldMask string `json:"field_mask"` - - Setting RestrictWorkspaceAdminsSetting `json:"setting"` + AllowMissing bool `json:"allow_missing"` + FieldMask string `json:"field_mask"` + Setting RestrictWorkspaceAdminsSetting `json:"setting"` } func updateRestrictWorkspaceAdminsSettingRequestFromPb(pb *updateRestrictWorkspaceAdminsSettingRequestPb) (*UpdateRestrictWorkspaceAdminsSettingRequest, error) { @@ -6846,15 +6406,13 @@ func updateWorkspaceNetworkOptionRequestToPb(st *UpdateWorkspaceNetworkOptionReq } pb := &updateWorkspaceNetworkOptionRequestPb{} pb.WorkspaceId = st.WorkspaceId - pb.WorkspaceNetworkOption = st.WorkspaceNetworkOption return pb, nil } type updateWorkspaceNetworkOptionRequestPb struct { - WorkspaceId int64 `json:"-" url:"-"` - + WorkspaceId int64 `json:"-" url:"-"` WorkspaceNetworkOption WorkspaceNetworkOption `json:"workspace_network_option"` } @@ -6893,7 +6451,6 @@ func workspaceNetworkOptionToPb(st *WorkspaceNetworkOption) (*workspaceNetworkOp } pb := &workspaceNetworkOptionPb{} pb.NetworkPolicyId = st.NetworkPolicyId - pb.WorkspaceId = st.WorkspaceId pb.ForceSendFields = st.ForceSendFields @@ -6902,8 +6459,7 @@ func workspaceNetworkOptionToPb(st *WorkspaceNetworkOption) (*workspaceNetworkOp type workspaceNetworkOptionPb struct { NetworkPolicyId string `json:"network_policy_id,omitempty"` - - WorkspaceId int64 `json:"workspace_id,omitempty"` + WorkspaceId int64 `json:"workspace_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6927,3 +6483,57 @@ func (st *workspaceNetworkOptionPb) UnmarshalJSON(b []byte) error { func (st workspaceNetworkOptionPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/settings/model.go b/service/settings/model.go index 885406fa5..f9faa207d 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -5,8 +5,6 @@ package settings import ( "encoding/json" "fmt" - "strings" - "time" ) type AccountIpAccessEnable struct { @@ -8476,57 +8474,3 @@ func (st WorkspaceNetworkOption) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/sharing/internal.go b/service/sharing/internal.go index 6081eb482..f4a4f0fc6 100755 --- a/service/sharing/internal.go +++ b/service/sharing/internal.go @@ -3,6 +3,10 @@ package sharing import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" "github.com/databricks/databricks-sdk-go/service/catalog" ) @@ -13,16 +17,14 @@ func createFederationPolicyRequestToPb(st *CreateFederationPolicyRequest) (*crea } pb := &createFederationPolicyRequestPb{} pb.Policy = st.Policy - pb.RecipientName = st.RecipientName return pb, nil } type createFederationPolicyRequestPb struct { - Policy FederationPolicy `json:"policy"` - - RecipientName string `json:"-" url:"-"` + Policy FederationPolicy `json:"policy"` + RecipientName string `json:"-" url:"-"` } func createFederationPolicyRequestFromPb(pb *createFederationPolicyRequestPb) (*CreateFederationPolicyRequest, error) { @@ -42,11 +44,8 @@ func createProviderToPb(st *CreateProvider) (*createProviderPb, error) { } pb := &createProviderPb{} pb.AuthenticationType = st.AuthenticationType - pb.Comment = st.Comment - pb.Name = st.Name - pb.RecipientProfileStr = st.RecipientProfileStr pb.ForceSendFields = st.ForceSendFields @@ -54,13 +53,10 @@ func createProviderToPb(st *CreateProvider) (*createProviderPb, error) { } type createProviderPb struct { - AuthenticationType AuthenticationType `json:"authentication_type"` - - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - - RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + AuthenticationType AuthenticationType `json:"authentication_type"` + Comment string `json:"comment,omitempty"` + Name string `json:"name"` + RecipientProfileStr string `json:"recipient_profile_str,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -93,21 +89,13 @@ func createRecipientToPb(st *CreateRecipient) (*createRecipientPb, error) { } pb := &createRecipientPb{} pb.AuthenticationType = st.AuthenticationType - pb.Comment = st.Comment - pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId - pb.ExpirationTime = st.ExpirationTime - pb.IpAccessList = st.IpAccessList - pb.Name = st.Name - pb.Owner = st.Owner - pb.PropertiesKvpairs = st.PropertiesKvpairs - pb.SharingCode = st.SharingCode pb.ForceSendFields = st.ForceSendFields @@ -115,23 +103,15 @@ func createRecipientToPb(st *CreateRecipient) (*createRecipientPb, error) { } type createRecipientPb struct { - AuthenticationType AuthenticationType `json:"authentication_type"` - - Comment string `json:"comment,omitempty"` - - DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` - - Name string `json:"name"` - - Owner string `json:"owner,omitempty"` - - PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` - - SharingCode string `json:"sharing_code,omitempty"` + AuthenticationType AuthenticationType `json:"authentication_type"` + Comment string `json:"comment,omitempty"` + DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + Name string `json:"name"` + Owner string `json:"owner,omitempty"` + PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + SharingCode string `json:"sharing_code,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -169,9 +149,7 @@ func createShareToPb(st *CreateShare) (*createSharePb, error) { } pb := &createSharePb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.StorageRoot = st.StorageRoot pb.ForceSendFields = st.ForceSendFields @@ -179,10 +157,8 @@ func createShareToPb(st *CreateShare) (*createSharePb, error) { } type createSharePb struct { - Comment string `json:"comment,omitempty"` - - Name string `json:"name"` - + Comment string `json:"comment,omitempty"` + Name string `json:"name"` StorageRoot string `json:"storage_root,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -215,15 +191,13 @@ func deleteFederationPolicyRequestToPb(st *DeleteFederationPolicyRequest) (*dele } pb := &deleteFederationPolicyRequestPb{} pb.Name = st.Name - pb.RecipientName = st.RecipientName return pb, nil } type deleteFederationPolicyRequestPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` RecipientName string `json:"-" url:"-"` } @@ -337,7 +311,6 @@ func deltaSharingDependencyToPb(st *DeltaSharingDependency) (*deltaSharingDepend } pb := &deltaSharingDependencyPb{} pb.Function = st.Function - pb.Table = st.Table return pb, nil @@ -345,8 +318,7 @@ func deltaSharingDependencyToPb(st *DeltaSharingDependency) (*deltaSharingDepend type deltaSharingDependencyPb struct { Function *DeltaSharingFunctionDependency `json:"function,omitempty"` - - Table *DeltaSharingTableDependency `json:"table,omitempty"` + Table *DeltaSharingTableDependency `json:"table,omitempty"` } func deltaSharingDependencyFromPb(pb *deltaSharingDependencyPb) (*DeltaSharingDependency, error) { @@ -390,35 +362,20 @@ func deltaSharingFunctionToPb(st *DeltaSharingFunction) (*deltaSharingFunctionPb } pb := &deltaSharingFunctionPb{} pb.Aliases = st.Aliases - pb.Comment = st.Comment - pb.DataType = st.DataType - pb.DependencyList = st.DependencyList - pb.FullDataType = st.FullDataType - pb.Id = st.Id - pb.InputParams = st.InputParams - pb.Name = st.Name - pb.Properties = st.Properties - pb.RoutineDefinition = st.RoutineDefinition - pb.Schema = st.Schema - pb.SecurableKind = st.SecurableKind - pb.Share = st.Share - pb.ShareId = st.ShareId - pb.StorageLocation = st.StorageLocation - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -426,37 +383,22 @@ func deltaSharingFunctionToPb(st *DeltaSharingFunction) (*deltaSharingFunctionPb } type deltaSharingFunctionPb struct { - Aliases []RegisteredModelAlias `json:"aliases,omitempty"` - - Comment string `json:"comment,omitempty"` - - DataType ColumnTypeName `json:"data_type,omitempty"` - - DependencyList *DeltaSharingDependencyList `json:"dependency_list,omitempty"` - - FullDataType string `json:"full_data_type,omitempty"` - - Id string `json:"id,omitempty"` - - InputParams *FunctionParameterInfos `json:"input_params,omitempty"` - - Name string `json:"name,omitempty"` - - Properties string `json:"properties,omitempty"` - - RoutineDefinition string `json:"routine_definition,omitempty"` - - Schema string `json:"schema,omitempty"` - - SecurableKind SharedSecurableKind `json:"securable_kind,omitempty"` - - Share string `json:"share,omitempty"` - - ShareId string `json:"share_id,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + Aliases []RegisteredModelAlias `json:"aliases,omitempty"` + Comment string `json:"comment,omitempty"` + DataType ColumnTypeName `json:"data_type,omitempty"` + DependencyList *DeltaSharingDependencyList `json:"dependency_list,omitempty"` + FullDataType string `json:"full_data_type,omitempty"` + Id string `json:"id,omitempty"` + InputParams *FunctionParameterInfos `json:"input_params,omitempty"` + Name string `json:"name,omitempty"` + Properties string `json:"properties,omitempty"` + RoutineDefinition string `json:"routine_definition,omitempty"` + Schema string `json:"schema,omitempty"` + SecurableKind SharedSecurableKind `json:"securable_kind,omitempty"` + Share string `json:"share,omitempty"` + ShareId string `json:"share_id,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + Tags []catalog.TagKeyValue `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -501,7 +443,6 @@ func deltaSharingFunctionDependencyToPb(st *DeltaSharingFunctionDependency) (*de } pb := &deltaSharingFunctionDependencyPb{} pb.FunctionName = st.FunctionName - pb.SchemaName = st.SchemaName pb.ForceSendFields = st.ForceSendFields @@ -510,8 +451,7 @@ func deltaSharingFunctionDependencyToPb(st *DeltaSharingFunctionDependency) (*de type deltaSharingFunctionDependencyPb struct { FunctionName string `json:"function_name,omitempty"` - - SchemaName string `json:"schema_name,omitempty"` + SchemaName string `json:"schema_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -542,7 +482,6 @@ func deltaSharingTableDependencyToPb(st *DeltaSharingTableDependency) (*deltaSha } pb := &deltaSharingTableDependencyPb{} pb.SchemaName = st.SchemaName - pb.TableName = st.TableName pb.ForceSendFields = st.ForceSendFields @@ -551,8 +490,7 @@ func deltaSharingTableDependencyToPb(st *DeltaSharingTableDependency) (*deltaSha type deltaSharingTableDependencyPb struct { SchemaName string `json:"schema_name,omitempty"` - - TableName string `json:"table_name,omitempty"` + TableName string `json:"table_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -583,15 +521,10 @@ func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { } pb := &federationPolicyPb{} pb.Comment = st.Comment - pb.CreateTime = st.CreateTime - pb.Id = st.Id - pb.Name = st.Name - pb.OidcPolicy = st.OidcPolicy - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -599,17 +532,12 @@ func federationPolicyToPb(st *FederationPolicy) (*federationPolicyPb, error) { } type federationPolicyPb struct { - Comment string `json:"comment,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - + Comment string `json:"comment,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -644,27 +572,16 @@ func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInf } pb := &functionParameterInfoPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.ParameterDefault = st.ParameterDefault - pb.ParameterMode = st.ParameterMode - pb.ParameterType = st.ParameterType - pb.Position = st.Position - pb.TypeIntervalType = st.TypeIntervalType - pb.TypeJson = st.TypeJson - pb.TypeName = st.TypeName - pb.TypePrecision = st.TypePrecision - pb.TypeScale = st.TypeScale - pb.TypeText = st.TypeText pb.ForceSendFields = st.ForceSendFields @@ -672,29 +589,18 @@ func functionParameterInfoToPb(st *FunctionParameterInfo) (*functionParameterInf } type functionParameterInfoPb struct { - Comment string `json:"comment,omitempty"` - - Name string `json:"name,omitempty"` - - ParameterDefault string `json:"parameter_default,omitempty"` - - ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` - - ParameterType FunctionParameterType `json:"parameter_type,omitempty"` - - Position int `json:"position,omitempty"` - - TypeIntervalType string `json:"type_interval_type,omitempty"` - - TypeJson string `json:"type_json,omitempty"` - - TypeName ColumnTypeName `json:"type_name,omitempty"` - - TypePrecision int `json:"type_precision,omitempty"` - - TypeScale int `json:"type_scale,omitempty"` - - TypeText string `json:"type_text,omitempty"` + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + ParameterDefault string `json:"parameter_default,omitempty"` + ParameterMode FunctionParameterMode `json:"parameter_mode,omitempty"` + ParameterType FunctionParameterType `json:"parameter_type,omitempty"` + Position int `json:"position,omitempty"` + TypeIntervalType string `json:"type_interval_type,omitempty"` + TypeJson string `json:"type_json,omitempty"` + TypeName ColumnTypeName `json:"type_name,omitempty"` + TypePrecision int `json:"type_precision,omitempty"` + TypeScale int `json:"type_scale,omitempty"` + TypeText string `json:"type_text,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -804,15 +710,13 @@ func getFederationPolicyRequestToPb(st *GetFederationPolicyRequest) (*getFederat } pb := &getFederationPolicyRequestPb{} pb.Name = st.Name - pb.RecipientName = st.RecipientName return pb, nil } type getFederationPolicyRequestPb struct { - Name string `json:"-" url:"-"` - + Name string `json:"-" url:"-"` RecipientName string `json:"-" url:"-"` } @@ -881,7 +785,6 @@ func getRecipientSharePermissionsResponseToPb(st *GetRecipientSharePermissionsRe } pb := &getRecipientSharePermissionsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.PermissionsOut = st.PermissionsOut pb.ForceSendFields = st.ForceSendFields @@ -889,8 +792,7 @@ func getRecipientSharePermissionsResponseToPb(st *GetRecipientSharePermissionsRe } type getRecipientSharePermissionsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` PermissionsOut []ShareToPrivilegeAssignment `json:"permissions_out,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -922,7 +824,6 @@ func getSharePermissionsResponseToPb(st *GetSharePermissionsResponse) (*getShare } pb := &getSharePermissionsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.PrivilegeAssignments = st.PrivilegeAssignments pb.ForceSendFields = st.ForceSendFields @@ -930,8 +831,7 @@ func getSharePermissionsResponseToPb(st *GetSharePermissionsResponse) (*getShare } type getSharePermissionsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -963,7 +863,6 @@ func getShareRequestToPb(st *GetShareRequest) (*getShareRequestPb, error) { } pb := &getShareRequestPb{} pb.IncludeSharedData = st.IncludeSharedData - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -971,9 +870,8 @@ func getShareRequestToPb(st *GetShareRequest) (*getShareRequestPb, error) { } type getShareRequestPb struct { - IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"` - - Name string `json:"-" url:"-"` + IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"` + Name string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -1028,9 +926,7 @@ func listFederationPoliciesRequestToPb(st *ListFederationPoliciesRequest) (*list } pb := &listFederationPoliciesRequestPb{} pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken - pb.RecipientName = st.RecipientName pb.ForceSendFields = st.ForceSendFields @@ -1038,10 +934,8 @@ func listFederationPoliciesRequestToPb(st *ListFederationPoliciesRequest) (*list } type listFederationPoliciesRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` - + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` RecipientName string `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` @@ -1074,7 +968,6 @@ func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*li } pb := &listFederationPoliciesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Policies = st.Policies pb.ForceSendFields = st.ForceSendFields @@ -1082,9 +975,8 @@ func listFederationPoliciesResponseToPb(st *ListFederationPoliciesResponse) (*li } type listFederationPoliciesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Policies []FederationPolicy `json:"policies,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Policies []FederationPolicy `json:"policies,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1115,15 +1007,10 @@ func listProviderShareAssetsRequestToPb(st *ListProviderShareAssetsRequest) (*li } pb := &listProviderShareAssetsRequestPb{} pb.FunctionMaxResults = st.FunctionMaxResults - pb.NotebookMaxResults = st.NotebookMaxResults - pb.ProviderName = st.ProviderName - pb.ShareName = st.ShareName - pb.TableMaxResults = st.TableMaxResults - pb.VolumeMaxResults = st.VolumeMaxResults pb.ForceSendFields = st.ForceSendFields @@ -1131,17 +1018,12 @@ func listProviderShareAssetsRequestToPb(st *ListProviderShareAssetsRequest) (*li } type listProviderShareAssetsRequestPb struct { - FunctionMaxResults int `json:"-" url:"function_max_results,omitempty"` - - NotebookMaxResults int `json:"-" url:"notebook_max_results,omitempty"` - - ProviderName string `json:"-" url:"-"` - - ShareName string `json:"-" url:"-"` - - TableMaxResults int `json:"-" url:"table_max_results,omitempty"` - - VolumeMaxResults int `json:"-" url:"volume_max_results,omitempty"` + FunctionMaxResults int `json:"-" url:"function_max_results,omitempty"` + NotebookMaxResults int `json:"-" url:"notebook_max_results,omitempty"` + ProviderName string `json:"-" url:"-"` + ShareName string `json:"-" url:"-"` + TableMaxResults int `json:"-" url:"table_max_results,omitempty"` + VolumeMaxResults int `json:"-" url:"volume_max_results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1176,11 +1058,8 @@ func listProviderShareAssetsResponseToPb(st *ListProviderShareAssetsResponse) (* } pb := &listProviderShareAssetsResponsePb{} pb.Functions = st.Functions - pb.Notebooks = st.Notebooks - pb.Tables = st.Tables - pb.Volumes = st.Volumes return pb, nil @@ -1188,12 +1067,9 @@ func listProviderShareAssetsResponseToPb(st *ListProviderShareAssetsResponse) (* type listProviderShareAssetsResponsePb struct { Functions []DeltaSharingFunction `json:"functions,omitempty"` - - Notebooks []NotebookFile `json:"notebooks,omitempty"` - - Tables []Table `json:"tables,omitempty"` - - Volumes []Volume `json:"volumes,omitempty"` + Notebooks []NotebookFile `json:"notebooks,omitempty"` + Tables []Table `json:"tables,omitempty"` + Volumes []Volume `json:"volumes,omitempty"` } func listProviderShareAssetsResponseFromPb(pb *listProviderShareAssetsResponsePb) (*ListProviderShareAssetsResponse, error) { @@ -1215,7 +1091,6 @@ func listProviderSharesResponseToPb(st *ListProviderSharesResponse) (*listProvid } pb := &listProviderSharesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Shares = st.Shares pb.ForceSendFields = st.ForceSendFields @@ -1223,9 +1098,8 @@ func listProviderSharesResponseToPb(st *ListProviderSharesResponse) (*listProvid } type listProviderSharesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Shares []ProviderShare `json:"shares,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Shares []ProviderShare `json:"shares,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1256,9 +1130,7 @@ func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb } pb := &listProvidersRequestPb{} pb.DataProviderGlobalMetastoreId = st.DataProviderGlobalMetastoreId - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1267,10 +1139,8 @@ func listProvidersRequestToPb(st *ListProvidersRequest) (*listProvidersRequestPb type listProvidersRequestPb struct { DataProviderGlobalMetastoreId string `json:"-" url:"data_provider_global_metastore_id,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1302,7 +1172,6 @@ func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersRespons } pb := &listProvidersResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Providers = st.Providers pb.ForceSendFields = st.ForceSendFields @@ -1310,9 +1179,8 @@ func listProvidersResponseToPb(st *ListProvidersResponse) (*listProvidersRespons } type listProvidersResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Providers []ProviderInfo `json:"providers,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Providers []ProviderInfo `json:"providers,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1343,9 +1211,7 @@ func listRecipientsRequestToPb(st *ListRecipientsRequest) (*listRecipientsReques } pb := &listRecipientsRequestPb{} pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1354,10 +1220,8 @@ func listRecipientsRequestToPb(st *ListRecipientsRequest) (*listRecipientsReques type listRecipientsRequestPb struct { DataRecipientGlobalMetastoreId string `json:"-" url:"data_recipient_global_metastore_id,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1389,7 +1253,6 @@ func listRecipientsResponseToPb(st *ListRecipientsResponse) (*listRecipientsResp } pb := &listRecipientsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Recipients = st.Recipients pb.ForceSendFields = st.ForceSendFields @@ -1397,9 +1260,8 @@ func listRecipientsResponseToPb(st *ListRecipientsResponse) (*listRecipientsResp } type listRecipientsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Recipients []RecipientInfo `json:"recipients,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Recipients []RecipientInfo `json:"recipients,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1430,9 +1292,7 @@ func listSharesRequestToPb(st *ListSharesRequest) (*listSharesRequestPb, error) } pb := &listSharesRequestPb{} pb.MaxResults = st.MaxResults - pb.Name = st.Name - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1440,11 +1300,9 @@ func listSharesRequestToPb(st *ListSharesRequest) (*listSharesRequestPb, error) } type listSharesRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - Name string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + Name string `json:"-" url:"-"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1476,7 +1334,6 @@ func listSharesResponseToPb(st *ListSharesResponse) (*listSharesResponsePb, erro } pb := &listSharesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Shares = st.Shares pb.ForceSendFields = st.ForceSendFields @@ -1484,9 +1341,8 @@ func listSharesResponseToPb(st *ListSharesResponse) (*listSharesResponsePb, erro } type listSharesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Shares []ShareInfo `json:"shares,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Shares []ShareInfo `json:"shares,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1517,15 +1373,10 @@ func notebookFileToPb(st *NotebookFile) (*notebookFilePb, error) { } pb := ¬ebookFilePb{} pb.Comment = st.Comment - pb.Id = st.Id - pb.Name = st.Name - pb.Share = st.Share - pb.ShareId = st.ShareId - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -1533,17 +1384,12 @@ func notebookFileToPb(st *NotebookFile) (*notebookFilePb, error) { } type notebookFilePb struct { - Comment string `json:"comment,omitempty"` - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - Share string `json:"share,omitempty"` - - ShareId string `json:"share_id,omitempty"` - - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + Comment string `json:"comment,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Share string `json:"share,omitempty"` + ShareId string `json:"share_id,omitempty"` + Tags []catalog.TagKeyValue `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1578,24 +1424,18 @@ func oidcFederationPolicyToPb(st *OidcFederationPolicy) (*oidcFederationPolicyPb } pb := &oidcFederationPolicyPb{} pb.Audiences = st.Audiences - pb.Issuer = st.Issuer - pb.Subject = st.Subject - pb.SubjectClaim = st.SubjectClaim return pb, nil } type oidcFederationPolicyPb struct { - Audiences []string `json:"audiences,omitempty"` - - Issuer string `json:"issuer"` - - Subject string `json:"subject"` - - SubjectClaim string `json:"subject_claim"` + Audiences []string `json:"audiences,omitempty"` + Issuer string `json:"issuer"` + Subject string `json:"subject"` + SubjectClaim string `json:"subject_claim"` } func oidcFederationPolicyFromPb(pb *oidcFederationPolicyPb) (*OidcFederationPolicy, error) { @@ -1641,11 +1481,8 @@ func partitionValueToPb(st *PartitionValue) (*partitionValuePb, error) { } pb := &partitionValuePb{} pb.Name = st.Name - pb.Op = st.Op - pb.RecipientPropertyKey = st.RecipientPropertyKey - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -1653,13 +1490,10 @@ func partitionValueToPb(st *PartitionValue) (*partitionValuePb, error) { } type partitionValuePb struct { - Name string `json:"name,omitempty"` - - Op PartitionValueOp `json:"op,omitempty"` - - RecipientPropertyKey string `json:"recipient_property_key,omitempty"` - - Value string `json:"value,omitempty"` + Name string `json:"name,omitempty"` + Op PartitionValueOp `json:"op,omitempty"` + RecipientPropertyKey string `json:"recipient_property_key,omitempty"` + Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1692,9 +1526,7 @@ func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) } pb := &permissionsChangePb{} pb.Add = st.Add - pb.Principal = st.Principal - pb.Remove = st.Remove pb.ForceSendFields = st.ForceSendFields @@ -1702,11 +1534,9 @@ func permissionsChangeToPb(st *PermissionsChange) (*permissionsChangePb, error) } type permissionsChangePb struct { - Add []string `json:"add,omitempty"` - - Principal string `json:"principal,omitempty"` - - Remove []string `json:"remove,omitempty"` + Add []string `json:"add,omitempty"` + Principal string `json:"principal,omitempty"` + Remove []string `json:"remove,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1738,7 +1568,6 @@ func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, e } pb := &privilegeAssignmentPb{} pb.Principal = st.Principal - pb.Privileges = st.Privileges pb.ForceSendFields = st.ForceSendFields @@ -1746,8 +1575,7 @@ func privilegeAssignmentToPb(st *PrivilegeAssignment) (*privilegeAssignmentPb, e } type privilegeAssignmentPb struct { - Principal string `json:"principal,omitempty"` - + Principal string `json:"principal,omitempty"` Privileges []Privilege `json:"privileges,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1779,31 +1607,18 @@ func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { } pb := &providerInfoPb{} pb.AuthenticationType = st.AuthenticationType - pb.Cloud = st.Cloud - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DataProviderGlobalMetastoreId = st.DataProviderGlobalMetastoreId - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.RecipientProfile = st.RecipientProfile - pb.RecipientProfileStr = st.RecipientProfileStr - pb.Region = st.Region - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -1811,33 +1626,20 @@ func providerInfoToPb(st *ProviderInfo) (*providerInfoPb, error) { } type providerInfoPb struct { - AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` - - Cloud string `json:"cloud,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"` - - RecipientProfileStr string `json:"recipient_profile_str,omitempty"` - - Region string `json:"region,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + Cloud string `json:"cloud,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"` + RecipientProfileStr string `json:"recipient_profile_str,omitempty"` + Region string `json:"region,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1916,41 +1718,23 @@ func recipientInfoToPb(st *RecipientInfo) (*recipientInfoPb, error) { } pb := &recipientInfoPb{} pb.Activated = st.Activated - pb.ActivationUrl = st.ActivationUrl - pb.AuthenticationType = st.AuthenticationType - pb.Cloud = st.Cloud - pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.DataRecipientGlobalMetastoreId = st.DataRecipientGlobalMetastoreId - pb.ExpirationTime = st.ExpirationTime - pb.IpAccessList = st.IpAccessList - pb.MetastoreId = st.MetastoreId - pb.Name = st.Name - pb.Owner = st.Owner - pb.PropertiesKvpairs = st.PropertiesKvpairs - pb.Region = st.Region - pb.SharingCode = st.SharingCode - pb.Tokens = st.Tokens - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -1958,43 +1742,25 @@ func recipientInfoToPb(st *RecipientInfo) (*recipientInfoPb, error) { } type recipientInfoPb struct { - Activated bool `json:"activated,omitempty"` - - ActivationUrl string `json:"activation_url,omitempty"` - - AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` - - Cloud string `json:"cloud,omitempty"` - - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` - - MetastoreId string `json:"metastore_id,omitempty"` - - Name string `json:"name,omitempty"` - - Owner string `json:"owner,omitempty"` - - PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` - - Region string `json:"region,omitempty"` - - SharingCode string `json:"sharing_code,omitempty"` - - Tokens []RecipientTokenInfo `json:"tokens,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Activated bool `json:"activated,omitempty"` + ActivationUrl string `json:"activation_url,omitempty"` + AuthenticationType AuthenticationType `json:"authentication_type,omitempty"` + Cloud string `json:"cloud,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` + Region string `json:"region,omitempty"` + SharingCode string `json:"sharing_code,omitempty"` + Tokens []RecipientTokenInfo `json:"tokens,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2042,9 +1808,7 @@ func recipientProfileToPb(st *RecipientProfile) (*recipientProfilePb, error) { } pb := &recipientProfilePb{} pb.BearerToken = st.BearerToken - pb.Endpoint = st.Endpoint - pb.ShareCredentialsVersion = st.ShareCredentialsVersion pb.ForceSendFields = st.ForceSendFields @@ -2052,11 +1816,9 @@ func recipientProfileToPb(st *RecipientProfile) (*recipientProfilePb, error) { } type recipientProfilePb struct { - BearerToken string `json:"bearer_token,omitempty"` - - Endpoint string `json:"endpoint,omitempty"` - - ShareCredentialsVersion int `json:"share_credentials_version,omitempty"` + BearerToken string `json:"bearer_token,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + ShareCredentialsVersion int `json:"share_credentials_version,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2088,17 +1850,11 @@ func recipientTokenInfoToPb(st *RecipientTokenInfo) (*recipientTokenInfoPb, erro } pb := &recipientTokenInfoPb{} pb.ActivationUrl = st.ActivationUrl - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.ExpirationTime = st.ExpirationTime - pb.Id = st.Id - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -2106,19 +1862,13 @@ func recipientTokenInfoToPb(st *RecipientTokenInfo) (*recipientTokenInfoPb, erro } type recipientTokenInfoPb struct { - ActivationUrl string `json:"activation_url,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - Id string `json:"id,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + ActivationUrl string `json:"activation_url,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + Id string `json:"id,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2154,7 +1904,6 @@ func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb } pb := ®isteredModelAliasPb{} pb.AliasName = st.AliasName - pb.VersionNum = st.VersionNum pb.ForceSendFields = st.ForceSendFields @@ -2162,9 +1911,8 @@ func registeredModelAliasToPb(st *RegisteredModelAlias) (*registeredModelAliasPb } type registeredModelAliasPb struct { - AliasName string `json:"alias_name,omitempty"` - - VersionNum int64 `json:"version_num,omitempty"` + AliasName string `json:"alias_name,omitempty"` + VersionNum int64 `json:"version_num,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2219,11 +1967,8 @@ func retrieveTokenResponseToPb(st *RetrieveTokenResponse) (*retrieveTokenRespons } pb := &retrieveTokenResponsePb{} pb.BearerToken = st.BearerToken - pb.Endpoint = st.Endpoint - pb.ExpirationTime = st.ExpirationTime - pb.ShareCredentialsVersion = st.ShareCredentialsVersion pb.ForceSendFields = st.ForceSendFields @@ -2231,13 +1976,10 @@ func retrieveTokenResponseToPb(st *RetrieveTokenResponse) (*retrieveTokenRespons } type retrieveTokenResponsePb struct { - BearerToken string `json:"bearerToken,omitempty"` - - Endpoint string `json:"endpoint,omitempty"` - - ExpirationTime string `json:"expirationTime,omitempty"` - - ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + BearerToken string `json:"bearerToken,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + ExpirationTime string `json:"expirationTime,omitempty"` + ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2270,16 +2012,14 @@ func rotateRecipientTokenToPb(st *RotateRecipientToken) (*rotateRecipientTokenPb } pb := &rotateRecipientTokenPb{} pb.ExistingTokenExpireInSeconds = st.ExistingTokenExpireInSeconds - pb.Name = st.Name return pb, nil } type rotateRecipientTokenPb struct { - ExistingTokenExpireInSeconds int64 `json:"existing_token_expire_in_seconds"` - - Name string `json:"-" url:"-"` + ExistingTokenExpireInSeconds int64 `json:"existing_token_expire_in_seconds"` + Name string `json:"-" url:"-"` } func rotateRecipientTokenFromPb(pb *rotateRecipientTokenPb) (*RotateRecipientToken, error) { @@ -2323,23 +2063,14 @@ func shareInfoToPb(st *ShareInfo) (*shareInfoPb, error) { } pb := &shareInfoPb{} pb.Comment = st.Comment - pb.CreatedAt = st.CreatedAt - pb.CreatedBy = st.CreatedBy - pb.Name = st.Name - pb.Objects = st.Objects - pb.Owner = st.Owner - pb.StorageLocation = st.StorageLocation - pb.StorageRoot = st.StorageRoot - pb.UpdatedAt = st.UpdatedAt - pb.UpdatedBy = st.UpdatedBy pb.ForceSendFields = st.ForceSendFields @@ -2347,25 +2078,16 @@ func shareInfoToPb(st *ShareInfo) (*shareInfoPb, error) { } type shareInfoPb struct { - Comment string `json:"comment,omitempty"` - - CreatedAt int64 `json:"created_at,omitempty"` - - CreatedBy string `json:"created_by,omitempty"` - - Name string `json:"name,omitempty"` - - Objects []SharedDataObject `json:"objects,omitempty"` - - Owner string `json:"owner,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - UpdatedAt int64 `json:"updated_at,omitempty"` - - UpdatedBy string `json:"updated_by,omitempty"` + Comment string `json:"comment,omitempty"` + CreatedAt int64 `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + Name string `json:"name,omitempty"` + Objects []SharedDataObject `json:"objects,omitempty"` + Owner string `json:"owner,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2404,9 +2126,7 @@ func sharePermissionsRequestToPb(st *SharePermissionsRequest) (*sharePermissions } pb := &sharePermissionsRequestPb{} pb.MaxResults = st.MaxResults - pb.Name = st.Name - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -2414,11 +2134,9 @@ func sharePermissionsRequestToPb(st *SharePermissionsRequest) (*sharePermissions } type sharePermissionsRequestPb struct { - MaxResults int `json:"-" url:"max_results,omitempty"` - - Name string `json:"-" url:"-"` - - PageToken string `json:"-" url:"page_token,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + Name string `json:"-" url:"-"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2450,7 +2168,6 @@ func shareToPrivilegeAssignmentToPb(st *ShareToPrivilegeAssignment) (*shareToPri } pb := &shareToPrivilegeAssignmentPb{} pb.PrivilegeAssignments = st.PrivilegeAssignments - pb.ShareName = st.ShareName pb.ForceSendFields = st.ForceSendFields @@ -2459,8 +2176,7 @@ func shareToPrivilegeAssignmentToPb(st *ShareToPrivilegeAssignment) (*shareToPri type shareToPrivilegeAssignmentPb struct { PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"` - - ShareName string `json:"share_name,omitempty"` + ShareName string `json:"share_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2491,29 +2207,17 @@ func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { } pb := &sharedDataObjectPb{} pb.AddedAt = st.AddedAt - pb.AddedBy = st.AddedBy - pb.CdfEnabled = st.CdfEnabled - pb.Comment = st.Comment - pb.Content = st.Content - pb.DataObjectType = st.DataObjectType - pb.HistoryDataSharingStatus = st.HistoryDataSharingStatus - pb.Name = st.Name - pb.Partitions = st.Partitions - pb.SharedAs = st.SharedAs - pb.StartVersion = st.StartVersion - pb.Status = st.Status - pb.StringSharedAs = st.StringSharedAs pb.ForceSendFields = st.ForceSendFields @@ -2521,31 +2225,19 @@ func sharedDataObjectToPb(st *SharedDataObject) (*sharedDataObjectPb, error) { } type sharedDataObjectPb struct { - AddedAt int64 `json:"added_at,omitempty"` - - AddedBy string `json:"added_by,omitempty"` - - CdfEnabled bool `json:"cdf_enabled,omitempty"` - - Comment string `json:"comment,omitempty"` - - Content string `json:"content,omitempty"` - - DataObjectType SharedDataObjectDataObjectType `json:"data_object_type,omitempty"` - + AddedAt int64 `json:"added_at,omitempty"` + AddedBy string `json:"added_by,omitempty"` + CdfEnabled bool `json:"cdf_enabled,omitempty"` + Comment string `json:"comment,omitempty"` + Content string `json:"content,omitempty"` + DataObjectType SharedDataObjectDataObjectType `json:"data_object_type,omitempty"` HistoryDataSharingStatus SharedDataObjectHistoryDataSharingStatus `json:"history_data_sharing_status,omitempty"` - - Name string `json:"name"` - - Partitions []Partition `json:"partitions,omitempty"` - - SharedAs string `json:"shared_as,omitempty"` - - StartVersion int64 `json:"start_version,omitempty"` - - Status SharedDataObjectStatus `json:"status,omitempty"` - - StringSharedAs string `json:"string_shared_as,omitempty"` + Name string `json:"name"` + Partitions []Partition `json:"partitions,omitempty"` + SharedAs string `json:"shared_as,omitempty"` + StartVersion int64 `json:"start_version,omitempty"` + Status SharedDataObjectStatus `json:"status,omitempty"` + StringSharedAs string `json:"string_shared_as,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2587,16 +2279,14 @@ func sharedDataObjectUpdateToPb(st *SharedDataObjectUpdate) (*sharedDataObjectUp } pb := &sharedDataObjectUpdatePb{} pb.Action = st.Action - pb.DataObject = st.DataObject return pb, nil } type sharedDataObjectUpdatePb struct { - Action SharedDataObjectUpdateAction `json:"action,omitempty"` - - DataObject *SharedDataObject `json:"data_object,omitempty"` + Action SharedDataObjectUpdateAction `json:"action,omitempty"` + DataObject *SharedDataObject `json:"data_object,omitempty"` } func sharedDataObjectUpdateFromPb(pb *sharedDataObjectUpdatePb) (*SharedDataObjectUpdate, error) { @@ -2616,23 +2306,14 @@ func tableToPb(st *Table) (*tablePb, error) { } pb := &tablePb{} pb.Comment = st.Comment - pb.Id = st.Id - pb.InternalAttributes = st.InternalAttributes - pb.MaterializationNamespace = st.MaterializationNamespace - pb.MaterializedTableName = st.MaterializedTableName - pb.Name = st.Name - pb.Schema = st.Schema - pb.Share = st.Share - pb.ShareId = st.ShareId - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -2640,25 +2321,16 @@ func tableToPb(st *Table) (*tablePb, error) { } type tablePb struct { - Comment string `json:"comment,omitempty"` - - Id string `json:"id,omitempty"` - - InternalAttributes *TableInternalAttributes `json:"internal_attributes,omitempty"` - - MaterializationNamespace string `json:"materialization_namespace,omitempty"` - - MaterializedTableName string `json:"materialized_table_name,omitempty"` - - Name string `json:"name,omitempty"` - - Schema string `json:"schema,omitempty"` - - Share string `json:"share,omitempty"` - - ShareId string `json:"share_id,omitempty"` - - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + Comment string `json:"comment,omitempty"` + Id string `json:"id,omitempty"` + InternalAttributes *TableInternalAttributes `json:"internal_attributes,omitempty"` + MaterializationNamespace string `json:"materialization_namespace,omitempty"` + MaterializedTableName string `json:"materialized_table_name,omitempty"` + Name string `json:"name,omitempty"` + Schema string `json:"schema,omitempty"` + Share string `json:"share,omitempty"` + ShareId string `json:"share_id,omitempty"` + Tags []catalog.TagKeyValue `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2697,11 +2369,8 @@ func tableInternalAttributesToPb(st *TableInternalAttributes) (*tableInternalAtt } pb := &tableInternalAttributesPb{} pb.ParentStorageLocation = st.ParentStorageLocation - pb.StorageLocation = st.StorageLocation - pb.Type = st.Type - pb.ViewDefinition = st.ViewDefinition pb.ForceSendFields = st.ForceSendFields @@ -2709,13 +2378,10 @@ func tableInternalAttributesToPb(st *TableInternalAttributes) (*tableInternalAtt } type tableInternalAttributesPb struct { - ParentStorageLocation string `json:"parent_storage_location,omitempty"` - - StorageLocation string `json:"storage_location,omitempty"` - - Type TableInternalAttributesSharedTableType `json:"type,omitempty"` - - ViewDefinition string `json:"view_definition,omitempty"` + ParentStorageLocation string `json:"parent_storage_location,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + Type TableInternalAttributesSharedTableType `json:"type,omitempty"` + ViewDefinition string `json:"view_definition,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2748,11 +2414,8 @@ func updateFederationPolicyRequestToPb(st *UpdateFederationPolicyRequest) (*upda } pb := &updateFederationPolicyRequestPb{} pb.Name = st.Name - pb.Policy = st.Policy - pb.RecipientName = st.RecipientName - pb.UpdateMask = st.UpdateMask pb.ForceSendFields = st.ForceSendFields @@ -2760,13 +2423,10 @@ func updateFederationPolicyRequestToPb(st *UpdateFederationPolicyRequest) (*upda } type updateFederationPolicyRequestPb struct { - Name string `json:"-" url:"-"` - - Policy FederationPolicy `json:"policy"` - - RecipientName string `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask,omitempty"` + Name string `json:"-" url:"-"` + Policy FederationPolicy `json:"policy"` + RecipientName string `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2799,13 +2459,9 @@ func updateProviderToPb(st *UpdateProvider) (*updateProviderPb, error) { } pb := &updateProviderPb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.RecipientProfileStr = st.RecipientProfileStr pb.ForceSendFields = st.ForceSendFields @@ -2813,14 +2469,10 @@ func updateProviderToPb(st *UpdateProvider) (*updateProviderPb, error) { } type updateProviderPb struct { - Comment string `json:"comment,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - + Comment string `json:"comment,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` RecipientProfileStr string `json:"recipient_profile_str,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2855,17 +2507,11 @@ func updateRecipientToPb(st *UpdateRecipient) (*updateRecipientPb, error) { } pb := &updateRecipientPb{} pb.Comment = st.Comment - pb.ExpirationTime = st.ExpirationTime - pb.IpAccessList = st.IpAccessList - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.PropertiesKvpairs = st.PropertiesKvpairs pb.ForceSendFields = st.ForceSendFields @@ -2873,18 +2519,12 @@ func updateRecipientToPb(st *UpdateRecipient) (*updateRecipientPb, error) { } type updateRecipientPb struct { - Comment string `json:"comment,omitempty"` - - ExpirationTime int64 `json:"expiration_time,omitempty"` - - IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - + Comment string `json:"comment,omitempty"` + ExpirationTime int64 `json:"expiration_time,omitempty"` + IpAccessList *IpAccessList `json:"ip_access_list,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2921,15 +2561,10 @@ func updateShareToPb(st *UpdateShare) (*updateSharePb, error) { } pb := &updateSharePb{} pb.Comment = st.Comment - pb.Name = st.Name - pb.NewName = st.NewName - pb.Owner = st.Owner - pb.StorageRoot = st.StorageRoot - pb.Updates = st.Updates pb.ForceSendFields = st.ForceSendFields @@ -2937,17 +2572,12 @@ func updateShareToPb(st *UpdateShare) (*updateSharePb, error) { } type updateSharePb struct { - Comment string `json:"comment,omitempty"` - - Name string `json:"-" url:"-"` - - NewName string `json:"new_name,omitempty"` - - Owner string `json:"owner,omitempty"` - - StorageRoot string `json:"storage_root,omitempty"` - - Updates []SharedDataObjectUpdate `json:"updates,omitempty"` + Comment string `json:"comment,omitempty"` + Name string `json:"-" url:"-"` + NewName string `json:"new_name,omitempty"` + Owner string `json:"owner,omitempty"` + StorageRoot string `json:"storage_root,omitempty"` + Updates []SharedDataObjectUpdate `json:"updates,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2982,9 +2612,7 @@ func updateSharePermissionsToPb(st *UpdateSharePermissions) (*updateSharePermiss } pb := &updateSharePermissionsPb{} pb.Changes = st.Changes - pb.Name = st.Name - pb.OmitPermissionsList = st.OmitPermissionsList pb.ForceSendFields = st.ForceSendFields @@ -2992,11 +2620,9 @@ func updateSharePermissionsToPb(st *UpdateSharePermissions) (*updateSharePermiss } type updateSharePermissionsPb struct { - Changes []PermissionsChange `json:"changes,omitempty"` - - Name string `json:"-" url:"-"` - - OmitPermissionsList bool `json:"omit_permissions_list,omitempty"` + Changes []PermissionsChange `json:"changes,omitempty"` + Name string `json:"-" url:"-"` + OmitPermissionsList bool `json:"omit_permissions_list,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3052,19 +2678,12 @@ func volumeToPb(st *Volume) (*volumePb, error) { } pb := &volumePb{} pb.Comment = st.Comment - pb.Id = st.Id - pb.InternalAttributes = st.InternalAttributes - pb.Name = st.Name - pb.Schema = st.Schema - pb.Share = st.Share - pb.ShareId = st.ShareId - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -3072,21 +2691,14 @@ func volumeToPb(st *Volume) (*volumePb, error) { } type volumePb struct { - Comment string `json:"comment,omitempty"` - - Id string `json:"id,omitempty"` - + Comment string `json:"comment,omitempty"` + Id string `json:"id,omitempty"` InternalAttributes *VolumeInternalAttributes `json:"internal_attributes,omitempty"` - - Name string `json:"name,omitempty"` - - Schema string `json:"schema,omitempty"` - - Share string `json:"share,omitempty"` - - ShareId string `json:"share_id,omitempty"` - - Tags []catalog.TagKeyValue `json:"tags,omitempty"` + Name string `json:"name,omitempty"` + Schema string `json:"schema,omitempty"` + Share string `json:"share,omitempty"` + ShareId string `json:"share_id,omitempty"` + Tags []catalog.TagKeyValue `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3123,7 +2735,6 @@ func volumeInternalAttributesToPb(st *VolumeInternalAttributes) (*volumeInternal } pb := &volumeInternalAttributesPb{} pb.StorageLocation = st.StorageLocation - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -3132,8 +2743,7 @@ func volumeInternalAttributesToPb(st *VolumeInternalAttributes) (*volumeInternal type volumeInternalAttributesPb struct { StorageLocation string `json:"storage_location,omitempty"` - - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3157,3 +2767,57 @@ func (st *volumeInternalAttributesPb) UnmarshalJSON(b []byte) error { func (st volumeInternalAttributesPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/sharing/model.go b/service/sharing/model.go index 3027acdcf..929441c75 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -5,8 +5,6 @@ package sharing import ( "encoding/json" "fmt" - "strings" - "time" "github.com/databricks/databricks-sdk-go/service/catalog" ) @@ -3462,57 +3460,3 @@ func (st VolumeInternalAttributes) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/sql/internal.go b/service/sql/internal.go index a171f6589..5d0a3442c 100755 --- a/service/sql/internal.go +++ b/service/sql/internal.go @@ -3,6 +3,10 @@ package sql import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,9 +16,7 @@ func accessControlToPb(st *AccessControl) (*accessControlPb, error) { } pb := &accessControlPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -22,11 +24,9 @@ func accessControlToPb(st *AccessControl) (*accessControlPb, error) { } type accessControlPb struct { - GroupName string `json:"group_name,omitempty"` - + GroupName string `json:"group_name,omitempty"` PermissionLevel PermissionLevel `json:"permission_level,omitempty"` - - UserName string `json:"user_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -58,33 +58,19 @@ func alertToPb(st *Alert) (*alertPb, error) { } pb := &alertPb{} pb.Condition = st.Condition - pb.CreateTime = st.CreateTime - pb.CustomBody = st.CustomBody - pb.CustomSubject = st.CustomSubject - pb.DisplayName = st.DisplayName - pb.Id = st.Id - pb.LifecycleState = st.LifecycleState - pb.NotifyOnOk = st.NotifyOnOk - pb.OwnerUserName = st.OwnerUserName - pb.ParentPath = st.ParentPath - pb.QueryId = st.QueryId - pb.SecondsToRetrigger = st.SecondsToRetrigger - pb.State = st.State - pb.TriggerTime = st.TriggerTime - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -92,35 +78,21 @@ func alertToPb(st *Alert) (*alertPb, error) { } type alertPb struct { - Condition *AlertCondition `json:"condition,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - CustomBody string `json:"custom_body,omitempty"` - - CustomSubject string `json:"custom_subject,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - NotifyOnOk bool `json:"notify_on_ok,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` - - State AlertState `json:"state,omitempty"` - - TriggerTime string `json:"trigger_time,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + Condition *AlertCondition `json:"condition,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CustomBody string `json:"custom_body,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + QueryId string `json:"query_id,omitempty"` + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + State AlertState `json:"state,omitempty"` + TriggerTime string `json:"trigger_time,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -164,24 +136,18 @@ func alertConditionToPb(st *AlertCondition) (*alertConditionPb, error) { } pb := &alertConditionPb{} pb.EmptyResultState = st.EmptyResultState - pb.Op = st.Op - pb.Operand = st.Operand - pb.Threshold = st.Threshold return pb, nil } type alertConditionPb struct { - EmptyResultState AlertState `json:"empty_result_state,omitempty"` - - Op AlertOperator `json:"op,omitempty"` - - Operand *AlertConditionOperand `json:"operand,omitempty"` - - Threshold *AlertConditionThreshold `json:"threshold,omitempty"` + EmptyResultState AlertState `json:"empty_result_state,omitempty"` + Op AlertOperator `json:"op,omitempty"` + Operand *AlertConditionOperand `json:"operand,omitempty"` + Threshold *AlertConditionThreshold `json:"threshold,omitempty"` } func alertConditionFromPb(pb *alertConditionPb) (*AlertCondition, error) { @@ -287,9 +253,7 @@ func alertOperandValueToPb(st *AlertOperandValue) (*alertOperandValuePb, error) } pb := &alertOperandValuePb{} pb.BoolValue = st.BoolValue - pb.DoubleValue = st.DoubleValue - pb.StringValue = st.StringValue pb.ForceSendFields = st.ForceSendFields @@ -297,11 +261,9 @@ func alertOperandValueToPb(st *AlertOperandValue) (*alertOperandValuePb, error) } type alertOperandValuePb struct { - BoolValue bool `json:"bool_value,omitempty"` - + BoolValue bool `json:"bool_value,omitempty"` DoubleValue float64 `json:"double_value,omitempty"` - - StringValue string `json:"string_value,omitempty"` + StringValue string `json:"string_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -333,17 +295,11 @@ func alertOptionsToPb(st *AlertOptions) (*alertOptionsPb, error) { } pb := &alertOptionsPb{} pb.Column = st.Column - pb.CustomBody = st.CustomBody - pb.CustomSubject = st.CustomSubject - pb.EmptyResultState = st.EmptyResultState - pb.Muted = st.Muted - pb.Op = st.Op - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -351,19 +307,13 @@ func alertOptionsToPb(st *AlertOptions) (*alertOptionsPb, error) { } type alertOptionsPb struct { - Column string `json:"column"` - - CustomBody string `json:"custom_body,omitempty"` - - CustomSubject string `json:"custom_subject,omitempty"` - + Column string `json:"column"` + CustomBody string `json:"custom_body,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` EmptyResultState AlertOptionsEmptyResultState `json:"empty_result_state,omitempty"` - - Muted bool `json:"muted,omitempty"` - - Op string `json:"op"` - - Value any `json:"value"` + Muted bool `json:"muted,omitempty"` + Op string `json:"op"` + Value any `json:"value"` ForceSendFields []string `json:"-" url:"-"` } @@ -399,29 +349,17 @@ func alertQueryToPb(st *AlertQuery) (*alertQueryPb, error) { } pb := &alertQueryPb{} pb.CreatedAt = st.CreatedAt - pb.DataSourceId = st.DataSourceId - pb.Description = st.Description - pb.Id = st.Id - pb.IsArchived = st.IsArchived - pb.IsDraft = st.IsDraft - pb.IsSafe = st.IsSafe - pb.Name = st.Name - pb.Options = st.Options - pb.Query = st.Query - pb.Tags = st.Tags - pb.UpdatedAt = st.UpdatedAt - pb.UserId = st.UserId pb.ForceSendFields = st.ForceSendFields @@ -429,31 +367,19 @@ func alertQueryToPb(st *AlertQuery) (*alertQueryPb, error) { } type alertQueryPb struct { - CreatedAt string `json:"created_at,omitempty"` - - DataSourceId string `json:"data_source_id,omitempty"` - - Description string `json:"description,omitempty"` - - Id string `json:"id,omitempty"` - - IsArchived bool `json:"is_archived,omitempty"` - - IsDraft bool `json:"is_draft,omitempty"` - - IsSafe bool `json:"is_safe,omitempty"` - - Name string `json:"name,omitempty"` - - Options *QueryOptions `json:"options,omitempty"` - - Query string `json:"query,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` - - UserId int `json:"user_id,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + DataSourceId string `json:"data_source_id,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + IsArchived bool `json:"is_archived,omitempty"` + IsDraft bool `json:"is_draft,omitempty"` + IsSafe bool `json:"is_safe,omitempty"` + Name string `json:"name,omitempty"` + Options *QueryOptions `json:"options,omitempty"` + Query string `json:"query,omitempty"` + Tags []string `json:"tags,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + UserId int `json:"user_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -495,31 +421,18 @@ func alertV2ToPb(st *AlertV2) (*alertV2Pb, error) { } pb := &alertV2Pb{} pb.CreateTime = st.CreateTime - pb.CustomDescription = st.CustomDescription - pb.CustomSummary = st.CustomSummary - pb.DisplayName = st.DisplayName - pb.Evaluation = st.Evaluation - pb.Id = st.Id - pb.LifecycleState = st.LifecycleState - pb.OwnerUserName = st.OwnerUserName - pb.ParentPath = st.ParentPath - pb.QueryText = st.QueryText - pb.RunAsUserName = st.RunAsUserName - pb.Schedule = st.Schedule - pb.UpdateTime = st.UpdateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -527,33 +440,20 @@ func alertV2ToPb(st *AlertV2) (*alertV2Pb, error) { } type alertV2Pb struct { - CreateTime string `json:"create_time,omitempty"` - - CustomDescription string `json:"custom_description,omitempty"` - - CustomSummary string `json:"custom_summary,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Evaluation *AlertV2Evaluation `json:"evaluation,omitempty"` - - Id string `json:"id,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RunAsUserName string `json:"run_as_user_name,omitempty"` - - Schedule *CronSchedule `json:"schedule,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CustomDescription string `json:"custom_description,omitempty"` + CustomSummary string `json:"custom_summary,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Evaluation *AlertV2Evaluation `json:"evaluation,omitempty"` + Id string `json:"id,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + QueryText string `json:"query_text,omitempty"` + RunAsUserName string `json:"run_as_user_name,omitempty"` + Schedule *CronSchedule `json:"schedule,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -596,17 +496,11 @@ func alertV2EvaluationToPb(st *AlertV2Evaluation) (*alertV2EvaluationPb, error) } pb := &alertV2EvaluationPb{} pb.ComparisonOperator = st.ComparisonOperator - pb.EmptyResultState = st.EmptyResultState - pb.LastEvaluatedAt = st.LastEvaluatedAt - pb.Notification = st.Notification - pb.Source = st.Source - pb.State = st.State - pb.Threshold = st.Threshold pb.ForceSendFields = st.ForceSendFields @@ -614,19 +508,13 @@ func alertV2EvaluationToPb(st *AlertV2Evaluation) (*alertV2EvaluationPb, error) } type alertV2EvaluationPb struct { - ComparisonOperator ComparisonOperator `json:"comparison_operator,omitempty"` - - EmptyResultState AlertEvaluationState `json:"empty_result_state,omitempty"` - - LastEvaluatedAt string `json:"last_evaluated_at,omitempty"` - - Notification *AlertV2Notification `json:"notification,omitempty"` - - Source *AlertV2OperandColumn `json:"source,omitempty"` - - State AlertEvaluationState `json:"state,omitempty"` - - Threshold *AlertV2Operand `json:"threshold,omitempty"` + ComparisonOperator ComparisonOperator `json:"comparison_operator,omitempty"` + EmptyResultState AlertEvaluationState `json:"empty_result_state,omitempty"` + LastEvaluatedAt string `json:"last_evaluated_at,omitempty"` + Notification *AlertV2Notification `json:"notification,omitempty"` + Source *AlertV2OperandColumn `json:"source,omitempty"` + State AlertEvaluationState `json:"state,omitempty"` + Threshold *AlertV2Operand `json:"threshold,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -662,9 +550,7 @@ func alertV2NotificationToPb(st *AlertV2Notification) (*alertV2NotificationPb, e } pb := &alertV2NotificationPb{} pb.NotifyOnOk = st.NotifyOnOk - pb.RetriggerSeconds = st.RetriggerSeconds - pb.Subscriptions = st.Subscriptions pb.ForceSendFields = st.ForceSendFields @@ -672,11 +558,9 @@ func alertV2NotificationToPb(st *AlertV2Notification) (*alertV2NotificationPb, e } type alertV2NotificationPb struct { - NotifyOnOk bool `json:"notify_on_ok,omitempty"` - - RetriggerSeconds int `json:"retrigger_seconds,omitempty"` - - Subscriptions []AlertV2Subscription `json:"subscriptions,omitempty"` + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + RetriggerSeconds int `json:"retrigger_seconds,omitempty"` + Subscriptions []AlertV2Subscription `json:"subscriptions,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -708,7 +592,6 @@ func alertV2OperandToPb(st *AlertV2Operand) (*alertV2OperandPb, error) { } pb := &alertV2OperandPb{} pb.Column = st.Column - pb.Value = st.Value return pb, nil @@ -716,8 +599,7 @@ func alertV2OperandToPb(st *AlertV2Operand) (*alertV2OperandPb, error) { type alertV2OperandPb struct { Column *AlertV2OperandColumn `json:"column,omitempty"` - - Value *AlertV2OperandValue `json:"value,omitempty"` + Value *AlertV2OperandValue `json:"value,omitempty"` } func alertV2OperandFromPb(pb *alertV2OperandPb) (*AlertV2Operand, error) { @@ -737,9 +619,7 @@ func alertV2OperandColumnToPb(st *AlertV2OperandColumn) (*alertV2OperandColumnPb } pb := &alertV2OperandColumnPb{} pb.Aggregation = st.Aggregation - pb.Display = st.Display - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -748,10 +628,8 @@ func alertV2OperandColumnToPb(st *AlertV2OperandColumn) (*alertV2OperandColumnPb type alertV2OperandColumnPb struct { Aggregation Aggregation `json:"aggregation,omitempty"` - - Display string `json:"display,omitempty"` - - Name string `json:"name,omitempty"` + Display string `json:"display,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -783,9 +661,7 @@ func alertV2OperandValueToPb(st *AlertV2OperandValue) (*alertV2OperandValuePb, e } pb := &alertV2OperandValuePb{} pb.BoolValue = st.BoolValue - pb.DoubleValue = st.DoubleValue - pb.StringValue = st.StringValue pb.ForceSendFields = st.ForceSendFields @@ -793,11 +669,9 @@ func alertV2OperandValueToPb(st *AlertV2OperandValue) (*alertV2OperandValuePb, e } type alertV2OperandValuePb struct { - BoolValue bool `json:"bool_value,omitempty"` - + BoolValue bool `json:"bool_value,omitempty"` DoubleValue float64 `json:"double_value,omitempty"` - - StringValue string `json:"string_value,omitempty"` + StringValue string `json:"string_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -829,7 +703,6 @@ func alertV2SubscriptionToPb(st *AlertV2Subscription) (*alertV2SubscriptionPb, e } pb := &alertV2SubscriptionPb{} pb.DestinationId = st.DestinationId - pb.UserEmail = st.UserEmail pb.ForceSendFields = st.ForceSendFields @@ -838,8 +711,7 @@ func alertV2SubscriptionToPb(st *AlertV2Subscription) (*alertV2SubscriptionPb, e type alertV2SubscriptionPb struct { DestinationId string `json:"destination_id,omitempty"` - - UserEmail string `json:"user_email,omitempty"` + UserEmail string `json:"user_email,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -870,11 +742,8 @@ func baseChunkInfoToPb(st *BaseChunkInfo) (*baseChunkInfoPb, error) { } pb := &baseChunkInfoPb{} pb.ByteCount = st.ByteCount - pb.ChunkIndex = st.ChunkIndex - pb.RowCount = st.RowCount - pb.RowOffset = st.RowOffset pb.ForceSendFields = st.ForceSendFields @@ -882,13 +751,10 @@ func baseChunkInfoToPb(st *BaseChunkInfo) (*baseChunkInfoPb, error) { } type baseChunkInfoPb struct { - ByteCount int64 `json:"byte_count,omitempty"` - - ChunkIndex int `json:"chunk_index,omitempty"` - - RowCount int64 `json:"row_count,omitempty"` - - RowOffset int64 `json:"row_offset,omitempty"` + ByteCount int64 `json:"byte_count,omitempty"` + ChunkIndex int `json:"chunk_index,omitempty"` + RowCount int64 `json:"row_count,omitempty"` + RowOffset int64 `json:"row_offset,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -966,7 +832,6 @@ func channelToPb(st *Channel) (*channelPb, error) { } pb := &channelPb{} pb.DbsqlVersion = st.DbsqlVersion - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -974,9 +839,8 @@ func channelToPb(st *Channel) (*channelPb, error) { } type channelPb struct { - DbsqlVersion string `json:"dbsql_version,omitempty"` - - Name ChannelName `json:"name,omitempty"` + DbsqlVersion string `json:"dbsql_version,omitempty"` + Name ChannelName `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1007,7 +871,6 @@ func channelInfoToPb(st *ChannelInfo) (*channelInfoPb, error) { } pb := &channelInfoPb{} pb.DbsqlVersion = st.DbsqlVersion - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -1015,9 +878,8 @@ func channelInfoToPb(st *ChannelInfo) (*channelInfoPb, error) { } type channelInfoPb struct { - DbsqlVersion string `json:"dbsql_version,omitempty"` - - Name ChannelName `json:"name,omitempty"` + DbsqlVersion string `json:"dbsql_version,omitempty"` + Name ChannelName `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1048,23 +910,14 @@ func clientConfigToPb(st *ClientConfig) (*clientConfigPb, error) { } pb := &clientConfigPb{} pb.AllowCustomJsVisualizations = st.AllowCustomJsVisualizations - pb.AllowDownloads = st.AllowDownloads - pb.AllowExternalShares = st.AllowExternalShares - pb.AllowSubscriptions = st.AllowSubscriptions - pb.DateFormat = st.DateFormat - pb.DateTimeFormat = st.DateTimeFormat - pb.DisablePublish = st.DisablePublish - pb.EnableLegacyAutodetectTypes = st.EnableLegacyAutodetectTypes - pb.FeatureShowPermissionsControl = st.FeatureShowPermissionsControl - pb.HidePlotlyModeBar = st.HidePlotlyModeBar pb.ForceSendFields = st.ForceSendFields @@ -1072,25 +925,16 @@ func clientConfigToPb(st *ClientConfig) (*clientConfigPb, error) { } type clientConfigPb struct { - AllowCustomJsVisualizations bool `json:"allow_custom_js_visualizations,omitempty"` - - AllowDownloads bool `json:"allow_downloads,omitempty"` - - AllowExternalShares bool `json:"allow_external_shares,omitempty"` - - AllowSubscriptions bool `json:"allow_subscriptions,omitempty"` - - DateFormat string `json:"date_format,omitempty"` - - DateTimeFormat string `json:"date_time_format,omitempty"` - - DisablePublish bool `json:"disable_publish,omitempty"` - - EnableLegacyAutodetectTypes bool `json:"enable_legacy_autodetect_types,omitempty"` - - FeatureShowPermissionsControl bool `json:"feature_show_permissions_control,omitempty"` - - HidePlotlyModeBar bool `json:"hide_plotly_mode_bar,omitempty"` + AllowCustomJsVisualizations bool `json:"allow_custom_js_visualizations,omitempty"` + AllowDownloads bool `json:"allow_downloads,omitempty"` + AllowExternalShares bool `json:"allow_external_shares,omitempty"` + AllowSubscriptions bool `json:"allow_subscriptions,omitempty"` + DateFormat string `json:"date_format,omitempty"` + DateTimeFormat string `json:"date_time_format,omitempty"` + DisablePublish bool `json:"disable_publish,omitempty"` + EnableLegacyAutodetectTypes bool `json:"enable_legacy_autodetect_types,omitempty"` + FeatureShowPermissionsControl bool `json:"feature_show_permissions_control,omitempty"` + HidePlotlyModeBar bool `json:"hide_plotly_mode_bar,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1129,17 +973,11 @@ func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { } pb := &columnInfoPb{} pb.Name = st.Name - pb.Position = st.Position - pb.TypeIntervalType = st.TypeIntervalType - pb.TypeName = st.TypeName - pb.TypePrecision = st.TypePrecision - pb.TypeScale = st.TypeScale - pb.TypeText = st.TypeText pb.ForceSendFields = st.ForceSendFields @@ -1147,19 +985,13 @@ func columnInfoToPb(st *ColumnInfo) (*columnInfoPb, error) { } type columnInfoPb struct { - Name string `json:"name,omitempty"` - - Position int `json:"position,omitempty"` - - TypeIntervalType string `json:"type_interval_type,omitempty"` - - TypeName ColumnInfoTypeName `json:"type_name,omitempty"` - - TypePrecision int `json:"type_precision,omitempty"` - - TypeScale int `json:"type_scale,omitempty"` - - TypeText string `json:"type_text,omitempty"` + Name string `json:"name,omitempty"` + Position int `json:"position,omitempty"` + TypeIntervalType string `json:"type_interval_type,omitempty"` + TypeName ColumnInfoTypeName `json:"type_name,omitempty"` + TypePrecision int `json:"type_precision,omitempty"` + TypeScale int `json:"type_scale,omitempty"` + TypeText string `json:"type_text,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1195,13 +1027,9 @@ func createAlertToPb(st *CreateAlert) (*createAlertPb, error) { } pb := &createAlertPb{} pb.Name = st.Name - pb.Options = st.Options - pb.Parent = st.Parent - pb.QueryId = st.QueryId - pb.Rearm = st.Rearm pb.ForceSendFields = st.ForceSendFields @@ -1209,15 +1037,11 @@ func createAlertToPb(st *CreateAlert) (*createAlertPb, error) { } type createAlertPb struct { - Name string `json:"name"` - + Name string `json:"name"` Options AlertOptions `json:"options"` - - Parent string `json:"parent,omitempty"` - - QueryId string `json:"query_id"` - - Rearm int `json:"rearm,omitempty"` + Parent string `json:"parent,omitempty"` + QueryId string `json:"query_id"` + Rearm int `json:"rearm,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1251,7 +1075,6 @@ func createAlertRequestToPb(st *CreateAlertRequest) (*createAlertRequestPb, erro } pb := &createAlertRequestPb{} pb.Alert = st.Alert - pb.AutoResolveDisplayName = st.AutoResolveDisplayName pb.ForceSendFields = st.ForceSendFields @@ -1259,9 +1082,8 @@ func createAlertRequestToPb(st *CreateAlertRequest) (*createAlertRequestPb, erro } type createAlertRequestPb struct { - Alert *CreateAlertRequestAlert `json:"alert,omitempty"` - - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + Alert *CreateAlertRequestAlert `json:"alert,omitempty"` + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1292,19 +1114,12 @@ func createAlertRequestAlertToPb(st *CreateAlertRequestAlert) (*createAlertReque } pb := &createAlertRequestAlertPb{} pb.Condition = st.Condition - pb.CustomBody = st.CustomBody - pb.CustomSubject = st.CustomSubject - pb.DisplayName = st.DisplayName - pb.NotifyOnOk = st.NotifyOnOk - pb.ParentPath = st.ParentPath - pb.QueryId = st.QueryId - pb.SecondsToRetrigger = st.SecondsToRetrigger pb.ForceSendFields = st.ForceSendFields @@ -1312,21 +1127,14 @@ func createAlertRequestAlertToPb(st *CreateAlertRequestAlert) (*createAlertReque } type createAlertRequestAlertPb struct { - Condition *AlertCondition `json:"condition,omitempty"` - - CustomBody string `json:"custom_body,omitempty"` - - CustomSubject string `json:"custom_subject,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - NotifyOnOk bool `json:"notify_on_ok,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + Condition *AlertCondition `json:"condition,omitempty"` + CustomBody string `json:"custom_body,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + DisplayName string `json:"display_name,omitempty"` + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + QueryId string `json:"query_id,omitempty"` + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1387,7 +1195,6 @@ func createQueryRequestToPb(st *CreateQueryRequest) (*createQueryRequestPb, erro } pb := &createQueryRequestPb{} pb.AutoResolveDisplayName = st.AutoResolveDisplayName - pb.Query = st.Query pb.ForceSendFields = st.ForceSendFields @@ -1395,9 +1202,8 @@ func createQueryRequestToPb(st *CreateQueryRequest) (*createQueryRequestPb, erro } type createQueryRequestPb struct { - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` - - Query *CreateQueryRequestQuery `json:"query,omitempty"` + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + Query *CreateQueryRequestQuery `json:"query,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1428,25 +1234,15 @@ func createQueryRequestQueryToPb(st *CreateQueryRequestQuery) (*createQueryReque } pb := &createQueryRequestQueryPb{} pb.ApplyAutoLimit = st.ApplyAutoLimit - pb.Catalog = st.Catalog - pb.Description = st.Description - pb.DisplayName = st.DisplayName - pb.Parameters = st.Parameters - pb.ParentPath = st.ParentPath - pb.QueryText = st.QueryText - pb.RunAsMode = st.RunAsMode - pb.Schema = st.Schema - pb.Tags = st.Tags - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -1454,27 +1250,17 @@ func createQueryRequestQueryToPb(st *CreateQueryRequestQuery) (*createQueryReque } type createQueryRequestQueryPb struct { - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Description string `json:"description,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Parameters []QueryParameter `json:"parameters,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` - - Schema string `json:"schema,omitempty"` - - Tags []string `json:"tags,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + Catalog string `json:"catalog,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Parameters []QueryParameter `json:"parameters,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + QueryText string `json:"query_text,omitempty"` + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + Schema string `json:"schema,omitempty"` + Tags []string `json:"tags,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1514,13 +1300,9 @@ func createQueryVisualizationsLegacyRequestToPb(st *CreateQueryVisualizationsLeg } pb := &createQueryVisualizationsLegacyRequestPb{} pb.Description = st.Description - pb.Name = st.Name - pb.Options = st.Options - pb.QueryId = st.QueryId - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -1529,14 +1311,10 @@ func createQueryVisualizationsLegacyRequestToPb(st *CreateQueryVisualizationsLeg type createQueryVisualizationsLegacyRequestPb struct { Description string `json:"description,omitempty"` - - Name string `json:"name,omitempty"` - - Options any `json:"options"` - - QueryId string `json:"query_id"` - - Type string `json:"type"` + Name string `json:"name,omitempty"` + Options any `json:"options"` + QueryId string `json:"query_id"` + Type string `json:"type"` ForceSendFields []string `json:"-" url:"-"` } @@ -1594,13 +1372,9 @@ func createVisualizationRequestVisualizationToPb(st *CreateVisualizationRequestV } pb := &createVisualizationRequestVisualizationPb{} pb.DisplayName = st.DisplayName - pb.QueryId = st.QueryId - pb.SerializedOptions = st.SerializedOptions - pb.SerializedQueryPlan = st.SerializedQueryPlan - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -1608,15 +1382,11 @@ func createVisualizationRequestVisualizationToPb(st *CreateVisualizationRequestV } type createVisualizationRequestVisualizationPb struct { - DisplayName string `json:"display_name,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SerializedOptions string `json:"serialized_options,omitempty"` - + DisplayName string `json:"display_name,omitempty"` + QueryId string `json:"query_id,omitempty"` + SerializedOptions string `json:"serialized_options,omitempty"` SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` - - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1650,29 +1420,17 @@ func createWarehouseRequestToPb(st *CreateWarehouseRequest) (*createWarehouseReq } pb := &createWarehouseRequestPb{} pb.AutoStopMins = st.AutoStopMins - pb.Channel = st.Channel - pb.ClusterSize = st.ClusterSize - pb.CreatorName = st.CreatorName - pb.EnablePhoton = st.EnablePhoton - pb.EnableServerlessCompute = st.EnableServerlessCompute - pb.InstanceProfileArn = st.InstanceProfileArn - pb.MaxNumClusters = st.MaxNumClusters - pb.MinNumClusters = st.MinNumClusters - pb.Name = st.Name - pb.SpotInstancePolicy = st.SpotInstancePolicy - pb.Tags = st.Tags - pb.WarehouseType = st.WarehouseType pb.ForceSendFields = st.ForceSendFields @@ -1680,31 +1438,19 @@ func createWarehouseRequestToPb(st *CreateWarehouseRequest) (*createWarehouseReq } type createWarehouseRequestPb struct { - AutoStopMins int `json:"auto_stop_mins,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - ClusterSize string `json:"cluster_size,omitempty"` - - CreatorName string `json:"creator_name,omitempty"` - - EnablePhoton bool `json:"enable_photon,omitempty"` - - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - MaxNumClusters int `json:"max_num_clusters,omitempty"` - - MinNumClusters int `json:"min_num_clusters,omitempty"` - - Name string `json:"name,omitempty"` - - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` - - Tags *EndpointTags `json:"tags,omitempty"` - - WarehouseType CreateWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + AutoStopMins int `json:"auto_stop_mins,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ClusterSize string `json:"cluster_size,omitempty"` + CreatorName string `json:"creator_name,omitempty"` + EnablePhoton bool `json:"enable_photon,omitempty"` + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + MaxNumClusters int `json:"max_num_clusters,omitempty"` + MinNumClusters int `json:"min_num_clusters,omitempty"` + Name string `json:"name,omitempty"` + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + Tags *EndpointTags `json:"tags,omitempty"` + WarehouseType CreateWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1782,15 +1528,10 @@ func createWidgetToPb(st *CreateWidget) (*createWidgetPb, error) { } pb := &createWidgetPb{} pb.DashboardId = st.DashboardId - pb.Id = st.Id - pb.Options = st.Options - pb.Text = st.Text - pb.VisualizationId = st.VisualizationId - pb.Width = st.Width pb.ForceSendFields = st.ForceSendFields @@ -1798,17 +1539,12 @@ func createWidgetToPb(st *CreateWidget) (*createWidgetPb, error) { } type createWidgetPb struct { - DashboardId string `json:"dashboard_id"` - - Id string `json:"-" url:"-"` - - Options WidgetOptions `json:"options"` - - Text string `json:"text,omitempty"` - - VisualizationId string `json:"visualization_id,omitempty"` - - Width int `json:"width"` + DashboardId string `json:"dashboard_id"` + Id string `json:"-" url:"-"` + Options WidgetOptions `json:"options"` + Text string `json:"text,omitempty"` + VisualizationId string `json:"visualization_id,omitempty"` + Width int `json:"width"` ForceSendFields []string `json:"-" url:"-"` } @@ -1843,9 +1579,7 @@ func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { } pb := &cronSchedulePb{} pb.PauseStatus = st.PauseStatus - pb.QuartzCronSchedule = st.QuartzCronSchedule - pb.TimezoneId = st.TimezoneId pb.ForceSendFields = st.ForceSendFields @@ -1853,11 +1587,9 @@ func cronScheduleToPb(st *CronSchedule) (*cronSchedulePb, error) { } type cronSchedulePb struct { - PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` - - QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` - - TimezoneId string `json:"timezone_id,omitempty"` + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"` + TimezoneId string `json:"timezone_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1889,37 +1621,21 @@ func dashboardToPb(st *Dashboard) (*dashboardPb, error) { } pb := &dashboardPb{} pb.CanEdit = st.CanEdit - pb.CreatedAt = st.CreatedAt - pb.DashboardFiltersEnabled = st.DashboardFiltersEnabled - pb.Id = st.Id - pb.IsArchived = st.IsArchived - pb.IsDraft = st.IsDraft - pb.IsFavorite = st.IsFavorite - pb.Name = st.Name - pb.Options = st.Options - pb.Parent = st.Parent - pb.PermissionTier = st.PermissionTier - pb.Slug = st.Slug - pb.Tags = st.Tags - pb.UpdatedAt = st.UpdatedAt - pb.User = st.User - pb.UserId = st.UserId - pb.Widgets = st.Widgets pb.ForceSendFields = st.ForceSendFields @@ -1927,39 +1643,23 @@ func dashboardToPb(st *Dashboard) (*dashboardPb, error) { } type dashboardPb struct { - CanEdit bool `json:"can_edit,omitempty"` - - CreatedAt string `json:"created_at,omitempty"` - - DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` - - Id string `json:"id,omitempty"` - - IsArchived bool `json:"is_archived,omitempty"` - - IsDraft bool `json:"is_draft,omitempty"` - - IsFavorite bool `json:"is_favorite,omitempty"` - - Name string `json:"name,omitempty"` - - Options *DashboardOptions `json:"options,omitempty"` - - Parent string `json:"parent,omitempty"` - - PermissionTier PermissionLevel `json:"permission_tier,omitempty"` - - Slug string `json:"slug,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` - - User *User `json:"user,omitempty"` - - UserId int `json:"user_id,omitempty"` - - Widgets []Widget `json:"widgets,omitempty"` + CanEdit bool `json:"can_edit,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + Id string `json:"id,omitempty"` + IsArchived bool `json:"is_archived,omitempty"` + IsDraft bool `json:"is_draft,omitempty"` + IsFavorite bool `json:"is_favorite,omitempty"` + Name string `json:"name,omitempty"` + Options *DashboardOptions `json:"options,omitempty"` + Parent string `json:"parent,omitempty"` + PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + Slug string `json:"slug,omitempty"` + Tags []string `json:"tags,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + User *User `json:"user,omitempty"` + UserId int `json:"user_id,omitempty"` + Widgets []Widget `json:"widgets,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2005,11 +1705,8 @@ func dashboardEditContentToPb(st *DashboardEditContent) (*dashboardEditContentPb } pb := &dashboardEditContentPb{} pb.DashboardId = st.DashboardId - pb.Name = st.Name - pb.RunAsRole = st.RunAsRole - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -2017,13 +1714,10 @@ func dashboardEditContentToPb(st *DashboardEditContent) (*dashboardEditContentPb } type dashboardEditContentPb struct { - DashboardId string `json:"-" url:"-"` - - Name string `json:"name,omitempty"` - - RunAsRole RunAsRole `json:"run_as_role,omitempty"` - - Tags []string `json:"tags,omitempty"` + DashboardId string `json:"-" url:"-"` + Name string `json:"name,omitempty"` + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + Tags []string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2092,15 +1786,10 @@ func dashboardPostContentToPb(st *DashboardPostContent) (*dashboardPostContentPb } pb := &dashboardPostContentPb{} pb.DashboardFiltersEnabled = st.DashboardFiltersEnabled - pb.IsFavorite = st.IsFavorite - pb.Name = st.Name - pb.Parent = st.Parent - pb.RunAsRole = st.RunAsRole - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -2108,17 +1797,12 @@ func dashboardPostContentToPb(st *DashboardPostContent) (*dashboardPostContentPb } type dashboardPostContentPb struct { - DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` - - IsFavorite bool `json:"is_favorite,omitempty"` - - Name string `json:"name"` - - Parent string `json:"parent,omitempty"` - - RunAsRole RunAsRole `json:"run_as_role,omitempty"` - - Tags []string `json:"tags,omitempty"` + DashboardFiltersEnabled bool `json:"dashboard_filters_enabled,omitempty"` + IsFavorite bool `json:"is_favorite,omitempty"` + Name string `json:"name"` + Parent string `json:"parent,omitempty"` + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + Tags []string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2153,21 +1837,13 @@ func dataSourceToPb(st *DataSource) (*dataSourcePb, error) { } pb := &dataSourcePb{} pb.Id = st.Id - pb.Name = st.Name - pb.PauseReason = st.PauseReason - pb.Paused = st.Paused - pb.SupportsAutoLimit = st.SupportsAutoLimit - pb.Syntax = st.Syntax - pb.Type = st.Type - pb.ViewOnly = st.ViewOnly - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -2175,23 +1851,15 @@ func dataSourceToPb(st *DataSource) (*dataSourcePb, error) { } type dataSourcePb struct { - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - PauseReason string `json:"pause_reason,omitempty"` - - Paused int `json:"paused,omitempty"` - - SupportsAutoLimit bool `json:"supports_auto_limit,omitempty"` - - Syntax string `json:"syntax,omitempty"` - - Type string `json:"type,omitempty"` - - ViewOnly bool `json:"view_only,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + PauseReason string `json:"pause_reason,omitempty"` + Paused int `json:"paused,omitempty"` + SupportsAutoLimit bool `json:"supports_auto_limit,omitempty"` + Syntax string `json:"syntax,omitempty"` + Type string `json:"type,omitempty"` + ViewOnly bool `json:"view_only,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2229,15 +1897,13 @@ func dateRangeToPb(st *DateRange) (*dateRangePb, error) { } pb := &dateRangePb{} pb.End = st.End - pb.Start = st.Start return pb, nil } type dateRangePb struct { - End string `json:"end"` - + End string `json:"end"` Start string `json:"start"` } @@ -2258,11 +1924,8 @@ func dateRangeValueToPb(st *DateRangeValue) (*dateRangeValuePb, error) { } pb := &dateRangeValuePb{} pb.DateRangeValue = st.DateRangeValue - pb.DynamicDateRangeValue = st.DynamicDateRangeValue - pb.Precision = st.Precision - pb.StartDayOfWeek = st.StartDayOfWeek pb.ForceSendFields = st.ForceSendFields @@ -2270,13 +1933,10 @@ func dateRangeValueToPb(st *DateRangeValue) (*dateRangeValuePb, error) { } type dateRangeValuePb struct { - DateRangeValue *DateRange `json:"date_range_value,omitempty"` - + DateRangeValue *DateRange `json:"date_range_value,omitempty"` DynamicDateRangeValue DateRangeValueDynamicDateRange `json:"dynamic_date_range_value,omitempty"` - - Precision DatePrecision `json:"precision,omitempty"` - - StartDayOfWeek int `json:"start_day_of_week,omitempty"` + Precision DatePrecision `json:"precision,omitempty"` + StartDayOfWeek int `json:"start_day_of_week,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2309,9 +1969,7 @@ func dateValueToPb(st *DateValue) (*dateValuePb, error) { } pb := &dateValuePb{} pb.DateValue = st.DateValue - pb.DynamicDateValue = st.DynamicDateValue - pb.Precision = st.Precision pb.ForceSendFields = st.ForceSendFields @@ -2319,11 +1977,9 @@ func dateValueToPb(st *DateValue) (*dateValuePb, error) { } type dateValuePb struct { - DateValue string `json:"date_value,omitempty"` - + DateValue string `json:"date_value,omitempty"` DynamicDateValue DateValueDynamicDate `json:"dynamic_date_value,omitempty"` - - Precision DatePrecision `json:"precision,omitempty"` + Precision DatePrecision `json:"precision,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2565,13 +2221,9 @@ func editAlertToPb(st *EditAlert) (*editAlertPb, error) { } pb := &editAlertPb{} pb.AlertId = st.AlertId - pb.Name = st.Name - pb.Options = st.Options - pb.QueryId = st.QueryId - pb.Rearm = st.Rearm pb.ForceSendFields = st.ForceSendFields @@ -2579,15 +2231,11 @@ func editAlertToPb(st *EditAlert) (*editAlertPb, error) { } type editAlertPb struct { - AlertId string `json:"-" url:"-"` - - Name string `json:"name"` - + AlertId string `json:"-" url:"-"` + Name string `json:"name"` Options AlertOptions `json:"options"` - - QueryId string `json:"query_id"` - - Rearm int `json:"rearm,omitempty"` + QueryId string `json:"query_id"` + Rearm int `json:"rearm,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2621,31 +2269,18 @@ func editWarehouseRequestToPb(st *EditWarehouseRequest) (*editWarehouseRequestPb } pb := &editWarehouseRequestPb{} pb.AutoStopMins = st.AutoStopMins - pb.Channel = st.Channel - pb.ClusterSize = st.ClusterSize - pb.CreatorName = st.CreatorName - pb.EnablePhoton = st.EnablePhoton - pb.EnableServerlessCompute = st.EnableServerlessCompute - pb.Id = st.Id - pb.InstanceProfileArn = st.InstanceProfileArn - pb.MaxNumClusters = st.MaxNumClusters - pb.MinNumClusters = st.MinNumClusters - pb.Name = st.Name - pb.SpotInstancePolicy = st.SpotInstancePolicy - pb.Tags = st.Tags - pb.WarehouseType = st.WarehouseType pb.ForceSendFields = st.ForceSendFields @@ -2653,33 +2288,20 @@ func editWarehouseRequestToPb(st *EditWarehouseRequest) (*editWarehouseRequestPb } type editWarehouseRequestPb struct { - AutoStopMins int `json:"auto_stop_mins,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - ClusterSize string `json:"cluster_size,omitempty"` - - CreatorName string `json:"creator_name,omitempty"` - - EnablePhoton bool `json:"enable_photon,omitempty"` - - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` - - Id string `json:"-" url:"-"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - MaxNumClusters int `json:"max_num_clusters,omitempty"` - - MinNumClusters int `json:"min_num_clusters,omitempty"` - - Name string `json:"name,omitempty"` - - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` - - Tags *EndpointTags `json:"tags,omitempty"` - - WarehouseType EditWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` + AutoStopMins int `json:"auto_stop_mins,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ClusterSize string `json:"cluster_size,omitempty"` + CreatorName string `json:"creator_name,omitempty"` + EnablePhoton bool `json:"enable_photon,omitempty"` + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + Id string `json:"-" url:"-"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + MaxNumClusters int `json:"max_num_clusters,omitempty"` + MinNumClusters int `json:"min_num_clusters,omitempty"` + Name string `json:"name,omitempty"` + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + Tags *EndpointTags `json:"tags,omitempty"` + WarehouseType EditWarehouseRequestWarehouseType `json:"warehouse_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2764,7 +2386,6 @@ func endpointConfPairToPb(st *EndpointConfPair) (*endpointConfPairPb, error) { } pb := &endpointConfPairPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -2772,8 +2393,7 @@ func endpointConfPairToPb(st *EndpointConfPair) (*endpointConfPairPb, error) { } type endpointConfPairPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2805,13 +2425,9 @@ func endpointHealthToPb(st *EndpointHealth) (*endpointHealthPb, error) { } pb := &endpointHealthPb{} pb.Details = st.Details - pb.FailureReason = st.FailureReason - pb.Message = st.Message - pb.Status = st.Status - pb.Summary = st.Summary pb.ForceSendFields = st.ForceSendFields @@ -2819,15 +2435,11 @@ func endpointHealthToPb(st *EndpointHealth) (*endpointHealthPb, error) { } type endpointHealthPb struct { - Details string `json:"details,omitempty"` - + Details string `json:"details,omitempty"` FailureReason *TerminationReason `json:"failure_reason,omitempty"` - - Message string `json:"message,omitempty"` - - Status Status `json:"status,omitempty"` - - Summary string `json:"summary,omitempty"` + Message string `json:"message,omitempty"` + Status Status `json:"status,omitempty"` + Summary string `json:"summary,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2861,43 +2473,24 @@ func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { } pb := &endpointInfoPb{} pb.AutoStopMins = st.AutoStopMins - pb.Channel = st.Channel - pb.ClusterSize = st.ClusterSize - pb.CreatorName = st.CreatorName - pb.EnablePhoton = st.EnablePhoton - pb.EnableServerlessCompute = st.EnableServerlessCompute - pb.Health = st.Health - pb.Id = st.Id - pb.InstanceProfileArn = st.InstanceProfileArn - pb.JdbcUrl = st.JdbcUrl - pb.MaxNumClusters = st.MaxNumClusters - pb.MinNumClusters = st.MinNumClusters - pb.Name = st.Name - pb.NumActiveSessions = st.NumActiveSessions - pb.NumClusters = st.NumClusters - pb.OdbcParams = st.OdbcParams - pb.SpotInstancePolicy = st.SpotInstancePolicy - pb.State = st.State - pb.Tags = st.Tags - pb.WarehouseType = st.WarehouseType pb.ForceSendFields = st.ForceSendFields @@ -2905,45 +2498,26 @@ func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { } type endpointInfoPb struct { - AutoStopMins int `json:"auto_stop_mins,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - ClusterSize string `json:"cluster_size,omitempty"` - - CreatorName string `json:"creator_name,omitempty"` - - EnablePhoton bool `json:"enable_photon,omitempty"` - - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` - - Health *EndpointHealth `json:"health,omitempty"` - - Id string `json:"id,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - JdbcUrl string `json:"jdbc_url,omitempty"` - - MaxNumClusters int `json:"max_num_clusters,omitempty"` - - MinNumClusters int `json:"min_num_clusters,omitempty"` - - Name string `json:"name,omitempty"` - - NumActiveSessions int64 `json:"num_active_sessions,omitempty"` - - NumClusters int `json:"num_clusters,omitempty"` - - OdbcParams *OdbcParams `json:"odbc_params,omitempty"` - - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` - - State State `json:"state,omitempty"` - - Tags *EndpointTags `json:"tags,omitempty"` - - WarehouseType EndpointInfoWarehouseType `json:"warehouse_type,omitempty"` + AutoStopMins int `json:"auto_stop_mins,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ClusterSize string `json:"cluster_size,omitempty"` + CreatorName string `json:"creator_name,omitempty"` + EnablePhoton bool `json:"enable_photon,omitempty"` + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + Health *EndpointHealth `json:"health,omitempty"` + Id string `json:"id,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + JdbcUrl string `json:"jdbc_url,omitempty"` + MaxNumClusters int `json:"max_num_clusters,omitempty"` + MinNumClusters int `json:"min_num_clusters,omitempty"` + Name string `json:"name,omitempty"` + NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + NumClusters int `json:"num_clusters,omitempty"` + OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + State State `json:"state,omitempty"` + Tags *EndpointTags `json:"tags,omitempty"` + WarehouseType EndpointInfoWarehouseType `json:"warehouse_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2992,7 +2566,6 @@ func endpointTagPairToPb(st *EndpointTagPair) (*endpointTagPairPb, error) { } pb := &endpointTagPairPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -3000,8 +2573,7 @@ func endpointTagPairToPb(st *EndpointTagPair) (*endpointTagPairPb, error) { } type endpointTagPairPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3057,9 +2629,7 @@ func enumValueToPb(st *EnumValue) (*enumValuePb, error) { } pb := &enumValuePb{} pb.EnumOptions = st.EnumOptions - pb.MultiValuesOptions = st.MultiValuesOptions - pb.Values = st.Values pb.ForceSendFields = st.ForceSendFields @@ -3067,11 +2637,9 @@ func enumValueToPb(st *EnumValue) (*enumValuePb, error) { } type enumValuePb struct { - EnumOptions string `json:"enum_options,omitempty"` - + EnumOptions string `json:"enum_options,omitempty"` MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` - - Values []string `json:"values,omitempty"` + Values []string `json:"values,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3103,25 +2671,15 @@ func executeStatementRequestToPb(st *ExecuteStatementRequest) (*executeStatement } pb := &executeStatementRequestPb{} pb.ByteLimit = st.ByteLimit - pb.Catalog = st.Catalog - pb.Disposition = st.Disposition - pb.Format = st.Format - pb.OnWaitTimeout = st.OnWaitTimeout - pb.Parameters = st.Parameters - pb.RowLimit = st.RowLimit - pb.Schema = st.Schema - pb.Statement = st.Statement - pb.WaitTimeout = st.WaitTimeout - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -3129,27 +2687,17 @@ func executeStatementRequestToPb(st *ExecuteStatementRequest) (*executeStatement } type executeStatementRequestPb struct { - ByteLimit int64 `json:"byte_limit,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Disposition Disposition `json:"disposition,omitempty"` - - Format Format `json:"format,omitempty"` - + ByteLimit int64 `json:"byte_limit,omitempty"` + Catalog string `json:"catalog,omitempty"` + Disposition Disposition `json:"disposition,omitempty"` + Format Format `json:"format,omitempty"` OnWaitTimeout ExecuteStatementRequestOnWaitTimeout `json:"on_wait_timeout,omitempty"` - - Parameters []StatementParameterListItem `json:"parameters,omitempty"` - - RowLimit int64 `json:"row_limit,omitempty"` - - Schema string `json:"schema,omitempty"` - - Statement string `json:"statement"` - - WaitTimeout string `json:"wait_timeout,omitempty"` - - WarehouseId string `json:"warehouse_id"` + Parameters []StatementParameterListItem `json:"parameters,omitempty"` + RowLimit int64 `json:"row_limit,omitempty"` + Schema string `json:"schema,omitempty"` + Statement string `json:"statement"` + WaitTimeout string `json:"wait_timeout,omitempty"` + WarehouseId string `json:"warehouse_id"` ForceSendFields []string `json:"-" url:"-"` } @@ -3189,21 +2737,13 @@ func externalLinkToPb(st *ExternalLink) (*externalLinkPb, error) { } pb := &externalLinkPb{} pb.ByteCount = st.ByteCount - pb.ChunkIndex = st.ChunkIndex - pb.Expiration = st.Expiration - pb.ExternalLink = st.ExternalLink - pb.HttpHeaders = st.HttpHeaders - pb.NextChunkIndex = st.NextChunkIndex - pb.NextChunkInternalLink = st.NextChunkInternalLink - pb.RowCount = st.RowCount - pb.RowOffset = st.RowOffset pb.ForceSendFields = st.ForceSendFields @@ -3211,23 +2751,15 @@ func externalLinkToPb(st *ExternalLink) (*externalLinkPb, error) { } type externalLinkPb struct { - ByteCount int64 `json:"byte_count,omitempty"` - - ChunkIndex int `json:"chunk_index,omitempty"` - - Expiration string `json:"expiration,omitempty"` - - ExternalLink string `json:"external_link,omitempty"` - - HttpHeaders map[string]string `json:"http_headers,omitempty"` - - NextChunkIndex int `json:"next_chunk_index,omitempty"` - - NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` - - RowCount int64 `json:"row_count,omitempty"` - - RowOffset int64 `json:"row_offset,omitempty"` + ByteCount int64 `json:"byte_count,omitempty"` + ChunkIndex int `json:"chunk_index,omitempty"` + Expiration string `json:"expiration,omitempty"` + ExternalLink string `json:"external_link,omitempty"` + HttpHeaders map[string]string `json:"http_headers,omitempty"` + NextChunkIndex int `json:"next_chunk_index,omitempty"` + NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + RowCount int64 `json:"row_count,omitempty"` + RowOffset int64 `json:"row_offset,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3265,17 +2797,11 @@ func externalQuerySourceToPb(st *ExternalQuerySource) (*externalQuerySourcePb, e } pb := &externalQuerySourcePb{} pb.AlertId = st.AlertId - pb.DashboardId = st.DashboardId - pb.GenieSpaceId = st.GenieSpaceId - pb.JobInfo = st.JobInfo - pb.LegacyDashboardId = st.LegacyDashboardId - pb.NotebookId = st.NotebookId - pb.SqlQueryId = st.SqlQueryId pb.ForceSendFields = st.ForceSendFields @@ -3283,19 +2809,13 @@ func externalQuerySourceToPb(st *ExternalQuerySource) (*externalQuerySourcePb, e } type externalQuerySourcePb struct { - AlertId string `json:"alert_id,omitempty"` - - DashboardId string `json:"dashboard_id,omitempty"` - - GenieSpaceId string `json:"genie_space_id,omitempty"` - - JobInfo *ExternalQuerySourceJobInfo `json:"job_info,omitempty"` - - LegacyDashboardId string `json:"legacy_dashboard_id,omitempty"` - - NotebookId string `json:"notebook_id,omitempty"` - - SqlQueryId string `json:"sql_query_id,omitempty"` + AlertId string `json:"alert_id,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` + GenieSpaceId string `json:"genie_space_id,omitempty"` + JobInfo *ExternalQuerySourceJobInfo `json:"job_info,omitempty"` + LegacyDashboardId string `json:"legacy_dashboard_id,omitempty"` + NotebookId string `json:"notebook_id,omitempty"` + SqlQueryId string `json:"sql_query_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3331,9 +2851,7 @@ func externalQuerySourceJobInfoToPb(st *ExternalQuerySourceJobInfo) (*externalQu } pb := &externalQuerySourceJobInfoPb{} pb.JobId = st.JobId - pb.JobRunId = st.JobRunId - pb.JobTaskRunId = st.JobTaskRunId pb.ForceSendFields = st.ForceSendFields @@ -3341,10 +2859,8 @@ func externalQuerySourceJobInfoToPb(st *ExternalQuerySourceJobInfo) (*externalQu } type externalQuerySourceJobInfoPb struct { - JobId string `json:"job_id,omitempty"` - - JobRunId string `json:"job_run_id,omitempty"` - + JobId string `json:"job_id,omitempty"` + JobRunId string `json:"job_run_id,omitempty"` JobTaskRunId string `json:"job_task_run_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3473,15 +2989,13 @@ func getDbsqlPermissionRequestToPb(st *GetDbsqlPermissionRequest) (*getDbsqlPerm } pb := &getDbsqlPermissionRequestPb{} pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType return pb, nil } type getDbsqlPermissionRequestPb struct { - ObjectId string `json:"-" url:"-"` - + ObjectId string `json:"-" url:"-"` ObjectType ObjectTypePlural `json:"-" url:"-"` } @@ -3550,9 +3064,7 @@ func getResponseToPb(st *GetResponse) (*getResponsePb, error) { } pb := &getResponsePb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -3561,10 +3073,8 @@ func getResponseToPb(st *GetResponse) (*getResponsePb, error) { type getResponsePb struct { AccessControlList []AccessControl `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType ObjectType `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType ObjectType `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3620,15 +3130,13 @@ func getStatementResultChunkNRequestToPb(st *GetStatementResultChunkNRequest) (* } pb := &getStatementResultChunkNRequestPb{} pb.ChunkIndex = st.ChunkIndex - pb.StatementId = st.StatementId return pb, nil } type getStatementResultChunkNRequestPb struct { - ChunkIndex int `json:"-" url:"-"` - + ChunkIndex int `json:"-" url:"-"` StatementId string `json:"-" url:"-"` } @@ -3745,43 +3253,24 @@ func getWarehouseResponseToPb(st *GetWarehouseResponse) (*getWarehouseResponsePb } pb := &getWarehouseResponsePb{} pb.AutoStopMins = st.AutoStopMins - pb.Channel = st.Channel - pb.ClusterSize = st.ClusterSize - pb.CreatorName = st.CreatorName - pb.EnablePhoton = st.EnablePhoton - pb.EnableServerlessCompute = st.EnableServerlessCompute - pb.Health = st.Health - pb.Id = st.Id - pb.InstanceProfileArn = st.InstanceProfileArn - pb.JdbcUrl = st.JdbcUrl - pb.MaxNumClusters = st.MaxNumClusters - pb.MinNumClusters = st.MinNumClusters - pb.Name = st.Name - pb.NumActiveSessions = st.NumActiveSessions - pb.NumClusters = st.NumClusters - pb.OdbcParams = st.OdbcParams - pb.SpotInstancePolicy = st.SpotInstancePolicy - pb.State = st.State - pb.Tags = st.Tags - pb.WarehouseType = st.WarehouseType pb.ForceSendFields = st.ForceSendFields @@ -3789,45 +3278,26 @@ func getWarehouseResponseToPb(st *GetWarehouseResponse) (*getWarehouseResponsePb } type getWarehouseResponsePb struct { - AutoStopMins int `json:"auto_stop_mins,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - ClusterSize string `json:"cluster_size,omitempty"` - - CreatorName string `json:"creator_name,omitempty"` - - EnablePhoton bool `json:"enable_photon,omitempty"` - - EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` - - Health *EndpointHealth `json:"health,omitempty"` - - Id string `json:"id,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - JdbcUrl string `json:"jdbc_url,omitempty"` - - MaxNumClusters int `json:"max_num_clusters,omitempty"` - - MinNumClusters int `json:"min_num_clusters,omitempty"` - - Name string `json:"name,omitempty"` - - NumActiveSessions int64 `json:"num_active_sessions,omitempty"` - - NumClusters int `json:"num_clusters,omitempty"` - - OdbcParams *OdbcParams `json:"odbc_params,omitempty"` - - SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` - - State State `json:"state,omitempty"` - - Tags *EndpointTags `json:"tags,omitempty"` - - WarehouseType GetWarehouseResponseWarehouseType `json:"warehouse_type,omitempty"` + AutoStopMins int `json:"auto_stop_mins,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ClusterSize string `json:"cluster_size,omitempty"` + CreatorName string `json:"creator_name,omitempty"` + EnablePhoton bool `json:"enable_photon,omitempty"` + EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"` + Health *EndpointHealth `json:"health,omitempty"` + Id string `json:"id,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + JdbcUrl string `json:"jdbc_url,omitempty"` + MaxNumClusters int `json:"max_num_clusters,omitempty"` + MinNumClusters int `json:"min_num_clusters,omitempty"` + Name string `json:"name,omitempty"` + NumActiveSessions int64 `json:"num_active_sessions,omitempty"` + NumClusters int `json:"num_clusters,omitempty"` + OdbcParams *OdbcParams `json:"odbc_params,omitempty"` + SpotInstancePolicy SpotInstancePolicy `json:"spot_instance_policy,omitempty"` + State State `json:"state,omitempty"` + Tags *EndpointTags `json:"tags,omitempty"` + WarehouseType GetWarehouseResponseWarehouseType `json:"warehouse_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3876,21 +3346,13 @@ func getWorkspaceWarehouseConfigResponseToPb(st *GetWorkspaceWarehouseConfigResp } pb := &getWorkspaceWarehouseConfigResponsePb{} pb.Channel = st.Channel - pb.ConfigParam = st.ConfigParam - pb.DataAccessConfig = st.DataAccessConfig - pb.EnabledWarehouseTypes = st.EnabledWarehouseTypes - pb.GlobalParam = st.GlobalParam - pb.GoogleServiceAccount = st.GoogleServiceAccount - pb.InstanceProfileArn = st.InstanceProfileArn - pb.SecurityPolicy = st.SecurityPolicy - pb.SqlConfigurationParameters = st.SqlConfigurationParameters pb.ForceSendFields = st.ForceSendFields @@ -3898,23 +3360,15 @@ func getWorkspaceWarehouseConfigResponseToPb(st *GetWorkspaceWarehouseConfigResp } type getWorkspaceWarehouseConfigResponsePb struct { - Channel *Channel `json:"channel,omitempty"` - - ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` - - DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` - - EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` - - GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` - - GoogleServiceAccount string `json:"google_service_account,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - SecurityPolicy GetWorkspaceWarehouseConfigResponseSecurityPolicy `json:"security_policy,omitempty"` - - SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + GoogleServiceAccount string `json:"google_service_account,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + SecurityPolicy GetWorkspaceWarehouseConfigResponseSecurityPolicy `json:"security_policy,omitempty"` + SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -3952,25 +3406,15 @@ func legacyAlertToPb(st *LegacyAlert) (*legacyAlertPb, error) { } pb := &legacyAlertPb{} pb.CreatedAt = st.CreatedAt - pb.Id = st.Id - pb.LastTriggeredAt = st.LastTriggeredAt - pb.Name = st.Name - pb.Options = st.Options - pb.Parent = st.Parent - pb.Query = st.Query - pb.Rearm = st.Rearm - pb.State = st.State - pb.UpdatedAt = st.UpdatedAt - pb.User = st.User pb.ForceSendFields = st.ForceSendFields @@ -3978,27 +3422,17 @@ func legacyAlertToPb(st *LegacyAlert) (*legacyAlertPb, error) { } type legacyAlertPb struct { - CreatedAt string `json:"created_at,omitempty"` - - Id string `json:"id,omitempty"` - - LastTriggeredAt string `json:"last_triggered_at,omitempty"` - - Name string `json:"name,omitempty"` - - Options *AlertOptions `json:"options,omitempty"` - - Parent string `json:"parent,omitempty"` - - Query *AlertQuery `json:"query,omitempty"` - - Rearm int `json:"rearm,omitempty"` - - State LegacyAlertState `json:"state,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` - - User *User `json:"user,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Id string `json:"id,omitempty"` + LastTriggeredAt string `json:"last_triggered_at,omitempty"` + Name string `json:"name,omitempty"` + Options *AlertOptions `json:"options,omitempty"` + Parent string `json:"parent,omitempty"` + Query *AlertQuery `json:"query,omitempty"` + Rearm int `json:"rearm,omitempty"` + State LegacyAlertState `json:"state,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + User *User `json:"user,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4038,51 +3472,28 @@ func legacyQueryToPb(st *LegacyQuery) (*legacyQueryPb, error) { } pb := &legacyQueryPb{} pb.CanEdit = st.CanEdit - pb.CreatedAt = st.CreatedAt - pb.DataSourceId = st.DataSourceId - pb.Description = st.Description - pb.Id = st.Id - pb.IsArchived = st.IsArchived - pb.IsDraft = st.IsDraft - pb.IsFavorite = st.IsFavorite - pb.IsSafe = st.IsSafe - pb.LastModifiedBy = st.LastModifiedBy - pb.LastModifiedById = st.LastModifiedById - pb.LatestQueryDataId = st.LatestQueryDataId - pb.Name = st.Name - pb.Options = st.Options - pb.Parent = st.Parent - pb.PermissionTier = st.PermissionTier - pb.Query = st.Query - pb.QueryHash = st.QueryHash - pb.RunAsRole = st.RunAsRole - pb.Tags = st.Tags - pb.UpdatedAt = st.UpdatedAt - pb.User = st.User - pb.UserId = st.UserId - pb.Visualizations = st.Visualizations pb.ForceSendFields = st.ForceSendFields @@ -4090,53 +3501,30 @@ func legacyQueryToPb(st *LegacyQuery) (*legacyQueryPb, error) { } type legacyQueryPb struct { - CanEdit bool `json:"can_edit,omitempty"` - - CreatedAt string `json:"created_at,omitempty"` - - DataSourceId string `json:"data_source_id,omitempty"` - - Description string `json:"description,omitempty"` - - Id string `json:"id,omitempty"` - - IsArchived bool `json:"is_archived,omitempty"` - - IsDraft bool `json:"is_draft,omitempty"` - - IsFavorite bool `json:"is_favorite,omitempty"` - - IsSafe bool `json:"is_safe,omitempty"` - - LastModifiedBy *User `json:"last_modified_by,omitempty"` - - LastModifiedById int `json:"last_modified_by_id,omitempty"` - - LatestQueryDataId string `json:"latest_query_data_id,omitempty"` - - Name string `json:"name,omitempty"` - - Options *QueryOptions `json:"options,omitempty"` - - Parent string `json:"parent,omitempty"` - - PermissionTier PermissionLevel `json:"permission_tier,omitempty"` - - Query string `json:"query,omitempty"` - - QueryHash string `json:"query_hash,omitempty"` - - RunAsRole RunAsRole `json:"run_as_role,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` - - User *User `json:"user,omitempty"` - - UserId int `json:"user_id,omitempty"` - - Visualizations []LegacyVisualization `json:"visualizations,omitempty"` + CanEdit bool `json:"can_edit,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + DataSourceId string `json:"data_source_id,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + IsArchived bool `json:"is_archived,omitempty"` + IsDraft bool `json:"is_draft,omitempty"` + IsFavorite bool `json:"is_favorite,omitempty"` + IsSafe bool `json:"is_safe,omitempty"` + LastModifiedBy *User `json:"last_modified_by,omitempty"` + LastModifiedById int `json:"last_modified_by_id,omitempty"` + LatestQueryDataId string `json:"latest_query_data_id,omitempty"` + Name string `json:"name,omitempty"` + Options *QueryOptions `json:"options,omitempty"` + Parent string `json:"parent,omitempty"` + PermissionTier PermissionLevel `json:"permission_tier,omitempty"` + Query string `json:"query,omitempty"` + QueryHash string `json:"query_hash,omitempty"` + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + Tags []string `json:"tags,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + User *User `json:"user,omitempty"` + UserId int `json:"user_id,omitempty"` + Visualizations []LegacyVisualization `json:"visualizations,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4189,19 +3577,12 @@ func legacyVisualizationToPb(st *LegacyVisualization) (*legacyVisualizationPb, e } pb := &legacyVisualizationPb{} pb.CreatedAt = st.CreatedAt - pb.Description = st.Description - pb.Id = st.Id - pb.Name = st.Name - pb.Options = st.Options - pb.Query = st.Query - pb.Type = st.Type - pb.UpdatedAt = st.UpdatedAt pb.ForceSendFields = st.ForceSendFields @@ -4209,21 +3590,14 @@ func legacyVisualizationToPb(st *LegacyVisualization) (*legacyVisualizationPb, e } type legacyVisualizationPb struct { - CreatedAt string `json:"created_at,omitempty"` - - Description string `json:"description,omitempty"` - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - Options any `json:"options,omitempty"` - - Query *LegacyQuery `json:"query,omitempty"` - - Type string `json:"type,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Options any `json:"options,omitempty"` + Query *LegacyQuery `json:"query,omitempty"` + Type string `json:"type,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4260,7 +3634,6 @@ func listAlertsRequestToPb(st *ListAlertsRequest) (*listAlertsRequestPb, error) } pb := &listAlertsRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4268,8 +3641,7 @@ func listAlertsRequestToPb(st *ListAlertsRequest) (*listAlertsRequestPb, error) } type listAlertsRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4301,7 +3673,6 @@ func listAlertsResponseToPb(st *ListAlertsResponse) (*listAlertsResponsePb, erro } pb := &listAlertsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -4309,9 +3680,8 @@ func listAlertsResponseToPb(st *ListAlertsResponse) (*listAlertsResponsePb, erro } type listAlertsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Results []ListAlertsResponseAlert `json:"results,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Results []ListAlertsResponseAlert `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4342,31 +3712,18 @@ func listAlertsResponseAlertToPb(st *ListAlertsResponseAlert) (*listAlertsRespon } pb := &listAlertsResponseAlertPb{} pb.Condition = st.Condition - pb.CreateTime = st.CreateTime - pb.CustomBody = st.CustomBody - pb.CustomSubject = st.CustomSubject - pb.DisplayName = st.DisplayName - pb.Id = st.Id - pb.LifecycleState = st.LifecycleState - pb.NotifyOnOk = st.NotifyOnOk - pb.OwnerUserName = st.OwnerUserName - pb.QueryId = st.QueryId - pb.SecondsToRetrigger = st.SecondsToRetrigger - pb.State = st.State - pb.TriggerTime = st.TriggerTime - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -4374,33 +3731,20 @@ func listAlertsResponseAlertToPb(st *ListAlertsResponseAlert) (*listAlertsRespon } type listAlertsResponseAlertPb struct { - Condition *AlertCondition `json:"condition,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - CustomBody string `json:"custom_body,omitempty"` - - CustomSubject string `json:"custom_subject,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - NotifyOnOk bool `json:"notify_on_ok,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` - - State AlertState `json:"state,omitempty"` - - TriggerTime string `json:"trigger_time,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + Condition *AlertCondition `json:"condition,omitempty"` + CreateTime string `json:"create_time,omitempty"` + CustomBody string `json:"custom_body,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + QueryId string `json:"query_id,omitempty"` + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + State AlertState `json:"state,omitempty"` + TriggerTime string `json:"trigger_time,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4443,7 +3787,6 @@ func listAlertsV2RequestToPb(st *ListAlertsV2Request) (*listAlertsV2RequestPb, e } pb := &listAlertsV2RequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4451,8 +3794,7 @@ func listAlertsV2RequestToPb(st *ListAlertsV2Request) (*listAlertsV2RequestPb, e } type listAlertsV2RequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4484,7 +3826,6 @@ func listAlertsV2ResponseToPb(st *ListAlertsV2Response) (*listAlertsV2ResponsePb } pb := &listAlertsV2ResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -4492,9 +3833,8 @@ func listAlertsV2ResponseToPb(st *ListAlertsV2Response) (*listAlertsV2ResponsePb } type listAlertsV2ResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Results []AlertV2 `json:"results,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Results []AlertV2 `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4525,11 +3865,8 @@ func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsReques } pb := &listDashboardsRequestPb{} pb.Order = st.Order - pb.Page = st.Page - pb.PageSize = st.PageSize - pb.Q = st.Q pb.ForceSendFields = st.ForceSendFields @@ -4537,13 +3874,10 @@ func listDashboardsRequestToPb(st *ListDashboardsRequest) (*listDashboardsReques } type listDashboardsRequestPb struct { - Order ListOrder `json:"-" url:"order,omitempty"` - - Page int `json:"-" url:"page,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - Q string `json:"-" url:"q,omitempty"` + Order ListOrder `json:"-" url:"order,omitempty"` + Page int `json:"-" url:"page,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + Q string `json:"-" url:"q,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4576,11 +3910,8 @@ func listQueriesLegacyRequestToPb(st *ListQueriesLegacyRequest) (*listQueriesLeg } pb := &listQueriesLegacyRequestPb{} pb.Order = st.Order - pb.Page = st.Page - pb.PageSize = st.PageSize - pb.Q = st.Q pb.ForceSendFields = st.ForceSendFields @@ -4588,13 +3919,10 @@ func listQueriesLegacyRequestToPb(st *ListQueriesLegacyRequest) (*listQueriesLeg } type listQueriesLegacyRequestPb struct { - Order string `json:"-" url:"order,omitempty"` - - Page int `json:"-" url:"page,omitempty"` - - PageSize int `json:"-" url:"page_size,omitempty"` - - Q string `json:"-" url:"q,omitempty"` + Order string `json:"-" url:"order,omitempty"` + Page int `json:"-" url:"page,omitempty"` + PageSize int `json:"-" url:"page_size,omitempty"` + Q string `json:"-" url:"q,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4627,7 +3955,6 @@ func listQueriesRequestToPb(st *ListQueriesRequest) (*listQueriesRequestPb, erro } pb := &listQueriesRequestPb{} pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4635,8 +3962,7 @@ func listQueriesRequestToPb(st *ListQueriesRequest) (*listQueriesRequestPb, erro } type listQueriesRequestPb struct { - PageSize int `json:"-" url:"page_size,omitempty"` - + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4668,9 +3994,7 @@ func listQueriesResponseToPb(st *ListQueriesResponse) (*listQueriesResponsePb, e } pb := &listQueriesResponsePb{} pb.HasNextPage = st.HasNextPage - pb.NextPageToken = st.NextPageToken - pb.Res = st.Res pb.ForceSendFields = st.ForceSendFields @@ -4678,11 +4002,9 @@ func listQueriesResponseToPb(st *ListQueriesResponse) (*listQueriesResponsePb, e } type listQueriesResponsePb struct { - HasNextPage bool `json:"has_next_page,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - Res []QueryInfo `json:"res,omitempty"` + HasNextPage bool `json:"has_next_page,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Res []QueryInfo `json:"res,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4714,11 +4036,8 @@ func listQueryHistoryRequestToPb(st *ListQueryHistoryRequest) (*listQueryHistory } pb := &listQueryHistoryRequestPb{} pb.FilterBy = st.FilterBy - pb.IncludeMetrics = st.IncludeMetrics - pb.MaxResults = st.MaxResults - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4726,13 +4045,10 @@ func listQueryHistoryRequestToPb(st *ListQueryHistoryRequest) (*listQueryHistory } type listQueryHistoryRequestPb struct { - FilterBy *QueryFilter `json:"-" url:"filter_by,omitempty"` - - IncludeMetrics bool `json:"-" url:"include_metrics,omitempty"` - - MaxResults int `json:"-" url:"max_results,omitempty"` - - PageToken string `json:"-" url:"page_token,omitempty"` + FilterBy *QueryFilter `json:"-" url:"filter_by,omitempty"` + IncludeMetrics bool `json:"-" url:"include_metrics,omitempty"` + MaxResults int `json:"-" url:"max_results,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4765,7 +4081,6 @@ func listQueryObjectsResponseToPb(st *ListQueryObjectsResponse) (*listQueryObjec } pb := &listQueryObjectsResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -4773,9 +4088,8 @@ func listQueryObjectsResponseToPb(st *ListQueryObjectsResponse) (*listQueryObjec } type listQueryObjectsResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Results []ListQueryObjectsResponseQuery `json:"results,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Results []ListQueryObjectsResponseQuery `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4806,35 +4120,20 @@ func listQueryObjectsResponseQueryToPb(st *ListQueryObjectsResponseQuery) (*list } pb := &listQueryObjectsResponseQueryPb{} pb.ApplyAutoLimit = st.ApplyAutoLimit - pb.Catalog = st.Catalog - pb.CreateTime = st.CreateTime - pb.Description = st.Description - pb.DisplayName = st.DisplayName - pb.Id = st.Id - pb.LastModifierUserName = st.LastModifierUserName - pb.LifecycleState = st.LifecycleState - pb.OwnerUserName = st.OwnerUserName - pb.Parameters = st.Parameters - pb.QueryText = st.QueryText - pb.RunAsMode = st.RunAsMode - pb.Schema = st.Schema - pb.Tags = st.Tags - pb.UpdateTime = st.UpdateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -4842,37 +4141,22 @@ func listQueryObjectsResponseQueryToPb(st *ListQueryObjectsResponseQuery) (*list } type listQueryObjectsResponseQueryPb struct { - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - Description string `json:"description,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` - - LastModifierUserName string `json:"last_modifier_user_name,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - Parameters []QueryParameter `json:"parameters,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` - - Schema string `json:"schema,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + Catalog string `json:"catalog,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` + LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + Parameters []QueryParameter `json:"parameters,omitempty"` + QueryText string `json:"query_text,omitempty"` + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + Schema string `json:"schema,omitempty"` + Tags []string `json:"tags,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4917,11 +4201,8 @@ func listResponseToPb(st *ListResponse) (*listResponsePb, error) { } pb := &listResponsePb{} pb.Count = st.Count - pb.Page = st.Page - pb.PageSize = st.PageSize - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -4929,13 +4210,10 @@ func listResponseToPb(st *ListResponse) (*listResponsePb, error) { } type listResponsePb struct { - Count int `json:"count,omitempty"` - - Page int `json:"page,omitempty"` - - PageSize int `json:"page_size,omitempty"` - - Results []Dashboard `json:"results,omitempty"` + Count int `json:"count,omitempty"` + Page int `json:"page,omitempty"` + PageSize int `json:"page_size,omitempty"` + Results []Dashboard `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4968,9 +4246,7 @@ func listVisualizationsForQueryRequestToPb(st *ListVisualizationsForQueryRequest } pb := &listVisualizationsForQueryRequestPb{} pb.Id = st.Id - pb.PageSize = st.PageSize - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -4978,10 +4254,8 @@ func listVisualizationsForQueryRequestToPb(st *ListVisualizationsForQueryRequest } type listVisualizationsForQueryRequestPb struct { - Id string `json:"-" url:"-"` - - PageSize int `json:"-" url:"page_size,omitempty"` - + Id string `json:"-" url:"-"` + PageSize int `json:"-" url:"page_size,omitempty"` PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5014,7 +4288,6 @@ func listVisualizationsForQueryResponseToPb(st *ListVisualizationsForQueryRespon } pb := &listVisualizationsForQueryResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -5022,9 +4295,8 @@ func listVisualizationsForQueryResponseToPb(st *ListVisualizationsForQueryRespon } type listVisualizationsForQueryResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Results []Visualization `json:"results,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Results []Visualization `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5115,9 +4387,7 @@ func multiValuesOptionsToPb(st *MultiValuesOptions) (*multiValuesOptionsPb, erro } pb := &multiValuesOptionsPb{} pb.Prefix = st.Prefix - pb.Separator = st.Separator - pb.Suffix = st.Suffix pb.ForceSendFields = st.ForceSendFields @@ -5125,11 +4395,9 @@ func multiValuesOptionsToPb(st *MultiValuesOptions) (*multiValuesOptionsPb, erro } type multiValuesOptionsPb struct { - Prefix string `json:"prefix,omitempty"` - + Prefix string `json:"prefix,omitempty"` Separator string `json:"separator,omitempty"` - - Suffix string `json:"suffix,omitempty"` + Suffix string `json:"suffix,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5197,11 +4465,8 @@ func odbcParamsToPb(st *OdbcParams) (*odbcParamsPb, error) { } pb := &odbcParamsPb{} pb.Hostname = st.Hostname - pb.Path = st.Path - pb.Port = st.Port - pb.Protocol = st.Protocol pb.ForceSendFields = st.ForceSendFields @@ -5210,11 +4475,8 @@ func odbcParamsToPb(st *OdbcParams) (*odbcParamsPb, error) { type odbcParamsPb struct { Hostname string `json:"hostname,omitempty"` - - Path string `json:"path,omitempty"` - - Port int `json:"port,omitempty"` - + Path string `json:"path,omitempty"` + Port int `json:"port,omitempty"` Protocol string `json:"protocol,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -5248,17 +4510,11 @@ func parameterToPb(st *Parameter) (*parameterPb, error) { } pb := ¶meterPb{} pb.EnumOptions = st.EnumOptions - pb.MultiValuesOptions = st.MultiValuesOptions - pb.Name = st.Name - pb.QueryId = st.QueryId - pb.Title = st.Title - pb.Type = st.Type - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -5266,19 +4522,13 @@ func parameterToPb(st *Parameter) (*parameterPb, error) { } type parameterPb struct { - EnumOptions string `json:"enumOptions,omitempty"` - + EnumOptions string `json:"enumOptions,omitempty"` MultiValuesOptions *MultiValuesOptions `json:"multiValuesOptions,omitempty"` - - Name string `json:"name,omitempty"` - - QueryId string `json:"queryId,omitempty"` - - Title string `json:"title,omitempty"` - - Type ParameterType `json:"type,omitempty"` - - Value any `json:"value,omitempty"` + Name string `json:"name,omitempty"` + QueryId string `json:"queryId,omitempty"` + Title string `json:"title,omitempty"` + Type ParameterType `json:"type,omitempty"` + Value any `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5314,37 +4564,21 @@ func queryToPb(st *Query) (*queryPb, error) { } pb := &queryPb{} pb.ApplyAutoLimit = st.ApplyAutoLimit - pb.Catalog = st.Catalog - pb.CreateTime = st.CreateTime - pb.Description = st.Description - pb.DisplayName = st.DisplayName - pb.Id = st.Id - pb.LastModifierUserName = st.LastModifierUserName - pb.LifecycleState = st.LifecycleState - pb.OwnerUserName = st.OwnerUserName - pb.Parameters = st.Parameters - pb.ParentPath = st.ParentPath - pb.QueryText = st.QueryText - pb.RunAsMode = st.RunAsMode - pb.Schema = st.Schema - pb.Tags = st.Tags - pb.UpdateTime = st.UpdateTime - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -5352,39 +4586,23 @@ func queryToPb(st *Query) (*queryPb, error) { } type queryPb struct { - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - CreateTime string `json:"create_time,omitempty"` - - Description string `json:"description,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` - - LastModifierUserName string `json:"last_modifier_user_name,omitempty"` - - LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - Parameters []QueryParameter `json:"parameters,omitempty"` - - ParentPath string `json:"parent_path,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` - - Schema string `json:"schema,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + Catalog string `json:"catalog,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` + LastModifierUserName string `json:"last_modifier_user_name,omitempty"` + LifecycleState LifecycleState `json:"lifecycle_state,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + Parameters []QueryParameter `json:"parameters,omitempty"` + ParentPath string `json:"parent_path,omitempty"` + QueryText string `json:"query_text,omitempty"` + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + Schema string `json:"schema,omitempty"` + Tags []string `json:"tags,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5430,9 +4648,7 @@ func queryBackedValueToPb(st *QueryBackedValue) (*queryBackedValuePb, error) { } pb := &queryBackedValuePb{} pb.MultiValuesOptions = st.MultiValuesOptions - pb.QueryId = st.QueryId - pb.Values = st.Values pb.ForceSendFields = st.ForceSendFields @@ -5441,10 +4657,8 @@ func queryBackedValueToPb(st *QueryBackedValue) (*queryBackedValuePb, error) { type queryBackedValuePb struct { MultiValuesOptions *MultiValuesOptions `json:"multi_values_options,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - Values []string `json:"values,omitempty"` + QueryId string `json:"query_id,omitempty"` + Values []string `json:"values,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5476,19 +4690,12 @@ func queryEditContentToPb(st *QueryEditContent) (*queryEditContentPb, error) { } pb := &queryEditContentPb{} pb.DataSourceId = st.DataSourceId - pb.Description = st.Description - pb.Name = st.Name - pb.Options = st.Options - pb.Query = st.Query - pb.QueryId = st.QueryId - pb.RunAsRole = st.RunAsRole - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields @@ -5496,21 +4703,14 @@ func queryEditContentToPb(st *QueryEditContent) (*queryEditContentPb, error) { } type queryEditContentPb struct { - DataSourceId string `json:"data_source_id,omitempty"` - - Description string `json:"description,omitempty"` - - Name string `json:"name,omitempty"` - - Options any `json:"options,omitempty"` - - Query string `json:"query,omitempty"` - - QueryId string `json:"-" url:"-"` - - RunAsRole RunAsRole `json:"run_as_role,omitempty"` - - Tags []string `json:"tags,omitempty"` + DataSourceId string `json:"data_source_id,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Options any `json:"options,omitempty"` + Query string `json:"query,omitempty"` + QueryId string `json:"-" url:"-"` + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + Tags []string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5547,28 +4747,20 @@ func queryFilterToPb(st *QueryFilter) (*queryFilterPb, error) { } pb := &queryFilterPb{} pb.QueryStartTimeRange = st.QueryStartTimeRange - pb.StatementIds = st.StatementIds - pb.Statuses = st.Statuses - pb.UserIds = st.UserIds - pb.WarehouseIds = st.WarehouseIds return pb, nil } type queryFilterPb struct { - QueryStartTimeRange *TimeRange `json:"query_start_time_range,omitempty" url:"query_start_time_range,omitempty"` - - StatementIds []string `json:"statement_ids,omitempty" url:"statement_ids,omitempty"` - - Statuses []QueryStatus `json:"statuses,omitempty" url:"statuses,omitempty"` - - UserIds []int64 `json:"user_ids,omitempty" url:"user_ids,omitempty"` - - WarehouseIds []string `json:"warehouse_ids,omitempty" url:"warehouse_ids,omitempty"` + QueryStartTimeRange *TimeRange `json:"query_start_time_range,omitempty" url:"query_start_time_range,omitempty"` + StatementIds []string `json:"statement_ids,omitempty" url:"statement_ids,omitempty"` + Statuses []QueryStatus `json:"statuses,omitempty" url:"statuses,omitempty"` + UserIds []int64 `json:"user_ids,omitempty" url:"user_ids,omitempty"` + WarehouseIds []string `json:"warehouse_ids,omitempty" url:"warehouse_ids,omitempty"` } func queryFilterFromPb(pb *queryFilterPb) (*QueryFilter, error) { @@ -5591,51 +4783,28 @@ func queryInfoToPb(st *QueryInfo) (*queryInfoPb, error) { } pb := &queryInfoPb{} pb.ChannelUsed = st.ChannelUsed - pb.ClientApplication = st.ClientApplication - pb.Duration = st.Duration - pb.EndpointId = st.EndpointId - pb.ErrorMessage = st.ErrorMessage - pb.ExecutedAsUserId = st.ExecutedAsUserId - pb.ExecutedAsUserName = st.ExecutedAsUserName - pb.ExecutionEndTimeMs = st.ExecutionEndTimeMs - pb.IsFinal = st.IsFinal - pb.LookupKey = st.LookupKey - pb.Metrics = st.Metrics - pb.PlansState = st.PlansState - pb.QueryEndTimeMs = st.QueryEndTimeMs - pb.QueryId = st.QueryId - pb.QuerySource = st.QuerySource - pb.QueryStartTimeMs = st.QueryStartTimeMs - pb.QueryText = st.QueryText - pb.RowsProduced = st.RowsProduced - pb.SparkUiUrl = st.SparkUiUrl - pb.StatementType = st.StatementType - pb.Status = st.Status - pb.UserId = st.UserId - pb.UserName = st.UserName - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -5643,53 +4812,30 @@ func queryInfoToPb(st *QueryInfo) (*queryInfoPb, error) { } type queryInfoPb struct { - ChannelUsed *ChannelInfo `json:"channel_used,omitempty"` - - ClientApplication string `json:"client_application,omitempty"` - - Duration int64 `json:"duration,omitempty"` - - EndpointId string `json:"endpoint_id,omitempty"` - - ErrorMessage string `json:"error_message,omitempty"` - - ExecutedAsUserId int64 `json:"executed_as_user_id,omitempty"` - - ExecutedAsUserName string `json:"executed_as_user_name,omitempty"` - - ExecutionEndTimeMs int64 `json:"execution_end_time_ms,omitempty"` - - IsFinal bool `json:"is_final,omitempty"` - - LookupKey string `json:"lookup_key,omitempty"` - - Metrics *QueryMetrics `json:"metrics,omitempty"` - - PlansState PlansState `json:"plans_state,omitempty"` - - QueryEndTimeMs int64 `json:"query_end_time_ms,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - QuerySource *ExternalQuerySource `json:"query_source,omitempty"` - - QueryStartTimeMs int64 `json:"query_start_time_ms,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RowsProduced int64 `json:"rows_produced,omitempty"` - - SparkUiUrl string `json:"spark_ui_url,omitempty"` - - StatementType QueryStatementType `json:"statement_type,omitempty"` - - Status QueryStatus `json:"status,omitempty"` - - UserId int64 `json:"user_id,omitempty"` - - UserName string `json:"user_name,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ChannelUsed *ChannelInfo `json:"channel_used,omitempty"` + ClientApplication string `json:"client_application,omitempty"` + Duration int64 `json:"duration,omitempty"` + EndpointId string `json:"endpoint_id,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` + ExecutedAsUserId int64 `json:"executed_as_user_id,omitempty"` + ExecutedAsUserName string `json:"executed_as_user_name,omitempty"` + ExecutionEndTimeMs int64 `json:"execution_end_time_ms,omitempty"` + IsFinal bool `json:"is_final,omitempty"` + LookupKey string `json:"lookup_key,omitempty"` + Metrics *QueryMetrics `json:"metrics,omitempty"` + PlansState PlansState `json:"plans_state,omitempty"` + QueryEndTimeMs int64 `json:"query_end_time_ms,omitempty"` + QueryId string `json:"query_id,omitempty"` + QuerySource *ExternalQuerySource `json:"query_source,omitempty"` + QueryStartTimeMs int64 `json:"query_start_time_ms,omitempty"` + QueryText string `json:"query_text,omitempty"` + RowsProduced int64 `json:"rows_produced,omitempty"` + SparkUiUrl string `json:"spark_ui_url,omitempty"` + StatementType QueryStatementType `json:"statement_type,omitempty"` + Status QueryStatus `json:"status,omitempty"` + UserId int64 `json:"user_id,omitempty"` + UserName string `json:"user_name,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5742,11 +4888,8 @@ func queryListToPb(st *QueryList) (*queryListPb, error) { } pb := &queryListPb{} pb.Count = st.Count - pb.Page = st.Page - pb.PageSize = st.PageSize - pb.Results = st.Results pb.ForceSendFields = st.ForceSendFields @@ -5754,13 +4897,10 @@ func queryListToPb(st *QueryList) (*queryListPb, error) { } type queryListPb struct { - Count int `json:"count,omitempty"` - - Page int `json:"page,omitempty"` - - PageSize int `json:"page_size,omitempty"` - - Results []LegacyQuery `json:"results,omitempty"` + Count int `json:"count,omitempty"` + Page int `json:"page,omitempty"` + PageSize int `json:"page_size,omitempty"` + Results []LegacyQuery `json:"results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5793,47 +4933,26 @@ func queryMetricsToPb(st *QueryMetrics) (*queryMetricsPb, error) { } pb := &queryMetricsPb{} pb.CompilationTimeMs = st.CompilationTimeMs - pb.ExecutionTimeMs = st.ExecutionTimeMs - pb.NetworkSentBytes = st.NetworkSentBytes - pb.OverloadingQueueStartTimestamp = st.OverloadingQueueStartTimestamp - pb.PhotonTotalTimeMs = st.PhotonTotalTimeMs - pb.ProvisioningQueueStartTimestamp = st.ProvisioningQueueStartTimestamp - pb.PrunedBytes = st.PrunedBytes - pb.PrunedFilesCount = st.PrunedFilesCount - pb.QueryCompilationStartTimestamp = st.QueryCompilationStartTimestamp - pb.ReadBytes = st.ReadBytes - pb.ReadCacheBytes = st.ReadCacheBytes - pb.ReadFilesCount = st.ReadFilesCount - pb.ReadPartitionsCount = st.ReadPartitionsCount - pb.ReadRemoteBytes = st.ReadRemoteBytes - pb.ResultFetchTimeMs = st.ResultFetchTimeMs - pb.ResultFromCache = st.ResultFromCache - pb.RowsProducedCount = st.RowsProducedCount - pb.RowsReadCount = st.RowsReadCount - pb.SpillToDiskBytes = st.SpillToDiskBytes - pb.TaskTotalTimeMs = st.TaskTotalTimeMs - pb.TotalTimeMs = st.TotalTimeMs - pb.WriteRemoteBytes = st.WriteRemoteBytes pb.ForceSendFields = st.ForceSendFields @@ -5841,49 +4960,28 @@ func queryMetricsToPb(st *QueryMetrics) (*queryMetricsPb, error) { } type queryMetricsPb struct { - CompilationTimeMs int64 `json:"compilation_time_ms,omitempty"` - - ExecutionTimeMs int64 `json:"execution_time_ms,omitempty"` - - NetworkSentBytes int64 `json:"network_sent_bytes,omitempty"` - - OverloadingQueueStartTimestamp int64 `json:"overloading_queue_start_timestamp,omitempty"` - - PhotonTotalTimeMs int64 `json:"photon_total_time_ms,omitempty"` - + CompilationTimeMs int64 `json:"compilation_time_ms,omitempty"` + ExecutionTimeMs int64 `json:"execution_time_ms,omitempty"` + NetworkSentBytes int64 `json:"network_sent_bytes,omitempty"` + OverloadingQueueStartTimestamp int64 `json:"overloading_queue_start_timestamp,omitempty"` + PhotonTotalTimeMs int64 `json:"photon_total_time_ms,omitempty"` ProvisioningQueueStartTimestamp int64 `json:"provisioning_queue_start_timestamp,omitempty"` - - PrunedBytes int64 `json:"pruned_bytes,omitempty"` - - PrunedFilesCount int64 `json:"pruned_files_count,omitempty"` - - QueryCompilationStartTimestamp int64 `json:"query_compilation_start_timestamp,omitempty"` - - ReadBytes int64 `json:"read_bytes,omitempty"` - - ReadCacheBytes int64 `json:"read_cache_bytes,omitempty"` - - ReadFilesCount int64 `json:"read_files_count,omitempty"` - - ReadPartitionsCount int64 `json:"read_partitions_count,omitempty"` - - ReadRemoteBytes int64 `json:"read_remote_bytes,omitempty"` - - ResultFetchTimeMs int64 `json:"result_fetch_time_ms,omitempty"` - - ResultFromCache bool `json:"result_from_cache,omitempty"` - - RowsProducedCount int64 `json:"rows_produced_count,omitempty"` - - RowsReadCount int64 `json:"rows_read_count,omitempty"` - - SpillToDiskBytes int64 `json:"spill_to_disk_bytes,omitempty"` - - TaskTotalTimeMs int64 `json:"task_total_time_ms,omitempty"` - - TotalTimeMs int64 `json:"total_time_ms,omitempty"` - - WriteRemoteBytes int64 `json:"write_remote_bytes,omitempty"` + PrunedBytes int64 `json:"pruned_bytes,omitempty"` + PrunedFilesCount int64 `json:"pruned_files_count,omitempty"` + QueryCompilationStartTimestamp int64 `json:"query_compilation_start_timestamp,omitempty"` + ReadBytes int64 `json:"read_bytes,omitempty"` + ReadCacheBytes int64 `json:"read_cache_bytes,omitempty"` + ReadFilesCount int64 `json:"read_files_count,omitempty"` + ReadPartitionsCount int64 `json:"read_partitions_count,omitempty"` + ReadRemoteBytes int64 `json:"read_remote_bytes,omitempty"` + ResultFetchTimeMs int64 `json:"result_fetch_time_ms,omitempty"` + ResultFromCache bool `json:"result_from_cache,omitempty"` + RowsProducedCount int64 `json:"rows_produced_count,omitempty"` + RowsReadCount int64 `json:"rows_read_count,omitempty"` + SpillToDiskBytes int64 `json:"spill_to_disk_bytes,omitempty"` + TaskTotalTimeMs int64 `json:"task_total_time_ms,omitempty"` + TotalTimeMs int64 `json:"total_time_ms,omitempty"` + WriteRemoteBytes int64 `json:"write_remote_bytes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5934,11 +5032,8 @@ func queryOptionsToPb(st *QueryOptions) (*queryOptionsPb, error) { } pb := &queryOptionsPb{} pb.Catalog = st.Catalog - pb.MovedToTrashAt = st.MovedToTrashAt - pb.Parameters = st.Parameters - pb.Schema = st.Schema pb.ForceSendFields = st.ForceSendFields @@ -5946,13 +5041,10 @@ func queryOptionsToPb(st *QueryOptions) (*queryOptionsPb, error) { } type queryOptionsPb struct { - Catalog string `json:"catalog,omitempty"` - - MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` - - Parameters []Parameter `json:"parameters,omitempty"` - - Schema string `json:"schema,omitempty"` + Catalog string `json:"catalog,omitempty"` + MovedToTrashAt string `json:"moved_to_trash_at,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` + Schema string `json:"schema,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -5985,19 +5077,12 @@ func queryParameterToPb(st *QueryParameter) (*queryParameterPb, error) { } pb := &queryParameterPb{} pb.DateRangeValue = st.DateRangeValue - pb.DateValue = st.DateValue - pb.EnumValue = st.EnumValue - pb.Name = st.Name - pb.NumericValue = st.NumericValue - pb.QueryBackedValue = st.QueryBackedValue - pb.TextValue = st.TextValue - pb.Title = st.Title pb.ForceSendFields = st.ForceSendFields @@ -6005,21 +5090,14 @@ func queryParameterToPb(st *QueryParameter) (*queryParameterPb, error) { } type queryParameterPb struct { - DateRangeValue *DateRangeValue `json:"date_range_value,omitempty"` - - DateValue *DateValue `json:"date_value,omitempty"` - - EnumValue *EnumValue `json:"enum_value,omitempty"` - - Name string `json:"name,omitempty"` - - NumericValue *NumericValue `json:"numeric_value,omitempty"` - + DateRangeValue *DateRangeValue `json:"date_range_value,omitempty"` + DateValue *DateValue `json:"date_value,omitempty"` + EnumValue *EnumValue `json:"enum_value,omitempty"` + Name string `json:"name,omitempty"` + NumericValue *NumericValue `json:"numeric_value,omitempty"` QueryBackedValue *QueryBackedValue `json:"query_backed_value,omitempty"` - - TextValue *TextValue `json:"text_value,omitempty"` - - Title string `json:"title,omitempty"` + TextValue *TextValue `json:"text_value,omitempty"` + Title string `json:"title,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6056,41 +5134,27 @@ func queryPostContentToPb(st *QueryPostContent) (*queryPostContentPb, error) { } pb := &queryPostContentPb{} pb.DataSourceId = st.DataSourceId - pb.Description = st.Description - pb.Name = st.Name - pb.Options = st.Options - pb.Parent = st.Parent - pb.Query = st.Query - pb.RunAsRole = st.RunAsRole - pb.Tags = st.Tags pb.ForceSendFields = st.ForceSendFields - return pb, nil -} - -type queryPostContentPb struct { - DataSourceId string `json:"data_source_id,omitempty"` - - Description string `json:"description,omitempty"` - - Name string `json:"name,omitempty"` - - Options any `json:"options,omitempty"` - - Parent string `json:"parent,omitempty"` - - Query string `json:"query,omitempty"` - - RunAsRole RunAsRole `json:"run_as_role,omitempty"` + return pb, nil +} - Tags []string `json:"tags,omitempty"` +type queryPostContentPb struct { + DataSourceId string `json:"data_source_id,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Options any `json:"options,omitempty"` + Parent string `json:"parent,omitempty"` + Query string `json:"query,omitempty"` + RunAsRole RunAsRole `json:"run_as_role,omitempty"` + Tags []string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6127,15 +5191,13 @@ func repeatedEndpointConfPairsToPb(st *RepeatedEndpointConfPairs) (*repeatedEndp } pb := &repeatedEndpointConfPairsPb{} pb.ConfigPair = st.ConfigPair - pb.ConfigurationPairs = st.ConfigurationPairs return pb, nil } type repeatedEndpointConfPairsPb struct { - ConfigPair []EndpointConfPair `json:"config_pair,omitempty"` - + ConfigPair []EndpointConfPair `json:"config_pair,omitempty"` ConfigurationPairs []EndpointConfPair `json:"configuration_pairs,omitempty"` } @@ -6225,19 +5287,12 @@ func resultDataToPb(st *ResultData) (*resultDataPb, error) { } pb := &resultDataPb{} pb.ByteCount = st.ByteCount - pb.ChunkIndex = st.ChunkIndex - pb.DataArray = st.DataArray - pb.ExternalLinks = st.ExternalLinks - pb.NextChunkIndex = st.NextChunkIndex - pb.NextChunkInternalLink = st.NextChunkInternalLink - pb.RowCount = st.RowCount - pb.RowOffset = st.RowOffset pb.ForceSendFields = st.ForceSendFields @@ -6245,21 +5300,14 @@ func resultDataToPb(st *ResultData) (*resultDataPb, error) { } type resultDataPb struct { - ByteCount int64 `json:"byte_count,omitempty"` - - ChunkIndex int `json:"chunk_index,omitempty"` - - DataArray [][]string `json:"data_array,omitempty"` - - ExternalLinks []ExternalLink `json:"external_links,omitempty"` - - NextChunkIndex int `json:"next_chunk_index,omitempty"` - - NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` - - RowCount int64 `json:"row_count,omitempty"` - - RowOffset int64 `json:"row_offset,omitempty"` + ByteCount int64 `json:"byte_count,omitempty"` + ChunkIndex int `json:"chunk_index,omitempty"` + DataArray [][]string `json:"data_array,omitempty"` + ExternalLinks []ExternalLink `json:"external_links,omitempty"` + NextChunkIndex int `json:"next_chunk_index,omitempty"` + NextChunkInternalLink string `json:"next_chunk_internal_link,omitempty"` + RowCount int64 `json:"row_count,omitempty"` + RowOffset int64 `json:"row_offset,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6296,17 +5344,11 @@ func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { } pb := &resultManifestPb{} pb.Chunks = st.Chunks - pb.Format = st.Format - pb.Schema = st.Schema - pb.TotalByteCount = st.TotalByteCount - pb.TotalChunkCount = st.TotalChunkCount - pb.TotalRowCount = st.TotalRowCount - pb.Truncated = st.Truncated pb.ForceSendFields = st.ForceSendFields @@ -6314,19 +5356,13 @@ func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { } type resultManifestPb struct { - Chunks []BaseChunkInfo `json:"chunks,omitempty"` - - Format Format `json:"format,omitempty"` - - Schema *ResultSchema `json:"schema,omitempty"` - - TotalByteCount int64 `json:"total_byte_count,omitempty"` - - TotalChunkCount int `json:"total_chunk_count,omitempty"` - - TotalRowCount int64 `json:"total_row_count,omitempty"` - - Truncated bool `json:"truncated,omitempty"` + Chunks []BaseChunkInfo `json:"chunks,omitempty"` + Format Format `json:"format,omitempty"` + Schema *ResultSchema `json:"schema,omitempty"` + TotalByteCount int64 `json:"total_byte_count,omitempty"` + TotalChunkCount int `json:"total_chunk_count,omitempty"` + TotalRowCount int64 `json:"total_row_count,omitempty"` + Truncated bool `json:"truncated,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6362,7 +5398,6 @@ func resultSchemaToPb(st *ResultSchema) (*resultSchemaPb, error) { } pb := &resultSchemaPb{} pb.ColumnCount = st.ColumnCount - pb.Columns = st.Columns pb.ForceSendFields = st.ForceSendFields @@ -6370,9 +5405,8 @@ func resultSchemaToPb(st *ResultSchema) (*resultSchemaPb, error) { } type resultSchemaPb struct { - ColumnCount int `json:"column_count,omitempty"` - - Columns []ColumnInfo `json:"columns,omitempty"` + ColumnCount int `json:"column_count,omitempty"` + Columns []ColumnInfo `json:"columns,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6403,7 +5437,6 @@ func serviceErrorToPb(st *ServiceError) (*serviceErrorPb, error) { } pb := &serviceErrorPb{} pb.ErrorCode = st.ErrorCode - pb.Message = st.Message pb.ForceSendFields = st.ForceSendFields @@ -6412,8 +5445,7 @@ func serviceErrorToPb(st *ServiceError) (*serviceErrorPb, error) { type serviceErrorPb struct { ErrorCode ServiceErrorCode `json:"error_code,omitempty"` - - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6444,20 +5476,16 @@ func setRequestToPb(st *SetRequest) (*setRequestPb, error) { } pb := &setRequestPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType return pb, nil } type setRequestPb struct { - AccessControlList []AccessControl `json:"access_control_list,omitempty"` - - ObjectId string `json:"-" url:"-"` - - ObjectType ObjectTypePlural `json:"-" url:"-"` + AccessControlList []AccessControl `json:"access_control_list,omitempty"` + ObjectId string `json:"-" url:"-"` + ObjectType ObjectTypePlural `json:"-" url:"-"` } func setRequestFromPb(pb *setRequestPb) (*SetRequest, error) { @@ -6478,9 +5506,7 @@ func setResponseToPb(st *SetResponse) (*setResponsePb, error) { } pb := &setResponsePb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -6489,10 +5515,8 @@ func setResponseToPb(st *SetResponse) (*setResponsePb, error) { type setResponsePb struct { AccessControlList []AccessControl `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType ObjectType `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType ObjectType `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6524,21 +5548,13 @@ func setWorkspaceWarehouseConfigRequestToPb(st *SetWorkspaceWarehouseConfigReque } pb := &setWorkspaceWarehouseConfigRequestPb{} pb.Channel = st.Channel - pb.ConfigParam = st.ConfigParam - pb.DataAccessConfig = st.DataAccessConfig - pb.EnabledWarehouseTypes = st.EnabledWarehouseTypes - pb.GlobalParam = st.GlobalParam - pb.GoogleServiceAccount = st.GoogleServiceAccount - pb.InstanceProfileArn = st.InstanceProfileArn - pb.SecurityPolicy = st.SecurityPolicy - pb.SqlConfigurationParameters = st.SqlConfigurationParameters pb.ForceSendFields = st.ForceSendFields @@ -6546,23 +5562,15 @@ func setWorkspaceWarehouseConfigRequestToPb(st *SetWorkspaceWarehouseConfigReque } type setWorkspaceWarehouseConfigRequestPb struct { - Channel *Channel `json:"channel,omitempty"` - - ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` - - DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` - - EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` - - GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` - - GoogleServiceAccount string `json:"google_service_account,omitempty"` - - InstanceProfileArn string `json:"instance_profile_arn,omitempty"` - - SecurityPolicy SetWorkspaceWarehouseConfigRequestSecurityPolicy `json:"security_policy,omitempty"` - - SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` + Channel *Channel `json:"channel,omitempty"` + ConfigParam *RepeatedEndpointConfPairs `json:"config_param,omitempty"` + DataAccessConfig []EndpointConfPair `json:"data_access_config,omitempty"` + EnabledWarehouseTypes []WarehouseTypePair `json:"enabled_warehouse_types,omitempty"` + GlobalParam *RepeatedEndpointConfPairs `json:"global_param,omitempty"` + GoogleServiceAccount string `json:"google_service_account,omitempty"` + InstanceProfileArn string `json:"instance_profile_arn,omitempty"` + SecurityPolicy SetWorkspaceWarehouseConfigRequestSecurityPolicy `json:"security_policy,omitempty"` + SqlConfigurationParameters *RepeatedEndpointConfPairs `json:"sql_configuration_parameters,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6666,9 +5674,7 @@ func statementParameterListItemToPb(st *StatementParameterListItem) (*statementP } pb := &statementParameterListItemPb{} pb.Name = st.Name - pb.Type = st.Type - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -6676,10 +5682,8 @@ func statementParameterListItemToPb(st *StatementParameterListItem) (*statementP } type statementParameterListItemPb struct { - Name string `json:"name"` - - Type string `json:"type,omitempty"` - + Name string `json:"name"` + Type string `json:"type,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6712,11 +5716,8 @@ func statementResponseToPb(st *StatementResponse) (*statementResponsePb, error) } pb := &statementResponsePb{} pb.Manifest = st.Manifest - pb.Result = st.Result - pb.StatementId = st.StatementId - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -6724,13 +5725,10 @@ func statementResponseToPb(st *StatementResponse) (*statementResponsePb, error) } type statementResponsePb struct { - Manifest *ResultManifest `json:"manifest,omitempty"` - - Result *ResultData `json:"result,omitempty"` - - StatementId string `json:"statement_id,omitempty"` - - Status *StatementStatus `json:"status,omitempty"` + Manifest *ResultManifest `json:"manifest,omitempty"` + Result *ResultData `json:"result,omitempty"` + StatementId string `json:"statement_id,omitempty"` + Status *StatementStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -6763,15 +5761,13 @@ func statementStatusToPb(st *StatementStatus) (*statementStatusPb, error) { } pb := &statementStatusPb{} pb.Error = st.Error - pb.State = st.State return pb, nil } type statementStatusPb struct { - Error *ServiceError `json:"error,omitempty"` - + Error *ServiceError `json:"error,omitempty"` State StatementState `json:"state,omitempty"` } @@ -6861,20 +5857,16 @@ func terminationReasonToPb(st *TerminationReason) (*terminationReasonPb, error) } pb := &terminationReasonPb{} pb.Code = st.Code - pb.Parameters = st.Parameters - pb.Type = st.Type return pb, nil } type terminationReasonPb struct { - Code TerminationReasonCode `json:"code,omitempty"` - - Parameters map[string]string `json:"parameters,omitempty"` - - Type TerminationReasonType `json:"type,omitempty"` + Code TerminationReasonCode `json:"code,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + Type TerminationReasonType `json:"type,omitempty"` } func terminationReasonFromPb(pb *terminationReasonPb) (*TerminationReason, error) { @@ -6931,7 +5923,6 @@ func timeRangeToPb(st *TimeRange) (*timeRangePb, error) { } pb := &timeRangePb{} pb.EndTimeMs = st.EndTimeMs - pb.StartTimeMs = st.StartTimeMs pb.ForceSendFields = st.ForceSendFields @@ -6939,8 +5930,7 @@ func timeRangeToPb(st *TimeRange) (*timeRangePb, error) { } type timeRangePb struct { - EndTimeMs int64 `json:"end_time_ms,omitempty" url:"end_time_ms,omitempty"` - + EndTimeMs int64 `json:"end_time_ms,omitempty" url:"end_time_ms,omitempty"` StartTimeMs int64 `json:"start_time_ms,omitempty" url:"start_time_ms,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7008,9 +5998,7 @@ func transferOwnershipRequestToPb(st *TransferOwnershipRequest) (*transferOwners } pb := &transferOwnershipRequestPb{} pb.NewOwner = st.NewOwner - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -7018,11 +6006,9 @@ func transferOwnershipRequestToPb(st *TransferOwnershipRequest) (*transferOwners } type transferOwnershipRequestPb struct { - NewOwner string `json:"new_owner,omitempty"` - - ObjectId TransferOwnershipObjectId `json:"-" url:"-"` - - ObjectType OwnableObjectType `json:"-" url:"-"` + NewOwner string `json:"new_owner,omitempty"` + ObjectId TransferOwnershipObjectId `json:"-" url:"-"` + ObjectType OwnableObjectType `json:"-" url:"-"` ForceSendFields []string `json:"-" url:"-"` } @@ -7126,11 +6112,8 @@ func updateAlertRequestToPb(st *UpdateAlertRequest) (*updateAlertRequestPb, erro } pb := &updateAlertRequestPb{} pb.Alert = st.Alert - pb.AutoResolveDisplayName = st.AutoResolveDisplayName - pb.Id = st.Id - pb.UpdateMask = st.UpdateMask pb.ForceSendFields = st.ForceSendFields @@ -7138,13 +6121,10 @@ func updateAlertRequestToPb(st *UpdateAlertRequest) (*updateAlertRequestPb, erro } type updateAlertRequestPb struct { - Alert *UpdateAlertRequestAlert `json:"alert,omitempty"` - - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` - - Id string `json:"-" url:"-"` - - UpdateMask string `json:"update_mask"` + Alert *UpdateAlertRequestAlert `json:"alert,omitempty"` + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + Id string `json:"-" url:"-"` + UpdateMask string `json:"update_mask"` ForceSendFields []string `json:"-" url:"-"` } @@ -7177,19 +6157,12 @@ func updateAlertRequestAlertToPb(st *UpdateAlertRequestAlert) (*updateAlertReque } pb := &updateAlertRequestAlertPb{} pb.Condition = st.Condition - pb.CustomBody = st.CustomBody - pb.CustomSubject = st.CustomSubject - pb.DisplayName = st.DisplayName - pb.NotifyOnOk = st.NotifyOnOk - pb.OwnerUserName = st.OwnerUserName - pb.QueryId = st.QueryId - pb.SecondsToRetrigger = st.SecondsToRetrigger pb.ForceSendFields = st.ForceSendFields @@ -7197,21 +6170,14 @@ func updateAlertRequestAlertToPb(st *UpdateAlertRequestAlert) (*updateAlertReque } type updateAlertRequestAlertPb struct { - Condition *AlertCondition `json:"condition,omitempty"` - - CustomBody string `json:"custom_body,omitempty"` - - CustomSubject string `json:"custom_subject,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - NotifyOnOk bool `json:"notify_on_ok,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` + Condition *AlertCondition `json:"condition,omitempty"` + CustomBody string `json:"custom_body,omitempty"` + CustomSubject string `json:"custom_subject,omitempty"` + DisplayName string `json:"display_name,omitempty"` + NotifyOnOk bool `json:"notify_on_ok,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + QueryId string `json:"query_id,omitempty"` + SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7248,20 +6214,16 @@ func updateAlertV2RequestToPb(st *UpdateAlertV2Request) (*updateAlertV2RequestPb } pb := &updateAlertV2RequestPb{} pb.Alert = st.Alert - pb.Id = st.Id - pb.UpdateMask = st.UpdateMask return pb, nil } type updateAlertV2RequestPb struct { - Alert AlertV2 `json:"alert"` - - Id string `json:"-" url:"-"` - - UpdateMask string `json:"-" url:"update_mask"` + Alert AlertV2 `json:"alert"` + Id string `json:"-" url:"-"` + UpdateMask string `json:"-" url:"update_mask"` } func updateAlertV2RequestFromPb(pb *updateAlertV2RequestPb) (*UpdateAlertV2Request, error) { @@ -7282,11 +6244,8 @@ func updateQueryRequestToPb(st *UpdateQueryRequest) (*updateQueryRequestPb, erro } pb := &updateQueryRequestPb{} pb.AutoResolveDisplayName = st.AutoResolveDisplayName - pb.Id = st.Id - pb.Query = st.Query - pb.UpdateMask = st.UpdateMask pb.ForceSendFields = st.ForceSendFields @@ -7294,13 +6253,10 @@ func updateQueryRequestToPb(st *UpdateQueryRequest) (*updateQueryRequestPb, erro } type updateQueryRequestPb struct { - AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` - - Id string `json:"-" url:"-"` - - Query *UpdateQueryRequestQuery `json:"query,omitempty"` - - UpdateMask string `json:"update_mask"` + AutoResolveDisplayName bool `json:"auto_resolve_display_name,omitempty"` + Id string `json:"-" url:"-"` + Query *UpdateQueryRequestQuery `json:"query,omitempty"` + UpdateMask string `json:"update_mask"` ForceSendFields []string `json:"-" url:"-"` } @@ -7333,25 +6289,15 @@ func updateQueryRequestQueryToPb(st *UpdateQueryRequestQuery) (*updateQueryReque } pb := &updateQueryRequestQueryPb{} pb.ApplyAutoLimit = st.ApplyAutoLimit - pb.Catalog = st.Catalog - pb.Description = st.Description - pb.DisplayName = st.DisplayName - pb.OwnerUserName = st.OwnerUserName - pb.Parameters = st.Parameters - pb.QueryText = st.QueryText - pb.RunAsMode = st.RunAsMode - pb.Schema = st.Schema - pb.Tags = st.Tags - pb.WarehouseId = st.WarehouseId pb.ForceSendFields = st.ForceSendFields @@ -7359,27 +6305,17 @@ func updateQueryRequestQueryToPb(st *UpdateQueryRequestQuery) (*updateQueryReque } type updateQueryRequestQueryPb struct { - ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` - - Catalog string `json:"catalog,omitempty"` - - Description string `json:"description,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - OwnerUserName string `json:"owner_user_name,omitempty"` - - Parameters []QueryParameter `json:"parameters,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - RunAsMode RunAsMode `json:"run_as_mode,omitempty"` - - Schema string `json:"schema,omitempty"` - - Tags []string `json:"tags,omitempty"` - - WarehouseId string `json:"warehouse_id,omitempty"` + ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"` + Catalog string `json:"catalog,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + OwnerUserName string `json:"owner_user_name,omitempty"` + Parameters []QueryParameter `json:"parameters,omitempty"` + QueryText string `json:"query_text,omitempty"` + RunAsMode RunAsMode `json:"run_as_mode,omitempty"` + Schema string `json:"schema,omitempty"` + Tags []string `json:"tags,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7440,19 +6376,15 @@ func updateVisualizationRequestToPb(st *UpdateVisualizationRequest) (*updateVisu } pb := &updateVisualizationRequestPb{} pb.Id = st.Id - pb.UpdateMask = st.UpdateMask - pb.Visualization = st.Visualization return pb, nil } type updateVisualizationRequestPb struct { - Id string `json:"-" url:"-"` - - UpdateMask string `json:"update_mask"` - + Id string `json:"-" url:"-"` + UpdateMask string `json:"update_mask"` Visualization *UpdateVisualizationRequestVisualization `json:"visualization,omitempty"` } @@ -7474,11 +6406,8 @@ func updateVisualizationRequestVisualizationToPb(st *UpdateVisualizationRequestV } pb := &updateVisualizationRequestVisualizationPb{} pb.DisplayName = st.DisplayName - pb.SerializedOptions = st.SerializedOptions - pb.SerializedQueryPlan = st.SerializedQueryPlan - pb.Type = st.Type pb.ForceSendFields = st.ForceSendFields @@ -7486,13 +6415,10 @@ func updateVisualizationRequestVisualizationToPb(st *UpdateVisualizationRequestV } type updateVisualizationRequestVisualizationPb struct { - DisplayName string `json:"display_name,omitempty"` - - SerializedOptions string `json:"serialized_options,omitempty"` - + DisplayName string `json:"display_name,omitempty"` + SerializedOptions string `json:"serialized_options,omitempty"` SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` - - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7525,9 +6451,7 @@ func userToPb(st *User) (*userPb, error) { } pb := &userPb{} pb.Email = st.Email - pb.Id = st.Id - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -7536,10 +6460,8 @@ func userToPb(st *User) (*userPb, error) { type userPb struct { Email string `json:"email,omitempty"` - - Id int `json:"id,omitempty"` - - Name string `json:"name,omitempty"` + Id int `json:"id,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7571,19 +6493,12 @@ func visualizationToPb(st *Visualization) (*visualizationPb, error) { } pb := &visualizationPb{} pb.CreateTime = st.CreateTime - pb.DisplayName = st.DisplayName - pb.Id = st.Id - pb.QueryId = st.QueryId - pb.SerializedOptions = st.SerializedOptions - pb.SerializedQueryPlan = st.SerializedQueryPlan - pb.Type = st.Type - pb.UpdateTime = st.UpdateTime pb.ForceSendFields = st.ForceSendFields @@ -7591,21 +6506,14 @@ func visualizationToPb(st *Visualization) (*visualizationPb, error) { } type visualizationPb struct { - CreateTime string `json:"create_time,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Id string `json:"id,omitempty"` - - QueryId string `json:"query_id,omitempty"` - - SerializedOptions string `json:"serialized_options,omitempty"` - + CreateTime string `json:"create_time,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` + QueryId string `json:"query_id,omitempty"` + SerializedOptions string `json:"serialized_options,omitempty"` SerializedQueryPlan string `json:"serialized_query_plan,omitempty"` - - Type string `json:"type,omitempty"` - - UpdateTime string `json:"update_time,omitempty"` + Type string `json:"type,omitempty"` + UpdateTime string `json:"update_time,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7642,11 +6550,8 @@ func warehouseAccessControlRequestToPb(st *WarehouseAccessControlRequest) (*ware } pb := &warehouseAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -7654,13 +6559,10 @@ func warehouseAccessControlRequestToPb(st *WarehouseAccessControlRequest) (*ware } type warehouseAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7693,13 +6595,9 @@ func warehouseAccessControlResponseToPb(st *WarehouseAccessControlResponse) (*wa } pb := &warehouseAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -7707,15 +6605,11 @@ func warehouseAccessControlResponseToPb(st *WarehouseAccessControlResponse) (*wa } type warehouseAccessControlResponsePb struct { - AllPermissions []WarehousePermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []WarehousePermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7749,9 +6643,7 @@ func warehousePermissionToPb(st *WarehousePermission) (*warehousePermissionPb, e } pb := &warehousePermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -7759,11 +6651,9 @@ func warehousePermissionToPb(st *WarehousePermission) (*warehousePermissionPb, e } type warehousePermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7795,9 +6685,7 @@ func warehousePermissionsToPb(st *WarehousePermissions) (*warehousePermissionsPb } pb := &warehousePermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -7806,10 +6694,8 @@ func warehousePermissionsToPb(st *WarehousePermissions) (*warehousePermissionsPb type warehousePermissionsPb struct { AccessControlList []WarehouseAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7841,7 +6727,6 @@ func warehousePermissionsDescriptionToPb(st *WarehousePermissionsDescription) (* } pb := &warehousePermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -7849,8 +6734,7 @@ func warehousePermissionsDescriptionToPb(st *WarehousePermissionsDescription) (* } type warehousePermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel WarehousePermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7882,7 +6766,6 @@ func warehousePermissionsRequestToPb(st *WarehousePermissionsRequest) (*warehous } pb := &warehousePermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.WarehouseId = st.WarehouseId return pb, nil @@ -7890,8 +6773,7 @@ func warehousePermissionsRequestToPb(st *WarehousePermissionsRequest) (*warehous type warehousePermissionsRequestPb struct { AccessControlList []WarehouseAccessControlRequest `json:"access_control_list,omitempty"` - - WarehouseId string `json:"-" url:"-"` + WarehouseId string `json:"-" url:"-"` } func warehousePermissionsRequestFromPb(pb *warehousePermissionsRequestPb) (*WarehousePermissionsRequest, error) { @@ -7911,7 +6793,6 @@ func warehouseTypePairToPb(st *WarehouseTypePair) (*warehouseTypePairPb, error) } pb := &warehouseTypePairPb{} pb.Enabled = st.Enabled - pb.WarehouseType = st.WarehouseType pb.ForceSendFields = st.ForceSendFields @@ -7919,8 +6800,7 @@ func warehouseTypePairToPb(st *WarehouseTypePair) (*warehouseTypePairPb, error) } type warehouseTypePairPb struct { - Enabled bool `json:"enabled,omitempty"` - + Enabled bool `json:"enabled,omitempty"` WarehouseType WarehouseTypePairWarehouseType `json:"warehouse_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -7952,11 +6832,8 @@ func widgetToPb(st *Widget) (*widgetPb, error) { } pb := &widgetPb{} pb.Id = st.Id - pb.Options = st.Options - pb.Visualization = st.Visualization - pb.Width = st.Width pb.ForceSendFields = st.ForceSendFields @@ -7964,13 +6841,10 @@ func widgetToPb(st *Widget) (*widgetPb, error) { } type widgetPb struct { - Id string `json:"id,omitempty"` - - Options *WidgetOptions `json:"options,omitempty"` - + Id string `json:"id,omitempty"` + Options *WidgetOptions `json:"options,omitempty"` Visualization *LegacyVisualization `json:"visualization,omitempty"` - - Width int `json:"width,omitempty"` + Width int `json:"width,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8003,17 +6877,11 @@ func widgetOptionsToPb(st *WidgetOptions) (*widgetOptionsPb, error) { } pb := &widgetOptionsPb{} pb.CreatedAt = st.CreatedAt - pb.Description = st.Description - pb.IsHidden = st.IsHidden - pb.ParameterMappings = st.ParameterMappings - pb.Position = st.Position - pb.Title = st.Title - pb.UpdatedAt = st.UpdatedAt pb.ForceSendFields = st.ForceSendFields @@ -8021,19 +6889,13 @@ func widgetOptionsToPb(st *WidgetOptions) (*widgetOptionsPb, error) { } type widgetOptionsPb struct { - CreatedAt string `json:"created_at,omitempty"` - - Description string `json:"description,omitempty"` - - IsHidden bool `json:"isHidden,omitempty"` - - ParameterMappings any `json:"parameterMappings,omitempty"` - - Position *WidgetPosition `json:"position,omitempty"` - - Title string `json:"title,omitempty"` - - UpdatedAt string `json:"updated_at,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Description string `json:"description,omitempty"` + IsHidden bool `json:"isHidden,omitempty"` + ParameterMappings any `json:"parameterMappings,omitempty"` + Position *WidgetPosition `json:"position,omitempty"` + Title string `json:"title,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8069,13 +6931,9 @@ func widgetPositionToPb(st *WidgetPosition) (*widgetPositionPb, error) { } pb := &widgetPositionPb{} pb.AutoHeight = st.AutoHeight - pb.Col = st.Col - pb.Row = st.Row - pb.SizeX = st.SizeX - pb.SizeY = st.SizeY pb.ForceSendFields = st.ForceSendFields @@ -8084,14 +6942,10 @@ func widgetPositionToPb(st *WidgetPosition) (*widgetPositionPb, error) { type widgetPositionPb struct { AutoHeight bool `json:"autoHeight,omitempty"` - - Col int `json:"col,omitempty"` - - Row int `json:"row,omitempty"` - - SizeX int `json:"sizeX,omitempty"` - - SizeY int `json:"sizeY,omitempty"` + Col int `json:"col,omitempty"` + Row int `json:"row,omitempty"` + SizeX int `json:"sizeX,omitempty"` + SizeY int `json:"sizeY,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -8118,3 +6972,57 @@ func (st *widgetPositionPb) UnmarshalJSON(b []byte) error { func (st widgetPositionPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/sql/model.go b/service/sql/model.go index 342eaa4fc..41e422879 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -5,8 +5,6 @@ package sql import ( "encoding/json" "fmt" - "strings" - "time" ) type AccessControl struct { @@ -9365,57 +9363,3 @@ func (st WidgetPosition) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/vectorsearch/internal.go b/service/vectorsearch/internal.go index 10492d1a2..a673e9feb 100755 --- a/service/vectorsearch/internal.go +++ b/service/vectorsearch/internal.go @@ -3,6 +3,10 @@ package vectorsearch import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -48,9 +52,7 @@ func createEndpointToPb(st *CreateEndpoint) (*createEndpointPb, error) { } pb := &createEndpointPb{} pb.BudgetPolicyId = st.BudgetPolicyId - pb.EndpointType = st.EndpointType - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -58,11 +60,9 @@ func createEndpointToPb(st *CreateEndpoint) (*createEndpointPb, error) { } type createEndpointPb struct { - BudgetPolicyId string `json:"budget_policy_id,omitempty"` - - EndpointType EndpointType `json:"endpoint_type"` - - Name string `json:"name"` + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + EndpointType EndpointType `json:"endpoint_type"` + Name string `json:"name"` ForceSendFields []string `json:"-" url:"-"` } @@ -94,32 +94,22 @@ func createVectorIndexRequestToPb(st *CreateVectorIndexRequest) (*createVectorIn } pb := &createVectorIndexRequestPb{} pb.DeltaSyncIndexSpec = st.DeltaSyncIndexSpec - pb.DirectAccessIndexSpec = st.DirectAccessIndexSpec - pb.EndpointName = st.EndpointName - pb.IndexType = st.IndexType - pb.Name = st.Name - pb.PrimaryKey = st.PrimaryKey return pb, nil } type createVectorIndexRequestPb struct { - DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest `json:"delta_sync_index_spec,omitempty"` - - DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` - - EndpointName string `json:"endpoint_name"` - - IndexType VectorIndexType `json:"index_type"` - - Name string `json:"name"` - - PrimaryKey string `json:"primary_key"` + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest `json:"delta_sync_index_spec,omitempty"` + DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + EndpointName string `json:"endpoint_name"` + IndexType VectorIndexType `json:"index_type"` + Name string `json:"name"` + PrimaryKey string `json:"primary_key"` } func createVectorIndexRequestFromPb(pb *createVectorIndexRequestPb) (*CreateVectorIndexRequest, error) { @@ -143,7 +133,6 @@ func customTagToPb(st *CustomTag) (*customTagPb, error) { } pb := &customTagPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -151,8 +140,7 @@ func customTagToPb(st *CustomTag) (*customTagPb, error) { } type customTagPb struct { - Key string `json:"key"` - + Key string `json:"key"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -184,7 +172,6 @@ func deleteDataResultToPb(st *DeleteDataResult) (*deleteDataResultPb, error) { } pb := &deleteDataResultPb{} pb.FailedPrimaryKeys = st.FailedPrimaryKeys - pb.SuccessRowCount = st.SuccessRowCount pb.ForceSendFields = st.ForceSendFields @@ -193,8 +180,7 @@ func deleteDataResultToPb(st *DeleteDataResult) (*deleteDataResultPb, error) { type deleteDataResultPb struct { FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` - - SuccessRowCount int64 `json:"success_row_count,omitempty"` + SuccessRowCount int64 `json:"success_row_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -225,15 +211,13 @@ func deleteDataVectorIndexRequestToPb(st *DeleteDataVectorIndexRequest) (*delete } pb := &deleteDataVectorIndexRequestPb{} pb.IndexName = st.IndexName - pb.PrimaryKeys = st.PrimaryKeys return pb, nil } type deleteDataVectorIndexRequestPb struct { - IndexName string `json:"-" url:"-"` - + IndexName string `json:"-" url:"-"` PrimaryKeys []string `json:"-" url:"primary_keys"` } @@ -254,7 +238,6 @@ func deleteDataVectorIndexResponseToPb(st *DeleteDataVectorIndexResponse) (*dele } pb := &deleteDataVectorIndexResponsePb{} pb.Result = st.Result - pb.Status = st.Status return pb, nil @@ -262,8 +245,7 @@ func deleteDataVectorIndexResponseToPb(st *DeleteDataVectorIndexResponse) (*dele type deleteDataVectorIndexResponsePb struct { Result *DeleteDataResult `json:"result,omitempty"` - - Status DeleteDataStatus `json:"status,omitempty"` + Status DeleteDataStatus `json:"status,omitempty"` } func deleteDataVectorIndexResponseFromPb(pb *deleteDataVectorIndexResponsePb) (*DeleteDataVectorIndexResponse, error) { @@ -373,15 +355,10 @@ func deltaSyncVectorIndexSpecRequestToPb(st *DeltaSyncVectorIndexSpecRequest) (* } pb := &deltaSyncVectorIndexSpecRequestPb{} pb.ColumnsToSync = st.ColumnsToSync - pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns - pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns - pb.EmbeddingWritebackTable = st.EmbeddingWritebackTable - pb.PipelineType = st.PipelineType - pb.SourceTable = st.SourceTable pb.ForceSendFields = st.ForceSendFields @@ -389,17 +366,12 @@ func deltaSyncVectorIndexSpecRequestToPb(st *DeltaSyncVectorIndexSpecRequest) (* } type deltaSyncVectorIndexSpecRequestPb struct { - ColumnsToSync []string `json:"columns_to_sync,omitempty"` - - EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` - - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` - - EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` - - PipelineType PipelineType `json:"pipeline_type,omitempty"` - - SourceTable string `json:"source_table,omitempty"` + ColumnsToSync []string `json:"columns_to_sync,omitempty"` + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + PipelineType PipelineType `json:"pipeline_type,omitempty"` + SourceTable string `json:"source_table,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -434,15 +406,10 @@ func deltaSyncVectorIndexSpecResponseToPb(st *DeltaSyncVectorIndexSpecResponse) } pb := &deltaSyncVectorIndexSpecResponsePb{} pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns - pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns - pb.EmbeddingWritebackTable = st.EmbeddingWritebackTable - pb.PipelineId = st.PipelineId - pb.PipelineType = st.PipelineType - pb.SourceTable = st.SourceTable pb.ForceSendFields = st.ForceSendFields @@ -450,17 +417,12 @@ func deltaSyncVectorIndexSpecResponseToPb(st *DeltaSyncVectorIndexSpecResponse) } type deltaSyncVectorIndexSpecResponsePb struct { - EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` - - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` - - EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` - - PipelineId string `json:"pipeline_id,omitempty"` - - PipelineType PipelineType `json:"pipeline_type,omitempty"` - - SourceTable string `json:"source_table,omitempty"` + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + PipelineId string `json:"pipeline_id,omitempty"` + PipelineType PipelineType `json:"pipeline_type,omitempty"` + SourceTable string `json:"source_table,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -495,9 +457,7 @@ func directAccessVectorIndexSpecToPb(st *DirectAccessVectorIndexSpec) (*directAc } pb := &directAccessVectorIndexSpecPb{} pb.EmbeddingSourceColumns = st.EmbeddingSourceColumns - pb.EmbeddingVectorColumns = st.EmbeddingVectorColumns - pb.SchemaJson = st.SchemaJson pb.ForceSendFields = st.ForceSendFields @@ -506,10 +466,8 @@ func directAccessVectorIndexSpecToPb(st *DirectAccessVectorIndexSpec) (*directAc type directAccessVectorIndexSpecPb struct { EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` - EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` - - SchemaJson string `json:"schema_json,omitempty"` + SchemaJson string `json:"schema_json,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -541,7 +499,6 @@ func embeddingSourceColumnToPb(st *EmbeddingSourceColumn) (*embeddingSourceColum } pb := &embeddingSourceColumnPb{} pb.EmbeddingModelEndpointName = st.EmbeddingModelEndpointName - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -550,8 +507,7 @@ func embeddingSourceColumnToPb(st *EmbeddingSourceColumn) (*embeddingSourceColum type embeddingSourceColumnPb struct { EmbeddingModelEndpointName string `json:"embedding_model_endpoint_name,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -582,7 +538,6 @@ func embeddingVectorColumnToPb(st *EmbeddingVectorColumn) (*embeddingVectorColum } pb := &embeddingVectorColumnPb{} pb.EmbeddingDimension = st.EmbeddingDimension - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -590,9 +545,8 @@ func embeddingVectorColumnToPb(st *EmbeddingVectorColumn) (*embeddingVectorColum } type embeddingVectorColumnPb struct { - EmbeddingDimension int `json:"embedding_dimension,omitempty"` - - Name string `json:"name,omitempty"` + EmbeddingDimension int `json:"embedding_dimension,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -623,25 +577,15 @@ func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { } pb := &endpointInfoPb{} pb.CreationTimestamp = st.CreationTimestamp - pb.Creator = st.Creator - pb.CustomTags = st.CustomTags - pb.EffectiveBudgetPolicyId = st.EffectiveBudgetPolicyId - pb.EndpointStatus = st.EndpointStatus - pb.EndpointType = st.EndpointType - pb.Id = st.Id - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp - pb.LastUpdatedUser = st.LastUpdatedUser - pb.Name = st.Name - pb.NumIndexes = st.NumIndexes pb.ForceSendFields = st.ForceSendFields @@ -649,27 +593,17 @@ func endpointInfoToPb(st *EndpointInfo) (*endpointInfoPb, error) { } type endpointInfoPb struct { - CreationTimestamp int64 `json:"creation_timestamp,omitempty"` - - Creator string `json:"creator,omitempty"` - - CustomTags []CustomTag `json:"custom_tags,omitempty"` - - EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` - - EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"` - - EndpointType EndpointType `json:"endpoint_type,omitempty"` - - Id string `json:"id,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` - - LastUpdatedUser string `json:"last_updated_user,omitempty"` - - Name string `json:"name,omitempty"` - - NumIndexes int `json:"num_indexes,omitempty"` + CreationTimestamp int64 `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + CustomTags []CustomTag `json:"custom_tags,omitempty"` + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"` + EndpointType EndpointType `json:"endpoint_type,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + LastUpdatedUser string `json:"last_updated_user,omitempty"` + Name string `json:"name,omitempty"` + NumIndexes int `json:"num_indexes,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -709,7 +643,6 @@ func endpointStatusToPb(st *EndpointStatus) (*endpointStatusPb, error) { } pb := &endpointStatusPb{} pb.Message = st.Message - pb.State = st.State pb.ForceSendFields = st.ForceSendFields @@ -717,9 +650,8 @@ func endpointStatusToPb(st *EndpointStatus) (*endpointStatusPb, error) { } type endpointStatusPb struct { - Message string `json:"message,omitempty"` - - State EndpointStatusState `json:"state,omitempty"` + Message string `json:"message,omitempty"` + State EndpointStatusState `json:"state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -798,7 +730,6 @@ func listEndpointResponseToPb(st *ListEndpointResponse) (*listEndpointResponsePb } pb := &listEndpointResponsePb{} pb.Endpoints = st.Endpoints - pb.NextPageToken = st.NextPageToken pb.ForceSendFields = st.ForceSendFields @@ -806,9 +737,8 @@ func listEndpointResponseToPb(st *ListEndpointResponse) (*listEndpointResponsePb } type listEndpointResponsePb struct { - Endpoints []EndpointInfo `json:"endpoints,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` + Endpoints []EndpointInfo `json:"endpoints,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -875,7 +805,6 @@ func listIndexesRequestToPb(st *ListIndexesRequest) (*listIndexesRequestPb, erro } pb := &listIndexesRequestPb{} pb.EndpointName = st.EndpointName - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -884,8 +813,7 @@ func listIndexesRequestToPb(st *ListIndexesRequest) (*listIndexesRequestPb, erro type listIndexesRequestPb struct { EndpointName string `json:"-" url:"endpoint_name"` - - PageToken string `json:"-" url:"page_token,omitempty"` + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -940,7 +868,6 @@ func listVectorIndexesResponseToPb(st *ListVectorIndexesResponse) (*listVectorIn } pb := &listVectorIndexesResponsePb{} pb.NextPageToken = st.NextPageToken - pb.VectorIndexes = st.VectorIndexes pb.ForceSendFields = st.ForceSendFields @@ -948,8 +875,7 @@ func listVectorIndexesResponseToPb(st *ListVectorIndexesResponse) (*listVectorIn } type listVectorIndexesResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - + NextPageToken string `json:"next_page_token,omitempty"` VectorIndexes []MiniVectorIndex `json:"vector_indexes,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -981,7 +907,6 @@ func mapStringValueEntryToPb(st *MapStringValueEntry) (*mapStringValueEntryPb, e } pb := &mapStringValueEntryPb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -989,8 +914,7 @@ func mapStringValueEntryToPb(st *MapStringValueEntry) (*mapStringValueEntryPb, e } type mapStringValueEntryPb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value *Value `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1022,13 +946,9 @@ func miniVectorIndexToPb(st *MiniVectorIndex) (*miniVectorIndexPb, error) { } pb := &miniVectorIndexPb{} pb.Creator = st.Creator - pb.EndpointName = st.EndpointName - pb.IndexType = st.IndexType - pb.Name = st.Name - pb.PrimaryKey = st.PrimaryKey pb.ForceSendFields = st.ForceSendFields @@ -1036,15 +956,11 @@ func miniVectorIndexToPb(st *MiniVectorIndex) (*miniVectorIndexPb, error) { } type miniVectorIndexPb struct { - Creator string `json:"creator,omitempty"` - - EndpointName string `json:"endpoint_name,omitempty"` - - IndexType VectorIndexType `json:"index_type,omitempty"` - - Name string `json:"name,omitempty"` - - PrimaryKey string `json:"primary_key,omitempty"` + Creator string `json:"creator,omitempty"` + EndpointName string `json:"endpoint_name,omitempty"` + IndexType VectorIndexType `json:"index_type,omitempty"` + Name string `json:"name,omitempty"` + PrimaryKey string `json:"primary_key,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1078,7 +994,6 @@ func patchEndpointBudgetPolicyRequestToPb(st *PatchEndpointBudgetPolicyRequest) } pb := &patchEndpointBudgetPolicyRequestPb{} pb.BudgetPolicyId = st.BudgetPolicyId - pb.EndpointName = st.EndpointName return pb, nil @@ -1086,8 +1001,7 @@ func patchEndpointBudgetPolicyRequestToPb(st *PatchEndpointBudgetPolicyRequest) type patchEndpointBudgetPolicyRequestPb struct { BudgetPolicyId string `json:"budget_policy_id"` - - EndpointName string `json:"-" url:"-"` + EndpointName string `json:"-" url:"-"` } func patchEndpointBudgetPolicyRequestFromPb(pb *patchEndpointBudgetPolicyRequestPb) (*PatchEndpointBudgetPolicyRequest, error) { @@ -1143,9 +1057,7 @@ func queryVectorIndexNextPageRequestToPb(st *QueryVectorIndexNextPageRequest) (* } pb := &queryVectorIndexNextPageRequestPb{} pb.EndpointName = st.EndpointName - pb.IndexName = st.IndexName - pb.PageToken = st.PageToken pb.ForceSendFields = st.ForceSendFields @@ -1154,10 +1066,8 @@ func queryVectorIndexNextPageRequestToPb(st *QueryVectorIndexNextPageRequest) (* type queryVectorIndexNextPageRequestPb struct { EndpointName string `json:"endpoint_name,omitempty"` - - IndexName string `json:"-" url:"-"` - - PageToken string `json:"page_token,omitempty"` + IndexName string `json:"-" url:"-"` + PageToken string `json:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1189,21 +1099,13 @@ func queryVectorIndexRequestToPb(st *QueryVectorIndexRequest) (*queryVectorIndex } pb := &queryVectorIndexRequestPb{} pb.Columns = st.Columns - pb.ColumnsToRerank = st.ColumnsToRerank - pb.FiltersJson = st.FiltersJson - pb.IndexName = st.IndexName - pb.NumResults = st.NumResults - pb.QueryText = st.QueryText - pb.QueryType = st.QueryType - pb.QueryVector = st.QueryVector - pb.ScoreThreshold = st.ScoreThreshold pb.ForceSendFields = st.ForceSendFields @@ -1211,23 +1113,15 @@ func queryVectorIndexRequestToPb(st *QueryVectorIndexRequest) (*queryVectorIndex } type queryVectorIndexRequestPb struct { - Columns []string `json:"columns"` - - ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` - - FiltersJson string `json:"filters_json,omitempty"` - - IndexName string `json:"-" url:"-"` - - NumResults int `json:"num_results,omitempty"` - - QueryText string `json:"query_text,omitempty"` - - QueryType string `json:"query_type,omitempty"` - - QueryVector []float64 `json:"query_vector,omitempty"` - - ScoreThreshold float64 `json:"score_threshold,omitempty"` + Columns []string `json:"columns"` + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` + FiltersJson string `json:"filters_json,omitempty"` + IndexName string `json:"-" url:"-"` + NumResults int `json:"num_results,omitempty"` + QueryText string `json:"query_text,omitempty"` + QueryType string `json:"query_type,omitempty"` + QueryVector []float64 `json:"query_vector,omitempty"` + ScoreThreshold float64 `json:"score_threshold,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1265,9 +1159,7 @@ func queryVectorIndexResponseToPb(st *QueryVectorIndexResponse) (*queryVectorInd } pb := &queryVectorIndexResponsePb{} pb.Manifest = st.Manifest - pb.NextPageToken = st.NextPageToken - pb.Result = st.Result pb.ForceSendFields = st.ForceSendFields @@ -1275,11 +1167,9 @@ func queryVectorIndexResponseToPb(st *QueryVectorIndexResponse) (*queryVectorInd } type queryVectorIndexResponsePb struct { - Manifest *ResultManifest `json:"manifest,omitempty"` - - NextPageToken string `json:"next_page_token,omitempty"` - - Result *ResultData `json:"result,omitempty"` + Manifest *ResultManifest `json:"manifest,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Result *ResultData `json:"result,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1311,7 +1201,6 @@ func resultDataToPb(st *ResultData) (*resultDataPb, error) { } pb := &resultDataPb{} pb.DataArray = st.DataArray - pb.RowCount = st.RowCount pb.ForceSendFields = st.ForceSendFields @@ -1320,8 +1209,7 @@ func resultDataToPb(st *ResultData) (*resultDataPb, error) { type resultDataPb struct { DataArray [][]string `json:"data_array,omitempty"` - - RowCount int `json:"row_count,omitempty"` + RowCount int `json:"row_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1352,7 +1240,6 @@ func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { } pb := &resultManifestPb{} pb.ColumnCount = st.ColumnCount - pb.Columns = st.Columns pb.ForceSendFields = st.ForceSendFields @@ -1360,9 +1247,8 @@ func resultManifestToPb(st *ResultManifest) (*resultManifestPb, error) { } type resultManifestPb struct { - ColumnCount int `json:"column_count,omitempty"` - - Columns []ColumnInfo `json:"columns,omitempty"` + ColumnCount int `json:"column_count,omitempty"` + Columns []ColumnInfo `json:"columns,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1393,9 +1279,7 @@ func scanVectorIndexRequestToPb(st *ScanVectorIndexRequest) (*scanVectorIndexReq } pb := &scanVectorIndexRequestPb{} pb.IndexName = st.IndexName - pb.LastPrimaryKey = st.LastPrimaryKey - pb.NumResults = st.NumResults pb.ForceSendFields = st.ForceSendFields @@ -1403,11 +1287,9 @@ func scanVectorIndexRequestToPb(st *ScanVectorIndexRequest) (*scanVectorIndexReq } type scanVectorIndexRequestPb struct { - IndexName string `json:"-" url:"-"` - + IndexName string `json:"-" url:"-"` LastPrimaryKey string `json:"last_primary_key,omitempty"` - - NumResults int `json:"num_results,omitempty"` + NumResults int `json:"num_results,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1439,7 +1321,6 @@ func scanVectorIndexResponseToPb(st *ScanVectorIndexResponse) (*scanVectorIndexR } pb := &scanVectorIndexResponsePb{} pb.Data = st.Data - pb.LastPrimaryKey = st.LastPrimaryKey pb.ForceSendFields = st.ForceSendFields @@ -1447,9 +1328,8 @@ func scanVectorIndexResponseToPb(st *ScanVectorIndexResponse) (*scanVectorIndexR } type scanVectorIndexResponsePb struct { - Data []Struct `json:"data,omitempty"` - - LastPrimaryKey string `json:"last_primary_key,omitempty"` + Data []Struct `json:"data,omitempty"` + LastPrimaryKey string `json:"last_primary_key,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1549,16 +1429,14 @@ func updateEndpointCustomTagsRequestToPb(st *UpdateEndpointCustomTagsRequest) (* } pb := &updateEndpointCustomTagsRequestPb{} pb.CustomTags = st.CustomTags - pb.EndpointName = st.EndpointName return pb, nil } type updateEndpointCustomTagsRequestPb struct { - CustomTags []CustomTag `json:"custom_tags"` - - EndpointName string `json:"-" url:"-"` + CustomTags []CustomTag `json:"custom_tags"` + EndpointName string `json:"-" url:"-"` } func updateEndpointCustomTagsRequestFromPb(pb *updateEndpointCustomTagsRequestPb) (*UpdateEndpointCustomTagsRequest, error) { @@ -1578,7 +1456,6 @@ func updateEndpointCustomTagsResponseToPb(st *UpdateEndpointCustomTagsResponse) } pb := &updateEndpointCustomTagsResponsePb{} pb.CustomTags = st.CustomTags - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -1587,8 +1464,7 @@ func updateEndpointCustomTagsResponseToPb(st *UpdateEndpointCustomTagsResponse) type updateEndpointCustomTagsResponsePb struct { CustomTags []CustomTag `json:"custom_tags,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1619,7 +1495,6 @@ func upsertDataResultToPb(st *UpsertDataResult) (*upsertDataResultPb, error) { } pb := &upsertDataResultPb{} pb.FailedPrimaryKeys = st.FailedPrimaryKeys - pb.SuccessRowCount = st.SuccessRowCount pb.ForceSendFields = st.ForceSendFields @@ -1628,8 +1503,7 @@ func upsertDataResultToPb(st *UpsertDataResult) (*upsertDataResultPb, error) { type upsertDataResultPb struct { FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` - - SuccessRowCount int64 `json:"success_row_count,omitempty"` + SuccessRowCount int64 `json:"success_row_count,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1660,15 +1534,13 @@ func upsertDataVectorIndexRequestToPb(st *UpsertDataVectorIndexRequest) (*upsert } pb := &upsertDataVectorIndexRequestPb{} pb.IndexName = st.IndexName - pb.InputsJson = st.InputsJson return pb, nil } type upsertDataVectorIndexRequestPb struct { - IndexName string `json:"-" url:"-"` - + IndexName string `json:"-" url:"-"` InputsJson string `json:"inputs_json"` } @@ -1689,7 +1561,6 @@ func upsertDataVectorIndexResponseToPb(st *UpsertDataVectorIndexResponse) (*upse } pb := &upsertDataVectorIndexResponsePb{} pb.Result = st.Result - pb.Status = st.Status return pb, nil @@ -1697,8 +1568,7 @@ func upsertDataVectorIndexResponseToPb(st *UpsertDataVectorIndexResponse) (*upse type upsertDataVectorIndexResponsePb struct { Result *UpsertDataResult `json:"result,omitempty"` - - Status UpsertDataStatus `json:"status,omitempty"` + Status UpsertDataStatus `json:"status,omitempty"` } func upsertDataVectorIndexResponseFromPb(pb *upsertDataVectorIndexResponsePb) (*UpsertDataVectorIndexResponse, error) { @@ -1718,13 +1588,9 @@ func valueToPb(st *Value) (*valuePb, error) { } pb := &valuePb{} pb.BoolValue = st.BoolValue - pb.ListValue = st.ListValue - pb.NumberValue = st.NumberValue - pb.StringValue = st.StringValue - pb.StructValue = st.StructValue pb.ForceSendFields = st.ForceSendFields @@ -1732,15 +1598,11 @@ func valueToPb(st *Value) (*valuePb, error) { } type valuePb struct { - BoolValue bool `json:"bool_value,omitempty"` - - ListValue *ListValue `json:"list_value,omitempty"` - - NumberValue float64 `json:"number_value,omitempty"` - - StringValue string `json:"string_value,omitempty"` - - StructValue *Struct `json:"struct_value,omitempty"` + BoolValue bool `json:"bool_value,omitempty"` + ListValue *ListValue `json:"list_value,omitempty"` + NumberValue float64 `json:"number_value,omitempty"` + StringValue string `json:"string_value,omitempty"` + StructValue *Struct `json:"struct_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1774,19 +1636,12 @@ func vectorIndexToPb(st *VectorIndex) (*vectorIndexPb, error) { } pb := &vectorIndexPb{} pb.Creator = st.Creator - pb.DeltaSyncIndexSpec = st.DeltaSyncIndexSpec - pb.DirectAccessIndexSpec = st.DirectAccessIndexSpec - pb.EndpointName = st.EndpointName - pb.IndexType = st.IndexType - pb.Name = st.Name - pb.PrimaryKey = st.PrimaryKey - pb.Status = st.Status pb.ForceSendFields = st.ForceSendFields @@ -1794,21 +1649,14 @@ func vectorIndexToPb(st *VectorIndex) (*vectorIndexPb, error) { } type vectorIndexPb struct { - Creator string `json:"creator,omitempty"` - - DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse `json:"delta_sync_index_spec,omitempty"` - - DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` - - EndpointName string `json:"endpoint_name,omitempty"` - - IndexType VectorIndexType `json:"index_type,omitempty"` - - Name string `json:"name,omitempty"` - - PrimaryKey string `json:"primary_key,omitempty"` - - Status *VectorIndexStatus `json:"status,omitempty"` + Creator string `json:"creator,omitempty"` + DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse `json:"delta_sync_index_spec,omitempty"` + DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"` + EndpointName string `json:"endpoint_name,omitempty"` + IndexType VectorIndexType `json:"index_type,omitempty"` + Name string `json:"name,omitempty"` + PrimaryKey string `json:"primary_key,omitempty"` + Status *VectorIndexStatus `json:"status,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1845,11 +1693,8 @@ func vectorIndexStatusToPb(st *VectorIndexStatus) (*vectorIndexStatusPb, error) } pb := &vectorIndexStatusPb{} pb.IndexUrl = st.IndexUrl - pb.IndexedRowCount = st.IndexedRowCount - pb.Message = st.Message - pb.Ready = st.Ready pb.ForceSendFields = st.ForceSendFields @@ -1857,13 +1702,10 @@ func vectorIndexStatusToPb(st *VectorIndexStatus) (*vectorIndexStatusPb, error) } type vectorIndexStatusPb struct { - IndexUrl string `json:"index_url,omitempty"` - - IndexedRowCount int64 `json:"indexed_row_count,omitempty"` - - Message string `json:"message,omitempty"` - - Ready bool `json:"ready,omitempty"` + IndexUrl string `json:"index_url,omitempty"` + IndexedRowCount int64 `json:"indexed_row_count,omitempty"` + Message string `json:"message,omitempty"` + Ready bool `json:"ready,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1889,3 +1731,57 @@ func (st *vectorIndexStatusPb) UnmarshalJSON(b []byte) error { func (st vectorIndexStatusPb) MarshalJSON() ([]byte, error) { return marshal.Marshal(st) } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 02b454c48..5dcb2022c 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -5,8 +5,6 @@ package vectorsearch import ( "encoding/json" "fmt" - "strings" - "time" ) type ColumnInfo struct { @@ -2018,57 +2016,3 @@ func (f *VectorIndexType) Set(v string) error { func (f *VectorIndexType) Type() string { return "VectorIndexType" } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -} diff --git a/service/workspace/internal.go b/service/workspace/internal.go index b4e88d406..2e8d9651c 100755 --- a/service/workspace/internal.go +++ b/service/workspace/internal.go @@ -3,6 +3,10 @@ package workspace import ( + "fmt" + "strings" + "time" + "github.com/databricks/databricks-sdk-go/marshal" ) @@ -12,7 +16,6 @@ func aclItemToPb(st *AclItem) (*aclItemPb, error) { } pb := &aclItemPb{} pb.Permission = st.Permission - pb.Principal = st.Principal return pb, nil @@ -20,8 +23,7 @@ func aclItemToPb(st *AclItem) (*aclItemPb, error) { type aclItemPb struct { Permission AclPermission `json:"permission"` - - Principal string `json:"principal"` + Principal string `json:"principal"` } func aclItemFromPb(pb *aclItemPb) (*AclItem, error) { @@ -41,15 +43,13 @@ func azureKeyVaultSecretScopeMetadataToPb(st *AzureKeyVaultSecretScopeMetadata) } pb := &azureKeyVaultSecretScopeMetadataPb{} pb.DnsName = st.DnsName - pb.ResourceId = st.ResourceId return pb, nil } type azureKeyVaultSecretScopeMetadataPb struct { - DnsName string `json:"dns_name"` - + DnsName string `json:"dns_name"` ResourceId string `json:"resource_id"` } @@ -70,9 +70,7 @@ func createCredentialsRequestToPb(st *CreateCredentialsRequest) (*createCredenti } pb := &createCredentialsRequestPb{} pb.GitProvider = st.GitProvider - pb.GitUsername = st.GitUsername - pb.PersonalAccessToken = st.PersonalAccessToken pb.ForceSendFields = st.ForceSendFields @@ -80,10 +78,8 @@ func createCredentialsRequestToPb(st *CreateCredentialsRequest) (*createCredenti } type createCredentialsRequestPb struct { - GitProvider string `json:"git_provider"` - - GitUsername string `json:"git_username,omitempty"` - + GitProvider string `json:"git_provider"` + GitUsername string `json:"git_username,omitempty"` PersonalAccessToken string `json:"personal_access_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -116,9 +112,7 @@ func createCredentialsResponseToPb(st *CreateCredentialsResponse) (*createCreden } pb := &createCredentialsResponsePb{} pb.CredentialId = st.CredentialId - pb.GitProvider = st.GitProvider - pb.GitUsername = st.GitUsername pb.ForceSendFields = st.ForceSendFields @@ -126,11 +120,9 @@ func createCredentialsResponseToPb(st *CreateCredentialsResponse) (*createCreden } type createCredentialsResponsePb struct { - CredentialId int64 `json:"credential_id"` - - GitProvider string `json:"git_provider"` - - GitUsername string `json:"git_username,omitempty"` + CredentialId int64 `json:"credential_id"` + GitProvider string `json:"git_provider"` + GitUsername string `json:"git_username,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -162,11 +154,8 @@ func createRepoRequestToPb(st *CreateRepoRequest) (*createRepoRequestPb, error) } pb := &createRepoRequestPb{} pb.Path = st.Path - pb.Provider = st.Provider - pb.SparseCheckout = st.SparseCheckout - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -174,13 +163,10 @@ func createRepoRequestToPb(st *CreateRepoRequest) (*createRepoRequestPb, error) } type createRepoRequestPb struct { - Path string `json:"path,omitempty"` - - Provider string `json:"provider"` - + Path string `json:"path,omitempty"` + Provider string `json:"provider"` SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` - - Url string `json:"url"` + Url string `json:"url"` ForceSendFields []string `json:"-" url:"-"` } @@ -213,17 +199,11 @@ func createRepoResponseToPb(st *CreateRepoResponse) (*createRepoResponsePb, erro } pb := &createRepoResponsePb{} pb.Branch = st.Branch - pb.HeadCommitId = st.HeadCommitId - pb.Id = st.Id - pb.Path = st.Path - pb.Provider = st.Provider - pb.SparseCheckout = st.SparseCheckout - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -231,19 +211,13 @@ func createRepoResponseToPb(st *CreateRepoResponse) (*createRepoResponsePb, erro } type createRepoResponsePb struct { - Branch string `json:"branch,omitempty"` - - HeadCommitId string `json:"head_commit_id,omitempty"` - - Id int64 `json:"id,omitempty"` - - Path string `json:"path,omitempty"` - - Provider string `json:"provider,omitempty"` - + Branch string `json:"branch,omitempty"` + HeadCommitId string `json:"head_commit_id,omitempty"` + Id int64 `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Provider string `json:"provider,omitempty"` SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` - - Url string `json:"url,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -279,11 +253,8 @@ func createScopeToPb(st *CreateScope) (*createScopePb, error) { } pb := &createScopePb{} pb.BackendAzureKeyvault = st.BackendAzureKeyvault - pb.InitialManagePrincipal = st.InitialManagePrincipal - pb.Scope = st.Scope - pb.ScopeBackendType = st.ScopeBackendType pb.ForceSendFields = st.ForceSendFields @@ -291,13 +262,10 @@ func createScopeToPb(st *CreateScope) (*createScopePb, error) { } type createScopePb struct { - BackendAzureKeyvault *AzureKeyVaultSecretScopeMetadata `json:"backend_azure_keyvault,omitempty"` - - InitialManagePrincipal string `json:"initial_manage_principal,omitempty"` - - Scope string `json:"scope"` - - ScopeBackendType ScopeBackendType `json:"scope_backend_type,omitempty"` + BackendAzureKeyvault *AzureKeyVaultSecretScopeMetadata `json:"backend_azure_keyvault,omitempty"` + InitialManagePrincipal string `json:"initial_manage_principal,omitempty"` + Scope string `json:"scope"` + ScopeBackendType ScopeBackendType `json:"scope_backend_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -351,9 +319,7 @@ func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { } pb := &credentialInfoPb{} pb.CredentialId = st.CredentialId - pb.GitProvider = st.GitProvider - pb.GitUsername = st.GitUsername pb.ForceSendFields = st.ForceSendFields @@ -361,11 +327,9 @@ func credentialInfoToPb(st *CredentialInfo) (*credentialInfoPb, error) { } type credentialInfoPb struct { - CredentialId int64 `json:"credential_id"` - - GitProvider string `json:"git_provider,omitempty"` - - GitUsername string `json:"git_username,omitempty"` + CredentialId int64 `json:"credential_id"` + GitProvider string `json:"git_provider,omitempty"` + GitUsername string `json:"git_username,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -397,7 +361,6 @@ func deleteToPb(st *Delete) (*deletePb, error) { } pb := &deletePb{} pb.Path = st.Path - pb.Recursive = st.Recursive pb.ForceSendFields = st.ForceSendFields @@ -405,9 +368,8 @@ func deleteToPb(st *Delete) (*deletePb, error) { } type deletePb struct { - Path string `json:"path"` - - Recursive bool `json:"recursive,omitempty"` + Path string `json:"path"` + Recursive bool `json:"recursive,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -438,7 +400,6 @@ func deleteAclToPb(st *DeleteAcl) (*deleteAclPb, error) { } pb := &deleteAclPb{} pb.Principal = st.Principal - pb.Scope = st.Scope return pb, nil @@ -446,8 +407,7 @@ func deleteAclToPb(st *DeleteAcl) (*deleteAclPb, error) { type deleteAclPb struct { Principal string `json:"principal"` - - Scope string `json:"scope"` + Scope string `json:"scope"` } func deleteAclFromPb(pb *deleteAclPb) (*DeleteAcl, error) { @@ -644,15 +604,13 @@ func deleteSecretToPb(st *DeleteSecret) (*deleteSecretPb, error) { } pb := &deleteSecretPb{} pb.Key = st.Key - pb.Scope = st.Scope return pb, nil } type deleteSecretPb struct { - Key string `json:"key"` - + Key string `json:"key"` Scope string `json:"scope"` } @@ -694,7 +652,6 @@ func exportRequestToPb(st *ExportRequest) (*exportRequestPb, error) { } pb := &exportRequestPb{} pb.Format = st.Format - pb.Path = st.Path return pb, nil @@ -702,8 +659,7 @@ func exportRequestToPb(st *ExportRequest) (*exportRequestPb, error) { type exportRequestPb struct { Format ExportFormat `json:"-" url:"format,omitempty"` - - Path string `json:"-" url:"path"` + Path string `json:"-" url:"path"` } func exportRequestFromPb(pb *exportRequestPb) (*ExportRequest, error) { @@ -723,7 +679,6 @@ func exportResponseToPb(st *ExportResponse) (*exportResponsePb, error) { } pb := &exportResponsePb{} pb.Content = st.Content - pb.FileType = st.FileType pb.ForceSendFields = st.ForceSendFields @@ -731,8 +686,7 @@ func exportResponseToPb(st *ExportResponse) (*exportResponsePb, error) { } type exportResponsePb struct { - Content string `json:"content,omitempty"` - + Content string `json:"content,omitempty"` FileType string `json:"file_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -764,7 +718,6 @@ func getAclRequestToPb(st *GetAclRequest) (*getAclRequestPb, error) { } pb := &getAclRequestPb{} pb.Principal = st.Principal - pb.Scope = st.Scope return pb, nil @@ -772,8 +725,7 @@ func getAclRequestToPb(st *GetAclRequest) (*getAclRequestPb, error) { type getAclRequestPb struct { Principal string `json:"-" url:"principal"` - - Scope string `json:"-" url:"scope"` + Scope string `json:"-" url:"scope"` } func getAclRequestFromPb(pb *getAclRequestPb) (*GetAclRequest, error) { @@ -817,9 +769,7 @@ func getCredentialsResponseToPb(st *GetCredentialsResponse) (*getCredentialsResp } pb := &getCredentialsResponsePb{} pb.CredentialId = st.CredentialId - pb.GitProvider = st.GitProvider - pb.GitUsername = st.GitUsername pb.ForceSendFields = st.ForceSendFields @@ -827,11 +777,9 @@ func getCredentialsResponseToPb(st *GetCredentialsResponse) (*getCredentialsResp } type getCredentialsResponsePb struct { - CredentialId int64 `json:"credential_id"` - - GitProvider string `json:"git_provider,omitempty"` - - GitUsername string `json:"git_username,omitempty"` + CredentialId int64 `json:"credential_id"` + GitProvider string `json:"git_provider,omitempty"` + GitUsername string `json:"git_username,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -959,17 +907,11 @@ func getRepoResponseToPb(st *GetRepoResponse) (*getRepoResponsePb, error) { } pb := &getRepoResponsePb{} pb.Branch = st.Branch - pb.HeadCommitId = st.HeadCommitId - pb.Id = st.Id - pb.Path = st.Path - pb.Provider = st.Provider - pb.SparseCheckout = st.SparseCheckout - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -977,19 +919,13 @@ func getRepoResponseToPb(st *GetRepoResponse) (*getRepoResponsePb, error) { } type getRepoResponsePb struct { - Branch string `json:"branch,omitempty"` - - HeadCommitId string `json:"head_commit_id,omitempty"` - - Id int64 `json:"id,omitempty"` - - Path string `json:"path,omitempty"` - - Provider string `json:"provider,omitempty"` - + Branch string `json:"branch,omitempty"` + HeadCommitId string `json:"head_commit_id,omitempty"` + Id int64 `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Provider string `json:"provider,omitempty"` SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` - - Url string `json:"url,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1025,15 +961,13 @@ func getSecretRequestToPb(st *GetSecretRequest) (*getSecretRequestPb, error) { } pb := &getSecretRequestPb{} pb.Key = st.Key - pb.Scope = st.Scope return pb, nil } type getSecretRequestPb struct { - Key string `json:"-" url:"key"` - + Key string `json:"-" url:"key"` Scope string `json:"-" url:"scope"` } @@ -1054,7 +988,6 @@ func getSecretResponseToPb(st *GetSecretResponse) (*getSecretResponsePb, error) } pb := &getSecretResponsePb{} pb.Key = st.Key - pb.Value = st.Value pb.ForceSendFields = st.ForceSendFields @@ -1062,8 +995,7 @@ func getSecretResponseToPb(st *GetSecretResponse) (*getSecretResponsePb, error) } type getSecretResponsePb struct { - Key string `json:"key,omitempty"` - + Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1119,15 +1051,13 @@ func getWorkspaceObjectPermissionLevelsRequestToPb(st *GetWorkspaceObjectPermiss } pb := &getWorkspaceObjectPermissionLevelsRequestPb{} pb.WorkspaceObjectId = st.WorkspaceObjectId - pb.WorkspaceObjectType = st.WorkspaceObjectType return pb, nil } type getWorkspaceObjectPermissionLevelsRequestPb struct { - WorkspaceObjectId string `json:"-" url:"-"` - + WorkspaceObjectId string `json:"-" url:"-"` WorkspaceObjectType string `json:"-" url:"-"` } @@ -1172,15 +1102,13 @@ func getWorkspaceObjectPermissionsRequestToPb(st *GetWorkspaceObjectPermissionsR } pb := &getWorkspaceObjectPermissionsRequestPb{} pb.WorkspaceObjectId = st.WorkspaceObjectId - pb.WorkspaceObjectType = st.WorkspaceObjectType return pb, nil } type getWorkspaceObjectPermissionsRequestPb struct { - WorkspaceObjectId string `json:"-" url:"-"` - + WorkspaceObjectId string `json:"-" url:"-"` WorkspaceObjectType string `json:"-" url:"-"` } @@ -1201,13 +1129,9 @@ func importToPb(st *Import) (*importPb, error) { } pb := &importPb{} pb.Content = st.Content - pb.Format = st.Format - pb.Language = st.Language - pb.Overwrite = st.Overwrite - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -1215,15 +1139,11 @@ func importToPb(st *Import) (*importPb, error) { } type importPb struct { - Content string `json:"content,omitempty"` - - Format ImportFormat `json:"format,omitempty"` - - Language Language `json:"language,omitempty"` - - Overwrite bool `json:"overwrite,omitempty"` - - Path string `json:"path"` + Content string `json:"content,omitempty"` + Format ImportFormat `json:"format,omitempty"` + Language Language `json:"language,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Path string `json:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -1350,7 +1270,6 @@ func listReposRequestToPb(st *ListReposRequest) (*listReposRequestPb, error) { } pb := &listReposRequestPb{} pb.NextPageToken = st.NextPageToken - pb.PathPrefix = st.PathPrefix pb.ForceSendFields = st.ForceSendFields @@ -1359,8 +1278,7 @@ func listReposRequestToPb(st *ListReposRequest) (*listReposRequestPb, error) { type listReposRequestPb struct { NextPageToken string `json:"-" url:"next_page_token,omitempty"` - - PathPrefix string `json:"-" url:"path_prefix,omitempty"` + PathPrefix string `json:"-" url:"path_prefix,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1391,7 +1309,6 @@ func listReposResponseToPb(st *ListReposResponse) (*listReposResponsePb, error) } pb := &listReposResponsePb{} pb.NextPageToken = st.NextPageToken - pb.Repos = st.Repos pb.ForceSendFields = st.ForceSendFields @@ -1399,9 +1316,8 @@ func listReposResponseToPb(st *ListReposResponse) (*listReposResponsePb, error) } type listReposResponsePb struct { - NextPageToken string `json:"next_page_token,omitempty"` - - Repos []RepoInfo `json:"repos,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` + Repos []RepoInfo `json:"repos,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1528,7 +1444,6 @@ func listWorkspaceRequestToPb(st *ListWorkspaceRequest) (*listWorkspaceRequestPb } pb := &listWorkspaceRequestPb{} pb.NotebooksModifiedAfter = st.NotebooksModifiedAfter - pb.Path = st.Path pb.ForceSendFields = st.ForceSendFields @@ -1536,9 +1451,8 @@ func listWorkspaceRequestToPb(st *ListWorkspaceRequest) (*listWorkspaceRequestPb } type listWorkspaceRequestPb struct { - NotebooksModifiedAfter int64 `json:"-" url:"notebooks_modified_after,omitempty"` - - Path string `json:"-" url:"path"` + NotebooksModifiedAfter int64 `json:"-" url:"notebooks_modified_after,omitempty"` + Path string `json:"-" url:"path"` ForceSendFields []string `json:"-" url:"-"` } @@ -1614,19 +1528,12 @@ func objectInfoToPb(st *ObjectInfo) (*objectInfoPb, error) { } pb := &objectInfoPb{} pb.CreatedAt = st.CreatedAt - pb.Language = st.Language - pb.ModifiedAt = st.ModifiedAt - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType - pb.Path = st.Path - pb.ResourceId = st.ResourceId - pb.Size = st.Size pb.ForceSendFields = st.ForceSendFields @@ -1634,21 +1541,14 @@ func objectInfoToPb(st *ObjectInfo) (*objectInfoPb, error) { } type objectInfoPb struct { - CreatedAt int64 `json:"created_at,omitempty"` - - Language Language `json:"language,omitempty"` - - ModifiedAt int64 `json:"modified_at,omitempty"` - - ObjectId int64 `json:"object_id,omitempty"` - + CreatedAt int64 `json:"created_at,omitempty"` + Language Language `json:"language,omitempty"` + ModifiedAt int64 `json:"modified_at,omitempty"` + ObjectId int64 `json:"object_id,omitempty"` ObjectType ObjectType `json:"object_type,omitempty"` - - Path string `json:"path,omitempty"` - - ResourceId string `json:"resource_id,omitempty"` - - Size int64 `json:"size,omitempty"` + Path string `json:"path,omitempty"` + ResourceId string `json:"resource_id,omitempty"` + Size int64 `json:"size,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1685,9 +1585,7 @@ func putAclToPb(st *PutAcl) (*putAclPb, error) { } pb := &putAclPb{} pb.Permission = st.Permission - pb.Principal = st.Principal - pb.Scope = st.Scope return pb, nil @@ -1695,10 +1593,8 @@ func putAclToPb(st *PutAcl) (*putAclPb, error) { type putAclPb struct { Permission AclPermission `json:"permission"` - - Principal string `json:"principal"` - - Scope string `json:"scope"` + Principal string `json:"principal"` + Scope string `json:"scope"` } func putAclFromPb(pb *putAclPb) (*PutAcl, error) { @@ -1740,11 +1636,8 @@ func putSecretToPb(st *PutSecret) (*putSecretPb, error) { } pb := &putSecretPb{} pb.BytesValue = st.BytesValue - pb.Key = st.Key - pb.Scope = st.Scope - pb.StringValue = st.StringValue pb.ForceSendFields = st.ForceSendFields @@ -1752,12 +1645,9 @@ func putSecretToPb(st *PutSecret) (*putSecretPb, error) { } type putSecretPb struct { - BytesValue string `json:"bytes_value,omitempty"` - - Key string `json:"key"` - - Scope string `json:"scope"` - + BytesValue string `json:"bytes_value,omitempty"` + Key string `json:"key"` + Scope string `json:"scope"` StringValue string `json:"string_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1812,11 +1702,8 @@ func repoAccessControlRequestToPb(st *RepoAccessControlRequest) (*repoAccessCont } pb := &repoAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1824,13 +1711,10 @@ func repoAccessControlRequestToPb(st *RepoAccessControlRequest) (*repoAccessCont } type repoAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1863,13 +1747,9 @@ func repoAccessControlResponseToPb(st *RepoAccessControlResponse) (*repoAccessCo } pb := &repoAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -1877,15 +1757,11 @@ func repoAccessControlResponseToPb(st *RepoAccessControlResponse) (*repoAccessCo } type repoAccessControlResponsePb struct { - AllPermissions []RepoPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []RepoPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1919,17 +1795,11 @@ func repoInfoToPb(st *RepoInfo) (*repoInfoPb, error) { } pb := &repoInfoPb{} pb.Branch = st.Branch - pb.HeadCommitId = st.HeadCommitId - pb.Id = st.Id - pb.Path = st.Path - pb.Provider = st.Provider - pb.SparseCheckout = st.SparseCheckout - pb.Url = st.Url pb.ForceSendFields = st.ForceSendFields @@ -1937,19 +1807,13 @@ func repoInfoToPb(st *RepoInfo) (*repoInfoPb, error) { } type repoInfoPb struct { - Branch string `json:"branch,omitempty"` - - HeadCommitId string `json:"head_commit_id,omitempty"` - - Id int64 `json:"id,omitempty"` - - Path string `json:"path,omitempty"` - - Provider string `json:"provider,omitempty"` - + Branch string `json:"branch,omitempty"` + HeadCommitId string `json:"head_commit_id,omitempty"` + Id int64 `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Provider string `json:"provider,omitempty"` SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"` - - Url string `json:"url,omitempty"` + Url string `json:"url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1985,9 +1849,7 @@ func repoPermissionToPb(st *RepoPermission) (*repoPermissionPb, error) { } pb := &repoPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -1995,11 +1857,9 @@ func repoPermissionToPb(st *RepoPermission) (*repoPermissionPb, error) { } type repoPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2031,9 +1891,7 @@ func repoPermissionsToPb(st *RepoPermissions) (*repoPermissionsPb, error) { } pb := &repoPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2042,10 +1900,8 @@ func repoPermissionsToPb(st *RepoPermissions) (*repoPermissionsPb, error) { type repoPermissionsPb struct { AccessControlList []RepoAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2077,7 +1933,6 @@ func repoPermissionsDescriptionToPb(st *RepoPermissionsDescription) (*repoPermis } pb := &repoPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2085,8 +1940,7 @@ func repoPermissionsDescriptionToPb(st *RepoPermissionsDescription) (*repoPermis } type repoPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel RepoPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2118,7 +1972,6 @@ func repoPermissionsRequestToPb(st *RepoPermissionsRequest) (*repoPermissionsReq } pb := &repoPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.RepoId = st.RepoId return pb, nil @@ -2126,8 +1979,7 @@ func repoPermissionsRequestToPb(st *RepoPermissionsRequest) (*repoPermissionsReq type repoPermissionsRequestPb struct { AccessControlList []RepoAccessControlRequest `json:"access_control_list,omitempty"` - - RepoId string `json:"-" url:"-"` + RepoId string `json:"-" url:"-"` } func repoPermissionsRequestFromPb(pb *repoPermissionsRequestPb) (*RepoPermissionsRequest, error) { @@ -2147,7 +1999,6 @@ func secretMetadataToPb(st *SecretMetadata) (*secretMetadataPb, error) { } pb := &secretMetadataPb{} pb.Key = st.Key - pb.LastUpdatedTimestamp = st.LastUpdatedTimestamp pb.ForceSendFields = st.ForceSendFields @@ -2155,9 +2006,8 @@ func secretMetadataToPb(st *SecretMetadata) (*secretMetadataPb, error) { } type secretMetadataPb struct { - Key string `json:"key,omitempty"` - - LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + Key string `json:"key,omitempty"` + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2188,9 +2038,7 @@ func secretScopeToPb(st *SecretScope) (*secretScopePb, error) { } pb := &secretScopePb{} pb.BackendType = st.BackendType - pb.KeyvaultMetadata = st.KeyvaultMetadata - pb.Name = st.Name pb.ForceSendFields = st.ForceSendFields @@ -2198,11 +2046,9 @@ func secretScopeToPb(st *SecretScope) (*secretScopePb, error) { } type secretScopePb struct { - BackendType ScopeBackendType `json:"backend_type,omitempty"` - + BackendType ScopeBackendType `json:"backend_type,omitempty"` KeyvaultMetadata *AzureKeyVaultSecretScopeMetadata `json:"keyvault_metadata,omitempty"` - - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2282,11 +2128,8 @@ func updateCredentialsRequestToPb(st *UpdateCredentialsRequest) (*updateCredenti } pb := &updateCredentialsRequestPb{} pb.CredentialId = st.CredentialId - pb.GitProvider = st.GitProvider - pb.GitUsername = st.GitUsername - pb.PersonalAccessToken = st.PersonalAccessToken pb.ForceSendFields = st.ForceSendFields @@ -2294,12 +2137,9 @@ func updateCredentialsRequestToPb(st *UpdateCredentialsRequest) (*updateCredenti } type updateCredentialsRequestPb struct { - CredentialId int64 `json:"-" url:"-"` - - GitProvider string `json:"git_provider"` - - GitUsername string `json:"git_username,omitempty"` - + CredentialId int64 `json:"-" url:"-"` + GitProvider string `json:"git_provider"` + GitUsername string `json:"git_username,omitempty"` PersonalAccessToken string `json:"personal_access_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2354,11 +2194,8 @@ func updateRepoRequestToPb(st *UpdateRepoRequest) (*updateRepoRequestPb, error) } pb := &updateRepoRequestPb{} pb.Branch = st.Branch - pb.RepoId = st.RepoId - pb.SparseCheckout = st.SparseCheckout - pb.Tag = st.Tag pb.ForceSendFields = st.ForceSendFields @@ -2366,13 +2203,10 @@ func updateRepoRequestToPb(st *UpdateRepoRequest) (*updateRepoRequestPb, error) } type updateRepoRequestPb struct { - Branch string `json:"branch,omitempty"` - - RepoId int64 `json:"-" url:"-"` - + Branch string `json:"branch,omitempty"` + RepoId int64 `json:"-" url:"-"` SparseCheckout *SparseCheckoutUpdate `json:"sparse_checkout,omitempty"` - - Tag string `json:"tag,omitempty"` + Tag string `json:"tag,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2426,11 +2260,8 @@ func workspaceObjectAccessControlRequestToPb(st *WorkspaceObjectAccessControlReq } pb := &workspaceObjectAccessControlRequestPb{} pb.GroupName = st.GroupName - pb.PermissionLevel = st.PermissionLevel - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2438,13 +2269,10 @@ func workspaceObjectAccessControlRequestToPb(st *WorkspaceObjectAccessControlReq } type workspaceObjectAccessControlRequestPb struct { - GroupName string `json:"group_name,omitempty"` - - PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2477,13 +2305,9 @@ func workspaceObjectAccessControlResponseToPb(st *WorkspaceObjectAccessControlRe } pb := &workspaceObjectAccessControlResponsePb{} pb.AllPermissions = st.AllPermissions - pb.DisplayName = st.DisplayName - pb.GroupName = st.GroupName - pb.ServicePrincipalName = st.ServicePrincipalName - pb.UserName = st.UserName pb.ForceSendFields = st.ForceSendFields @@ -2491,15 +2315,11 @@ func workspaceObjectAccessControlResponseToPb(st *WorkspaceObjectAccessControlRe } type workspaceObjectAccessControlResponsePb struct { - AllPermissions []WorkspaceObjectPermission `json:"all_permissions,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - GroupName string `json:"group_name,omitempty"` - - ServicePrincipalName string `json:"service_principal_name,omitempty"` - - UserName string `json:"user_name,omitempty"` + AllPermissions []WorkspaceObjectPermission `json:"all_permissions,omitempty"` + DisplayName string `json:"display_name,omitempty"` + GroupName string `json:"group_name,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UserName string `json:"user_name,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2533,9 +2353,7 @@ func workspaceObjectPermissionToPb(st *WorkspaceObjectPermission) (*workspaceObj } pb := &workspaceObjectPermissionPb{} pb.Inherited = st.Inherited - pb.InheritedFromObject = st.InheritedFromObject - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2543,11 +2361,9 @@ func workspaceObjectPermissionToPb(st *WorkspaceObjectPermission) (*workspaceObj } type workspaceObjectPermissionPb struct { - Inherited bool `json:"inherited,omitempty"` - - InheritedFromObject []string `json:"inherited_from_object,omitempty"` - - PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` + Inherited bool `json:"inherited,omitempty"` + InheritedFromObject []string `json:"inherited_from_object,omitempty"` + PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2579,9 +2395,7 @@ func workspaceObjectPermissionsToPb(st *WorkspaceObjectPermissions) (*workspaceO } pb := &workspaceObjectPermissionsPb{} pb.AccessControlList = st.AccessControlList - pb.ObjectId = st.ObjectId - pb.ObjectType = st.ObjectType pb.ForceSendFields = st.ForceSendFields @@ -2590,10 +2404,8 @@ func workspaceObjectPermissionsToPb(st *WorkspaceObjectPermissions) (*workspaceO type workspaceObjectPermissionsPb struct { AccessControlList []WorkspaceObjectAccessControlResponse `json:"access_control_list,omitempty"` - - ObjectId string `json:"object_id,omitempty"` - - ObjectType string `json:"object_type,omitempty"` + ObjectId string `json:"object_id,omitempty"` + ObjectType string `json:"object_type,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2625,7 +2437,6 @@ func workspaceObjectPermissionsDescriptionToPb(st *WorkspaceObjectPermissionsDes } pb := &workspaceObjectPermissionsDescriptionPb{} pb.Description = st.Description - pb.PermissionLevel = st.PermissionLevel pb.ForceSendFields = st.ForceSendFields @@ -2633,8 +2444,7 @@ func workspaceObjectPermissionsDescriptionToPb(st *WorkspaceObjectPermissionsDes } type workspaceObjectPermissionsDescriptionPb struct { - Description string `json:"description,omitempty"` - + Description string `json:"description,omitempty"` PermissionLevel WorkspaceObjectPermissionLevel `json:"permission_level,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -2666,20 +2476,16 @@ func workspaceObjectPermissionsRequestToPb(st *WorkspaceObjectPermissionsRequest } pb := &workspaceObjectPermissionsRequestPb{} pb.AccessControlList = st.AccessControlList - pb.WorkspaceObjectId = st.WorkspaceObjectId - pb.WorkspaceObjectType = st.WorkspaceObjectType return pb, nil } type workspaceObjectPermissionsRequestPb struct { - AccessControlList []WorkspaceObjectAccessControlRequest `json:"access_control_list,omitempty"` - - WorkspaceObjectId string `json:"-" url:"-"` - - WorkspaceObjectType string `json:"-" url:"-"` + AccessControlList []WorkspaceObjectAccessControlRequest `json:"access_control_list,omitempty"` + WorkspaceObjectId string `json:"-" url:"-"` + WorkspaceObjectType string `json:"-" url:"-"` } func workspaceObjectPermissionsRequestFromPb(pb *workspaceObjectPermissionsRequestPb) (*WorkspaceObjectPermissionsRequest, error) { @@ -2693,3 +2499,57 @@ func workspaceObjectPermissionsRequestFromPb(pb *workspaceObjectPermissionsReque return st, nil } + +func durationToPb(d *time.Duration) (*string, error) { + if d == nil { + return nil, nil + } + s := fmt.Sprintf("%fs", d.Seconds()) + return &s, nil +} + +func durationFromPb(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + d, err := time.ParseDuration(*s) + if err != nil { + return nil, err + } + return &d, nil +} + +func timestampToPb(t *time.Time) (*string, error) { + if t == nil { + return nil, nil + } + s := t.Format(time.RFC3339) + return &s, nil +} + +func timestampFromPb(s *string) (*time.Time, error) { + if s == nil { + return nil, nil + } + t, err := time.Parse(time.RFC3339, *s) + if err != nil { + return nil, err + } + return &t, nil +} + +func fieldMaskToPb(fm *[]string) (*string, error) { + if fm == nil { + return nil, nil + } + s := strings.Join(*fm, ",") + return &s, nil +} + +func fieldMaskFromPb(s *string) (*[]string, error) { + if s == nil { + return nil, nil + } + fm := strings.Split(*s, ",") + return &fm, nil +} diff --git a/service/workspace/model.go b/service/workspace/model.go index 000553753..e8e0b8b4e 100755 --- a/service/workspace/model.go +++ b/service/workspace/model.go @@ -5,8 +5,6 @@ package workspace import ( "encoding/json" "fmt" - "strings" - "time" ) type AclItem struct { @@ -3104,57 +3102,3 @@ func (st WorkspaceObjectPermissionsRequest) MarshalJSON() ([]byte, error) { } return json.Marshal(pb) } - -func durationToPb(d *time.Duration) (*string, error) { - if d == nil { - return nil, nil - } - s := fmt.Sprintf("%fs", d.Seconds()) - return &s, nil -} - -func durationFromPb(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - d, err := time.ParseDuration(*s) - if err != nil { - return nil, err - } - return &d, nil -} - -func timestampToPb(t *time.Time) (*string, error) { - if t == nil { - return nil, nil - } - s := t.Format(time.RFC3339) - return &s, nil -} - -func timestampFromPb(s *string) (*time.Time, error) { - if s == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return nil, err - } - return &t, nil -} - -func fieldMaskToPb(fm *[]string) (*string, error) { - if fm == nil { - return nil, nil - } - s := strings.Join(*fm, ",") - return &s, nil -} - -func fieldMaskFromPb(s *string) (*[]string, error) { - if s == nil { - return nil, nil - } - fm := strings.Split(*s, ",") - return &fm, nil -}